Sortix cross-nightly manual
This manual documents Sortix cross-nightly. You can instead view this document in the latest official manual.
NAME
SMIME_write_CMS — convert CMS structure to S/MIME formatSYNOPSIS
library “libcrypto”#include <openssl/cms.h>
SMIME_write_CMS(BIO *out, CMS_ContentInfo *cms, BIO *data, int flags);
DESCRIPTION
SMIME_write_CMS() generates an S/MIME message on out by writing MIME 1.0 headers followed by a BER- and base64-encoded serialization of cms. The BER encoding uses the DER format except as described for CMS_STREAM below. If streaming is enabled, the content must be supplied in the data argument.- CMS_DETACHED
-
Use cleartext signing and generate a “multipart/signed” S/MIME message. The content is read from data. If data is a NULL pointer, this flag is ignored.This flag is only supported 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.If CMS_DETACHED is ignored or not specified, the smime-type is chosen according to CMS_get0_type(3):
- NID_pkcs7_enveloped
- “enveloped-data”
- NID_pkcs7_signed
-
- “signed-receipt”
- if CMS_get0_eContentType(3) is NID_id_smime_ct_receipt
- “signed-data”
- if cms specifies any digest algorithm
- “certs-only”
- otherwise
- NID_id_smime_ct_compressedData
- “compressed-data”
- CMS_REUSE_DIGEST
- Skip the calls to CMS_dataInit(3) and CMS_dataFinal(3). This flag has no effect unless CMS_DETACHED is also set.
- CMS_STREAM
-
Perform streaming by reading the content from data. This only works if CMS_DETACHED is not specified.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.
- CMS_TEXT
- Prepend the line “Content-Type: text/plain” to the content. This only makes sense if CMS_DETACHED is also set. It is ignored if the flag SMIME_BINARY is also set.
- SMIME_BINARY
- If specified, this flag is passed through to SMIME_crlf_copy(3).
- SMIME_CRLFEOL
- End MIME header lines with pairs of carriage return and newline characters. By default, no carriage return characters are written and header lines are ended with newline characters only.