|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.crypto.key.KeyProvider
org.apache.hadoop.crypto.key.KeyProviderExtension<E>
public abstract class KeyProviderExtension<E extends KeyProviderExtension.Extension>
This is a utility class used to extend the functionality of KeyProvider, that takes a KeyProvider and an Extension. It implements all the required methods of the KeyProvider by delegating it to the provided KeyProvider.
| Nested Class Summary | |
|---|---|
static interface |
KeyProviderExtension.Extension
A marker interface for the KeyProviderExtension subclass implement. |
| Nested classes/interfaces inherited from class org.apache.hadoop.crypto.key.KeyProvider |
|---|
KeyProvider.KeyVersion, KeyProvider.Metadata, KeyProvider.Options |
| Field Summary |
|---|
| Fields inherited from class org.apache.hadoop.crypto.key.KeyProvider |
|---|
DEFAULT_BITLENGTH, DEFAULT_BITLENGTH_NAME, DEFAULT_CIPHER, DEFAULT_CIPHER_NAME |
| Constructor Summary | |
|---|---|
KeyProviderExtension(KeyProvider keyProvider,
E extensions)
|
|
| Method Summary | |
|---|---|
KeyProvider.KeyVersion |
createKey(String name,
byte[] material,
KeyProvider.Options options)
Create a new key. |
KeyProvider.KeyVersion |
createKey(String name,
KeyProvider.Options options)
Create a new key generating the material for it. |
void |
deleteKey(String name)
Delete the given key. |
void |
flush()
Ensures that any changes to the keys are written to persistent store. |
KeyProvider.KeyVersion |
getCurrentKey(String name)
Get the current version of the key, which should be used for encrypting new data. |
protected E |
getExtension()
|
protected KeyProvider |
getKeyProvider()
|
List<String> |
getKeys()
Get the key names for all keys. |
KeyProvider.Metadata[] |
getKeysMetadata(String... names)
Get key metadata in bulk. |
KeyProvider.KeyVersion |
getKeyVersion(String versionName)
Get the key material for a specific version of the key. |
List<KeyProvider.KeyVersion> |
getKeyVersions(String name)
Get the key material for all versions of a specific key name. |
KeyProvider.Metadata |
getMetadata(String name)
Get metadata about the key. |
boolean |
isTransient()
Indicates whether this provider represents a store that is intended for transient use - such as the UserProvider is. |
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. |
String |
toString()
|
| Methods inherited from class org.apache.hadoop.crypto.key.KeyProvider |
|---|
buildVersionName, close, findProvider, generateKey, getBaseName, getConf, options |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public KeyProviderExtension(KeyProvider keyProvider,
E extensions)
| Method Detail |
|---|
protected E getExtension()
protected KeyProvider getKeyProvider()
public boolean isTransient()
KeyProvider
isTransient in class KeyProvider
public KeyProvider.Metadata[] getKeysMetadata(String... names)
throws IOException
KeyProvider
getKeysMetadata in class KeyProvidernames - the names of the keys to get
IOException
public KeyProvider.KeyVersion getCurrentKey(String name)
throws IOException
KeyProvider
getCurrentKey in class KeyProvidername - the base name of the key
IOException
public KeyProvider.KeyVersion createKey(String name,
KeyProvider.Options options)
throws NoSuchAlgorithmException,
IOException
KeyProviderKeyProvider.createKey(String, byte[], Options) method.
createKey in class KeyProvidername - the base name of the keyoptions - the options for the new key.
NoSuchAlgorithmException
IOException
public KeyProvider.KeyVersion rollNewVersion(String name)
throws NoSuchAlgorithmException,
IOException
KeyProviderKeyProvider.rollNewVersion(String, byte[]) method.
rollNewVersion in class KeyProvidername - the basename of the key
IOException
NoSuchAlgorithmException
public KeyProvider.KeyVersion getKeyVersion(String versionName)
throws IOException
KeyProvider
getKeyVersion in class KeyProviderversionName - the name of a specific version of the key
IOException
public List<String> getKeys()
throws IOException
KeyProvider
getKeys in class KeyProviderIOException
public List<KeyProvider.KeyVersion> getKeyVersions(String name)
throws IOException
KeyProvider
getKeyVersions in class KeyProviderIOException
public KeyProvider.Metadata getMetadata(String name)
throws IOException
KeyProvider
getMetadata in class KeyProvidername - the basename of the key
IOException
public KeyProvider.KeyVersion createKey(String name,
byte[] material,
KeyProvider.Options options)
throws IOException
KeyProvider
createKey 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.
IOException
public void deleteKey(String name)
throws IOException
KeyProvider
deleteKey in class KeyProvidername - the name of the key to delete
IOException
public KeyProvider.KeyVersion rollNewVersion(String name,
byte[] material)
throws IOException
KeyProvider
rollNewVersion in class KeyProvidername - the basename of the keymaterial - the new key material
IOException
public void flush()
throws IOException
KeyProvider
flush in class KeyProviderIOExceptionpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||