@AccessesPartialKey
  private static ProtoKeySerialization serializeKey(
      LegacyKmsEnvelopeAeadKey key, @Nullable SecretKeyAccess access)
      throws GeneralSecurityException {
    return ProtoKeySerialization.create(
        TYPE_URL,
        KmsEnvelopeAeadKey.newBuilder()
            .setParams(serializeParametersToKmsEnvelopeAeadKeyFormat(key.getParameters()))
            .build()
            .toByteString(),
        KeyMaterialType.REMOTE,
        toProtoOutputPrefixType(key.getParameters().getVariant()),
        key.getIdRequirementOrNull());
  }
Serializers and Parsers for LegacyKmsEnvelopeAeadProtoKey and
LegacyKmsEnvelopeAeadProtoParameters
java_src/src/main/java/com/google/crypto/tink/aead/LegacyKmsEnvelopeAeadProtoSerialization.java