code: public static SecretKey secretKeyFor(SignatureAlgorithm alg) throws IllegalArgumentException {
          Assert.notNull(alg, "SignatureAlgorithm cannot be null.");
          switch (alg) {
              case HS256:
              case HS384:
              case HS512:
                  return Classes.invokeStatic(MAC, "generateKey", SIG_ARG_TYPES, alg);
              default:
                  String msg = "The " + alg.name() + " algorithm does not support shared secret keys.";
                  throw new IllegalArgumentException(msg);
          }
      }
docs: Returns a new {@link SecretKey} with a key length suitable for use with the specified {@link SignatureAlgorithm}.
  
  <p><a href="https://tools.ietf.org/html/rfc7518#section-3.2">JWA Specification (RFC 7518), Section 3.2</a>
  requires minimum key lengths to be used for each respective Signature Algorithm.  This method returns a
  secure-random generated SecretKey that adheres to the required minimum key length.  The lengths are:</p>
  
  <table>
  <tr>
  <th>Algorithm</th>
  <th>Key Length</th>
  </tr>
  <tr>
  <td>HS256</td>
  <td>256 bits (32 bytes)</td>
  </tr>
  <tr>
  <td>HS384</td>
  <td>384 bits (48 bytes)</td>
  </tr>
  <tr>
  <td>HS512</td>
  <td>512 bits (64 bytes)</td>
  </tr>
  </table>
  
  @param alg the {@code SignatureAlgorithm} to inspect to determine which key length to use.
  @return a new {@link SecretKey} instance suitable for use with the specified {@link SignatureAlgorithm}.
  @throws IllegalArgumentException for any input value other than {@link SignatureAlgorithm#HS256},
  {@link SignatureAlgorithm#HS384}, or {@link SignatureAlgorithm#HS512}