Skip to content

None of the following functions can be called with the arguments supplied. #977

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

You must be logged in to vote

Hi @ItSNeverLate !

...
.signWith(privateKey, SignatureAlgorithm.RS512)
.compact()

should be:

...
.signWith(privateKey, Jwts.SIG.RS512) // <-- Jwts.SIG.RS512
.compact()

The .signWith method signature requires that key specified must be compatible with the paired SignatureAlgorithm instance. As such, the type of key required by Jwts.SIG.RS512 must be a PrivateKey, but it looks like you've typed val privateKey to be just a Key (and not a PrivateKey as required).

I think that's the issue - let us know!

Replies: 1 comment 1 reply

Comment options

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

Answer selected by ItSNeverLate
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