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

Add support for RSA-PSS PublicKeyInfo variants #326

Open chris-wood opened 2 years ago

chris-wood commented 2 years ago

Currently, PublicKeyInfo only supports two algorithms -- ECDSA ("1.2.840.10045.2.1") and RSA ("1.2.840.113549.1.1.1", for encryption). It would be useful to also support RSA-PSS ("1.2.840.113549.1.1.10"). The format is defined here:

      id-RSASSA-PSS  OBJECT IDENTIFIER  ::=  { pkcs-1 10 }

      RSASSA-PSS-params  ::=  SEQUENCE  {
         hashAlgorithm      [0] HashAlgorithm DEFAULT
                                   sha1Identifier,
         maskGenAlgorithm   [1] MaskGenAlgorithm DEFAULT
                                   mgf1SHA1Identifier,
         saltLength         [2] INTEGER DEFAULT 20,
         trailerField       [3] INTEGER DEFAULT 1  }

If folks generally agree, I can try and send a PR to add this support.

rmhrisk commented 2 years ago

Non breaking addition would be great.