On Tue, Jun 16, 2009, Chris Bare wrote:

> Is there a way to find the size of the der-encoded CMS object without writing
> it to a file/buffer first?
> 
> I'm doing this:
> 
>       cms = CMS_sign(scert, skey, NULL, mem, flags);
> 
>       i2d_CMS_bio(server, cms);
> 
> but I need to send the size to the server in a header before I send the CMS.

Yes, all ASN1 structures follow the same rules in the i2d/d2i functions. See:

http://www.openssl.org/support/faq.html#PROG3

but in this case you'd use i2d_CMS_ContentInfo().

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to