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

Name

Description

cms

ContentInfo expected to contain EncryptedData (AEAD ciphers are not supported).

ciph

Symmetric cipher whose ASN.1 parameters are recorded.

key

Symmetric key bytes to copy.

keylen

Length of key in octets.

Created with MrDocs