nodejs / webcrypto

This repository has been archived. The WebCrypto API has been implemented in recent versions of Node.js and does not require additional packages.
69 stars 20 forks source link

RSA needs to distinguish between RSA keys with different OIDs and parameters #17

Open tniessen opened 5 years ago

tniessen commented 5 years ago

WebCrypto requires implementations to be able to distinguish between the OIDs rsaEncryption, sha1WithRSAEncryption, sha256WithRSAEncryption, sha384WithRSAEncryption, sha512WithRSAEncryption, id-RSAES-OAEP and id-RSASSA-PSS, and for the last two, we even need access to the ASN.1 parameters.

This is currently not possible using the KeyObject API.

panva commented 5 years ago

Similar for EC and (in the future, not part of webcrypto yet) OKP keys, you'll need the curve name from the key too.

tniessen commented 5 years ago

@panva The curve name would have been part of my original proposal in nodejs/node#26854, I guess we could use a similar pattern for the other OIDs / parameters.

Another problem is that WebCrypto requires the ability to export keys with a different OID than they were imported with, so we would need to implement some kind of conversion.