private void validate(HmacKey key) throws GeneralSecurityException {
    Validators.validateVersion(key.getVersion(), VERSION);
    if (key.getKeyValue().size() < MIN_KEY_SIZE_IN_BYTES) {
      throw new GeneralSecurityException("key too short");
    }
    validate(key.getParams());
  }
@param serializedKeyFormat serialized {@code HmacKeyFormat} proto
@return {@code KeyData} with a new {@code HmacKey} proto
java_src/src/main/java/com/google/crypto/tink/mac/internal/LegacyHmacTestKeyManager.java