title: Generate token with RS256 and Jwts.builder().signWith() produces invalid signature
body: <p>Using the <a href="https://github.com/jwtk/jjwt" rel="nofollow noreferrer">JWT Java library</a> and producing a token with the <strong>RS256</strong> algorithm, I always get an invalid signature with the <a href="https://jwt.io/" rel="nofollow noreferrer">jwt.io</a> debugger. Here is my example code, I tried to make it as simple as possible to start with my current project:</p>
  
  <pre><code>    // Create a legitimate RSA public and private key pair:
      KeyPair kp = RsaProvider.generateKeyPair();
      PublicKey publicKey = kp.getPublic();
      PrivateKey privateKey = kp.getPrivate();
  
      String jwt = Jwts.builder().setSubject("Joe").signWith(SignatureAlgorithm.RS256, privateKey).compact();
  </code></pre>
  
  <p>This code is inspired from the test class <a href="https://github.com/jwtk/jjwt/blob/master/src/test/groovy/io/jsonwebtoken/JwtsTest.groovy" rel="nofollow noreferrer">here</a>.</p>
  
  <p>Any idea what I could be missing?</p>