private static LegacyKmsAeadParameters parseParameters(ProtoParametersSerialization serialization)
      throws GeneralSecurityException {
    if (!serialization.getKeyTemplate().getTypeUrl().equals(TYPE_URL)) {
      throw new IllegalArgumentException(
          "Wrong type URL in call to LegacyKmsAeadProtoSerialization.parseParameters: "
              + serialization.getKeyTemplate().getTypeUrl());
    }
    KmsAeadKeyFormat format;
    try {
      format =
          KmsAeadKeyFormat.parseFrom(
              serialization.getKeyTemplate().getValue(), ExtensionRegistryLite.getEmptyRegistry());
    } catch (InvalidProtocolBufferException e) {
      throw new GeneralSecurityException("Parsing KmsAeadKeyFormat failed: ", e);
    }
    return LegacyKmsAeadParameters.create(
        format.getKeyUri(), toVariant(serialization.getKeyTemplate().getOutputPrefixType()));
  }
Serializers and Parsers for LegacyKmsAeadProtoKey and LegacyKmsAeadProtoParameters
java_src/src/main/java/com/google/crypto/tink/aead/LegacyKmsAeadProtoSerialization.java