CMS_add0_recipient_key

Add a KEKRecipientInfo that wraps the content-encryption key with a symmetric KEK.

Synopsis

Declared in <openssl/cms.h>

CMS_RecipientInfo*
CMS_add0_recipient_key(
    CMS_ContentInfo* cms,
    int nid,
    unsigned char* key,
    size_t keylen,
    unsigned char* id,
    size_t idlen,
    ASN1_GENERALIZEDTIME* date,
    ASN1_OBJECT* otherTypeId,
    ASN1_TYPE* otherType);

Return Value

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

Parameters

NameDescription
cmsEnveloped ContentInfo created with CMS_PARTIAL.
nidKey-wrap algorithm NID (AES wrap NIDs, or NID_undef to choose from keylen).
keySymmetric key-encryption key; ownership transfers to cms.
keylenLength of key in octets.
idKey identifier bytes; ownership transfers to cms.
idlenLength of id in octets.
dateOptional key validity date, or NULL.
otherTypeIdOptional otherKeyAttribute type OID, or NULL.
otherTypeOptional otherKeyAttribute value, or NULL.