is there any way to encrypt data for multiple public key (so multiple key owner can decrypt data using their private key) using javascript cryto Api.
If that is not possible using RSA-OAEP, can you please suggest way for the same?
Thanks
window.crypto.subtle.encrypt(
{
name: "RSA-OAEP",
},
ArrayOfPublicKeys,
data
)
.then(function(encrypted){
console.log(encrypted);
})
Dr Jack Millan.
The way PGP, S/MIME and other similar messaging solutions enable a multi-party message is to:
The challenge here is the secure discovery of public keys, most applications punt on this and make the user do manual thumbprint verification or rely on a third-party such as a Certificate Authority to verify the binding of a key to a subject.
You can find an example that does this using webcrypto with a single recipient here: https://pkijs.org/examples/CMSEnvelopedExample.html
The source for this demo is here: https://github.com/PeculiarVentures/PKI.js/tree/master/examples/HowToEncryptCMSviaCertificate