private static void validate(JwtHmacParameters parameters) throws GeneralSecurityException {
    int minKeySize = Integer.MAX_VALUE;
    if (parameters.getAlgorithm().equals(JwtHmacParameters.Algorithm.HS256)) {
      minKeySize = 32;
    }
    if (parameters.getAlgorithm().equals(JwtHmacParameters.Algorithm.HS384)) {
      minKeySize = 48;
    }
    if (parameters.getAlgorithm().equals(JwtHmacParameters.Algorithm.HS512)) {
      minKeySize = 64;
    }
    if (parameters.getKeySizeBytes() < minKeySize) {
      throw new GeneralSecurityException("Key size must be at least " + minKeySize);
    }
  }
This key manager generates new {@code JwtHmacKey} keys and produces new instances of {@link
JwtHmac}.
java_src/src/main/java/com/google/crypto/tink/jwt/JwtHmacKeyManager.java