public static Aead create(AeadParameters dekParameters, Aead remote)
      throws GeneralSecurityException {
    // This serializes the parameters, changes output prefix to raw, and parses it again.
    // It would be better to reject the parameters immediately if it was a non-raw object, but
    // this might break someone, so we keep as is.
    KeyTemplate dekTemplate;
    try {
      dekTemplate =
          KeyTemplate.parseFrom(
              TinkProtoParametersFormat.serialize(dekParameters),
              ExtensionRegistryLite.getEmptyRegistry());
    } catch (InvalidProtocolBufferException e) {
      throw new GeneralSecurityException(e);
    }
    return new KmsEnvelopeAead(dekTemplate, remote);
  }
Creates a new instance of Tink's KMS Envelope AEAD.

<p>{@code dekParameters} must be any of these Tink AEAD parameters (any other will be
rejected): {@link AesGcmParameters}, {@link ChaCha20Poly1305Parameters}, {@link
XChaCha20Poly1305Parameters}, {@link AesCtrHmacAeadParameters}, {@link AesGcmSivParameters}, or
{@link AesEaxParameters}.
java_src/src/main/java/com/google/crypto/tink/aead/KmsEnvelopeAead.java