public final class AesGcmSivKeyManager extends KeyTypeManager<AesGcmSivKey>
AesGcmSivKey keys and produces new instances of AesGcmSiv.KeyTypeManager.KeyFactory<KeyFormatProtoT extends com.google.protobuf.MessageLite,KeyProtoT extends com.google.protobuf.MessageLite>| Modifier and Type | Method and Description |
|---|---|
static KeyTemplate |
aes128GcmSivTemplate()
Creates and returns a
KeyTemplate that generates new instances of AES-GCM-SIV with the
following parameters:
Key size: 16 bytes
Prefix type: KeyTemplate.OutputPrefixType#TINK
|
static KeyTemplate |
aes256GcmSivTemplate()
Creates and returns a
KeyTemplate that generates new instances of AES-GCM-SIV with the
following parameters:
Key size: 32 bytes
Prefix type: KeyTemplate.OutputPrefixType#TINK
|
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<AesGcmSivKeyFormat,AesGcmSivKey> |
keyFactory()
Returns the
KeyTypeManager.KeyFactory for this key type. |
KeyData.KeyMaterialType |
keyMaterialType()
Returns the
KeyData.KeyMaterialType for this proto. |
AesGcmSivKey |
parseKey(com.google.protobuf.ByteString byteString)
Parses a serialized key proto.
|
static KeyTemplate |
rawAes128GcmSivTemplate()
Creates and returns a
KeyTemplate that generates new instances of AES-GCM with the
following parameters:
Key size: 16 bytes
Prefix type: KeyTemplate.OutputPrefixType#RAW (no prefix)
|
static KeyTemplate |
rawAes256GcmSivTemplate()
Creates and returns a
KeyTemplate that generates new instances of AES-GCM-SIV with the
following parameters:
Key size: 32 bytes
Prefix type: KeyTemplate.OutputPrefixType#RAW (no prefix)
|
static void |
register(boolean newKeyAllowed) |
void |
validateKey(AesGcmSivKey key)
Checks if the given
keyProto is a valid key. |
fipsStatus, firstSupportedPrimitiveClass, getKeyClass, getPrimitive, supportedPrimitivespublic String getKeyType()
KeyTypeManagergetKeyType in class KeyTypeManager<AesGcmSivKey>public int getVersion()
KeyTypeManagergetVersion in class KeyTypeManager<AesGcmSivKey>public KeyData.KeyMaterialType keyMaterialType()
KeyTypeManagerKeyData.KeyMaterialType for this proto.keyMaterialType in class KeyTypeManager<AesGcmSivKey>public void validateKey(AesGcmSivKey key) throws GeneralSecurityException
KeyTypeManagerkeyProto is a valid key.validateKey in class KeyTypeManager<AesGcmSivKey>GeneralSecurityException - if the passed keyProto is not valid in any way.public AesGcmSivKey parseKey(com.google.protobuf.ByteString byteString) throws com.google.protobuf.InvalidProtocolBufferException
KeyTypeManagerImplement as return KeyProtoT.parseFrom(byteString);.
parseKey in class KeyTypeManager<AesGcmSivKey>com.google.protobuf.InvalidProtocolBufferExceptionpublic KeyTypeManager.KeyFactory<AesGcmSivKeyFormat,AesGcmSivKey> 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<AesGcmSivKey>public static void register(boolean newKeyAllowed)
throws GeneralSecurityException
GeneralSecurityExceptionpublic static final KeyTemplate aes128GcmSivTemplate()
KeyTemplate that generates new instances of AES-GCM-SIV with the
following parameters:
KeyTemplate.OutputPrefixType#TINK
public static final KeyTemplate rawAes128GcmSivTemplate()
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.
public static final KeyTemplate aes256GcmSivTemplate()
KeyTemplate that generates new instances of AES-GCM-SIV with the
following parameters:
KeyTemplate.OutputPrefixType#TINK
public static final KeyTemplate rawAes256GcmSivTemplate()
KeyTemplate that generates new instances of AES-GCM-SIV with the
following parameters:
KeyTemplate.OutputPrefixType#RAW (no prefix)
Keys generated from this template should create ciphertexts compatible with other libraries.