PeculiarVentures / PKI.js

PKI.js is a pure JavaScript library implementing the formats that are used in PKI applications (signing, encryption, certificate requests, OCSP and TSP requests/responses). It is built on WebCrypto (Web Cryptography API) and requires no plug-ins.
http://pkijs.org
Other
1.25k stars 204 forks source link

EnvelopedData decrypt method doesn't support CryptoKey #318

Open microshine opened 3 years ago

microshine commented 3 years ago

EnvelopedData::decrypt imports private key from pkcs8 buffer only. But what to do if CryptoKey is unextractable? We need to extend that function and make decryptionParameters.recipientPrivateKey: ArrayBuffer | CryptoKey https://github.com/PeculiarVentures/PKI.js/blob/8f84d40ee6181d3020239a85f4d923bb13a4d99e/src/EnvelopedData.js#L1446-L1451