None of the following functions can be called with the arguments supplied. #977
-
|
Hello everyone, I could not use this fun signature! Any idea? .signWith(privateKey, Jwts.SIG.RS512) ` val kf = KeyFactory.getInstance("RSA") other signatures work, but: None of the following functions can be called with the arguments supplied. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi @ItSNeverLate ! ...
.signWith(privateKey, SignatureAlgorithm.RS512)
.compact()should be: ...
.signWith(privateKey, Jwts.SIG.RS512) // <-- Jwts.SIG.RS512
.compact()The I think that's the issue - let us know! |
Beta Was this translation helpful? Give feedback.
Hi @ItSNeverLate !
should be:
The
.signWithmethod signature requires that key specified must be compatible with the pairedSignatureAlgorithminstance. As such, the type of key required byJwts.SIG.RS512must be aPrivateKey, but it looks like you've typedval privateKeyto be just aKey(and not aPrivateKeyas required).I think that's the issue - let us know!