private void validate(HmacPrfKey key) throws GeneralSecurityException {
    if (key.getKeyValue().size() < MIN_KEY_SIZE_IN_BYTES) {
      throw new GeneralSecurityException("key too short");
    }
    switch (key.getParams().getHash()) {
      case SHA1:
      case SHA224:
      case SHA256:
      case SHA384:
      case SHA512:
        return;
      default:
        throw new GeneralSecurityException("unknown hash type");
    }
  }
@param serializedKey serialized {@code HmacPrfKey} proto
java_src/src/main/java/com/google/crypto/tink/prf/internal/LegacyHmacPrfTestKeyManager.java