[dev] S/MIME again

Cliff Green green@UMDNJ.EDU
Tue, 1 Oct 2002 10:34:00 -0400 (EDT)


And it came to pass that, on Mon, 30 Sep 2002, Cliff Green wrote:

CG>[stuff elided]
CG>
CG>Well, the problem was that the signed message, returned by
CG>$imp_smime->signMessage() was the entire message, sans non-MIME headers.  So, if
CG>I used setContentTypeParameter, etc., all I succeeded in doing was stuffing the
CG>message into another envelope.
CG>
CG>The only thing I've come up with so far that works is an ugly solution: chop off
CG>the "MIME-Version: " from the front of the $signed_message, use
CG>$headers->addHeader('MIME-Version', $rest_of_signed_message), and then send it
CG>all with IMP::sendMessage($recipients, $headers, $a_null_string).
CG>
CG>If anyone will show me the error of my ways, I'll be very grateful.

Nevermind.  I've seen the error of my ways and must repent.

Using the method above, you cannot send a message with an attachment and
then sign it;  the attachment is thrown away and the proper nesting isn't
done.

The problem is that the multipart/signed enclosure must be the outer
enclosure.

<sigh> It's beginning to look like using the external openssl binary is
the way to go (like with gpg).  Too bad - what a rush when smime signing
seemed to work.

c
--
Cliff Green				   green@umdnj.edu
Academic Computing Service			     UMDNJ
voice: 732-235-5250		     	 fax: 732-235-5252
-=Sent via PINE 4.44: Internet News & Email for Win/Unix=-