There was no data in BIO out. I needed to call BIO_reset() after calling PKCS7_sign().
Thanks ----- Original Message ----- From: "Dr. Stephen Henson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, January 19, 2003 5:10 AM Subject: Re: Problem passing BIO buffer to PKCS7_sign() > On Sat, Jan 18, 2003, marcus.carey wrote: > > > > > BIO *in = BIO_new(BIO_s_mem()); > > BIO *out = BIO_new(BIO_s_mem()); > > char buffer[40]; > > > > BIO_puts(in,"data"); > > > > pkcs7 = PKCS7_sign(cert,pkey,chain,in,flags) > > SMIME_write_PKCS7(out,pkcs7,in,flags) > > > > BIO_read(out,buffer); > > > > "data" does not appear in the S/MIME message. > > > > What's the correct method for setting up BIO buffers for S/MIME messages? > > > > > > What do you mean "does not appear"? Do you mean the data written to the BIO > 'out' doesn't contain "data" or it doesn't show up in some client like Outlook > Express? > > If you aren't using PKCS7_DETACHED for flags "data" wont be visible but will > still be encoded. If you are reading it with a client and can't see "data" > then you may need PKCS7_TEXT as well. > > Steve. > -- > Dr. Stephen Henson [EMAIL PROTECTED] > OpenSSL Project http://www.openssl.org/~steve/ > ______________________________________________________________________ > OpenSSL Project http://www.openssl.org > User Support Mailing List [EMAIL PROTECTED] > Automated List Manager [EMAIL PROTECTED] ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]