public class GenerateDataKeyRequest extends AmazonWebServiceRequest implements Serializable, Cloneable
GenerateDataKey operation.
Generates a secure data key. Data keys are used to encrypt and decrypt data. They are wrapped by customer master keys.
NOOP| Constructor and Description |
|---|
GenerateDataKeyRequest() |
| Modifier and Type | Method and Description |
|---|---|
GenerateDataKeyRequest |
addEncryptionContextEntry(String key,
String value)
Name/value pair that contains additional data to be authenticated
during the encryption and decryption processes that use the key.
|
GenerateDataKeyRequest |
clearEncryptionContextEntries()
Removes all the entries added into EncryptionContext.
|
GenerateDataKeyRequest |
clone()
Creates a shallow clone of this request.
|
boolean |
equals(Object obj) |
Map<String,String> |
getEncryptionContext()
Name/value pair that contains additional data to be authenticated
during the encryption and decryption processes that use the key.
|
List<String> |
getGrantTokens()
A list of grant tokens that represent grants which can be used to
provide long term permissions to generate a key.
|
String |
getKeyId()
Unique identifier of the key.
|
String |
getKeySpec()
Value that identifies the encryption algorithm and key size to
generate a data key for.
|
Integer |
getNumberOfBytes()
Integer that contains the number of bytes to generate.
|
int |
hashCode() |
void |
setEncryptionContext(Map<String,String> encryptionContext)
Name/value pair that contains additional data to be authenticated
during the encryption and decryption processes that use the key.
|
void |
setGrantTokens(Collection<String> grantTokens)
A list of grant tokens that represent grants which can be used to
provide long term permissions to generate a key.
|
void |
setKeyId(String keyId)
Unique identifier of the key.
|
void |
setKeySpec(DataKeySpec keySpec)
Value that identifies the encryption algorithm and key size to
generate a data key for.
|
void |
setKeySpec(String keySpec)
Value that identifies the encryption algorithm and key size to
generate a data key for.
|
void |
setNumberOfBytes(Integer numberOfBytes)
Integer that contains the number of bytes to generate.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
GenerateDataKeyRequest |
withEncryptionContext(Map<String,String> encryptionContext)
Name/value pair that contains additional data to be authenticated
during the encryption and decryption processes that use the key.
|
GenerateDataKeyRequest |
withGrantTokens(Collection<String> grantTokens)
A list of grant tokens that represent grants which can be used to
provide long term permissions to generate a key.
|
GenerateDataKeyRequest |
withGrantTokens(String... grantTokens)
A list of grant tokens that represent grants which can be used to
provide long term permissions to generate a key.
|
GenerateDataKeyRequest |
withKeyId(String keyId)
Unique identifier of the key.
|
GenerateDataKeyRequest |
withKeySpec(DataKeySpec keySpec)
Value that identifies the encryption algorithm and key size to
generate a data key for.
|
GenerateDataKeyRequest |
withKeySpec(String keySpec)
Value that identifies the encryption algorithm and key size to
generate a data key for.
|
GenerateDataKeyRequest |
withNumberOfBytes(Integer numberOfBytes)
Integer that contains the number of bytes to generate.
|
copyBaseTo, copyPrivateRequestParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollectorpublic String getKeyId()
Constraints:
Length: 1 - 256
public void setKeyId(String keyId)
Constraints:
Length: 1 - 256
keyId - Unique identifier of the key. This can be an ARN, an alias, or a
globally unique identifier.public GenerateDataKeyRequest withKeyId(String keyId)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 256
keyId - Unique identifier of the key. This can be an ARN, an alias, or a
globally unique identifier.public Map<String,String> getEncryptionContext()
public void setEncryptionContext(Map<String,String> encryptionContext)
encryptionContext - Name/value pair that contains additional data to be authenticated
during the encryption and decryption processes that use the key. This
value is logged by AWS CloudTrail to provide context around the data
encrypted by the key.public GenerateDataKeyRequest withEncryptionContext(Map<String,String> encryptionContext)
Returns a reference to this object so that method calls can be chained together.
encryptionContext - Name/value pair that contains additional data to be authenticated
during the encryption and decryption processes that use the key. This
value is logged by AWS CloudTrail to provide context around the data
encrypted by the key.public GenerateDataKeyRequest addEncryptionContextEntry(String key, String value)
The method adds a new key-value pair into EncryptionContext parameter, and returns a reference to this object so that method calls can be chained together.
key - The key of the entry to be added into EncryptionContext.value - The corresponding value of the entry to be added into EncryptionContext.public GenerateDataKeyRequest clearEncryptionContextEntries()
Returns a reference to this object so that method calls can be chained together.
public Integer getNumberOfBytes()
Constraints:
Range: 1 - 1024
public void setNumberOfBytes(Integer numberOfBytes)
Constraints:
Range: 1 - 1024
numberOfBytes - Integer that contains the number of bytes to generate. Common values
are 128, 256, 512, 1024 and so on. 1024 is the current limit.public GenerateDataKeyRequest withNumberOfBytes(Integer numberOfBytes)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Range: 1 - 1024
numberOfBytes - Integer that contains the number of bytes to generate. Common values
are 128, 256, 512, 1024 and so on. 1024 is the current limit.public String getKeySpec()
Constraints:
Allowed Values: AES_256, AES_128
DataKeySpecpublic void setKeySpec(String keySpec)
Constraints:
Allowed Values: AES_256, AES_128
keySpec - Value that identifies the encryption algorithm and key size to
generate a data key for. Currently this can be AES_128 or AES_256.DataKeySpecpublic GenerateDataKeyRequest withKeySpec(String keySpec)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: AES_256, AES_128
keySpec - Value that identifies the encryption algorithm and key size to
generate a data key for. Currently this can be AES_128 or AES_256.DataKeySpecpublic void setKeySpec(DataKeySpec keySpec)
Constraints:
Allowed Values: AES_256, AES_128
keySpec - Value that identifies the encryption algorithm and key size to
generate a data key for. Currently this can be AES_128 or AES_256.DataKeySpecpublic GenerateDataKeyRequest withKeySpec(DataKeySpec keySpec)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: AES_256, AES_128
keySpec - Value that identifies the encryption algorithm and key size to
generate a data key for. Currently this can be AES_128 or AES_256.DataKeySpecpublic List<String> getGrantTokens()
Constraints:
Length: 0 - 10
public void setGrantTokens(Collection<String> grantTokens)
Constraints:
Length: 0 - 10
grantTokens - A list of grant tokens that represent grants which can be used to
provide long term permissions to generate a key.public GenerateDataKeyRequest withGrantTokens(String... grantTokens)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 0 - 10
grantTokens - A list of grant tokens that represent grants which can be used to
provide long term permissions to generate a key.public GenerateDataKeyRequest withGrantTokens(Collection<String> grantTokens)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 0 - 10
grantTokens - A list of grant tokens that represent grants which can be used to
provide long term permissions to generate a key.public String toString()
toString in class ObjectObject.toString()public GenerateDataKeyRequest clone()
AmazonWebServiceRequestclone in class AmazonWebServiceRequestObject.clone()Copyright © 2015. All rights reserved.