CMS_EncryptedData_decrypt

Decrypt a CMS EncryptedData ContentInfo with a symmetric key.

Synopsis

Declared in <openssl/cms.h>

int
CMS_EncryptedData_decrypt(
    CMS_ContentInfo* cms,
    unsigned char const* key,
    size_t keylen,
    BIO* dcont,
    BIO* out,
    unsigned int flags);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
cmsEncryptedData ContentInfo to decrypt (AEAD ciphers are not supported).
keySymmetric decryption key bytes.
keylenLength of key in bytes.
dcontDetached encrypted-content BIO, or NULL when content is embedded.
outBIO that receives the decrypted plaintext.
flagsOptional CMS flags (for example CMS_TEXT).