question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation on use of Public/Private Keys

See original GitHub issue

Any 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:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
pme123commented, Dec 12, 2017

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.

0reactions
lhazlewoodcommented, Aug 6, 2018

Closing this as per the 0.10.0 release, signatures with both Secret and Public/Private keypairs are documented in the Readme.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found