Skip to content

SignatureException: JWT signature does not match locally computed signature #864

Closed Answered by lhazlewood
kalidasstamil asked this question in Q&A
Discussion options

You must be logged in to vote

We haven't experienced any problems in JJWT before with random public key data working sometimes and not working during other times. Odds are very high that there's a problem with creating the RSAPublicKeySpec correctly and/or saving or parsing the String data correctly.

For example, in most cryptographic contexts where a BigInteger is required, the data represents unsigned bytes, so we always use the BigInteger(1, bytes) constructor:

Converting the BigInteger values to a numeric String, trimming and then back again could be problematic. In…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@lhazlewood
Comment options

Answer selected by lhazlewood
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants