/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include namespace Aws { namespace KMS { namespace Model { /** */ class GenerateMacRequest : public KMSRequest { public: AWS_KMS_API GenerateMacRequest(); // 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 "GenerateMac"; } AWS_KMS_API Aws::String SerializePayload() const override; AWS_KMS_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** *

The message to be hashed. Specify a message of up to 4,096 bytes.

* GenerateMac and VerifyMac do not provide special handling * for message digests. If you generate an HMAC for a hash digest of a message, you * must verify the HMAC of the same hash digest.

*/ inline const Aws::Utils::CryptoBuffer& GetMessage() const{ return m_message; } /** *

The message to be hashed. Specify a message of up to 4,096 bytes.

* GenerateMac and VerifyMac do not provide special handling * for message digests. If you generate an HMAC for a hash digest of a message, you * must verify the HMAC of the same hash digest.

*/ inline bool MessageHasBeenSet() const { return m_messageHasBeenSet; } /** *

The message to be hashed. Specify a message of up to 4,096 bytes.

* GenerateMac and VerifyMac do not provide special handling * for message digests. If you generate an HMAC for a hash digest of a message, you * must verify the HMAC of the same hash digest.

*/ inline void SetMessage(const Aws::Utils::CryptoBuffer& value) { m_messageHasBeenSet = true; m_message = value; } /** *

The message to be hashed. Specify a message of up to 4,096 bytes.

* GenerateMac and VerifyMac do not provide special handling * for message digests. If you generate an HMAC for a hash digest of a message, you * must verify the HMAC of the same hash digest.

*/ inline void SetMessage(Aws::Utils::CryptoBuffer&& value) { m_messageHasBeenSet = true; m_message = std::move(value); } /** *

The message to be hashed. Specify a message of up to 4,096 bytes.

* GenerateMac and VerifyMac do not provide special handling * for message digests. If you generate an HMAC for a hash digest of a message, you * must verify the HMAC of the same hash digest.

*/ inline GenerateMacRequest& WithMessage(const Aws::Utils::CryptoBuffer& value) { SetMessage(value); return *this;} /** *

The message to be hashed. Specify a message of up to 4,096 bytes.

* GenerateMac and VerifyMac do not provide special handling * for message digests. If you generate an HMAC for a hash digest of a message, you * must verify the HMAC of the same hash digest.

*/ inline GenerateMacRequest& WithMessage(Aws::Utils::CryptoBuffer&& value) { SetMessage(std::move(value)); return *this;} /** *

The HMAC KMS key to use in the operation. The MAC algorithm computes the HMAC * for the message and the key as described in RFC 2104.

To * identify an HMAC KMS key, use the DescribeKey operation and see the * KeySpec field in the response.

*/ inline const Aws::String& GetKeyId() const{ return m_keyId; } /** *

The HMAC KMS key to use in the operation. The MAC algorithm computes the HMAC * for the message and the key as described in RFC 2104.

To * identify an HMAC KMS key, use the DescribeKey operation and see the * KeySpec field in the response.

*/ inline bool KeyIdHasBeenSet() const { return m_keyIdHasBeenSet; } /** *

The HMAC KMS key to use in the operation. The MAC algorithm computes the HMAC * for the message and the key as described in RFC 2104.

To * identify an HMAC KMS key, use the DescribeKey operation and see the * KeySpec field in the response.

*/ inline void SetKeyId(const Aws::String& value) { m_keyIdHasBeenSet = true; m_keyId = value; } /** *

The HMAC KMS key to use in the operation. The MAC algorithm computes the HMAC * for the message and the key as described in RFC 2104.

To * identify an HMAC KMS key, use the DescribeKey operation and see the * KeySpec field in the response.

*/ inline void SetKeyId(Aws::String&& value) { m_keyIdHasBeenSet = true; m_keyId = std::move(value); } /** *

The HMAC KMS key to use in the operation. The MAC algorithm computes the HMAC * for the message and the key as described in RFC 2104.

To * identify an HMAC KMS key, use the DescribeKey operation and see the * KeySpec field in the response.

*/ inline void SetKeyId(const char* value) { m_keyIdHasBeenSet = true; m_keyId.assign(value); } /** *

The HMAC KMS key to use in the operation. The MAC algorithm computes the HMAC * for the message and the key as described in RFC 2104.

To * identify an HMAC KMS key, use the DescribeKey operation and see the * KeySpec field in the response.

*/ inline GenerateMacRequest& WithKeyId(const Aws::String& value) { SetKeyId(value); return *this;} /** *

The HMAC KMS key to use in the operation. The MAC algorithm computes the HMAC * for the message and the key as described in RFC 2104.

To * identify an HMAC KMS key, use the DescribeKey operation and see the * KeySpec field in the response.

*/ inline GenerateMacRequest& WithKeyId(Aws::String&& value) { SetKeyId(std::move(value)); return *this;} /** *

The HMAC KMS key to use in the operation. The MAC algorithm computes the HMAC * for the message and the key as described in RFC 2104.

To * identify an HMAC KMS key, use the DescribeKey operation and see the * KeySpec field in the response.

*/ inline GenerateMacRequest& WithKeyId(const char* value) { SetKeyId(value); return *this;} /** *

The MAC algorithm used in the operation.

The algorithm must be * compatible with the HMAC KMS key that you specify. To find the MAC algorithms * that your HMAC KMS key supports, use the DescribeKey operation and see * the MacAlgorithms field in the DescribeKey * response.

*/ inline const MacAlgorithmSpec& GetMacAlgorithm() const{ return m_macAlgorithm; } /** *

The MAC algorithm used in the operation.

The algorithm must be * compatible with the HMAC KMS key that you specify. To find the MAC algorithms * that your HMAC KMS key supports, use the DescribeKey operation and see * the MacAlgorithms field in the DescribeKey * response.

*/ inline bool MacAlgorithmHasBeenSet() const { return m_macAlgorithmHasBeenSet; } /** *

The MAC algorithm used in the operation.

The algorithm must be * compatible with the HMAC KMS key that you specify. To find the MAC algorithms * that your HMAC KMS key supports, use the DescribeKey operation and see * the MacAlgorithms field in the DescribeKey * response.

*/ inline void SetMacAlgorithm(const MacAlgorithmSpec& value) { m_macAlgorithmHasBeenSet = true; m_macAlgorithm = value; } /** *

The MAC algorithm used in the operation.

The algorithm must be * compatible with the HMAC KMS key that you specify. To find the MAC algorithms * that your HMAC KMS key supports, use the DescribeKey operation and see * the MacAlgorithms field in the DescribeKey * response.

*/ inline void SetMacAlgorithm(MacAlgorithmSpec&& value) { m_macAlgorithmHasBeenSet = true; m_macAlgorithm = std::move(value); } /** *

The MAC algorithm used in the operation.

The algorithm must be * compatible with the HMAC KMS key that you specify. To find the MAC algorithms * that your HMAC KMS key supports, use the DescribeKey operation and see * the MacAlgorithms field in the DescribeKey * response.

*/ inline GenerateMacRequest& WithMacAlgorithm(const MacAlgorithmSpec& value) { SetMacAlgorithm(value); return *this;} /** *

The MAC algorithm used in the operation.

The algorithm must be * compatible with the HMAC KMS key that you specify. To find the MAC algorithms * that your HMAC KMS key supports, use the DescribeKey operation and see * the MacAlgorithms field in the DescribeKey * response.

*/ inline GenerateMacRequest& WithMacAlgorithm(MacAlgorithmSpec&& value) { SetMacAlgorithm(std::move(value)); return *this;} /** *

A list of grant tokens.

Use a grant token when your permission to call * this operation comes from a new grant that has not yet achieved eventual * consistency. For more information, see Grant * token and Using * a grant token in the Key Management Service Developer Guide.

*/ inline const Aws::Vector& GetGrantTokens() const{ return m_grantTokens; } /** *

A list of grant tokens.

Use a grant token when your permission to call * this operation comes from a new grant that has not yet achieved eventual * consistency. For more information, see Grant * token and Using * a grant token in the Key Management Service Developer Guide.

*/ inline bool GrantTokensHasBeenSet() const { return m_grantTokensHasBeenSet; } /** *

A list of grant tokens.

Use a grant token when your permission to call * this operation comes from a new grant that has not yet achieved eventual * consistency. For more information, see Grant * token and Using * a grant token in the Key Management Service Developer Guide.

*/ inline void SetGrantTokens(const Aws::Vector& value) { m_grantTokensHasBeenSet = true; m_grantTokens = value; } /** *

A list of grant tokens.

Use a grant token when your permission to call * this operation comes from a new grant that has not yet achieved eventual * consistency. For more information, see Grant * token and Using * a grant token in the Key Management Service Developer Guide.

*/ inline void SetGrantTokens(Aws::Vector&& value) { m_grantTokensHasBeenSet = true; m_grantTokens = std::move(value); } /** *

A list of grant tokens.

Use a grant token when your permission to call * this operation comes from a new grant that has not yet achieved eventual * consistency. For more information, see Grant * token and Using * a grant token in the Key Management Service Developer Guide.

*/ inline GenerateMacRequest& WithGrantTokens(const Aws::Vector& value) { SetGrantTokens(value); return *this;} /** *

A list of grant tokens.

Use a grant token when your permission to call * this operation comes from a new grant that has not yet achieved eventual * consistency. For more information, see Grant * token and Using * a grant token in the Key Management Service Developer Guide.

*/ inline GenerateMacRequest& WithGrantTokens(Aws::Vector&& value) { SetGrantTokens(std::move(value)); return *this;} /** *

A list of grant tokens.

Use a grant token when your permission to call * this operation comes from a new grant that has not yet achieved eventual * consistency. For more information, see Grant * token and Using * a grant token in the Key Management Service Developer Guide.

*/ inline GenerateMacRequest& AddGrantTokens(const Aws::String& value) { m_grantTokensHasBeenSet = true; m_grantTokens.push_back(value); return *this; } /** *

A list of grant tokens.

Use a grant token when your permission to call * this operation comes from a new grant that has not yet achieved eventual * consistency. For more information, see Grant * token and Using * a grant token in the Key Management Service Developer Guide.

*/ inline GenerateMacRequest& AddGrantTokens(Aws::String&& value) { m_grantTokensHasBeenSet = true; m_grantTokens.push_back(std::move(value)); return *this; } /** *

A list of grant tokens.

Use a grant token when your permission to call * this operation comes from a new grant that has not yet achieved eventual * consistency. For more information, see Grant * token and Using * a grant token in the Key Management Service Developer Guide.

*/ inline GenerateMacRequest& AddGrantTokens(const char* value) { m_grantTokensHasBeenSet = true; m_grantTokens.push_back(value); return *this; } /** *

Checks if your request will succeed. DryRun is an optional * parameter.

To learn more about how to use this parameter, see Testing * your KMS API calls in the Key Management Service Developer Guide.

*/ inline bool GetDryRun() const{ return m_dryRun; } /** *

Checks if your request will succeed. DryRun is an optional * parameter.

To learn more about how to use this parameter, see Testing * your KMS API calls in the Key Management Service Developer Guide.

*/ inline bool DryRunHasBeenSet() const { return m_dryRunHasBeenSet; } /** *

Checks if your request will succeed. DryRun is an optional * parameter.

To learn more about how to use this parameter, see Testing * your KMS API calls in the Key Management Service Developer Guide.

*/ inline void SetDryRun(bool value) { m_dryRunHasBeenSet = true; m_dryRun = value; } /** *

Checks if your request will succeed. DryRun is an optional * parameter.

To learn more about how to use this parameter, see Testing * your KMS API calls in the Key Management Service Developer Guide.

*/ inline GenerateMacRequest& WithDryRun(bool value) { SetDryRun(value); return *this;} private: Aws::Utils::CryptoBuffer m_message; bool m_messageHasBeenSet = false; Aws::String m_keyId; bool m_keyIdHasBeenSet = false; MacAlgorithmSpec m_macAlgorithm; bool m_macAlgorithmHasBeenSet = false; Aws::Vector m_grantTokens; bool m_grantTokensHasBeenSet = false; bool m_dryRun; bool m_dryRunHasBeenSet = false; }; } // namespace Model } // namespace KMS } // namespace Aws