PKCS7_encrypt

Create a PKCS#7 envelopedData encrypting in for each recipient in certs.

Synopsis

Declared in <openssl/pkcs7.h>

PKCS7*
PKCS7_encrypt(
    stack_st_X509* certs,
    BIO* in,
    EVP_CIPHER const* cipher,
    int flags);

Return Value

New PKCS7 envelopedData object, or NULL on error; free with PKCS7_free.

Parameters

NameDescription
certsRecipient certificates whose public keys encrypt the content-encryption key (RSA keys).
inBIO supplying the plaintext content.
cipherContent-encryption cipher (for example triple-DES or AES).
flagsPKCS7_* encryption flags (for example PKCS7_TEXT, PKCS7_BINARY, PKCS7_STREAM).