title: How to make HMAC_SHA256 key from secret string to use it with JWT in jose4j?
body: <p>I want to produce JWTs and sign them with HMAC_SHA256.
  For that task I must use <a href="https://bitbucket.org/b_c/jose4j/wiki/Home" rel="noreferrer">jose4j</a>.
  I have tried to generate key based on secret with:</p>
  
  <pre><code>SecretKeySpec key = new SecretKeySpec(("secret").getBytes("UTF-8"), AlgorithmIdentifiers.HMAC_SHA512);
  </code></pre>
  
  <p>but it generates 40bits key while 512bit one is required for signing using HMAC_SHA256.</p>
  
  <ul>
  <li>The primary issue - how to sign tokens with HMAC_SHA512 using jose4j?</li>
  <li>Issue created by my approach solving issue above - how to make 512bit long secret key based on secret string?</li>
  </ul>