CMS_decrypt

Decrypt a CMS EnvelopedData or AuthEnvelopedData and write the content.

Synopsis

Declared in <openssl/cms.h>

int
CMS_decrypt(
    CMS_ContentInfo* cms,
    EVP_PKEY* pkey,
    X509* cert,
    BIO* dcont,
    BIO* out,
    unsigned int flags);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
cmsEnveloped ContentInfo to decrypt.
pkeyRecipient private key, or NULL if a key was already set via CMS_decrypt_set1_*.
certRecipient certificate used to locate the matching RecipientInfo; may be NULL.
dcontDetached encrypted-content BIO when applicable; normally NULL.
outBIO that receives the decrypted content (may be NULL when only setting up keys).
flagsOptional CMS decrypt flags (for example CMS_TEXT or CMS_DEBUG_DECRYPT).