public interface KmsClient
| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_ACCESS_TOKEN_DEFAULT |
static String |
KMS_INSTANCE_ID_DEFAULT |
static String |
KMS_INSTANCE_URL_DEFAULT |
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(org.apache.hadoop.conf.Configuration configuration,
String kmsInstanceID,
String kmsInstanceURL,
String accessToken)
Pass configuration with KMS-specific parameters.
|
byte[] |
unwrapKey(String wrappedKey,
String masterKeyIdentifier)
Decrypts (unwraps) a key with the master key.
|
String |
wrapKey(byte[] keyBytes,
String masterKeyIdentifier)
Wraps a key - encrypts it with the master key, encodes the result
and potentially adds a KMS-specific metadata.
|
static final String KMS_INSTANCE_ID_DEFAULT
static final String KMS_INSTANCE_URL_DEFAULT
static final String KEY_ACCESS_TOKEN_DEFAULT
void initialize(org.apache.hadoop.conf.Configuration configuration,
String kmsInstanceID,
String kmsInstanceURL,
String accessToken)
throws KeyAccessDeniedException
configuration - 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.KeyAccessDeniedException - unauthorized to initialize the KMS clientString wrapKey(byte[] keyBytes, String masterKeyIdentifier) throws KeyAccessDeniedException
If your KMS client code throws runtime exceptions related to access/permission problems (such as Hadoop AccessControlException), catch them and throw the KeyAccessDeniedException.
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 keybyte[] unwrapKey(String wrappedKey, String masterKeyIdentifier) throws KeyAccessDeniedException
If your KMS client code throws runtime exceptions related to access/permission problems (such as Hadoop AccessControlException), catch them and throw the KeyAccessDeniedException.
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 keyCopyright © 2023 The Apache Software Foundation. All rights reserved.