Package org.apache.iceberg.aws
Class AwsKeyManagementClient
java.lang.Object
org.apache.iceberg.aws.AwsKeyManagementClient
- All Implemented Interfaces:
- Closeable,- Serializable,- AutoCloseable,- KeyManagementClient
Key management client implementation that uses AWS Key Management Service. To be used for
 encrypting/decrypting keys with a KMS-managed master key, (by referencing its key ID), and for
 the generation of new encryption keys.
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.iceberg.encryption.KeyManagementClientKeyManagementClient.KeyGenerationResult
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Close KMS Client to release underlying resources, this could be triggered in different threads when KmsClient is shared by multiple encryption managers.generateKey(String wrappingKeyId) Generate a new secret key in the KMS server, and wrap it using a wrapping/master key which is stored in KMS and referenced by an ID.voidinitialize(Map<String, String> properties) Initialize the KMS client with given properties.booleanSome KMS systems support generation of secret keys inside the KMS server.unwrapKey(ByteBuffer wrappedKey, String wrappingKeyId) Unwrap a secret key, using a wrapping/master key which is stored in KMS and referenced by an ID.wrapKey(ByteBuffer key, String wrappingKeyId) Wrap a secret key, using a wrapping/master key which is stored in KMS and referenced by an ID.
- 
Constructor Details- 
AwsKeyManagementClientpublic AwsKeyManagementClient()
 
- 
- 
Method Details- 
initializeDescription copied from interface:KeyManagementClientInitialize the KMS client with given properties.- Specified by:
- initializein interface- KeyManagementClient
- Parameters:
- properties- kms client properties
 
- 
wrapKeyDescription copied from interface:KeyManagementClientWrap a secret key, using a wrapping/master key which is stored in KMS and referenced by an ID. Wrapping means encryption of the secret key with the master key, and adding optional KMS-specific metadata that allows the KMS to decrypt the secret key in an unwrapping call.- Specified by:
- wrapKeyin interface- KeyManagementClient
- Parameters:
- key- a secret key being wrapped
- wrappingKeyId- a key ID that represents a wrapping key stored in KMS
- Returns:
- wrapped key material
 
- 
supportsKeyGenerationpublic boolean supportsKeyGeneration()Description copied from interface:KeyManagementClientSome KMS systems support generation of secret keys inside the KMS server.- Specified by:
- supportsKeyGenerationin interface- KeyManagementClient
- Returns:
- true if KMS server supports key generation and KeyManagementClient implementation is
     interested to leverage this capability. Otherwise, return false - Iceberg will then
     generate secret keys locally (using the SecureRandom mechanism) and call KeyManagementClient.wrapKey(ByteBuffer, String)to wrap them in KMS.
 
- 
generateKeyDescription copied from interface:KeyManagementClientGenerate a new secret key in the KMS server, and wrap it using a wrapping/master key which is stored in KMS and referenced by an ID. This method will be called only if supportsKeyGeneration returns true.- Specified by:
- generateKeyin interface- KeyManagementClient
- Parameters:
- wrappingKeyId- a key ID that represents a wrapping key stored in KMS
- Returns:
- key in two forms: raw, and wrapped with the given wrappingKeyId
 
- 
unwrapKeyDescription copied from interface:KeyManagementClientUnwrap a secret key, using a wrapping/master key which is stored in KMS and referenced by an ID.- Specified by:
- unwrapKeyin interface- KeyManagementClient
- Parameters:
- wrappedKey- wrapped key material (encrypted key and optional KMS metadata, returned by the wrapKey method)
- wrappingKeyId- a key ID that represents a wrapping key stored in KMS
- Returns:
- raw key bytes
 
- 
closepublic void close()Description copied from interface:KeyManagementClientClose KMS Client to release underlying resources, this could be triggered in different threads when KmsClient is shared by multiple encryption managers.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Specified by:
- closein interface- KeyManagementClient
 
 
-