[#CMS_RecipientInfo_kari_set0_pkey_and_peer]
= CMS&lowbar;RecipientInfo&lowbar;kari&lowbar;set0&lowbar;pkey&lowbar;and&lowbar;peer
:mrdocs:

Associate a private key and optional peer certificate with a key&hyphen;agreement CMS RecipientInfo&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
CMS&lowbar;RecipientInfo&lowbar;kari&lowbar;set0&lowbar;pkey&lowbar;and&lowbar;peer(
    xref:CMS_RecipientInfo.adoc[CMS&lowbar;RecipientInfo]* ri,
    xref:EVP_PKEY.adoc[EVP&lowbar;PKEY]* pk,
    xref:X509.adoc[X509]* peer);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ri*
| Recipient info that must be of type CMS&lowbar;RECIPINFO&lowbar;AGREE&period;
| *pk*
| Private key used for key agreement&semi; ownership transfers to `ri` (may be NULL to clear)&period;
| *peer*
| Peer (originator) certificate used when deriving shared secrets, or NULL when unused&period;
|===


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