Package com.google.crypto.tink.aead
Class XAesGcmParameters
- java.lang.Object
-
- com.google.crypto.tink.Parameters
-
- com.google.crypto.tink.aead.AeadParameters
-
- com.google.crypto.tink.aead.XAesGcmParameters
-
public final class XAesGcmParameters extends AeadParameters
Describes the parameters of anXAesGcmKey
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXAesGcmParameters.VariantDescribes how the prefix is computed.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XAesGcmParameterscreate(XAesGcmParameters.Variant variant, int saltSizeBytes)Creates a newXAesGcmParametersobject for generating new instances ofXAesGcmKey.booleanequals(java.lang.Object o)intgetSaltSizeBytes()XAesGcmParameters.VariantgetVariant()Returns a variant object.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
-
create
public static XAesGcmParameters create(XAesGcmParameters.Variant variant, int saltSizeBytes) throws java.security.GeneralSecurityException
Creates a newXAesGcmParametersobject for generating new instances ofXAesGcmKey. The key size is 32 bytes and the tag size is 16 bytes. The IV size in bytes issaltSizeBytes + 12.create(Variant.NO_PREFIX, 12)returnsXAesGcmParametersthat follow the XAES-256-GCM specification.- Parameters:
variant- the variant of the X-AES-GCM key.saltSizeBytes- the size of the salt in bytes. Must be between 8 and 12 bytes.- Throws:
java.security.GeneralSecurityException
-
getVariant
public XAesGcmParameters.Variant getVariant()
Returns a variant object.
-
getSaltSizeBytes
public int getSaltSizeBytes()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
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
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-