Class LegacyKmsEnvelopeAeadParameters


  • public final class LegacyKmsEnvelopeAeadParameters
    extends AeadParameters
    Describes the parameters of an LegacyKmsEnvelopeAeadKey.

    Usage of this key type is not recommended. Instead, we recommend to implement the idea of this class manually:

    1. Create an remote Aead object for your KMS with an appropriate Tink extension (typically using a subclass of KmsClient).
    2. Create an envelope AEAD with KmsEnvelopeAead.create(com.google.crypto.tink.aead.AeadParameters, com.google.crypto.tink.Aead).

    Known Issues

    Global registration

    If a user uses a LegacyKmsEnvelopeAeadKey, when the corresponding Aead is created, Tink looks up the KmsClient in a global registry. This registry needs to store all the credentials and all the information. This is inappropriate in many situations.

    Ciphertext format

    The ciphertext format does not encode the key type of the key used. This can lead to unexpected results if a user changes the dekParametersForNewKeys or the dekParsingStrategy for the same remote key. In more details, the ciphertext contains a Tink key proto of newly generated key, but not the type URL. This means that if a user reuses the same remote Key with a different key type, it will be parsed with the wrong one.

    Also, Tink does note compare the parameters of the parsed key with the parameters specified in dekParametersForNewKeys. For example, if the dekParametersForNewKeys is specified as AES_128_GCM in one binary, and AES_256_GCM in another binary, communication between the binaries succeeds in both directions.

    Ciphertext malleability

    Some KMS have malleable ciphertexts. This means that the Aeads corresponding to these keys may be malleable. See https://developers.google.com/tink/issues/envelope-aead-malleability

    • Method Detail

      • getKekUri

        public java.lang.String getKekUri()
        Returns the URI with the key of the remote AEAD used.
      • hasIdRequirement

        public boolean hasIdRequirement()
        Description copied from class: Parameters
        Returns true if a key created with the parameters in this object has to have a certain ID when it is in a keyset.

        In Tink, certain keys change their behavior depending on the key id (for example, an Aead object can prefix the ciphertext with the big endian encoding of the key id). If this is the case, such a key should require a unique id in Key.getIdRequirementOrNull() and return true here.

        Specified by:
        hasIdRequirement in class Parameters
      • getDekParametersForNewKeys

        public AeadParameters getDekParametersForNewKeys()
        Parameters used when creating new keys.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object