[#CMS_add0_recipient_key]
= CMS&lowbar;add0&lowbar;recipient&lowbar;key
:mrdocs:

Add a KEKRecipientInfo that wraps the content&hyphen;encryption key with a symmetric KEK&period;

== Synopsis

Declared in `&lt;openssl&sol;cms&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CMS_RecipientInfo.adoc[CMS&lowbar;RecipientInfo]*
CMS&lowbar;add0&lowbar;recipient&lowbar;key(
    xref:CMS_ContentInfo.adoc[CMS&lowbar;ContentInfo]* cms,
    int nid,
    unsigned char* key,
    size&lowbar;t keylen,
    unsigned char* id,
    size&lowbar;t idlen,
    xref:ASN1_GENERALIZEDTIME.adoc[ASN1&lowbar;GENERALIZEDTIME]* date,
    xref:ASN1_OBJECT.adoc[ASN1&lowbar;OBJECT]* otherTypeId,
    xref:ASN1_TYPE.adoc[ASN1&lowbar;TYPE]* otherType);
----

== Return Value

Internal pointer to the new CMS&lowbar;RecipientInfo, or NULL on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *cms*
| Enveloped ContentInfo created with CMS&lowbar;PARTIAL&period;
| *nid*
| Key&hyphen;wrap algorithm NID (AES wrap NIDs, or NID&lowbar;undef to choose from `keylen)&period;`
| *key*
| Symmetric key&hyphen;encryption key&semi; ownership transfers to `cms&period;`
| *keylen*
| Length of `key` in octets&period;
| *id*
| Key identifier bytes&semi; ownership transfers to `cms&period;`
| *idlen*
| Length of `id` in octets&period;
| *date*
| Optional key validity date, or NULL&period;
| *otherTypeId*
| Optional otherKeyAttribute type OID, or NULL&period;
| *otherType*
| Optional otherKeyAttribute value, or NULL&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
