/** * 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 #include namespace Aws { namespace KMS { namespace Model { /** */ class EncryptRequest : public KMSRequest { public: AWS_KMS_API EncryptRequest(); // 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 "Encrypt"; } AWS_KMS_API Aws::String SerializePayload() const override; AWS_KMS_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** *

Identifies the KMS key to use in the encryption operation. The KMS key must * have a KeyUsage of ENCRYPT_DECRYPT. To find the * KeyUsage of a KMS key, use the DescribeKey operation.

*

To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When * using an alias name, prefix it with "alias/". To specify a KMS key * in a different Amazon Web Services account, you must use the key ARN or alias * ARN.

For example:

  • Key ID: * 1234abcd-12ab-34cd-56ef-1234567890ab

  • Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

To get the key ID and key ARN for a KMS key, use * ListKeys or DescribeKey. To get the alias name and alias ARN, use * ListAliases.

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

Identifies the KMS key to use in the encryption operation. The KMS key must * have a KeyUsage of ENCRYPT_DECRYPT. To find the * KeyUsage of a KMS key, use the DescribeKey operation.

*

To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When * using an alias name, prefix it with "alias/". To specify a KMS key * in a different Amazon Web Services account, you must use the key ARN or alias * ARN.

For example:

  • Key ID: * 1234abcd-12ab-34cd-56ef-1234567890ab

  • Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

To get the key ID and key ARN for a KMS key, use * ListKeys or DescribeKey. To get the alias name and alias ARN, use * ListAliases.

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

Identifies the KMS key to use in the encryption operation. The KMS key must * have a KeyUsage of ENCRYPT_DECRYPT. To find the * KeyUsage of a KMS key, use the DescribeKey operation.

*

To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When * using an alias name, prefix it with "alias/". To specify a KMS key * in a different Amazon Web Services account, you must use the key ARN or alias * ARN.

For example:

  • Key ID: * 1234abcd-12ab-34cd-56ef-1234567890ab

  • Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

To get the key ID and key ARN for a KMS key, use * ListKeys or DescribeKey. To get the alias name and alias ARN, use * ListAliases.

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

Identifies the KMS key to use in the encryption operation. The KMS key must * have a KeyUsage of ENCRYPT_DECRYPT. To find the * KeyUsage of a KMS key, use the DescribeKey operation.

*

To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When * using an alias name, prefix it with "alias/". To specify a KMS key * in a different Amazon Web Services account, you must use the key ARN or alias * ARN.

For example:

  • Key ID: * 1234abcd-12ab-34cd-56ef-1234567890ab

  • Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

To get the key ID and key ARN for a KMS key, use * ListKeys or DescribeKey. To get the alias name and alias ARN, use * ListAliases.

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

Identifies the KMS key to use in the encryption operation. The KMS key must * have a KeyUsage of ENCRYPT_DECRYPT. To find the * KeyUsage of a KMS key, use the DescribeKey operation.

*

To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When * using an alias name, prefix it with "alias/". To specify a KMS key * in a different Amazon Web Services account, you must use the key ARN or alias * ARN.

For example:

  • Key ID: * 1234abcd-12ab-34cd-56ef-1234567890ab

  • Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

To get the key ID and key ARN for a KMS key, use * ListKeys or DescribeKey. To get the alias name and alias ARN, use * ListAliases.

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

Identifies the KMS key to use in the encryption operation. The KMS key must * have a KeyUsage of ENCRYPT_DECRYPT. To find the * KeyUsage of a KMS key, use the DescribeKey operation.

*

To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When * using an alias name, prefix it with "alias/". To specify a KMS key * in a different Amazon Web Services account, you must use the key ARN or alias * ARN.

For example:

  • Key ID: * 1234abcd-12ab-34cd-56ef-1234567890ab

  • Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

To get the key ID and key ARN for a KMS key, use * ListKeys or DescribeKey. To get the alias name and alias ARN, use * ListAliases.

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

Identifies the KMS key to use in the encryption operation. The KMS key must * have a KeyUsage of ENCRYPT_DECRYPT. To find the * KeyUsage of a KMS key, use the DescribeKey operation.

*

To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When * using an alias name, prefix it with "alias/". To specify a KMS key * in a different Amazon Web Services account, you must use the key ARN or alias * ARN.

For example:

  • Key ID: * 1234abcd-12ab-34cd-56ef-1234567890ab

  • Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

To get the key ID and key ARN for a KMS key, use * ListKeys or DescribeKey. To get the alias name and alias ARN, use * ListAliases.

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

Identifies the KMS key to use in the encryption operation. The KMS key must * have a KeyUsage of ENCRYPT_DECRYPT. To find the * KeyUsage of a KMS key, use the DescribeKey operation.

*

To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When * using an alias name, prefix it with "alias/". To specify a KMS key * in a different Amazon Web Services account, you must use the key ARN or alias * ARN.

For example:

  • Key ID: * 1234abcd-12ab-34cd-56ef-1234567890ab

  • Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

To get the key ID and key ARN for a KMS key, use * ListKeys or DescribeKey. To get the alias name and alias ARN, use * ListAliases.

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

Data to be encrypted.

*/ inline const Aws::Utils::CryptoBuffer& GetPlaintext() const{ return m_plaintext; } /** *

Data to be encrypted.

*/ inline bool PlaintextHasBeenSet() const { return m_plaintextHasBeenSet; } /** *

Data to be encrypted.

*/ inline void SetPlaintext(const Aws::Utils::CryptoBuffer& value) { m_plaintextHasBeenSet = true; m_plaintext = value; } /** *

Data to be encrypted.

*/ inline void SetPlaintext(Aws::Utils::CryptoBuffer&& value) { m_plaintextHasBeenSet = true; m_plaintext = std::move(value); } /** *

Data to be encrypted.

*/ inline EncryptRequest& WithPlaintext(const Aws::Utils::CryptoBuffer& value) { SetPlaintext(value); return *this;} /** *

Data to be encrypted.

*/ inline EncryptRequest& WithPlaintext(Aws::Utils::CryptoBuffer&& value) { SetPlaintext(std::move(value)); return *this;} /** *

Specifies the encryption context that will be used to encrypt the data. An * encryption context is valid only for cryptographic * operations with a symmetric encryption KMS key. The standard asymmetric * encryption algorithms and HMAC algorithms that KMS uses do not support an * encryption context.

Do not include confidential or sensitive * information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output.

An encryption * context is a collection of non-secret key-value pairs that represent * additional authenticated data. When you use an encryption context to encrypt * data, you must specify the same (an exact case-sensitive match) encryption * context to decrypt the data. An encryption context is supported only on * operations with symmetric encryption KMS keys. On operations with symmetric * encryption KMS keys, an encryption context is optional, but it is strongly * recommended.

For more information, see Encryption * context in the Key Management Service Developer Guide.

*/ inline const Aws::Map& GetEncryptionContext() const{ return m_encryptionContext; } /** *

Specifies the encryption context that will be used to encrypt the data. An * encryption context is valid only for cryptographic * operations with a symmetric encryption KMS key. The standard asymmetric * encryption algorithms and HMAC algorithms that KMS uses do not support an * encryption context.

Do not include confidential or sensitive * information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output.

An encryption * context is a collection of non-secret key-value pairs that represent * additional authenticated data. When you use an encryption context to encrypt * data, you must specify the same (an exact case-sensitive match) encryption * context to decrypt the data. An encryption context is supported only on * operations with symmetric encryption KMS keys. On operations with symmetric * encryption KMS keys, an encryption context is optional, but it is strongly * recommended.

For more information, see Encryption * context in the Key Management Service Developer Guide.

*/ inline bool EncryptionContextHasBeenSet() const { return m_encryptionContextHasBeenSet; } /** *

Specifies the encryption context that will be used to encrypt the data. An * encryption context is valid only for cryptographic * operations with a symmetric encryption KMS key. The standard asymmetric * encryption algorithms and HMAC algorithms that KMS uses do not support an * encryption context.

Do not include confidential or sensitive * information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output.

An encryption * context is a collection of non-secret key-value pairs that represent * additional authenticated data. When you use an encryption context to encrypt * data, you must specify the same (an exact case-sensitive match) encryption * context to decrypt the data. An encryption context is supported only on * operations with symmetric encryption KMS keys. On operations with symmetric * encryption KMS keys, an encryption context is optional, but it is strongly * recommended.

For more information, see Encryption * context in the Key Management Service Developer Guide.

*/ inline void SetEncryptionContext(const Aws::Map& value) { m_encryptionContextHasBeenSet = true; m_encryptionContext = value; } /** *

Specifies the encryption context that will be used to encrypt the data. An * encryption context is valid only for cryptographic * operations with a symmetric encryption KMS key. The standard asymmetric * encryption algorithms and HMAC algorithms that KMS uses do not support an * encryption context.

Do not include confidential or sensitive * information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output.

An encryption * context is a collection of non-secret key-value pairs that represent * additional authenticated data. When you use an encryption context to encrypt * data, you must specify the same (an exact case-sensitive match) encryption * context to decrypt the data. An encryption context is supported only on * operations with symmetric encryption KMS keys. On operations with symmetric * encryption KMS keys, an encryption context is optional, but it is strongly * recommended.

For more information, see Encryption * context in the Key Management Service Developer Guide.

*/ inline void SetEncryptionContext(Aws::Map&& value) { m_encryptionContextHasBeenSet = true; m_encryptionContext = std::move(value); } /** *

Specifies the encryption context that will be used to encrypt the data. An * encryption context is valid only for cryptographic * operations with a symmetric encryption KMS key. The standard asymmetric * encryption algorithms and HMAC algorithms that KMS uses do not support an * encryption context.

Do not include confidential or sensitive * information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output.

An encryption * context is a collection of non-secret key-value pairs that represent * additional authenticated data. When you use an encryption context to encrypt * data, you must specify the same (an exact case-sensitive match) encryption * context to decrypt the data. An encryption context is supported only on * operations with symmetric encryption KMS keys. On operations with symmetric * encryption KMS keys, an encryption context is optional, but it is strongly * recommended.

For more information, see Encryption * context in the Key Management Service Developer Guide.

*/ inline EncryptRequest& WithEncryptionContext(const Aws::Map& value) { SetEncryptionContext(value); return *this;} /** *

Specifies the encryption context that will be used to encrypt the data. An * encryption context is valid only for cryptographic * operations with a symmetric encryption KMS key. The standard asymmetric * encryption algorithms and HMAC algorithms that KMS uses do not support an * encryption context.

Do not include confidential or sensitive * information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output.

An encryption * context is a collection of non-secret key-value pairs that represent * additional authenticated data. When you use an encryption context to encrypt * data, you must specify the same (an exact case-sensitive match) encryption * context to decrypt the data. An encryption context is supported only on * operations with symmetric encryption KMS keys. On operations with symmetric * encryption KMS keys, an encryption context is optional, but it is strongly * recommended.

For more information, see Encryption * context in the Key Management Service Developer Guide.

*/ inline EncryptRequest& WithEncryptionContext(Aws::Map&& value) { SetEncryptionContext(std::move(value)); return *this;} /** *

Specifies the encryption context that will be used to encrypt the data. An * encryption context is valid only for cryptographic * operations with a symmetric encryption KMS key. The standard asymmetric * encryption algorithms and HMAC algorithms that KMS uses do not support an * encryption context.

Do not include confidential or sensitive * information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output.

An encryption * context is a collection of non-secret key-value pairs that represent * additional authenticated data. When you use an encryption context to encrypt * data, you must specify the same (an exact case-sensitive match) encryption * context to decrypt the data. An encryption context is supported only on * operations with symmetric encryption KMS keys. On operations with symmetric * encryption KMS keys, an encryption context is optional, but it is strongly * recommended.

For more information, see Encryption * context in the Key Management Service Developer Guide.

*/ inline EncryptRequest& AddEncryptionContext(const Aws::String& key, const Aws::String& value) { m_encryptionContextHasBeenSet = true; m_encryptionContext.emplace(key, value); return *this; } /** *

Specifies the encryption context that will be used to encrypt the data. An * encryption context is valid only for cryptographic * operations with a symmetric encryption KMS key. The standard asymmetric * encryption algorithms and HMAC algorithms that KMS uses do not support an * encryption context.

Do not include confidential or sensitive * information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output.

An encryption * context is a collection of non-secret key-value pairs that represent * additional authenticated data. When you use an encryption context to encrypt * data, you must specify the same (an exact case-sensitive match) encryption * context to decrypt the data. An encryption context is supported only on * operations with symmetric encryption KMS keys. On operations with symmetric * encryption KMS keys, an encryption context is optional, but it is strongly * recommended.

For more information, see Encryption * context in the Key Management Service Developer Guide.

*/ inline EncryptRequest& AddEncryptionContext(Aws::String&& key, const Aws::String& value) { m_encryptionContextHasBeenSet = true; m_encryptionContext.emplace(std::move(key), value); return *this; } /** *

Specifies the encryption context that will be used to encrypt the data. An * encryption context is valid only for cryptographic * operations with a symmetric encryption KMS key. The standard asymmetric * encryption algorithms and HMAC algorithms that KMS uses do not support an * encryption context.

Do not include confidential or sensitive * information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output.

An encryption * context is a collection of non-secret key-value pairs that represent * additional authenticated data. When you use an encryption context to encrypt * data, you must specify the same (an exact case-sensitive match) encryption * context to decrypt the data. An encryption context is supported only on * operations with symmetric encryption KMS keys. On operations with symmetric * encryption KMS keys, an encryption context is optional, but it is strongly * recommended.

For more information, see Encryption * context in the Key Management Service Developer Guide.

*/ inline EncryptRequest& AddEncryptionContext(const Aws::String& key, Aws::String&& value) { m_encryptionContextHasBeenSet = true; m_encryptionContext.emplace(key, std::move(value)); return *this; } /** *

Specifies the encryption context that will be used to encrypt the data. An * encryption context is valid only for cryptographic * operations with a symmetric encryption KMS key. The standard asymmetric * encryption algorithms and HMAC algorithms that KMS uses do not support an * encryption context.

Do not include confidential or sensitive * information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output.

An encryption * context is a collection of non-secret key-value pairs that represent * additional authenticated data. When you use an encryption context to encrypt * data, you must specify the same (an exact case-sensitive match) encryption * context to decrypt the data. An encryption context is supported only on * operations with symmetric encryption KMS keys. On operations with symmetric * encryption KMS keys, an encryption context is optional, but it is strongly * recommended.

For more information, see Encryption * context in the Key Management Service Developer Guide.

*/ inline EncryptRequest& AddEncryptionContext(Aws::String&& key, Aws::String&& value) { m_encryptionContextHasBeenSet = true; m_encryptionContext.emplace(std::move(key), std::move(value)); return *this; } /** *

Specifies the encryption context that will be used to encrypt the data. An * encryption context is valid only for cryptographic * operations with a symmetric encryption KMS key. The standard asymmetric * encryption algorithms and HMAC algorithms that KMS uses do not support an * encryption context.

Do not include confidential or sensitive * information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output.

An encryption * context is a collection of non-secret key-value pairs that represent * additional authenticated data. When you use an encryption context to encrypt * data, you must specify the same (an exact case-sensitive match) encryption * context to decrypt the data. An encryption context is supported only on * operations with symmetric encryption KMS keys. On operations with symmetric * encryption KMS keys, an encryption context is optional, but it is strongly * recommended.

For more information, see Encryption * context in the Key Management Service Developer Guide.

*/ inline EncryptRequest& AddEncryptionContext(const char* key, Aws::String&& value) { m_encryptionContextHasBeenSet = true; m_encryptionContext.emplace(key, std::move(value)); return *this; } /** *

Specifies the encryption context that will be used to encrypt the data. An * encryption context is valid only for cryptographic * operations with a symmetric encryption KMS key. The standard asymmetric * encryption algorithms and HMAC algorithms that KMS uses do not support an * encryption context.

Do not include confidential or sensitive * information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output.

An encryption * context is a collection of non-secret key-value pairs that represent * additional authenticated data. When you use an encryption context to encrypt * data, you must specify the same (an exact case-sensitive match) encryption * context to decrypt the data. An encryption context is supported only on * operations with symmetric encryption KMS keys. On operations with symmetric * encryption KMS keys, an encryption context is optional, but it is strongly * recommended.

For more information, see Encryption * context in the Key Management Service Developer Guide.

*/ inline EncryptRequest& AddEncryptionContext(Aws::String&& key, const char* value) { m_encryptionContextHasBeenSet = true; m_encryptionContext.emplace(std::move(key), value); return *this; } /** *

Specifies the encryption context that will be used to encrypt the data. An * encryption context is valid only for cryptographic * operations with a symmetric encryption KMS key. The standard asymmetric * encryption algorithms and HMAC algorithms that KMS uses do not support an * encryption context.

Do not include confidential or sensitive * information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output.

An encryption * context is a collection of non-secret key-value pairs that represent * additional authenticated data. When you use an encryption context to encrypt * data, you must specify the same (an exact case-sensitive match) encryption * context to decrypt the data. An encryption context is supported only on * operations with symmetric encryption KMS keys. On operations with symmetric * encryption KMS keys, an encryption context is optional, but it is strongly * recommended.

For more information, see Encryption * context in the Key Management Service Developer Guide.

*/ inline EncryptRequest& AddEncryptionContext(const char* key, const char* value) { m_encryptionContextHasBeenSet = true; m_encryptionContext.emplace(key, 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 EncryptRequest& 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 EncryptRequest& 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 EncryptRequest& 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 EncryptRequest& 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 EncryptRequest& AddGrantTokens(const char* value) { m_grantTokensHasBeenSet = true; m_grantTokens.push_back(value); return *this; } /** *

Specifies the encryption algorithm that KMS will use to encrypt the plaintext * message. The algorithm must be compatible with the KMS key that you specify.

*

This parameter is required only for asymmetric KMS keys. The default value, * SYMMETRIC_DEFAULT, is the algorithm used for symmetric encryption * KMS keys. If you are using an asymmetric KMS key, we recommend * RSAES_OAEP_SHA_256.

The SM2PKE algorithm is only available in China * Regions.

*/ inline const EncryptionAlgorithmSpec& GetEncryptionAlgorithm() const{ return m_encryptionAlgorithm; } /** *

Specifies the encryption algorithm that KMS will use to encrypt the plaintext * message. The algorithm must be compatible with the KMS key that you specify.

*

This parameter is required only for asymmetric KMS keys. The default value, * SYMMETRIC_DEFAULT, is the algorithm used for symmetric encryption * KMS keys. If you are using an asymmetric KMS key, we recommend * RSAES_OAEP_SHA_256.

The SM2PKE algorithm is only available in China * Regions.

*/ inline bool EncryptionAlgorithmHasBeenSet() const { return m_encryptionAlgorithmHasBeenSet; } /** *

Specifies the encryption algorithm that KMS will use to encrypt the plaintext * message. The algorithm must be compatible with the KMS key that you specify.

*

This parameter is required only for asymmetric KMS keys. The default value, * SYMMETRIC_DEFAULT, is the algorithm used for symmetric encryption * KMS keys. If you are using an asymmetric KMS key, we recommend * RSAES_OAEP_SHA_256.

The SM2PKE algorithm is only available in China * Regions.

*/ inline void SetEncryptionAlgorithm(const EncryptionAlgorithmSpec& value) { m_encryptionAlgorithmHasBeenSet = true; m_encryptionAlgorithm = value; } /** *

Specifies the encryption algorithm that KMS will use to encrypt the plaintext * message. The algorithm must be compatible with the KMS key that you specify.

*

This parameter is required only for asymmetric KMS keys. The default value, * SYMMETRIC_DEFAULT, is the algorithm used for symmetric encryption * KMS keys. If you are using an asymmetric KMS key, we recommend * RSAES_OAEP_SHA_256.

The SM2PKE algorithm is only available in China * Regions.

*/ inline void SetEncryptionAlgorithm(EncryptionAlgorithmSpec&& value) { m_encryptionAlgorithmHasBeenSet = true; m_encryptionAlgorithm = std::move(value); } /** *

Specifies the encryption algorithm that KMS will use to encrypt the plaintext * message. The algorithm must be compatible with the KMS key that you specify.

*

This parameter is required only for asymmetric KMS keys. The default value, * SYMMETRIC_DEFAULT, is the algorithm used for symmetric encryption * KMS keys. If you are using an asymmetric KMS key, we recommend * RSAES_OAEP_SHA_256.

The SM2PKE algorithm is only available in China * Regions.

*/ inline EncryptRequest& WithEncryptionAlgorithm(const EncryptionAlgorithmSpec& value) { SetEncryptionAlgorithm(value); return *this;} /** *

Specifies the encryption algorithm that KMS will use to encrypt the plaintext * message. The algorithm must be compatible with the KMS key that you specify.

*

This parameter is required only for asymmetric KMS keys. The default value, * SYMMETRIC_DEFAULT, is the algorithm used for symmetric encryption * KMS keys. If you are using an asymmetric KMS key, we recommend * RSAES_OAEP_SHA_256.

The SM2PKE algorithm is only available in China * Regions.

*/ inline EncryptRequest& WithEncryptionAlgorithm(EncryptionAlgorithmSpec&& value) { SetEncryptionAlgorithm(std::move(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 EncryptRequest& WithDryRun(bool value) { SetDryRun(value); return *this;} private: Aws::String m_keyId; bool m_keyIdHasBeenSet = false; Aws::Utils::CryptoBuffer m_plaintext; bool m_plaintextHasBeenSet = false; Aws::Map m_encryptionContext; bool m_encryptionContextHasBeenSet = false; Aws::Vector m_grantTokens; bool m_grantTokensHasBeenSet = false; EncryptionAlgorithmSpec m_encryptionAlgorithm; bool m_encryptionAlgorithmHasBeenSet = false; bool m_dryRun; bool m_dryRunHasBeenSet = false; }; } // namespace Model } // namespace KMS } // namespace Aws