public class CachingKeyProvider extends KeyProviderExtension<org.apache.hadoop.crypto.key.CachingKeyProvider.CacheExtension>
KeyProviderExtension implementation providing a short lived
cache for KeyVersions and Metadatato avoid burst
of requests to hit the underlying KeyProvider.KeyProviderExtension.ExtensionKeyProvider.KeyVersion, KeyProvider.Metadata, KeyProvider.OptionsDEFAULT_BITLENGTH, DEFAULT_BITLENGTH_NAME, DEFAULT_CIPHER, DEFAULT_CIPHER_NAME, JCEKS_KEY_SERIAL_FILTER, JCEKS_KEY_SERIALFILTER_DEFAULT| Constructor and Description |
|---|
CachingKeyProvider(KeyProvider keyProvider,
long keyTimeoutMillis,
long currKeyTimeoutMillis) |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteKey(String name)
Delete the given key.
|
KeyProvider.KeyVersion |
getCurrentKey(String name)
Get the current version of the key, which should be used for encrypting new
data.
|
KeyProvider.KeyVersion |
getKeyVersion(String versionName)
Get the key material for a specific version of the key.
|
KeyProvider.Metadata |
getMetadata(String name)
Get metadata about the key.
|
void |
invalidateCache(String name)
Can be used by implementing classes to invalidate the caches.
|
KeyProvider.KeyVersion |
rollNewVersion(String name)
Roll a new version of the given key generating the material for it.
|
KeyProvider.KeyVersion |
rollNewVersion(String name,
byte[] material)
Roll a new version of the given key.
|
createKey, createKey, flush, getExtension, getKeyProvider, getKeys, getKeysMetadata, getKeyVersions, isTransient, toStringbuildVersionName, close, findProvider, generateKey, getBaseName, getConf, needsPassword, noPasswordError, noPasswordWarning, optionspublic CachingKeyProvider(KeyProvider keyProvider, long keyTimeoutMillis, long currKeyTimeoutMillis)
public KeyProvider.KeyVersion getCurrentKey(String name) throws IOException
KeyProvidergetCurrentKey in class KeyProviderExtension<org.apache.hadoop.crypto.key.CachingKeyProvider.CacheExtension>name - the base name of the keyIOExceptionpublic KeyProvider.KeyVersion getKeyVersion(String versionName) throws IOException
KeyProvidergetKeyVersion in class KeyProviderExtension<org.apache.hadoop.crypto.key.CachingKeyProvider.CacheExtension>versionName - the name of a specific version of the keyIOExceptionpublic void deleteKey(String name) throws IOException
KeyProviderdeleteKey in class KeyProviderExtension<org.apache.hadoop.crypto.key.CachingKeyProvider.CacheExtension>name - the name of the key to deleteIOExceptionpublic KeyProvider.KeyVersion rollNewVersion(String name, byte[] material) throws IOException
KeyProviderrollNewVersion in class KeyProviderExtension<org.apache.hadoop.crypto.key.CachingKeyProvider.CacheExtension>name - the basename of the keymaterial - the new key materialIOExceptionpublic KeyProvider.KeyVersion rollNewVersion(String name) throws NoSuchAlgorithmException, IOException
KeyProviderKeyProvider.rollNewVersion(String, byte[]) method.rollNewVersion in class KeyProviderExtension<org.apache.hadoop.crypto.key.CachingKeyProvider.CacheExtension>name - the basename of the keyIOExceptionNoSuchAlgorithmExceptionpublic void invalidateCache(String name) throws IOException
KeyProviderinvalidateCache in class KeyProviderExtension<org.apache.hadoop.crypto.key.CachingKeyProvider.CacheExtension>name - the basename of the keyIOExceptionpublic KeyProvider.Metadata getMetadata(String name) throws IOException
KeyProvidergetMetadata in class KeyProviderExtension<org.apache.hadoop.crypto.key.CachingKeyProvider.CacheExtension>name - the basename of the keyIOExceptionCopyright © 2008–2022 Apache Software Foundation. All rights reserved.