public class SSECustomerKey extends Object implements Serializable
Constructor and Description |
---|
SSECustomerKey(byte[] rawKeyMaterial)
Constructs a new customer provided server-side encryption key using the
specified raw key material.
|
SSECustomerKey(SecretKey key)
Constructs a new customer provided server-side encryption key using the
specified SecretKey.
|
SSECustomerKey(String base64EncodedKey)
Constructs a new customer provided server-side encryption key using the specified
base64-encoded key material.
|
Modifier and Type | Method and Description |
---|---|
static SSECustomerKey |
generateSSECustomerKeyForPresignUrl(String algorithm)
Constructs a new SSECustomerKey that can be used for generating the
presigned URL's.
|
String |
getAlgorithm()
Returns the encryption algorithm to use with this customer-provided
server-side encryption key.
|
String |
getKey()
Returns the base64-encoded server-side encryption key that was provided
in this object's constructor.
|
String |
getMd5()
Returns the optional base64-encoded MD5 digest of the encryption key to
use when validating the integrity of the transmitted server-side
encryption key.
|
void |
setAlgorithm(String algorithm)
Sets the encryption algorithm to use with this customer-provided
server-side encryption key.
|
void |
setMd5(String md5Digest)
Sets the optional MD5 digest (base64-encoded) of the encryption key to use when
encrypting the object.
|
SSECustomerKey |
withAlgorithm(String algorithm)
Sets the encryption algorithm to use with this customer-provided
server-side encryption key, and returns this object so that method calls
can be chained together.
|
SSECustomerKey |
withMd5(String md5Digest)
Sets the optional MD5 digest (base64-encoded) of the encryption key to
use when encrypting the object, and returns the updated object so that
additional method calls can be chained together.
|
public SSECustomerKey(String base64EncodedKey)
setAlgorithm(String)
method.
Currently, Amazon S3 only supports AES-256 encryption keys.base64EncodedKey
- The base 64 encoded encryption key material.public SSECustomerKey(byte[] rawKeyMaterial)
setAlgorithm(String)
method.
Currently, Amazon S3 only supports AES-256 encryption keys.rawKeyMaterial
- The raw bytes of the customer provided encryption key.public SSECustomerKey(SecretKey key)
setAlgorithm(String)
method.
Currently, Amazon S3 only supports AES-256 encryption keys.key
- The customer provided server-side encryption key.public String getKey()
public String getAlgorithm()
public void setAlgorithm(String algorithm)
algorithm
- The server-side encryption algorithm to use with this
customer-provided server-side encryption key.SSEAlgorithm.AES256
public SSECustomerKey withAlgorithm(String algorithm)
algorithm
- The server-side encryption algorithm to use with this
customer-provided server-side encryption key.SSEAlgorithm.AES256
public String getMd5()
public void setMd5(String md5Digest)
md5Digest
- The MD5 digest (base64-encoded) of the encryption key to use
when encrypting the object.public SSECustomerKey withMd5(String md5Digest)
md5Digest
- The MD5 digest (base64-encoded) of the encryption key to use
when encrypting the object.public static SSECustomerKey generateSSECustomerKeyForPresignUrl(String algorithm)
algorithm
- The server-side encryption algorithm to use with this
customer-provided server-side encryption key; must not be
null.IllegalArgumentException
- if the input parameter is null.SSEAlgorithm.AES256