| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.conf.Configuration |
hadoopConfiguration |
protected boolean |
isDefaultToken |
protected Boolean |
isWrapLocally |
protected String |
kmsInstanceID |
protected String |
kmsInstanceURL |
protected String |
kmsToken |
static String |
LOCAL_WRAP_NO_KEY_VERSION |
KEY_ACCESS_TOKEN_DEFAULT, KMS_INSTANCE_ID_DEFAULT, KMS_INSTANCE_URL_DEFAULT| Constructor and Description |
|---|
RemoteKmsClient() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract byte[] |
getMasterKeyFromServer(String masterKeyIdentifier)
Get master key from the remote KMS server.
|
void |
initialize(org.apache.hadoop.conf.Configuration configuration,
String kmsInstanceID,
String kmsInstanceURL,
String accessToken)
Pass configuration with KMS-specific parameters.
|
protected abstract void |
initializeInternal()
Pass configuration with KMS-specific parameters.
|
byte[] |
unwrapKey(String wrappedKey,
String masterKeyIdentifier)
Decrypts (unwraps) a key with the master key.
|
protected abstract byte[] |
unwrapKeyInServer(String wrappedKey,
String masterKeyIdentifier)
Unwrap a key with the master key in the remote KMS server.
|
String |
wrapKey(byte[] key,
String masterKeyIdentifier)
Wraps a key - encrypts it with the master key, encodes the result
and potentially adds a KMS-specific metadata.
|
protected abstract String |
wrapKeyInServer(byte[] keyBytes,
String masterKeyIdentifier)
Wrap a key with the master key in the remote KMS server.
|
public static final String LOCAL_WRAP_NO_KEY_VERSION
protected String kmsInstanceID
protected String kmsInstanceURL
protected String kmsToken
protected Boolean isWrapLocally
protected org.apache.hadoop.conf.Configuration hadoopConfiguration
protected boolean isDefaultToken
public void initialize(org.apache.hadoop.conf.Configuration configuration,
String kmsInstanceID,
String kmsInstanceURL,
String accessToken)
KmsClientinitialize in interface KmsClientconfiguration - Hadoop configurationkmsInstanceID - ID of the KMS instance handled by this KmsClient. Use the default value, for KMS systems
that don't work with multiple instances.kmsInstanceURL - URL of the KMS instance handled by this KmsClient. Use the default value, for KMS systems
that don't work with URLs.accessToken - KMS access (authorization) token. Use the default value, for KMS systems that don't work with tokens.public String wrapKey(byte[] key, String masterKeyIdentifier) throws KeyAccessDeniedException
KmsClientwrapKey in interface KmsClientKeyAccessDeniedException - unauthorized to encrypt with the given master keypublic byte[] unwrapKey(String wrappedKey, String masterKeyIdentifier) throws KeyAccessDeniedException
KmsClientunwrapKey in interface KmsClientwrappedKey - String produced by wrapKey operationKeyAccessDeniedException - unauthorized to unwrap with the given master keyprotected abstract String wrapKeyInServer(byte[] keyBytes, String masterKeyIdentifier) throws KeyAccessDeniedException, UnsupportedOperationException
keyBytes: - key bytes to be wrappedmasterKeyIdentifier: - a string that uniquely identifies the master key in a KMS instanceKeyAccessDeniedException - unauthorized to encrypt with the given master keyUnsupportedOperationException - KMS does not support in-server wrappingprotected abstract byte[] unwrapKeyInServer(String wrappedKey, String masterKeyIdentifier) throws KeyAccessDeniedException, UnsupportedOperationException
wrappedKey - String produced by wrapKey operationmasterKeyIdentifier: - a string that uniquely identifies the master key in a KMS instanceKeyAccessDeniedException - unauthorized to unwrap with the given master keyUnsupportedOperationException - KMS does not support in-server unwrappingprotected abstract byte[] getMasterKeyFromServer(String masterKeyIdentifier) throws KeyAccessDeniedException, UnsupportedOperationException
masterKeyIdentifier: - a string that uniquely identifies the master key in a KMS instanceKeyAccessDeniedException - unauthorized to get the master keyUnsupportedOperationException - If not implemented, or KMS does not support key fetchingprotected abstract void initializeInternal()
throws KeyAccessDeniedException
KeyAccessDeniedExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.