@AccessesPartialKey
  private static JwtHmacKey createKey(JwtHmacParameters parameters, @Nullable Integer idRequirement)
      throws GeneralSecurityException {
    validate(parameters);
    JwtHmacKey.Builder builder =
        JwtHmacKey.builder()
            .setParameters(parameters)
            .setKeyBytes(SecretBytes.randomBytes(parameters.getKeySizeBytes()));
    if (parameters.hasIdRequirement()) {
      if (idRequirement == null) {
        throw new GeneralSecurityException(
            "Cannot create key without ID requirement with parameters with ID requirement");
      }
      builder.setIdRequirement(idRequirement);
    }
    return builder.build();
  }
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