[#CMS_EncryptedData_decrypt]
= CMS&lowbar;EncryptedData&lowbar;decrypt
:mrdocs:

Decrypt a CMS EncryptedData ContentInfo with a symmetric key&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
CMS&lowbar;EncryptedData&lowbar;decrypt(
    xref:CMS_ContentInfo.adoc[CMS&lowbar;ContentInfo]* cms,
    unsigned char const* key,
    size&lowbar;t keylen,
    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*
| EncryptedData ContentInfo to decrypt (AEAD ciphers are not supported)&period;
| *key*
| Symmetric decryption key bytes&period;
| *keylen*
| Length of `key` in bytes&period;
| *dcont*
| Detached encrypted&hyphen;content BIO, or NULL when content is embedded&period;
| *out*
| BIO that receives the decrypted plaintext&period;
| *flags*
| Optional CMS flags (for example CMS&lowbar;TEXT)&period;
|===


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