On Wed, May 20, 2009, Chris Bare wrote: > > > Are there any good examples of using the ASN1 and CMS functions in > > > openssl 1.0 > > > for generic operations? > > > I'm trying to talk to an SCVP server, which takes requests wrapped in DER > > > encoded > > > CMS ContentInfo structure. So far I can't find an openssl function to > > > output a > > > CMS that way, so any example code or pointers would be appreciated. > > > > Try demos/cms > > > > I've been through all of that. The thing that confuses me is that I just want > a ContactInfo wrapper. I don't need to sign it or compress it etc, and it > looks like I can use CMS_data_create in that case, but then I just want to > write it to a socket in DER format, not base64. > Also I need to figure out how to build up other ASN1 structures to go inside > the ContactInfo. I hoped looking at the CMS code would give me an example to > follow, but if so, I haven't figured it out yet. >
The ContentInfo wrapper can be of many types. If you just want data the CMS_data_create() will work. Then you can write the result to a memory buffer using i2d_CMS_ContentInfo() and once there to a socket. There are various options to set the inner content type as well. 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