[#CMS_decrypt_set1_pkey]
= CMS&lowbar;decrypt&lowbar;set1&lowbar;pkey
:mrdocs:

Decrypt CMS recipient key material using a private key, then store it for CMS&lowbar;decrypt()&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
CMS&lowbar;decrypt&lowbar;set1&lowbar;pkey(
    xref:CMS_ContentInfo.adoc[CMS&lowbar;ContentInfo]* cms,
    xref:EVP_PKEY.adoc[EVP&lowbar;PKEY]* pk,
    xref:X509.adoc[X509]* cert);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *cms*
| CMS ContentInfo to decrypt&semi; on success stores `pk` for a later CMS&lowbar;decrypt() with NULL key arguments&period;
| *pk*
| Recipient private key used to unwrap the content&hyphen;encryption key&period;
| *cert*
| Recipient certificate used to locate the matching RecipientInfo&semi; may be NULL to try all recipients&period;
|===


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