| SMIME_WRITE_ASN1(3) | Library Functions Manual | SMIME_WRITE_ASN1(3) |
SMIME_write_ASN1 —
generate an S/MIME message
#include
<openssl/asn1.h>
int
SMIME_write_ASN1(BIO *out_bio,
ASN1_VALUE *val_in, BIO *in_bio,
int flags, int ctype_nid,
int econt_nid, STACK_OF(X509_ALGOR)
*micalg, const ASN1_ITEM *it);
SMIME_write_ASN1()
generates an S/MIME message on out_bio by writing MIME
1.0 headers followed by a BER- and base64-encoded serialization of
val_in, which can be of the type
CMS_ContentInfo or PKCS7 and has
to match the it argument.
The flags can be the logical OR of zero or more of the following bits:
PKCS7_REUSE_DIGESTSMIME_DETACHED is
also set. It is normally used if out_bio is already
set up to calculate and finalize the digest when written through.SMIME_BINARYSMIME_CRLFEOLSMIME_DETACHEDNULL pointer,
this flag is ignored.
If this flag is ignored or not specified, the smime-type is chosen according to ctype_nid instead:
NID_pkcs7_envelopedNID_pkcs7_signedNID_id_smime_ct_receipt
NID_id_smime_ct_compressedDataSMIME_OLDMIMESMIME_STREAMSMIME_DETACHED is not specified.SMIME_DETACHED is also set. It
is ignored if the flag SMIME_BINARY is also
set.SMIME_write_ASN1() is intended to return 1
on success or 0 on failure.
ASN1_item_i2d_bio(3), BIO_f_base64(3), BIO_new(3), SMIME_crlf_copy(3), SMIME_write_CMS(3), SMIME_write_PKCS7(3), X509_ALGOR_new(3)
SMIME_write_ASN1() first appeared in
OpenSSL 1.0.0 and has been available since OpenBSD
4.9.
SMIME_write_ASN1() ignores most errors and
is likely to return 1 even after producing corrupt or incomplete output.
| May 1, 2023 | openbsd |