libZSservicesZSamazonka-kmsZSamazonka-kms
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.KMS.GetParametersForImport

Description

Returns the items you need to import key material into a symmetric, customer managed KMS key. For more information about importing key material into KMS, see Importing Key Material in the Key Management Service Developer Guide.

This operation returns a public key and an import token. Use the public key to encrypt the symmetric key material. Store the import token to send with a subsequent ImportKeyMaterial request.

You must specify the key ID of the symmetric KMS key into which you will import key material. This KMS key's Origin must be EXTERNAL. You must also specify the wrapping algorithm and type of wrapping key (public key) that you will use to encrypt the key material. You cannot perform this operation on an asymmetric KMS key or on any KMS key in a different Amazon Web Services account.

To import key material, you must use the public key and import token from the same response. These items are valid for 24 hours. The expiration date and time appear in the GetParametersForImport response. You cannot use an expired token in an ImportKeyMaterial request. If your key and token expire, send another GetParametersForImport request.

The KMS key that you use for this operation must be in a compatible key state. For details, see Key state: Effect on your KMS key in the Key Management Service Developer Guide.

Cross-account use: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account.

Required permissions: kms:GetParametersForImport (key policy)

Related operations:

  • ImportKeyMaterial
  • DeleteImportedKeyMaterial
Synopsis

Creating a Request

data GetParametersForImport Source #

See: newGetParametersForImport smart constructor.

Constructors

GetParametersForImport' 

Fields

  • keyId :: Text

    The identifier of the symmetric KMS key into which you will import key material. The Origin of the KMS key must be EXTERNAL.

    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.

  • wrappingAlgorithm :: AlgorithmSpec

    The algorithm you will use to encrypt the key material before importing it with ImportKeyMaterial. For more information, see Encrypt the Key Material in the Key Management Service Developer Guide.

  • wrappingKeySpec :: WrappingKeySpec

    The type of wrapping key (public key) to return in the response. Only 2048-bit RSA public keys are supported.

Instances

Instances details
Eq GetParametersForImport Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

Read GetParametersForImport Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

Show GetParametersForImport Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

Generic GetParametersForImport Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

Associated Types

type Rep GetParametersForImport :: Type -> Type #

NFData GetParametersForImport Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

Methods

rnf :: GetParametersForImport -> () #

Hashable GetParametersForImport Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

ToJSON GetParametersForImport Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

AWSRequest GetParametersForImport Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

Associated Types

type AWSResponse GetParametersForImport #

ToHeaders GetParametersForImport Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

ToPath GetParametersForImport Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

ToQuery GetParametersForImport Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

type Rep GetParametersForImport Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

type Rep GetParametersForImport = D1 ('MetaData "GetParametersForImport" "Amazonka.KMS.GetParametersForImport" "libZSservicesZSamazonka-kmsZSamazonka-kms" 'False) (C1 ('MetaCons "GetParametersForImport'" 'PrefixI 'True) (S1 ('MetaSel ('Just "keyId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "wrappingAlgorithm") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AlgorithmSpec) :*: S1 ('MetaSel ('Just "wrappingKeySpec") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 WrappingKeySpec))))
type AWSResponse GetParametersForImport Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

newGetParametersForImport Source #

Create a value of GetParametersForImport with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:keyId:GetParametersForImport', getParametersForImport_keyId - The identifier of the symmetric KMS key into which you will import key material. The Origin of the KMS key must be EXTERNAL.

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.

$sel:wrappingAlgorithm:GetParametersForImport', getParametersForImport_wrappingAlgorithm - The algorithm you will use to encrypt the key material before importing it with ImportKeyMaterial. For more information, see Encrypt the Key Material in the Key Management Service Developer Guide.

$sel:wrappingKeySpec:GetParametersForImport', getParametersForImport_wrappingKeySpec - The type of wrapping key (public key) to return in the response. Only 2048-bit RSA public keys are supported.

Request Lenses

getParametersForImport_keyId :: Lens' GetParametersForImport Text Source #

The identifier of the symmetric KMS key into which you will import key material. The Origin of the KMS key must be EXTERNAL.

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.

getParametersForImport_wrappingAlgorithm :: Lens' GetParametersForImport AlgorithmSpec Source #

The algorithm you will use to encrypt the key material before importing it with ImportKeyMaterial. For more information, see Encrypt the Key Material in the Key Management Service Developer Guide.

getParametersForImport_wrappingKeySpec :: Lens' GetParametersForImport WrappingKeySpec Source #

The type of wrapping key (public key) to return in the response. Only 2048-bit RSA public keys are supported.

