Class LegacyKmsEnvelopeAeadParameters
- java.lang.Object
-
- com.google.crypto.tink.Parameters
-
- com.google.crypto.tink.aead.AeadParameters
-
- com.google.crypto.tink.aead.LegacyKmsEnvelopeAeadParameters
-
public final class LegacyKmsEnvelopeAeadParameters extends AeadParameters
Describes the parameters of anLegacyKmsEnvelopeAeadKey.Usage of this key type is not recommended. Instead, we recommend to implement the idea of this class manually:
- Create an remote
Aeadobject for your KMS with an appropriate Tink extension (typically using a subclass ofKmsClient). - 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 aLegacyKmsEnvelopeAeadKey, when the correspondingAeadis created, Tink looks up theKmsClientin 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 thedekParametersForNewKeysor thedekParsingStrategyfor 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 thedekParametersForNewKeysis 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
- Create an remote
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLegacyKmsEnvelopeAeadParameters.BuilderBuilder forLegacyKmsEnvelopeAeadParameters.static classLegacyKmsEnvelopeAeadParameters.DekParsingStrategySpecifies how the DEK in received ciphertexts are parsed.static classLegacyKmsEnvelopeAeadParameters.VariantDescribes how the prefix is computed.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LegacyKmsEnvelopeAeadParameters.Builderbuilder()booleanequals(java.lang.Object o)AeadParametersgetDekParametersForNewKeys()Parameters used when creating new keys.LegacyKmsEnvelopeAeadParameters.DekParsingStrategygetDekParsingStrategy()Returns the type URL which is used when parsing encrypted keys.java.lang.StringgetKekUri()Returns the URI with the key of the remote AEAD used.LegacyKmsEnvelopeAeadParameters.VariantgetVariant()inthashCode()booleanhasIdRequirement()Returns true if a key created with the parameters in this object has to have a certain ID when it is in a keyset.java.lang.StringtoString()
-
-
-
Method Detail
-
builder
public static LegacyKmsEnvelopeAeadParameters.Builder builder()
-
getKekUri
public java.lang.String getKekUri()
Returns the URI with the key of the remote AEAD used.
-
getVariant
public LegacyKmsEnvelopeAeadParameters.Variant getVariant()
-
hasIdRequirement
public boolean hasIdRequirement()
Description copied from class:ParametersReturns 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
Aeadobject 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 inKey.getIdRequirementOrNull()and return true here.- Specified by:
hasIdRequirementin classParameters
-
getDekParsingStrategy
public LegacyKmsEnvelopeAeadParameters.DekParsingStrategy getDekParsingStrategy()
Returns the type URL which is used when parsing encrypted keys.See "Known Issues" section above.
-
getDekParametersForNewKeys
public AeadParameters getDekParametersForNewKeys()
Parameters used when creating new keys.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-