Add RS512, PS256, and PS512 support
See original GitHub issueWith new release of god_crypto v1.4.7, you can now add support for the following algorithms: RS512, PS256, and PS512.
RS512
await rsa.sign(message, { algorithm: "rsassa-pkcs1-v1_5", hash: "sha512" })
await rsa.verify(signature, message, { algorithm: "rsassa-pkcs1-v1_5", hash: "sha512" });
PS256
await rsa.sign(message, { algorithm: "rsassa-pss", hash: "sha256" });
await rsa.verify(signature, message, { algorithm: "rsassa-pss", hash: "sha256" });
PS512
await rsa.sign(message, { algorithm: "rsassa-pss", hash: "sha512" });
await rsa.verify(signature, message, { algorithm: "rsassa-pss", hash: "sha512" });
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
The Nimbus JOSE+JWT library adds PS256, PS384 and ...
Release 2.20 of the Nimbus JOSE+JWT library adds support for the JWS PS256, PS384 and PS512 signature algorithms, which are a form of...
Read more >Unsupported JWS algorithm PS256, must be RS256, RS384 ...
For generating JWS, I am using PS256 algorithm, but getting the error Unsupported JWS algorithm PS256, must be RS256, RS384, RS512, PS256, PS384 ......
Read more >jsjws: pure JavaScript JSON Web Signature library (now a part ...
Release 2.0 is now available to support PS{256,512} (i.e. SHA256/512withRSAPSS) signature algorithm. 2012-May-21: Release 1.2 is now available to add JWS-JS ...
Read more >Enhancements coming soon in JWT Policies
You can use the same RSA keys with PS256, PS384, and PS512 that you ... The JWS policies support all the same key...
Read more >Generate JWT - IBM
For algorithm types RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512 the cryptographic objects referenced must be a Crypto Key (private key)....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank. I have checked the problems and I found the problem in my implementation:
RS512
, the encryption is right, except that I write the wrongoid
(using sha256 oid). I use verify code to test the sign code and my verify code does not include checkingoid
. I will update more test case for this one.PS256
, there is small error in my code as well and add more test cases.The test method for testing
PS256
in your code is also wrong.PS256
andPS512
include random salt. That’s mean that it always produce different signature for same message.I will patch the fix this week and I will update back to you on this issue.
The tests pass now.
I would love to get a code review before I merge these changes: https://github.com/timonson/djwt/pull/44