/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include namespace Aws { namespace KMS { namespace Model { /** */ class GenerateRandomRequest : public KMSRequest { public: AWS_KMS_API GenerateRandomRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "GenerateRandom"; } AWS_KMS_API Aws::String SerializePayload() const override; AWS_KMS_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** *

The length of the random byte string. This parameter is required.

*/ inline int GetNumberOfBytes() const{ return m_numberOfBytes; } /** *

The length of the random byte string. This parameter is required.

*/ inline bool NumberOfBytesHasBeenSet() const { return m_numberOfBytesHasBeenSet; } /** *

The length of the random byte string. This parameter is required.

*/ inline void SetNumberOfBytes(int value) { m_numberOfBytesHasBeenSet = true; m_numberOfBytes = value; } /** *

The length of the random byte string. This parameter is required.

*/ inline GenerateRandomRequest& WithNumberOfBytes(int value) { SetNumberOfBytes(value); return *this;} /** *

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.

*/ inline const Aws::String& GetCustomKeyStoreId() const{ return m_customKeyStoreId; } /** *

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.

*/ inline bool CustomKeyStoreIdHasBeenSet() const { return m_customKeyStoreIdHasBeenSet; } /** *

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.

*/ inline void SetCustomKeyStoreId(const Aws::String& value) { m_customKeyStoreIdHasBeenSet = true; m_customKeyStoreId = value; } /** *

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.

*/ inline void SetCustomKeyStoreId(Aws::String&& value) { m_customKeyStoreIdHasBeenSet = true; m_customKeyStoreId = std::move(value); } /** *

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.

*/ inline void SetCustomKeyStoreId(const char* value) { m_customKeyStoreIdHasBeenSet = true; m_customKeyStoreId.assign(value); } /** *

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.

*/ inline GenerateRandomRequest& WithCustomKeyStoreId(const Aws::String& value) { SetCustomKeyStoreId(value); return *this;} /** *

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.

*/ inline GenerateRandomRequest& WithCustomKeyStoreId(Aws::String&& value) { SetCustomKeyStoreId(std::move(value)); return *this;} /** *

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.

*/ inline GenerateRandomRequest& WithCustomKeyStoreId(const char* value) { SetCustomKeyStoreId(value); return *this;} /** *

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.

*/ inline const RecipientInfo& GetRecipient() const{ return m_recipient; } /** *

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.

*/ inline bool RecipientHasBeenSet() const { return m_recipientHasBeenSet; } /** *

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.

*/ inline void SetRecipient(const RecipientInfo& value) { m_recipientHasBeenSet = true; m_recipient = value; } /** *

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.

*/ inline void SetRecipient(RecipientInfo&& value) { m_recipientHasBeenSet = true; m_recipient = std::move(value); } /** *

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.

*/ inline GenerateRandomRequest& WithRecipient(const RecipientInfo& value) { SetRecipient(value); return *this;} /** *

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.

*/ inline GenerateRandomRequest& WithRecipient(RecipientInfo&& value) { SetRecipient(std::move(value)); return *this;} private: int m_numberOfBytes; bool m_numberOfBytesHasBeenSet = false; Aws::String m_customKeyStoreId; bool m_customKeyStoreIdHasBeenSet = false; RecipientInfo m_recipient; bool m_recipientHasBeenSet = false; }; } // namespace Model } // namespace KMS } // namespace Aws