SMIME_write_ASN1_ex

Write an ASN.1 CMS/PKCS#7 value as an S/MIME message with library context.

Synopsis

Declared in <openssl/asn1.h>

int
SMIME_write_ASN1_ex(
    BIO* bio,
    ASN1_VALUE* val,
    BIO* data,
    int flags,
    int ctype_nid,
    int econt_nid,
    stack_st_X509_ALGOR* mdalgs,
    ASN1_ITEM const* it,
    OSSL_LIB_CTX* libctx,
    char const* propq);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
bioBIO that receives the S/MIME output.
valCMS_ContentInfo or PKCS7 value to wrap (not const because streaming may update state).
dataOptional content BIO when streaming / detached content is used, or NULL.
flagsCMS_* / SMIME_* flags (for example CMS_DETACHED, CMS_TEXT, CMS_STREAM).
ctype_nidNID of the content type.
econt_nidNID of the embedded content type.
mdalgsDigest algorithms for SignedData, or NULL when unused.
itItem descriptor such as ASN1_ITEM_rptr(CMS_ContentInfo) or ASN1_ITEM_rptr(PKCS7).
libctxLibrary context for algorithm fetches, or NULL for the default.
propqProperty query for those fetches, or NULL.