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

The identifier of the KMS key that will be associated with the imported key * material. This must be the same KMS key specified in the KeyID * parameter of the corresponding GetParametersForImport request. The * Origin of the KMS key must be EXTERNAL and its * KeyState must be PendingImport.

The KMS key * can be a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS * key, or asymmetric signing KMS key, including a multi-Region * key of any supported type. You cannot perform this operation on a KMS key in * a custom key store, or on a KMS key in a different Amazon Web Services * account.

Specify the key ID or key ARN of the KMS key.

For * example:

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

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

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

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

The identifier of the KMS key that will be associated with the imported key * material. This must be the same KMS key specified in the KeyID * parameter of the corresponding GetParametersForImport request. The * Origin of the KMS key must be EXTERNAL and its * KeyState must be PendingImport.

The KMS key * can be a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS * key, or asymmetric signing KMS key, including a multi-Region * key of any supported type. You cannot perform this operation on a KMS key in * a custom key store, or on a KMS key in a different Amazon Web Services * account.

Specify the key ID or key ARN of the KMS key.

For * example:

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

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

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

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

The identifier of the KMS key that will be associated with the imported key * material. This must be the same KMS key specified in the KeyID * parameter of the corresponding GetParametersForImport request. The * Origin of the KMS key must be EXTERNAL and its * KeyState must be PendingImport.

The KMS key * can be a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS * key, or asymmetric signing KMS key, including a multi-Region * key of any supported type. You cannot perform this operation on a KMS key in * a custom key store, or on a KMS key in a different Amazon Web Services * account.

Specify the key ID or key ARN of the KMS key.

For * example:

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

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

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

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

The identifier of the KMS key that will be associated with the imported key * material. This must be the same KMS key specified in the KeyID * parameter of the corresponding GetParametersForImport request. The * Origin of the KMS key must be EXTERNAL and its * KeyState must be PendingImport.

The KMS key * can be a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS * key, or asymmetric signing KMS key, including a multi-Region * key of any supported type. You cannot perform this operation on a KMS key in * a custom key store, or on a KMS key in a different Amazon Web Services * account.

Specify the key ID or key ARN of the KMS key.

For * example:

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

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

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

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

The identifier of the KMS key that will be associated with the imported key * material. This must be the same KMS key specified in the KeyID * parameter of the corresponding GetParametersForImport request. The * Origin of the KMS key must be EXTERNAL and its * KeyState must be PendingImport.

The KMS key * can be a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS * key, or asymmetric signing KMS key, including a multi-Region * key of any supported type. You cannot perform this operation on a KMS key in * a custom key store, or on a KMS key in a different Amazon Web Services * account.

Specify the key ID or key ARN of the KMS key.

For * example:

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

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

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

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

The identifier of the KMS key that will be associated with the imported key * material. This must be the same KMS key specified in the KeyID * parameter of the corresponding GetParametersForImport request. The * Origin of the KMS key must be EXTERNAL and its * KeyState must be PendingImport.

The KMS key * can be a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS * key, or asymmetric signing KMS key, including a multi-Region * key of any supported type. You cannot perform this operation on a KMS key in * a custom key store, or on a KMS key in a different Amazon Web Services * account.

Specify the key ID or key ARN of the KMS key.

For * example:

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

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

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

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

The identifier of the KMS key that will be associated with the imported key * material. This must be the same KMS key specified in the KeyID * parameter of the corresponding GetParametersForImport request. The * Origin of the KMS key must be EXTERNAL and its * KeyState must be PendingImport.

The KMS key * can be a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS * key, or asymmetric signing KMS key, including a multi-Region * key of any supported type. You cannot perform this operation on a KMS key in * a custom key store, or on a KMS key in a different Amazon Web Services * account.

Specify the key ID or key ARN of the KMS key.

For * example:

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

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

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

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

The identifier of the KMS key that will be associated with the imported key * material. This must be the same KMS key specified in the KeyID * parameter of the corresponding GetParametersForImport request. The * Origin of the KMS key must be EXTERNAL and its * KeyState must be PendingImport.

The KMS key * can be a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS * key, or asymmetric signing KMS key, including a multi-Region * key of any supported type. You cannot perform this operation on a KMS key in * a custom key store, or on a KMS key in a different Amazon Web Services * account.

