Public Key Encryption to Multiple Recipients
In PKCS#7 enveloped-data (now CMS, RFC 5652), RSA public key encryption can be used to encrypt content such that multiple recipients (each with their own certificate) can decrypt it. This is done by:
How It Works
This is what Chilkat does internally.
- A random symmetric key (e.g., AES key) is generated.
- The actual content is encrypted with this symmetric key.
- The symmetric key is then encrypted separately with the RSA public key of each recipient.
- These encrypted keys are packaged with the message—one per recipient certificate.
The result is a PKCS#7 enveloped-data structure containing:
- The encrypted content
- A set of RecipientInfo structures, each with:
- The recipient’s certificate identifier
- The symmetric key encrypted with that recipient's public key
How Decryption Works
- Each recipient tries to match their certificate (subject/key ID) in the
RecipientInfo
list. - If a match is found, the recipient uses their private key to decrypt the symmetric key.
- That decrypted key is then used to decrypt the actual content.
Summary
Step | Description |
---|---|
Multiple recipients | Each gets the same content key encrypted with their public key |
Only one is needed | Any one recipient with the corresponding private key can decrypt the message |
Efficient & scalable | Content is encrypted once, key is encrypted per recipient |
This design enables secure group delivery: the sender encrypts once, and any authorized recipient can decrypt with their own private key.