On Fri, Sep 06, 2002, Himanshu Soni wrote: > Hi > > I need to generate a signed and encrypted SMIME message. > I see in the openssld apps that there is a sample that can sign OR > encrypt. > If I was to write my own to do signing AND encryption, then would I > follow the following steps: > > Step 1: Sign the message using PKCS7_sign(). > Step 2: i2d the P7 returned from PKCS7_sign(). > Step 3: Encrypt the DER encoding from step 2 and call PKCS7_encrypt() on > it? > Step 4: Write the resulting P7 using SMIME_write_PKCS7 and send that to > my mail client for delivery? > > I am not too sure about step 2. Do I need to DER encode the P7 returned > from step 1 or should I call SMIME_write_PKCS7 on the P& generated from > step 1 and then call encrypt on the result. > > Please advise if my approach is wrong or if you have any suggestions. > >
Call SMIME_write_PKCS7 in step 2, save the result to a file or memory BIO and pass that to PKCS7_encrypt(). Steve. -- Dr. Stephen Henson [EMAIL PROTECTED] OpenSSL Project http://www.openssl.org/~steve/ ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