Specify the key ID or key ARN of the KMS key.

For * example:

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

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

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

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

The import token that you received in the response to a previous * GetParametersForImport request. It must be from the same response that * contained the public key that you used to encrypt the key material.

*/ inline const Aws::Utils::ByteBuffer& GetImportToken() const{ return m_importToken; } /** *

The import token that you received in the response to a previous * GetParametersForImport request. It must be from the same response that * contained the public key that you used to encrypt the key material.

*/ inline bool ImportTokenHasBeenSet() const { return m_importTokenHasBeenSet; } /** *

The import token that you received in the response to a previous * GetParametersForImport request. It must be from the same response that * contained the public key that you used to encrypt the key material.

*/ inline void SetImportToken(const Aws::Utils::ByteBuffer& value) { m_importTokenHasBeenSet = true; m_importToken = value; } /** *

The import token that you received in the response to a previous * GetParametersForImport request. It must be from the same response that * contained the public key that you used to encrypt the key material.

*/ inline void SetImportToken(Aws::Utils::ByteBuffer&& value) { m_importTokenHasBeenSet = true; m_importToken = std::move(value); } /** *

The import token that you received in the response to a previous * GetParametersForImport request. It must be from the same response that * contained the public key that you used to encrypt the key material.

*/ inline ImportKeyMaterialRequest& WithImportToken(const Aws::Utils::ByteBuffer& value) { SetImportToken(value); return *this;} /** *

The import token that you received in the response to a previous * GetParametersForImport request. It must be from the same response that * contained the public key that you used to encrypt the key material.

*/ inline ImportKeyMaterialRequest& WithImportToken(Aws::Utils::ByteBuffer&& value) { SetImportToken(std::move(value)); return *this;} /** *

The encrypted key material to import. The key material must be encrypted * under the public wrapping key that GetParametersForImport returned, using * the wrapping algorithm that you specified in the same * GetParametersForImport request.

*/ inline const Aws::Utils::ByteBuffer& GetEncryptedKeyMaterial() const{ return m_encryptedKeyMaterial; } /** *

The encrypted key material to import. The key material must be encrypted * under the public wrapping key that GetParametersForImport returned, using * the wrapping algorithm that you specified in the same * GetParametersForImport request.

*/ inline bool EncryptedKeyMaterialHasBeenSet() const { return m_encryptedKeyMaterialHasBeenSet; } /** *

The encrypted key material to import. The key material must be encrypted * under the public wrapping key that GetParametersForImport returned, using * the wrapping algorithm that you specified in the same * GetParametersForImport request.

*/ inline void SetEncryptedKeyMaterial(const Aws::Utils::ByteBuffer& value) { m_encryptedKeyMaterialHasBeenSet = true; m_encryptedKeyMaterial = value; } /** *

The encrypted key material to import. The key material must be encrypted * under the public wrapping key that GetParametersForImport returned, using * the wrapping algorithm that you specified in the same * GetParametersForImport request.

*/ inline void SetEncryptedKeyMaterial(Aws::Utils::ByteBuffer&& value) { m_encryptedKeyMaterialHasBeenSet = true; m_encryptedKeyMaterial = std::move(value); } /** *

The encrypted key material to import. The key material must be encrypted * under the public wrapping key that GetParametersForImport returned, using * the wrapping algorithm that you specified in the same * GetParametersForImport request.

*/ inline ImportKeyMaterialRequest& WithEncryptedKeyMaterial(const Aws::Utils::ByteBuffer& value) { SetEncryptedKeyMaterial(value); return *this;} /** *

The encrypted key material to import. The key material must be encrypted * under the public wrapping key that GetParametersForImport returned, using * the wrapping algorithm that you specified in the same * GetParametersForImport request.

*/ inline ImportKeyMaterialRequest& WithEncryptedKeyMaterial(Aws::Utils::ByteBuffer&& value) { SetEncryptedKeyMaterial(std::move(value)); return *this;} /** *

The date and time when the imported key material expires. This parameter is * required when the value of the ExpirationModel parameter is * KEY_MATERIAL_EXPIRES. Otherwise it is not valid.

The value * of this parameter must be a future date and time. The maximum value is 365 days * from the request date.

When the key material expires, KMS deletes the key * material from the KMS key. Without its key material, the KMS key is unusable. To * use the KMS key in cryptographic operations, you must reimport the same key * material.

You cannot change the ExpirationModel or * ValidTo values for the current import after the request completes. * To change either value, you must delete (DeleteImportedKeyMaterial) and * reimport the key material.

*/ inline const Aws::Utils::DateTime& GetValidTo() const{ return m_validTo; } /** *

The date and time when the imported key material expires. This parameter is * required when the value of the ExpirationModel parameter is * KEY_MATERIAL_EXPIRES. Otherwise it is not valid.

The value * of this parameter must be a future date and time. The maximum value is 365 days * from the request date.

When the key material expires, KMS deletes the key * material from the KMS key. Without its key material, the KMS key is unusable. To * use the KMS key in cryptographic operations, you must reimport the same key * material.

You cannot change the ExpirationModel or * ValidTo values for the current import after the request completes. * To change either value, you must delete (DeleteImportedKeyMaterial) and * reimport the key material.

*/ inline bool ValidToHasBeenSet() const { return m_validToHasBeenSet; } /** *

The date and time when the imported key material expires. This parameter is * required when the value of the ExpirationModel parameter is * KEY_MATERIAL_EXPIRES. Otherwise it is not valid.

The value * of this parameter must be a future date and time. The maximum value is 365 days * from the request date.

When the key material expires, KMS deletes the key * material from the KMS key. Without its key material, the KMS key is unusable. To * use the KMS key in cryptographic operations, you must reimport the same key * material.

You cannot change the ExpirationModel or * ValidTo values for the current import after the request completes. * To change either value, you must delete (DeleteImportedKeyMaterial) and * reimport the key material.

*/ inline void SetValidTo(const Aws::Utils::DateTime& value) { m_validToHasBeenSet = true; m_validTo = value; } /** *

The date and time when the imported key material expires. This parameter is * required when the value of the ExpirationModel parameter is * KEY_MATERIAL_EXPIRES. Otherwise it is not valid.

The value * of this parameter must be a future date and time. The maximum value is 365 days * from the request date.

When the key material expires, KMS deletes the key * material from the KMS key. Without its key material, the KMS key is unusable. To * use the KMS key in cryptographic operations, you must reimport the same key * material.

You cannot change the ExpirationModel or * ValidTo values for the current import after the request completes. * To change either value, you must delete (DeleteImportedKeyMaterial) and * reimport the key material.

*/ inline void SetValidTo(Aws::Utils::DateTime&& value) { m_validToHasBeenSet = true; m_validTo = std::move(value); } /** *

The date and time when the imported key material expires. This parameter is * required when the value of the ExpirationModel parameter is * KEY_MATERIAL_EXPIRES. Otherwise it is not valid.

The value * of this parameter must be a future date and time. The maximum value is 365 days * from the request date.

When the key material expires, KMS deletes the key * material from the KMS key. Without its key material, the KMS key is unusable. To * use the KMS key in cryptographic operations, you must reimport the same key * material.

You cannot change the ExpirationModel or * ValidTo values for the current import after the request completes. * To change either value, you must delete (DeleteImportedKeyMaterial) and * reimport the key material.

*/ inline ImportKeyMaterialRequest& WithValidTo(const Aws::Utils::DateTime& value) { SetValidTo(value); return *this;} /** *

The date and time when the imported key material expires. This parameter is * required when the value of the ExpirationModel parameter is * KEY_MATERIAL_EXPIRES. Otherwise it is not valid.

The value * of this parameter must be a future date and time. The maximum value is 365 days * from the request date.

When the key material expires, KMS deletes the key * material from the KMS key. Without its key material, the KMS key is unusable. To * use the KMS key in cryptographic operations, you must reimport the same key * material.

You cannot change the ExpirationModel or * ValidTo values for the current import after the request completes. * To change either value, you must delete (DeleteImportedKeyMaterial) and * reimport the key material.

*/ inline ImportKeyMaterialRequest& WithValidTo(Aws::Utils::DateTime&& value) { SetValidTo(std::move(value)); return *this;} /** *

Specifies whether the key material expires. The default is * KEY_MATERIAL_EXPIRES. For help with this choice, see Setting * an expiration time in the Key Management Service Developer Guide.

*

When the value of ExpirationModel is * KEY_MATERIAL_EXPIRES, you must specify a value for the * ValidTo parameter. When value is * KEY_MATERIAL_DOES_NOT_EXPIRE, you must omit the * ValidTo parameter.

You cannot change the * ExpirationModel or ValidTo values for the current * import after the request completes. To change either value, you must reimport * the key material.

*/ inline const ExpirationModelType& GetExpirationModel() const{ return m_expirationModel; } /** *

Specifies whether the key material expires. The default is * KEY_MATERIAL_EXPIRES. For help with this choice, see Setting * an expiration time in the Key Management Service Developer Guide.

*

When the value of ExpirationModel is * KEY_MATERIAL_EXPIRES, you must specify a value for the * ValidTo parameter. When value is * KEY_MATERIAL_DOES_NOT_EXPIRE, you must omit the * ValidTo parameter.

You cannot change the * ExpirationModel or ValidTo values for the current * import after the request completes. To change either value, you must reimport * the key material.

*/ inline bool ExpirationModelHasBeenSet() const { return m_expirationModelHasBeenSet; } /** *

Specifies whether the key material expires. The default is * KEY_MATERIAL_EXPIRES. For help with this choice, see Setting * an expiration time in the Key Management Service Developer Guide.

*

When the value of ExpirationModel is * KEY_MATERIAL_EXPIRES, you must specify a value for the * ValidTo parameter. When value is * KEY_MATERIAL_DOES_NOT_EXPIRE, you must omit the * ValidTo parameter.

You cannot change the * ExpirationModel or ValidTo values for the current * import after the request completes. To change either value, you must reimport * the key material.

*/ inline void SetExpirationModel(const ExpirationModelType& value) { m_expirationModelHasBeenSet = true; m_expirationModel = value; } /** *

Specifies whether the key material expires. The default is * KEY_MATERIAL_EXPIRES. For help with this choice, see Setting * an expiration time in the Key Management Service Developer Guide.

*

When the value of ExpirationModel is * KEY_MATERIAL_EXPIRES, you must specify a value for the * ValidTo parameter. When value is * KEY_MATERIAL_DOES_NOT_EXPIRE, you must omit the * ValidTo parameter.

You cannot change the * ExpirationModel or ValidTo values for the current * import after the request completes. To change either value, you must reimport * the key material.

*/ inline void SetExpirationModel(ExpirationModelType&& value) { m_expirationModelHasBeenSet = true; m_expirationModel = std::move(value); } /** *

Specifies whether the key material expires. The default is * KEY_MATERIAL_EXPIRES. For help with this choice, see Setting * an expiration time in the Key Management Service Developer Guide.

*

When the value of ExpirationModel is * KEY_MATERIAL_EXPIRES, you must specify a value for the * ValidTo parameter. When value is * KEY_MATERIAL_DOES_NOT_EXPIRE, you must omit the * ValidTo parameter.

You cannot change the * ExpirationModel or ValidTo values for the current * import after the request completes. To change either value, you must reimport * the key material.

*/ inline ImportKeyMaterialRequest& WithExpirationModel(const ExpirationModelType& value) { SetExpirationModel(value); return *this;} /** *

Specifies whether the key material expires. The default is * KEY_MATERIAL_EXPIRES. For help with this choice, see Setting * an expiration time in the Key Management Service Developer Guide.

*

When the value of ExpirationModel is * KEY_MATERIAL_EXPIRES, you must specify a value for the * ValidTo parameter. When value is * KEY_MATERIAL_DOES_NOT_EXPIRE, you must omit the * ValidTo parameter.

You cannot change the * ExpirationModel or ValidTo values for the current * import after the request completes. To change either value, you must reimport * the key material.

*/ inline ImportKeyMaterialRequest& WithExpirationModel(ExpirationModelType&& value) { SetExpirationModel(std::move(value)); return *this;} private: Aws::String m_keyId; bool m_keyIdHasBeenSet = false; Aws::Utils::ByteBuffer m_importToken; bool m_importTokenHasBeenSet = false; Aws::Utils::ByteBuffer m_encryptedKeyMaterial; bool m_encryptedKeyMaterialHasBeenSet = false; Aws::Utils::DateTime m_validTo; bool m_validToHasBeenSet = false; ExpirationModelType m_expirationModel; bool m_expirationModelHasBeenSet = false; }; } // namespace Model } // namespace KMS } // namespace Aws