public class KmsAeadKeyManager extends KeyTypeManager<KmsAeadKey>
Aead that forwards encrypt/decrypt requests to
a key residing in a remote KMS.KeyTypeManager.KeyFactory<KeyFormatProtoT extends com.google.protobuf.MessageLite,KeyProtoT extends com.google.protobuf.MessageLite>| Modifier and Type | Method and Description |
|---|---|
static KeyTemplate |
createKeyTemplate(String kekUri)
Returns a new
KeyTemplate that can generate a KmsAeadKey whose key encrypting key (KEK) is pointing to kekUri. |
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<KmsAeadKeyFormat,KmsAeadKey> |
keyFactory()
Returns the
KeyTypeManager.KeyFactory for this key type. |
KeyData.KeyMaterialType |
keyMaterialType()
Returns the
KeyData.KeyMaterialType for this proto. |
KmsAeadKey |
parseKey(com.google.protobuf.ByteString byteString)
Parses a serialized key proto.
|
static void |
register(boolean newKeyAllowed) |
void |
validateKey(KmsAeadKey key)
Checks if the given
keyProto is a valid key. |
fipsStatus, firstSupportedPrimitiveClass, getKeyClass, getPrimitive, supportedPrimitivespublic String getKeyType()
KeyTypeManagergetKeyType in class KeyTypeManager<KmsAeadKey>public int getVersion()
KeyTypeManagergetVersion in class KeyTypeManager<KmsAeadKey>public KeyData.KeyMaterialType keyMaterialType()
KeyTypeManagerKeyData.KeyMaterialType for this proto.keyMaterialType in class KeyTypeManager<KmsAeadKey>public void validateKey(KmsAeadKey key) throws GeneralSecurityException
KeyTypeManagerkeyProto is a valid key.validateKey in class KeyTypeManager<KmsAeadKey>GeneralSecurityException - if the passed keyProto is not valid in any way.public KmsAeadKey parseKey(com.google.protobuf.ByteString byteString) throws com.google.protobuf.InvalidProtocolBufferException
KeyTypeManagerImplement as return KeyProtoT.parseFrom(byteString);.
parseKey in class KeyTypeManager<KmsAeadKey>com.google.protobuf.InvalidProtocolBufferExceptionpublic KeyTypeManager.KeyFactory<KmsAeadKeyFormat,KmsAeadKey> 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<KmsAeadKey>public static void register(boolean newKeyAllowed)
throws GeneralSecurityException
GeneralSecurityExceptionpublic static KeyTemplate createKeyTemplate(String kekUri)
KeyTemplate that can generate a KmsAeadKey whose key encrypting key (KEK) is pointing to kekUri. Keys generated by this key template uses RAW output prefix to make them compatible
with the remote KMS' encrypt/decrypt operations. Unlike other templates, when you call KeysetHandle#generateNew with this template, Tink does not generate new key material, but only
creates a reference to the remote KEK.