CMS_EncryptedData_set1_key

Set the content-encryption cipher and copy the symmetric key into a CMS EncryptedData.

Synopsis

Declared in <openssl/cms.h>

int
CMS_EncryptedData_set1_key(
    CMS_ContentInfo* cms,
    EVP_CIPHER const* ciph,
    unsigned char const* key,
    size_t keylen);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
cmsContentInfo expected to contain EncryptedData (AEAD ciphers are not supported).
ciphSymmetric cipher whose ASN.1 parameters are recorded.
keySymmetric key bytes to copy.
keylenLength of key in octets.