Create a CMS EncryptedData ContentInfo by encrypting data from a BIO.

Synopsis

Declared in <openssl/cms.h>

CMS_ContentInfo*
CMS_EncryptedData_encrypt(
    BIO* in,
    EVP_CIPHER const* cipher,
    unsigned char const* key,
    size_t keylen,
    unsigned int flags);

Description

Equivalent to CMS_EncryptedData_encrypt_ex() with a NULL library context and property query. Unless CMS_STREAM and/or CMS_PARTIAL is set, CMS_final() is called internally.

Return Value

New CMS_ContentInfo of type NID_pkcs7_encrypted, or NULL on error.

Parameters

Name

Description

in

BIO supplying the plaintext to encrypt.

cipher

Symmetric cipher; must support ASN.1 encoding of its parameters (AEAD not supported).

key

Encryption key bytes.

keylen

Length of key in bytes.

flags

CMS_* option flags such as CMS_DETACHED, CMS_STREAM, or CMS_PARTIAL.

Created with MrDocs