private static void validate(HkdfPrfParameters parameters) throws GeneralSecurityException {
    if (parameters.getKeySizeBytes() < MIN_KEY_SIZE) {
      throw new GeneralSecurityException("Key size must be at least " + MIN_KEY_SIZE);
    }
    if (parameters.getHashType() != HkdfPrfParameters.HashType.SHA256
        && parameters.getHashType() != HkdfPrfParameters.HashType.SHA512) {
      throw new GeneralSecurityException("Hash type must be SHA256 or SHA512");
    }
  }
This key manager generates new {@code HkdfPrfKey} keys and produces new instances of {@code
HkdfStreamingPrf} and {@code HkdfPrf}.
java_src/src/main/java/com/google/crypto/tink/prf/HkdfPrfKeyManager.java