CMS_add0_recipient_password

Add a PasswordRecipientInfo that derives a KEK from a password.

Synopsis

Declared in <openssl/cms.h>

CMS_RecipientInfo*
CMS_add0_recipient_password(
    CMS_ContentInfo* cms,
    int iter,
    int wrap_nid,
    int pbe_nid,
    unsigned char* pass,
    ssize_t passlen,
    EVP_CIPHER const* kekciph);

Return Value

Internal pointer to the new CMS_RecipientInfo, or NULL on error.

Parameters

NameDescription
cmsEnveloped ContentInfo created with CMS_PARTIAL.
iterPBKDF2 iteration count, or a non-positive value for the default.
wrap_nidPassword-based key-wrap algorithm NID, or <= 0 for NID_id_alg_PWRI_KEK.
pbe_nidPassword-based KDF NID, or <= 0 for NID_id_pbkdf2.
passPassword bytes; ownership transfers to cms (may be set later via CMS_RecipientInfo_set0_password).
passlenLength of pass in octets, or a negative value if pass is a NUL-terminated string.
kekciphCipher used to wrap the content-encryption key; NULL uses the enveloped content cipher.