Validating jwt in java: Key bytes cannot be specified for RSA signatures
<p>I receive the jwt (access token) from an OAuth Server. The OAuth server has already provided me with the secret, public key, and self-signed CA certificate.</p>

<p>I want to write a code that when I receive a jwt, I can validate it and check if this server has sent it to me. I use the following code to validat my jwt in java.</p>

<pre><code>String jwt = "xxx.yyy.zzz";

        //This line will throw an exception if it is not a signed JWS (as expected)
Claims claims = Jwts.parser().setSigningKey(DatatypeConverter.parseBase64Binary(self_signed_CA_Certificate))
                .parseClaimsJws(jwt).getBody();
</code></pre>

<p>I get the error: <code>Key bytes cannot be specified for RSA signatures.  Please specify a PublicKey or PrivateKey instance.</code></p>

<p>Any help is appreciated.</p>