title: How to obtain JWKs and use them in JWT signing?
body: <p>I am reading this blog about JWTs and how you can use the signature part of it to verify that the token was actually issued by the trusted party.</p>
  
  <p><a href="https://hackernoon.com/json-web-tokens-jwt-demystified-f7e202249640" rel="noreferrer">https://hackernoon.com/json-web-tokens-jwt-demystified-f7e202249640</a></p>
  
  <blockquote>
    <p>The JSON Web Key (JWK) is a JSON object that contains a well-known public key which can be be used to validate the signature of a signed JWT.</p>
    
    <p>If the issuer of your JWT used an asymmetric key to sign the JWT, it
    will likely host a file called a JSON Web Key Set (JWKS). The JWKS is
    a JSON object that contains the property keys, which in turn holds an
    array of JWK objects.</p>
  </blockquote>
  
  <p>Here is java code snippet from my codebase that generates JWT for me:</p>
  
  <pre><code>new JwtBuilder().setClaims(claims).setExpiration(expiration).signWith(signatureAlgorithm, sharedSecret).compact();
  </code></pre>
  
  <p>I do not quite understand how I obtain JWKs and how do I use them for signing? 
  I haven't found any examples on the web. </p>
  
  <p>Any help will be greatly appreciated.</p>