CMS_encrypt_ex

Create a CMS EnvelopedData or AuthEnvelopedData encrypting content for recipient certificates.

Synopsis

Declared in <openssl/cms.h>

CMS_ContentInfo*
CMS_encrypt_ex(
    stack_st_X509* certs,
    BIO* in,
    EVP_CIPHER const* cipher,
    unsigned int flags,
    OSSL_LIB_CTX* libctx,
    char const* propq);

Return Value

New enveloped ContentInfo, or NULL on error.

Parameters

NameDescription
certsStack of recipient certificates (RSA, Diffie-Hellman, or EC keys).
inBIO supplying the content to encrypt (unused when CMS_STREAM is set).
cipherSymmetric content-encryption cipher; GCM yields AuthEnvelopedData.
flagsOptional CMS flags (CMS_TEXT, CMS_BINARY, CMS_USE_KEYID, CMS_STREAM, CMS_PARTIAL, CMS_DETACHED, …).
libctxLibrary context for algorithm fetches, or NULL for the default.
propqProperty query for provider selection, or NULL.