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

Name

Description

cms

Enveloped ContentInfo created with CMS_PARTIAL.

iter

PBKDF2 iteration count, or a non‐positive value for the default.

wrap_nid

Password‐based key‐wrap algorithm NID, or <= 0 for NID_id_alg_PWRI_KEK.

pbe_nid

Password‐based KDF NID, or <= 0 for NID_id_pbkdf2.

pass

Password bytes; ownership transfers to cms (may be set later via CMS_RecipientInfo_set0_password).

passlen

Length of pass in octets, or a negative value if pass is a NUL‐terminated string.

kekciph

Cipher used to wrap the content‐encryption key; NULL uses the enveloped content cipher.

Created with MrDocs