private static ProtoKeySerialization serializeKey(
      LegacyKmsAeadKey key, @Nullable SecretKeyAccess access) throws GeneralSecurityException {
    return ProtoKeySerialization.create(
        TYPE_URL,
        com.google.crypto.tink.proto.KmsAeadKey.newBuilder()
            .setParams(
                KmsAeadKeyFormat.newBuilder().setKeyUri(key.getParameters().keyUri()).build())
            .build()
            .toByteString(),
        KeyMaterialType.REMOTE,
        toProtoOutputPrefixType(key.getParameters().variant()),
        key.getIdRequirementOrNull());
  }
Serializers and Parsers for LegacyKmsAeadProtoKey and LegacyKmsAeadProtoParameters
java_src/src/main/java/com/google/crypto/tink/aead/LegacyKmsAeadProtoSerialization.java