CMS_EncryptedData_set1_key.3ossl - Man Page

Sets the cipher and key for CMS EncryptedData

Synopsis

 #include <openssl/cms.h>

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

Description

CMS_EncryptedData_set1_key() takes in a cms EncryptedData object and sets the appropriate attributes to ciph, it makes a copy of the symmetric key of size keylen. AEAD cipher algorithms are not supported.

Return Values

CMS_EncryptedData_set1_key() returns 0 if an error occurred otherwise returns 1.

See Also

CMS_EncryptedData_encrypt(3), CMS_EncryptedData_decrypt(3)

Info

2026-01-27 3.5.5 OpenSSL