java.io.Closeable, java.lang.AutoCloseableCachingKeyProvider, KeyProviderCryptoExtension, KeyProviderDelegationTokenExtensionpublic abstract class KeyProviderExtension<E extends KeyProviderExtension.Extension> extends KeyProvider
| Modifier and Type | Class | Description |
|---|---|---|
static interface |
KeyProviderExtension.Extension |
A marker interface for the KeyProviderExtension subclass implement.
|
KeyProvider.KeyVersion, KeyProvider.Metadata, KeyProvider.OptionsDEFAULT_BITLENGTH, DEFAULT_BITLENGTH_NAME, DEFAULT_CIPHER, DEFAULT_CIPHER_NAME, JCEKS_KEY_SERIAL_FILTER, JCEKS_KEY_SERIALFILTER_DEFAULT| Constructor | Description |
|---|---|
KeyProviderExtension(KeyProvider keyProvider,
E extensions) |
| Modifier and Type | Method | Description |
|---|---|---|
KeyProvider.KeyVersion |
createKey(java.lang.String name,
byte[] material,
KeyProvider.Options options) |
Create a new key.
|
KeyProvider.KeyVersion |
createKey(java.lang.String name,
KeyProvider.Options options) |
Create a new key generating the material for it.
|
void |
deleteKey(java.lang.String name) |
Delete the given key.
|
void |
flush() |
Ensures that any changes to the keys are written to persistent store.
|
KeyProvider.KeyVersion |
getCurrentKey(java.lang.String name) |
Get the current version of the key, which should be used for encrypting new
data.
|
protected E |
getExtension() |
|
protected KeyProvider |
getKeyProvider() |
|
java.util.List<java.lang.String> |
getKeys() |
Get the key names for all keys.
|
KeyProvider.Metadata[] |
getKeysMetadata(java.lang.String... names) |
Get key metadata in bulk.
|
KeyProvider.KeyVersion |
getKeyVersion(java.lang.String versionName) |
Get the key material for a specific version of the key.
|
java.util.List<KeyProvider.KeyVersion> |
getKeyVersions(java.lang.String name) |
Get the key material for all versions of a specific key name.
|
KeyProvider.Metadata |
getMetadata(java.lang.String name) |
Get metadata about the key.
|
void |
invalidateCache(java.lang.String name) |
Can be used by implementing classes to invalidate the caches.
|
boolean |
isTransient() |
Indicates whether this provider represents a store
that is intended for transient use - such as the UserProvider
is.
|
KeyProvider.KeyVersion |
rollNewVersion(java.lang.String name) |
Roll a new version of the given key generating the material for it.
|
KeyProvider.KeyVersion |
rollNewVersion(java.lang.String name,
byte[] material) |
Roll a new version of the given key.
|
java.lang.String |
toString() |
buildVersionName, close, findProvider, generateKey, getBaseName, getConf, needsPassword, noPasswordError, noPasswordWarning, optionspublic KeyProviderExtension(KeyProvider keyProvider, E extensions)
protected E getExtension()
protected KeyProvider getKeyProvider()
public boolean isTransient()
KeyProviderisTransient in class KeyProviderpublic KeyProvider.Metadata[] getKeysMetadata(java.lang.String... names) throws java.io.IOException
KeyProvidergetKeysMetadata in class KeyProvidernames - the names of the keys to getjava.io.IOException - raised on errors performing I/O.public KeyProvider.KeyVersion getCurrentKey(java.lang.String name) throws java.io.IOException
KeyProvidergetCurrentKey in class KeyProvidername - the base name of the keyjava.io.IOException - raised on errors performing I/O.public KeyProvider.KeyVersion createKey(java.lang.String name, KeyProvider.Options options) throws java.security.NoSuchAlgorithmException, java.io.IOException
KeyProvider
This implementation generates the key material and calls the
KeyProvider.createKey(String, byte[], Options) method.
createKey in class KeyProvidername - the base name of the keyoptions - the options for the new key.java.security.NoSuchAlgorithmException - no such algorithm exception.java.io.IOException - raised on errors performing I/O.public KeyProvider.KeyVersion rollNewVersion(java.lang.String name) throws java.security.NoSuchAlgorithmException, java.io.IOException
KeyProvider
This implementation generates the key material and calls the
KeyProvider.rollNewVersion(String, byte[]) method.
rollNewVersion in class KeyProvidername - the basename of the keyjava.security.NoSuchAlgorithmException - This exception is thrown when a particular
cryptographic algorithm is requested
but is not available in the environment.java.io.IOException - raised on errors performing I/O.public KeyProvider.KeyVersion getKeyVersion(java.lang.String versionName) throws java.io.IOException
KeyProvidergetKeyVersion in class KeyProviderversionName - the name of a specific version of the keyjava.io.IOException - raised on errors performing I/O.public java.util.List<java.lang.String> getKeys()
throws java.io.IOException
KeyProvidergetKeys in class KeyProviderjava.io.IOException - raised on errors performing I/O.public java.util.List<KeyProvider.KeyVersion> getKeyVersions(java.lang.String name) throws java.io.IOException
KeyProvidergetKeyVersions in class KeyProvidername - the base name of the key.java.io.IOException - raised on errors performing I/O.public KeyProvider.Metadata getMetadata(java.lang.String name) throws java.io.IOException
KeyProvidergetMetadata in class KeyProvidername - the basename of the keyjava.io.IOException - raised on errors performing I/O.public KeyProvider.KeyVersion createKey(java.lang.String name, byte[] material, KeyProvider.Options options) throws java.io.IOException
KeyProvidercreateKey in class KeyProvidername - the base name of the keymaterial - the key material for the first version of the key.options - the options for the new key.java.io.IOException - raised on errors performing I/O.public void deleteKey(java.lang.String name)
throws java.io.IOException
KeyProviderdeleteKey in class KeyProvidername - the name of the key to deletejava.io.IOException - raised on errors performing I/O.public KeyProvider.KeyVersion rollNewVersion(java.lang.String name, byte[] material) throws java.io.IOException
KeyProviderrollNewVersion in class KeyProvidername - the basename of the keymaterial - the new key materialjava.io.IOException - raised on errors performing I/O.public void invalidateCache(java.lang.String name)
throws java.io.IOException
KeyProviderinvalidateCache in class KeyProvidername - the basename of the keyjava.io.IOException - raised on errors performing I/O.public void flush()
throws java.io.IOException
KeyProviderflush in class KeyProviderjava.io.IOException - raised on errors performing I/O.public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008–2025 Apache Software Foundation. All rights reserved.