CMS_EncryptedData_encrypt_ex

Create a CMS EncryptedData ContentInfo by encrypting data from a BIO (with libctx).

Synopsis

Declared in <openssl/cms.h>

CMS_ContentInfo*
CMS_EncryptedData_encrypt_ex(
    BIO* in,
    EVP_CIPHER const* cipher,
    unsigned char const* key,
    size_t keylen,
    unsigned int flags,
    OSSL_LIB_CTX* libctx,
    char const* propq);

Description

Unless CMS_STREAM and/or CMS_PARTIAL is set, CMS_final() is called internally.

Return Value

New EncryptedData ContentInfo, or NULL on error.

Parameters

NameDescription
inBIO supplying the plaintext to encrypt.
cipherSymmetric cipher; must support ASN.1 encoding of its parameters (AEAD not supported).
keyEncryption key bytes.
keylenLength of key in bytes.
flagsCMS_* option flags such as CMS_DETACHED, CMS_STREAM, or CMS_PARTIAL.
libctxLibrary context for algorithm fetches, or NULL for the default.
propqProperty query for provider selection, or NULL.