GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SMIME_WRITE_CMS(3) FreeBSD Library Functions Manual SMIME_WRITE_CMS(3)

SMIME_write_CMSconvert CMS structure to S/MIME format

#include <openssl/cms.h>

int
SMIME_write_CMS(BIO *out, CMS_ContentInfo *cms, BIO *data, int flags);

() adds the appropriate MIME headers to the cms structure to produce an S/MIME message and writes it to out. If streaming is enabled, the content must be supplied in the data argument.

The following flags can be passed:

Use cleartext signing. This option only makes sense if cms is of the type SignedData and CMS_DETACHED was also set when it was created with CMS_sign(3).

If CMS_STREAM is not set, the data must be read twice: once to compute the signature in CMS_sign(3) and once to output the S/MIME message.

Add MIME headers for type text/plain to the content. This only makes sense if CMS_DETACHED is also set.
Perform streaming. This flag should only be set if CMS_STREAM was also passed to the function that created cms.

The content is output in BER format using indefinite length constructed encoding except in the case of SignedData with detached content where the content is absent and DER format is used.

SMIME_write_CMS() returns 1 for success or 0 for failure.

CMS_ContentInfo_new(3), CMS_encrypt(3), CMS_sign(3), d2i_CMS_ContentInfo(3), ERR_get_error(3), SMIME_write_ASN1(3)

SMIME_write_CMS() first appeared in OpenSSL 0.9.8h and has been available since OpenBSD 6.7.

SMIME_write_CMS() always base64 encodes CMS structures. There should be an option to disable this.

December 13, 2021 FreeBSD 14.3-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.