pub struct GenerateRandomFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to GenerateRandom
.
Returns a random byte string that is cryptographically secure.
You must use the NumberOfBytes
parameter to specify the length of the random byte string. There is no default value for string length.
By default, the random byte string is generated in KMS. To generate the byte string in the CloudHSM cluster associated with an CloudHSM key store, use the CustomKeyStoreId
parameter.
GenerateRandom
also supports Amazon Web Services Nitro Enclaves, which provide an isolated compute environment in Amazon EC2. To call GenerateRandom
for a Nitro enclave, use the Amazon Web Services Nitro Enclaves SDK or any Amazon Web Services SDK. Use the Recipient
parameter to provide the attestation document for the enclave. Instead of plaintext bytes, the response includes the plaintext bytes encrypted under the public key from the attestation document (CiphertextForRecipient
).For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS in the Key Management Service Developer Guide.
For more information about entropy and random number generation, see Key Management Service Cryptographic Details.
Cross-account use: Not applicable. GenerateRandom
does not use any account-specific resources, such as KMS keys.
Required permissions: kms:GenerateRandom (IAM policy)
Eventual consistency: The KMS API follows an eventual consistency model. For more information, see KMS eventual consistency.
Implementations§
source§impl GenerateRandomFluentBuilder
impl GenerateRandomFluentBuilder
sourcepub fn as_input(&self) -> &GenerateRandomInputBuilder
pub fn as_input(&self) -> &GenerateRandomInputBuilder
Access the GenerateRandom as a reference.
sourcepub async fn send(
self
) -> Result<GenerateRandomOutput, SdkError<GenerateRandomError, HttpResponse>>
pub async fn send( self ) -> Result<GenerateRandomOutput, SdkError<GenerateRandomError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn customize(
self
) -> CustomizableOperation<GenerateRandomOutput, GenerateRandomError, Self>
pub fn customize( self ) -> CustomizableOperation<GenerateRandomOutput, GenerateRandomError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
sourcepub fn number_of_bytes(self, input: i32) -> Self
pub fn number_of_bytes(self, input: i32) -> Self
The length of the random byte string. This parameter is required.
sourcepub fn set_number_of_bytes(self, input: Option<i32>) -> Self
pub fn set_number_of_bytes(self, input: Option<i32>) -> Self
The length of the random byte string. This parameter is required.
sourcepub fn get_number_of_bytes(&self) -> &Option<i32>
pub fn get_number_of_bytes(&self) -> &Option<i32>
The length of the random byte string. This parameter is required.
sourcepub fn custom_key_store_id(self, input: impl Into<String>) -> Self
pub fn custom_key_store_id(self, input: impl Into<String>) -> Self
Generates the random byte string in the CloudHSM cluster that is associated with the specified CloudHSM key store. To find the ID of a custom key store, use the DescribeCustomKeyStores
operation.
External key store IDs are not valid for this parameter. If you specify the ID of an external key store, GenerateRandom
throws an UnsupportedOperationException
.
sourcepub fn set_custom_key_store_id(self, input: Option<String>) -> Self
pub fn set_custom_key_store_id(self, input: Option<String>) -> Self
Generates the random byte string in the CloudHSM cluster that is associated with the specified CloudHSM key store. To find the ID of a custom key store, use the DescribeCustomKeyStores
operation.
External key store IDs are not valid for this parameter. If you specify the ID of an external key store, GenerateRandom
throws an UnsupportedOperationException
.
sourcepub fn get_custom_key_store_id(&self) -> &Option<String>
pub fn get_custom_key_store_id(&self) -> &Option<String>
Generates the random byte string in the CloudHSM cluster that is associated with the specified CloudHSM key store. To find the ID of a custom key store, use the DescribeCustomKeyStores
operation.
External key store IDs are not valid for this parameter. If you specify the ID of an external key store, GenerateRandom
throws an UnsupportedOperationException
.
sourcepub fn recipient(self, input: RecipientInfo) -> Self
pub fn recipient(self, input: RecipientInfo) -> Self
A signed attestation document from an Amazon Web Services Nitro enclave and the encryption algorithm to use with the enclave's public key. The only valid encryption algorithm is RSAES_OAEP_SHA_256
.
This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To include this parameter, use the Amazon Web Services Nitro Enclaves SDK or any Amazon Web Services SDK.
When you use this parameter, instead of returning plaintext bytes, KMS encrypts the plaintext bytes under the public key in the attestation document, and returns the resulting ciphertext in the CiphertextForRecipient
field in the response. This ciphertext can be decrypted only with the private key in the enclave. The Plaintext
field in the response is null or empty.
For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS in the Key Management Service Developer Guide.
sourcepub fn set_recipient(self, input: Option<RecipientInfo>) -> Self
pub fn set_recipient(self, input: Option<RecipientInfo>) -> Self
A signed attestation document from an Amazon Web Services Nitro enclave and the encryption algorithm to use with the enclave's public key. The only valid encryption algorithm is RSAES_OAEP_SHA_256
.
This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To include this parameter, use the Amazon Web Services Nitro Enclaves SDK or any Amazon Web Services SDK.
When you use this parameter, instead of returning plaintext bytes, KMS encrypts the plaintext bytes under the public key in the attestation document, and returns the resulting ciphertext in the CiphertextForRecipient
field in the response. This ciphertext can be decrypted only with the private key in the enclave. The Plaintext
field in the response is null or empty.
For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS in the Key Management Service Developer Guide.
sourcepub fn get_recipient(&self) -> &Option<RecipientInfo>
pub fn get_recipient(&self) -> &Option<RecipientInfo>
A signed attestation document from an Amazon Web Services Nitro enclave and the encryption algorithm to use with the enclave's public key. The only valid encryption algorithm is RSAES_OAEP_SHA_256
.
This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To include this parameter, use the Amazon Web Services Nitro Enclaves SDK or any Amazon Web Services SDK.
When you use this parameter, instead of returning plaintext bytes, KMS encrypts the plaintext bytes under the public key in the attestation document, and returns the resulting ciphertext in the CiphertextForRecipient
field in the response. This ciphertext can be decrypted only with the private key in the enclave. The Plaintext
field in the response is null or empty.
For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see How Amazon Web Services Nitro Enclaves uses KMS in the Key Management Service Developer Guide.
Trait Implementations§
source§impl Clone for GenerateRandomFluentBuilder
impl Clone for GenerateRandomFluentBuilder
source§fn clone(&self) -> GenerateRandomFluentBuilder
fn clone(&self) -> GenerateRandomFluentBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more