pkcs7_decrypt.c
error_t pkcs7DecryptData(const Pkcs7EncryptedContentInfo *encryptedContentInfo, const uint8_t *key, size_t keyLen, uint8_t *plaintext, size_t *plaintextLen)
Perform data decryption.
Definition: pkcs7_decrypt.c:138
X509OctetString encryptedContent
Definition: pkcs7_common.h:342
OID (Object Identifier)
Collection of AEAD algorithms.
const CipherAlgo * pkcs7GetCipherAlgo(const uint8_t *oid, size_t length)
Get the cipher algorithm that matches the specified OID.
Definition: pkcs7_common.c:215
error_t rsaesPkcs1v15Decrypt(const RsaPrivateKey *key, const uint8_t *ciphertext, size_t ciphertextLen, uint8_t *message, size_t messageSize, size_t *messageLen)
RSAES-PKCS1-v1_5 decryption operation.
Definition: rsa.c:507
PKCS #7 message parsing.
error_t pkcs7FindRecipient(const Pkcs7RecipientInfos *recipientInfos, const X509CertInfo *recipientCertInfo, Pkcs7RecipientInfo *recipientInfo)
Search a list of per-recipient informations for a given recipient.
Definition: pkcs7_decrypt.c:230
uint_t pkcs7GetKeyLength(const uint8_t *oid, size_t length)
Get the encryption key length to be used for PBES2 operation.
Definition: pkcs7_common.c:270
General definitions for cryptographic algorithms.
Pkcs7EncryptedContentInfo encryptedContentInfo
Definition: pkcs7_common.h:369
Cipher Block Chaining (CBC) mode.
PKCS #7 message decryption.
Pkcs7ContentEncrAlgo contentEncrAlgo
Definition: pkcs7_common.h:341
error_t pkcs7ParseRecipientInfo(const uint8_t *data, size_t length, size_t *totalLength, Pkcs7RecipientInfo *recipientInfo)
Parse RecipientInfo structure.
Definition: pkcs7_parse.c:1203
error_t pkcs7DecryptEnvelopedData(const Pkcs7EnvelopedData *envelopedData, const X509CertInfo *recipientCertInfo, const void *recipientPrivateKey, uint8_t *plaintext, size_t *plaintextLen)
Decrypt enveloped-data content.
Definition: pkcs7_decrypt.c:57
__weak_func error_t cbcDecrypt(const CipherAlgo *cipher, void *context, uint8_t *iv, const uint8_t *c, uint8_t *p, size_t length)
CBC decryption.
Definition: cbc.c:108
bool_t x509CompareName(const uint8_t *name1, size_t nameLen1, const uint8_t *name2, size_t nameLen2)
Compare distinguished names.
Definition: x509_common.c:184
Pkcs7IssuerAndSerialNumber issuerAndSerialNumber
Definition: pkcs7_common.h:294
error_t pkcs7DecryptKey(const Pkcs7RecipientInfo *recipientInfo, const void *recipientPrivateKey, uint8_t *plaintext, size_t *plaintextLen)
Perform key decryption.
Definition: pkcs7_decrypt.c:100
Debugging facilities.