/** * 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 GetPublicKeyRequest : public KMSRequest { public: AWS_KMS_API GetPublicKeyRequest(); // 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 "GetPublicKey"; } AWS_KMS_API Aws::String SerializePayload() const override; AWS_KMS_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** *

Identifies the asymmetric KMS key that includes the public key.

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 asymmetric KMS key that includes the public key.

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 asymmetric KMS key that includes the public key.

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 asymmetric KMS key that includes the public key.

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 asymmetric KMS key that includes the public key.

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 asymmetric KMS key that includes the public key.

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 GetPublicKeyRequest& WithKeyId(const Aws::String& value) { SetKeyId(value); return *this;} /** *

Identifies the asymmetric KMS key that includes the public key.

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 GetPublicKeyRequest& WithKeyId(Aws::String&& value) { SetKeyId(std::move(value)); return *this;} /** *

Identifies the asymmetric KMS key that includes the public key.

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 GetPublicKeyRequest& WithKeyId(const char* value) { SetKeyId(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 GetPublicKeyRequest& 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 GetPublicKeyRequest& 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 GetPublicKeyRequest& 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 GetPublicKeyRequest& 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 GetPublicKeyRequest& AddGrantTokens(const char* value) { m_grantTokensHasBeenSet = true; m_grantTokens.push_back(value); return *this; } private: Aws::String m_keyId; bool m_keyIdHasBeenSet = false; Aws::Vector m_grantTokens; bool m_grantTokensHasBeenSet = false; }; } // namespace Model } // namespace KMS } // namespace Aws