[#CMS_RecipientInfo_set0_key]
= CMS&lowbar;RecipientInfo&lowbar;set0&lowbar;key
:mrdocs:

Attach a symmetric key&hyphen;encryption key to a KEK RecipientInfo (transfers ownership of `key)&period;`

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
CMS&lowbar;RecipientInfo&lowbar;set0&lowbar;key(
    xref:CMS_RecipientInfo.adoc[CMS&lowbar;RecipientInfo]* ri,
    unsigned char* key,
    size&lowbar;t keylen);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ri*
| Recipient info of type CMS&lowbar;RECIPINFO&lowbar;KEK&period;
| *key*
| Key bytes allocated with OPENSSL&lowbar;malloc()&semi; ownership transferred to `ri` (may be NULL to clear)&period;
| *keylen*
| Length of `key` in bytes&period;
|===


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