Create a CMS EnvelopedData or AuthEnvelopedData encrypting content for recipient certificates.
Declared in <openssl/cms.h>
CMS_ContentInfo*
CMS_encrypt(
stack_st_X509* certs,
BIO* in,
EVP_CIPHER const* cipher,
unsigned int flags);
Equivalent to CMS_encrypt_ex() with a NULL library context and property query.
New enveloped ContentInfo, or NULL on error.
| Name | Description |
|---|---|
| certs | Stack of recipient certificates (RSA, Diffie-Hellman, or EC keys). |
| in | BIO supplying the content to encrypt (unused when CMS_STREAM is set). |
| cipher | Symmetric content-encryption cipher; GCM yields AuthEnvelopedData. |
| flags | Optional CMS flags (CMS_TEXT, CMS_BINARY, CMS_USE_KEYID, CMS_STREAM, CMS_PARTIAL, CMS_DETACHED, …). |