public class StaticKeyProvider extends Object implements KeyProvider
| Modifier and Type | Field and Description |
|---|---|
private Map<String,SecretKey> |
keys |
private static org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
StaticKeyProvider(Map<String,SecretKey> keys) |
StaticKeyProvider(String keyId,
String keyHex) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addKey(String keyId,
SecretKey key)
Adds the key to the provider and associates it with the given ID.
|
List<String> |
getAvailableKeyIds()
Returns a singleton list of the available key identifier.
|
SecretKey |
getKey(String keyId)
Returns the key identified by this ID or throws an exception if one is not available.
|
boolean |
keyExists(String keyId)
Returns true if the key exists and is available.
|
public StaticKeyProvider(String keyId, String keyHex) throws KeyManagementException
KeyManagementExceptionpublic StaticKeyProvider(Map<String,SecretKey> keys) throws KeyManagementException
KeyManagementExceptionpublic SecretKey getKey(String keyId) throws KeyManagementException
getKey in interface KeyProviderkeyId - the key identifierKeyManagementException - if the key cannot be retrievedpublic boolean keyExists(String keyId)
keyExists in interface KeyProviderkeyId - the key identifierpublic List<String> getAvailableKeyIds()
getAvailableKeyIds in interface KeyProviderKEY_IDpublic boolean addKey(String keyId, SecretKey key) throws OperationNotSupportedException, KeyManagementException
addKey in interface KeyProviderkeyId - the key identifierkey - the keyOperationNotSupportedException - if this implementation doesn't support adding keysKeyManagementException - if the key is invalid, the ID conflicts, etc.Copyright © 2018 Apache NiFi Project. All rights reserved.