public final class AesGcmKeyManager extends KeyTypeManager<AesGcmKey>
AesGcmKey keys and produces new instances of AesGcmJce.KeyTypeManager.KeyFactory<KeyFormatProtoT extends com.google.protobuf.MessageLite,KeyProtoT extends com.google.protobuf.MessageLite>| Modifier and Type | Method and Description |
|---|---|
static KeyTemplate |
aes128GcmTemplate() |
static KeyTemplate |
aes256GcmTemplate() |
TinkFipsUtil.AlgorithmFipsCompatibility |
fipsStatus()
Returns the FIPS compatibility of this KeyTypeManager.
|
String |
getKeyType()
Returns the type URL that identifies the key type of keys managed by this KeyManager.
|
int |
getVersion()
Returns the version number of this KeyManager.
|
KeyTypeManager.KeyFactory<AesGcmKeyFormat,AesGcmKey> |
keyFactory()
Returns the
KeyTypeManager.KeyFactory for this key type. |
KeyData.KeyMaterialType |
keyMaterialType()
Returns the
KeyData.KeyMaterialType for this proto. |
AesGcmKey |
parseKey(com.google.protobuf.ByteString byteString)
Parses a serialized key proto.
|
static KeyTemplate |
rawAes128GcmTemplate() |
static KeyTemplate |
rawAes256GcmTemplate() |
static void |
register(boolean newKeyAllowed) |
void |
validateKey(AesGcmKey key)
Checks if the given
keyProto is a valid key. |
firstSupportedPrimitiveClass, getKeyClass, getPrimitive, supportedPrimitivespublic String getKeyType()
KeyTypeManagergetKeyType in class KeyTypeManager<AesGcmKey>public int getVersion()
KeyTypeManagergetVersion in class KeyTypeManager<AesGcmKey>public KeyData.KeyMaterialType keyMaterialType()
KeyTypeManagerKeyData.KeyMaterialType for this proto.keyMaterialType in class KeyTypeManager<AesGcmKey>public void validateKey(AesGcmKey key) throws GeneralSecurityException
KeyTypeManagerkeyProto is a valid key.validateKey in class KeyTypeManager<AesGcmKey>GeneralSecurityException - if the passed keyProto is not valid in any way.public AesGcmKey parseKey(com.google.protobuf.ByteString byteString) throws com.google.protobuf.InvalidProtocolBufferException
KeyTypeManagerImplement as return KeyProtoT.parseFrom(byteString);.
parseKey in class KeyTypeManager<AesGcmKey>com.google.protobuf.InvalidProtocolBufferExceptionpublic KeyTypeManager.KeyFactory<AesGcmKeyFormat,AesGcmKey> keyFactory()
KeyTypeManagerKeyTypeManager.KeyFactory for this key type.
By default, this throws an UnsupportedOperationException. Hence, if an implementation does not support creating primitives, no implementation is required.
keyFactory in class KeyTypeManager<AesGcmKey>public static void register(boolean newKeyAllowed)
throws GeneralSecurityException
GeneralSecurityExceptionpublic static final KeyTemplate aes128GcmTemplate()
KeyTemplate that generates new instances of AES-GCM with the following
parameters:
KeyTemplate.OutputPrefixType#TINK
On Android KitKat (API level 19), the Aead instance
generated by this key template does not support associated data. It might not work at all
in older versions.
public static final KeyTemplate rawAes128GcmTemplate()
KeyTemplate that generates new instances of AES-GCM with the following
parameters:
KeyTemplate.OutputPrefixType#RAW (no prefix)
Keys generated from this template should create ciphertexts compatible with other libraries.
On Android KitKat (API level 19), the Aead instance
generated by this key template does not support associated data. It might not work at all
in older versions.
public static final KeyTemplate aes256GcmTemplate()
KeyTemplate that generates new instances of AES-GCM with the following
parameters:
KeyTemplate.OutputPrefixType#TINK
On Android KitKat (API level 19), the Aead instance
generated by this key template does not support associated data. It might not work at all
in older versions.
public static final KeyTemplate rawAes256GcmTemplate()
KeyTemplate that generates new instances of AES-GCM with the following
parameters:
KeyTemplate.OutputPrefixType#RAW (no prefix)
Keys generated from this template should create ciphertexts compatible with other libraries.
On Android KitKat (API level 19), the Aead instance
generated by this key template does not support associated data. It might not work at all
in older versions.
public TinkFipsUtil.AlgorithmFipsCompatibility fipsStatus()
KeyTypeManagerfipsStatus in class KeyTypeManager<AesGcmKey>