[#CMS_encrypt_ex]
= CMS&lowbar;encrypt&lowbar;ex
:mrdocs:

Create a CMS EnvelopedData or AuthEnvelopedData encrypting content for recipient certificates&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CMS_ContentInfo.adoc[CMS&lowbar;ContentInfo]*
CMS&lowbar;encrypt&lowbar;ex(
    xref:stack_st_X509.adoc[stack&lowbar;st&lowbar;X509]* certs,
    xref:BIO.adoc[BIO]* in,
    xref:EVP_CIPHER-07.adoc[EVP&lowbar;CIPHER] const* cipher,
    unsigned int flags,
    xref:OSSL_LIB_CTX.adoc[OSSL&lowbar;LIB&lowbar;CTX]* libctx,
    char const* propq);
----

== Return Value

New enveloped ContentInfo, or NULL on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *certs*
| Stack of recipient certificates (RSA, Diffie&hyphen;Hellman, or EC keys)&period;
| *in*
| BIO supplying the content to encrypt (unused when CMS&lowbar;STREAM is set)&period;
| *cipher*
| Symmetric content&hyphen;encryption cipher&semi; GCM yields AuthEnvelopedData&period;
| *flags*
| Optional CMS flags (CMS&lowbar;TEXT, CMS&lowbar;BINARY, CMS&lowbar;USE&lowbar;KEYID, CMS&lowbar;STREAM, CMS&lowbar;PARTIAL, CMS&lowbar;DETACHED, …)&period;
| *libctx*
| Library context for algorithm fetches, or NULL for the default&period;
| *propq*
| Property query for provider selection, or NULL&period;
|===


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