Documentation on use of Public/Private Keys
See original GitHub issueAny docs or even links to relevent tests on using Public/Private Keys would be useful.
I have seen and read : https://github.com/jwtk/jjwt/issues/25 but could not figure out how to actually use the keypair.
I’m attempting to do what I think should be the obvious thing but receive
java.lang.IllegalArgumentException: MAC signatures must be computed and verified using a SecretKey. The specified key of type sun.security.rsa.RSAPrivateCrtKeyImpl is not a SecretKey.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:8 (3 by maintainers)
Top Results From Across the Web
What is a Public Key and How Does it Work? - TechTarget
Public keys are available from a certificate authority, which issues digital certificates that prove the owner's identity and contain the owner's public key....
Read more >Public-Private Key Authentication - Apple Developer
There are two forms of public-private key authentication: passkeys and security keys. ... An identifier for the algorithm that a credential's key pair...
Read more >How does public key cryptography work? - Cloudflare
Public key cryptography, also known as asymmetric cryptography, uses two separate keys instead of one shared one: a public key and a private...
Read more >Public Keys, Private Keys, and Certificates
Public -key cryptography is based on the concept of a key pair, which consists of a public key and a private key. Data...
Read more >Creating public/private key pairs - Cloud IoT Core
Generating an RSA key · rsa_private.pem : The private key that must be securely stored on the device and used to sign the...
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
Even with the example of @lhazlewood I got the IllegalArgumentException described above:
java.lang.IllegalArgumentException: MAC signatures must be computed and verified using a SecretKey. The specified key of type sun.security.rsa.RSAPrivateCrtKeyImpl is not a SecretKey.
The problem was that the algorithm did not match.Changing to
SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.RS256;
fixed it.Closing this as per the 0.10.0 release, signatures with both Secret and Public/Private keypairs are documented in the Readme.