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

Name

Description

cms

Enveloped ContentInfo to decrypt.

pkey

Recipient private key, or NULL if a key was already set via CMS_decrypt_set1_*.

cert

Recipient certificate used to locate the matching RecipientInfo; may be NULL.

dcont

Detached encrypted‐content BIO when applicable; normally NULL.

out

BIO that receives the decrypted content (may be NULL when only setting up keys).

flags

Optional CMS decrypt flags (for example CMS_TEXT or CMS_DEBUG_DECRYPT).

Created with MrDocs