public abstract class ServerSideEncryption extends Object implements Destroyable
Modifier and Type | Class and Description |
---|---|
static class |
ServerSideEncryption.Type
The types of server-side encryption.
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
destroyed |
Constructor and Description |
---|
ServerSideEncryption() |
Modifier and Type | Method and Description |
---|---|
static ServerSideEncryption |
atRest()
Create a new server-side-encryption object for encryption at rest (a.k.a.
|
static ServerSideEncryption |
copyWithCustomerKey(SecretKey key)
Create a new server-side-encryption object for encryption with customer
provided keys (a.k.a.
|
abstract ServerSideEncryption.Type |
getType()
Returns the type of server-side encryption.
|
boolean |
isDestroyed() |
abstract void |
marshal(Map<String,String> headers)
Set the server-side-encryption headers of this specific encryption.
|
static ServerSideEncryption |
withCustomerKey(SecretKey key)
Create a new server-side-encryption object for encryption with customer
provided keys (a.k.a.
|
static ServerSideEncryption |
withManagedKeys(String keyId,
Map<String,String> context)
Create a new server-side-encryption object for encryption using a KMS (a.k.a.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy
public abstract ServerSideEncryption.Type getType()
public abstract void marshal(Map<String,String> headers)
headers
- The metadata key-value map.public boolean isDestroyed()
isDestroyed
in interface Destroyable
public static ServerSideEncryption withCustomerKey(SecretKey key) throws InvalidKeyException, NoSuchAlgorithmException
key
- The secret AES-256 key.InvalidKeyException
- if the provided secret key is not a 256 bit AES key.NoSuchAlgorithmException
- if the crypto provider does not implement MD5.public static ServerSideEncryption copyWithCustomerKey(SecretKey key) throws InvalidKeyException, NoSuchAlgorithmException
key
- The secret AES-256 key.InvalidKeyException
- if the provided secret key is not a 256 bit AES key.NoSuchAlgorithmException
- if the crypto provider does not implement MD5.public static ServerSideEncryption atRest()
public static ServerSideEncryption withManagedKeys(String keyId, Map<String,String> context) throws InvalidArgumentException, UnsupportedEncodingException
keyId
- specifies the customer-master-key (CMK) and must not be null.context
- is the encryption context. If the context is null no context is used.InvalidArgumentException
UnsupportedEncodingException