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

GitHub | x2on | 7 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Windows RSAPrivateKey (MSCAPI)

    GitHub | 7 months ago | x2on
    java.lang.IllegalArgumentException: RSA signatures must be computed using an RSAPrivateKey. The specified key of type sun.security.mscapi.RSAPrivateKey is not an RSAPrivateKey.

    Root Cause Analysis

    1. 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.<init>()
    2. io.jsonwebtoken.impl
      DefaultJwtBuilder.compact
      1. io.jsonwebtoken.impl.crypto.RsaSigner.<init>(RsaSigner.java:34)
      2. io.jsonwebtoken.impl.crypto.DefaultSignerFactory.createSigner(DefaultSignerFactory.java:43)
      3. io.jsonwebtoken.impl.crypto.DefaultJwtSigner.<init>(DefaultJwtSigner.java:37)
      4. io.jsonwebtoken.impl.crypto.DefaultJwtSigner.<init>(DefaultJwtSigner.java:32)
      5. io.jsonwebtoken.impl.DefaultJwtBuilder.createSigner(DefaultJwtBuilder.java:339)
      6. io.jsonwebtoken.impl.DefaultJwtBuilder.compact(DefaultJwtBuilder.java:321)
      6 frames