| Modifier and Type | Method and Description |
|---|---|
KeysetManager |
add(KeyTemplate keyTemplate)
Generates and adds a fresh key generated using
keyTemplate. |
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)
Generates and adds a fresh key generated using
keyTemplate, and sets the new key as the
primary key. |
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 keysetGeneralSecurityExceptionpublic KeysetManager rotate(KeyTemplate keyTemplate) throws GeneralSecurityException
keyTemplate, and sets the new key as the
primary key.GeneralSecurityException - if cannot find any KeyManager that can handle keyTemplatepublic KeysetManager add(KeyTemplate keyTemplate) throws GeneralSecurityException
keyTemplate.GeneralSecurityException - if cannot find any KeyManager that can handle keyTemplatepublic KeysetManager setPrimary(int keyId) throws GeneralSecurityException
keyId as primary.GeneralSecurityException - if the key is not found or not enabled@Deprecated public KeysetManager promote(int keyId) throws GeneralSecurityException
setPrimarykeyId as primary.GeneralSecurityException - if the key is not found or not enabledpublic KeysetManager enable(int keyId) throws GeneralSecurityException
keyId.GeneralSecurityException - if the key is not foundpublic KeysetManager disable(int keyId) throws GeneralSecurityException
keyId.GeneralSecurityException - if the key is not found or it is the primary keypublic KeysetManager delete(int keyId) throws GeneralSecurityException
keyId.GeneralSecurityException - if the key is not found or it is the primary keypublic KeysetManager destroy(int keyId) throws GeneralSecurityException
keyId.GeneralSecurityException - if the key is not found or it is the primary key