CMS_decrypt_set1_pkey_and_peer

Decrypt CMS EnvelopedData/AuthEnvelopedData recipient key material using a private key and optional peer certificate.

Synopsis

Declared in <openssl/cms.h>

int
CMS_decrypt_set1_pkey_and_peer(
    CMS_ContentInfo* cms,
    EVP_PKEY* pk,
    X509* cert,
    X509* peer);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
cmsCMS ContentInfo to decrypt; on success stores pk for a later CMS_decrypt() with NULL key arguments.
pkRecipient private key used to unwrap the content-encryption key.
certRecipient certificate used to locate the matching RecipientInfo; may be NULL to try all recipients.
peerOptional originator certificate for key-agreement recipients, or NULL.