[#PKCS7_decrypt]
= PKCS7&lowbar;decrypt
:mrdocs:

Decrypt a PKCS&num;7 envelopedData (or signed&hyphen;and&hyphen;enveloped) structure for a recipient&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
PKCS7&lowbar;decrypt(
    xref:PKCS7.adoc[PKCS7]* p7,
    xref:EVP_PKEY.adoc[EVP&lowbar;PKEY]* pkey,
    xref:X509.adoc[X509]* cert,
    xref:BIO.adoc[BIO]* data,
    int flags);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *p7*
| Enveloped PKCS&num;7 object to decrypt&period;
| *pkey*
| Recipient private key matching a RecipientInfo in `p7&period;`
| *cert*
| Recipient certificate used to select the matching RecipientInfo, or NULL&period;
| *data*
| BIO that receives the decrypted content&period;
| *flags*
| PKCS7&lowbar;&ast; decryption flags (for example PKCS7&lowbar;TEXT)&period;
|===


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