PKCS7_decrypt

Decrypt a PKCS#7 envelopedData (or signed-and-enveloped) structure for a recipient.

Synopsis

Declared in <openssl/pkcs7.h>

int
PKCS7_decrypt(
    PKCS7* p7,
    EVP_PKEY* pkey,
    X509* cert,
    BIO* data,
    int flags);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
p7Enveloped PKCS#7 object to decrypt.
pkeyRecipient private key matching a RecipientInfo in p7.
certRecipient certificate used to select the matching RecipientInfo, or NULL.
dataBIO that receives the decrypted content.
flagsPKCS7_* decryption flags (for example PKCS7_TEXT).