Destructuring the Response

data GetParametersForImportResponse Source #

See: newGetParametersForImportResponse smart constructor.

Constructors

GetParametersForImportResponse' 

Fields

  • keyId :: Maybe Text

    The Amazon Resource Name (key ARN) of the KMS key to use in a subsequent ImportKeyMaterial request. This is the same KMS key specified in the GetParametersForImport request.

  • publicKey :: Maybe (Sensitive Base64)

    The public key to use to encrypt the key material before importing it with ImportKeyMaterial.

  • parametersValidTo :: Maybe POSIX

    The time at which the import token and public key are no longer valid. After this time, you cannot use them to make an ImportKeyMaterial request and you must send another GetParametersForImport request to get new ones.

  • importToken :: Maybe Base64

    The import token to send in a subsequent ImportKeyMaterial request.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Eq GetParametersForImportResponse Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

Show GetParametersForImportResponse Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

Generic GetParametersForImportResponse Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

Associated Types

type Rep GetParametersForImportResponse :: Type -> Type #

NFData GetParametersForImportResponse Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

type Rep GetParametersForImportResponse Source # 
Instance details

Defined in Amazonka.KMS.GetParametersForImport

type Rep GetParametersForImportResponse = D1 ('MetaData "GetParametersForImportResponse" "Amazonka.KMS.GetParametersForImport" "libZSservicesZSamazonka-kmsZSamazonka-kms" 'False) (C1 ('MetaCons "GetParametersForImportResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "keyId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "publicKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (Sensitive Base64)))) :*: (S1 ('MetaSel ('Just "parametersValidTo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX)) :*: (S1 ('MetaSel ('Just "importToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Base64)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))))

newGetParametersForImportResponse Source #

Create a value of GetParametersForImportResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:keyId:GetParametersForImport', getParametersForImportResponse_keyId - The Amazon Resource Name (key ARN) of the KMS key to use in a subsequent ImportKeyMaterial request. This is the same KMS key specified in the GetParametersForImport request.

$sel:publicKey:GetParametersForImportResponse', getParametersForImportResponse_publicKey - The public key to use to encrypt the key material before importing it with ImportKeyMaterial.-- -- Note: This Lens automatically encodes and decodes Base64 data. -- The underlying isomorphism will encode to Base64 representation during -- serialisation, and decode from Base64 representation during deserialisation. -- This Lens accepts and returns only raw unencoded data.

$sel:parametersValidTo:GetParametersForImportResponse', getParametersForImportResponse_parametersValidTo - The time at which the import token and public key are no longer valid. After this time, you cannot use them to make an ImportKeyMaterial request and you must send another GetParametersForImport request to get new ones.

$sel:importToken:GetParametersForImportResponse', getParametersForImportResponse_importToken - The import token to send in a subsequent ImportKeyMaterial request.-- -- Note: This Lens automatically encodes and decodes Base64 data. -- The underlying isomorphism will encode to Base64 representation during -- serialisation, and decode from Base64 representation during deserialisation. -- This Lens accepts and returns only raw unencoded data.

$sel:httpStatus:GetParametersForImportResponse', getParametersForImportResponse_httpStatus - The response's http status code.

Response Lenses

getParametersForImportResponse_keyId :: Lens' GetParametersForImportResponse (Maybe Text) Source #

The Amazon Resource Name (key ARN) of the KMS key to use in a subsequent ImportKeyMaterial request. This is the same KMS key specified in the GetParametersForImport request.

getParametersForImportResponse_publicKey :: Lens' GetParametersForImportResponse (Maybe ByteString) Source #

The public key to use to encrypt the key material before importing it with ImportKeyMaterial.-- -- Note: This Lens automatically encodes and decodes Base64 data. -- The underlying isomorphism will encode to Base64 representation during -- serialisation, and decode from Base64 representation during deserialisation. -- This Lens accepts and returns only raw unencoded data.

getParametersForImportResponse_parametersValidTo :: Lens' GetParametersForImportResponse (Maybe UTCTime) Source #

The time at which the import token and public key are no longer valid. After this time, you cannot use them to make an ImportKeyMaterial request and you must send another GetParametersForImport request to get new ones.

getParametersForImportResponse_importToken :: Lens' GetParametersForImportResponse (Maybe ByteString) Source #

The import token to send in a subsequent ImportKeyMaterial request.-- -- Note: This Lens automatically encodes and decodes Base64 data. -- The underlying isomorphism will encode to Base64 representation during -- serialisation, and decode from Base64 representation during deserialisation. -- This Lens accepts and returns only raw unencoded data.