[#CMS_decrypt]
= CMS&lowbar;decrypt
:mrdocs:

Decrypt a CMS EnvelopedData or AuthEnvelopedData and write the content&period;

== Synopsis

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

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

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *cms*
| Enveloped ContentInfo to decrypt&period;
| *pkey*
| Recipient private key, or NULL if a key was already set via CMS&lowbar;decrypt&lowbar;set1&lowbar;&ast;&period;
| *cert*
| Recipient certificate used to locate the matching RecipientInfo&semi; may be NULL&period;
| *dcont*
| Detached encrypted&hyphen;content BIO when applicable&semi; normally NULL&period;
| *out*
| BIO that receives the decrypted content (may be NULL when only setting up keys)&period;
| *flags*
| Optional CMS decrypt flags (for example CMS&lowbar;TEXT or CMS&lowbar;DEBUG&lowbar;DECRYPT)&period;
|===


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