pkcs7_encrypt.c
Go to the documentation of this file.
92 envelopedData.recipientInfos.recipientInfos[0].issuerAndSerialNumber.name.raw = recipientCertInfo->tbsCert.issuer.raw;
93 envelopedData.recipientInfos.recipientInfos[0].issuerAndSerialNumber.serialNumber = recipientCertInfo->tbsCert.serialNumber;
95 envelopedData.recipientInfos.recipientInfos[0].keyEncryptionAlgo.oid.length = sizeof(RSA_ENCRYPTION_OID);
error_t pkcs7FormatEnvelopedData(const PrngAlgo *prngAlgo, void *prngContext, const X509CertInfo *recipientCertInfo, const Pkcs7EnvelopedData *envelopedData, const uint8_t *plaintext, size_t plaintextLen, uint8_t *output, size_t *written)
Format enveloped-data content.
Definition: pkcs7_format.c:349
__weak_func error_t cbcEncrypt(const CipherAlgo *cipher, void *context, uint8_t *iv, const uint8_t *p, uint8_t *c, size_t length)
CBC encryption.
Definition: cbc.c:61
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 pkcs7EncryptData(const Pkcs7EncryptedContentInfo *encryptedContentInfo, const uint8_t *key, size_t keyLen, const uint8_t *plaintext, size_t plaintextLen, uint8_t *ciphertext, size_t *ciphertextLen)
Perform data encryption.
Definition: pkcs7_encrypt.c:183
error_t pkcs7EncryptKey(const PrngAlgo *prngAlgo, void *prngContext, const X509CertInfo *recipientCertInfo, const uint8_t *plaintext, size_t plaintextLen, uint8_t *ciphertext, size_t *ciphertextLen)
Perform key encryption.
Definition: pkcs7_encrypt.c:126
error_t rsaesPkcs1v15Encrypt(const PrngAlgo *prngAlgo, void *prngContext, const RsaPublicKey *key, const uint8_t *message, size_t messageLen, uint8_t *ciphertext, size_t *ciphertextLen)
RSAES-PKCS1-v1_5 encryption operation.
Definition: rsa.c:409
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.
Pkcs7ContentEncrAlgo contentEncrAlgo
Definition: pkcs7_common.h:341
PKCS #7 message encryption.
error_t x509ImportRsaPublicKey(RsaPublicKey *publicKey, const X509SubjectPublicKeyInfo *publicKeyInfo)
Import an RSA public key.
Definition: x509_key_parse.c:563
Pkcs7RecipientInfo recipientInfos[PKCS7_MAX_RECIPIENT_INFOS]
Definition: pkcs7_common.h:308
Parsing of ASN.1 encoded keys.
PKCS #7 message formatting.
X509SubjectPublicKeyInfo subjectPublicKeyInfo
Definition: x509_common.h:1109
Pkcs7IssuerAndSerialNumber issuerAndSerialNumber
Definition: pkcs7_common.h:294
error_t pkcs7EncryptEnvelopedData(const PrngAlgo *prngAlgo, void *prngContext, const X509CertInfo *recipientCertInfo, const Pkcs7ContentEncrAlgo *contentEncrAlgo, const uint8_t *plaintext, size_t plaintextLen, uint8_t *output, size_t *written)
Encrypt enveloped-data content.
Definition: pkcs7_encrypt.c:60
Debugging facilities.