| Modifier and Type | Method and Description |
|---|---|
KeysetManager |
add(KeyHandle keyHandle)
Adds the input
KeyHandle to the existing keyset. |
KeysetManager |
add(KeyHandle keyHandle,
KeyAccess access)
Adds the input
KeyHandle to the existing keyset with OutputPrefixType.TINK. |
KeysetManager |
add(KeyTemplate keyTemplate)
Deprecated.
This method takes a KeyTemplate proto, which is an internal implementation detail.
Please use the add method that takes a
KeyTemplate POJO. |
KeysetManager |
add(KeyTemplate keyTemplate)
Generates and adds a fresh key generated using
keyTemplate. |
int |
addNewKey(KeyTemplate keyTemplate,
boolean asPrimary)
Deprecated.
Please use
add(com.google.crypto.tink.proto.KeyTemplate). This method adds a new key and when asPrimary is
true immediately promotes it to primary. However, when you do keyset rotation, you almost
never want to make the new key primary, because old binaries don't know the new key yet. |
KeysetManager |
delete(int keyId)
Deletes the key with
keyId. |
KeysetManager |
destroy(int keyId)
Destroys the key material associated with the
keyId. |
KeysetManager |
disable(int keyId)
Disables the key with
keyId. |
KeysetManager |
enable(int keyId)
Enables the key with
keyId. |
KeysetHandle |
getKeysetHandle() |
KeysetManager |
promote(int keyId)
Deprecated.
use
setPrimary |
KeysetManager |
rotate(KeyTemplate keyTemplate)
Deprecated.
Please use
add(com.google.crypto.tink.proto.KeyTemplate). This method adds a new key and immediately promotes it to
primary. However, when you do keyset rotation, you almost never want to make the new key
primary, because old binaries don't know the new key yet. |
KeysetManager |
setPrimary(int keyId)
Sets the key with
keyId as primary. |
static KeysetManager |
withEmptyKeyset() |
static KeysetManager |
withKeysetHandle(KeysetHandle val) |
public static KeysetManager withKeysetHandle(KeysetHandle val)
KeysetManager for the keyset manged by valpublic static KeysetManager withEmptyKeyset()
KeysetManager for an empty keyset.public KeysetHandle getKeysetHandle() throws GeneralSecurityException
KeysetHandle of the managed keysetGeneralSecurityException@CanIgnoreReturnValue @Deprecated public KeysetManager rotate(KeyTemplate keyTemplate) throws GeneralSecurityException
add(com.google.crypto.tink.proto.KeyTemplate). This method adds a new key and immediately promotes it to
primary. However, when you do keyset rotation, you almost never want to make the new key
primary, because old binaries don't know the new key yet.keyTemplate, and sets the new key as the
primary key.GeneralSecurityException - if cannot find any KeyManager that can handle keyTemplate@CanIgnoreReturnValue @Deprecated public KeysetManager add(KeyTemplate keyTemplate) throws GeneralSecurityException
KeyTemplate POJO.keyTemplate.GeneralSecurityException - if cannot find any KeyManager that can handle keyTemplate@CanIgnoreReturnValue public KeysetManager add(KeyTemplate keyTemplate) throws GeneralSecurityException
keyTemplate.GeneralSecurityException - if cannot find any KeyManager that can handle keyTemplate@CanIgnoreReturnValue public KeysetManager add(KeyHandle keyHandle) throws GeneralSecurityException
KeyHandle to the existing keyset. The KeyStatusType and key ID of the
KeyHandle are used as-is in the keyset.UnsupportedOperationException - if the KeyHandle contains a TinkKey which
is not a ProtoKey.GeneralSecurityException - if the KeyHandle's key ID collides with another key ID
in the keyset.@CanIgnoreReturnValue public KeysetManager add(KeyHandle keyHandle, KeyAccess access) throws GeneralSecurityException
KeyHandle to the existing keyset with OutputPrefixType.TINK.GeneralSecurityException - if the given KeyAccess does not grant access to the
key contained in the KeyHandle.UnsupportedOperationException - if the KeyHandle contains a TinkKey which
is not a ProtoKey.@CanIgnoreReturnValue @Deprecated public int addNewKey(KeyTemplate keyTemplate, boolean asPrimary) throws GeneralSecurityException
add(com.google.crypto.tink.proto.KeyTemplate). This method adds a new key and when asPrimary is
true immediately promotes it to primary. However, when you do keyset rotation, you almost
never want to make the new key primary, because old binaries don't know the new key yet.keyTemplate and returns the keyId of it. In case
asPrimary is true the generated key will be the new primary.GeneralSecurityException@CanIgnoreReturnValue public KeysetManager setPrimary(int keyId) throws GeneralSecurityException
keyId as primary.GeneralSecurityException - if the key is not found or not enabled@InlineMe(replacement="this.setPrimary(keyId)") @CanIgnoreReturnValue @Deprecated public KeysetManager promote(int keyId) throws GeneralSecurityException
setPrimarykeyId as primary.GeneralSecurityException - if the key is not found or not enabled@CanIgnoreReturnValue public KeysetManager enable(int keyId) throws GeneralSecurityException
keyId.GeneralSecurityException - if the key is not found@CanIgnoreReturnValue public KeysetManager disable(int keyId) throws GeneralSecurityException
keyId.GeneralSecurityException - if the key is not found or it is the primary key@CanIgnoreReturnValue public KeysetManager delete(int keyId) throws GeneralSecurityException
keyId.GeneralSecurityException - if the key is not found or it is the primary key@CanIgnoreReturnValue public KeysetManager destroy(int keyId) throws GeneralSecurityException
keyId.GeneralSecurityException - if the key is not found or it is the primary key