java.lang.IllegalArgumentException: RSA signatures must be computed using an RSAPrivateKey. The specified key of type sun.security.mscapi.RSAPrivateKey is not an RSAPrivateKey.

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via GitHub by x2on
, 1 year ago
RSA signatures must be computed using an RSAPrivateKey. The specified key of type sun.security.mscapi.RSAPrivateKey is not an RSAPrivateKey.
java.lang.IllegalArgumentException: RSA signatures must be computed using an RSAPrivateKey. The specified key of type sun.security.mscapi.RSAPrivateKey is not an RSAPrivateKey.
at io.jsonwebtoken.impl.crypto.RsaSigner.(RsaSigner.java:34)
at io.jsonwebtoken.impl.crypto.DefaultSignerFactory.createSigner(DefaultSignerFactory.java:43)
at io.jsonwebtoken.impl.crypto.DefaultJwtSigner.(DefaultJwtSigner.java:37)
at io.jsonwebtoken.impl.crypto.DefaultJwtSigner.(DefaultJwtSigner.java:32)
at io.jsonwebtoken.impl.DefaultJwtBuilder.createSigner(DefaultJwtBuilder.java:339)
at io.jsonwebtoken.impl.DefaultJwtBuilder.compact(DefaultJwtBuilder.java:321)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.