| Copyright | (c) 2013-2018 Brendan Hay |
|---|---|
| License | Mozilla Public License, v. 2.0. |
| Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
| Stability | auto-generated |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | None |
| Language | Haskell2010 |
Network.AWS.KMS.GetParametersForImport
Description
Returns the items you need in order to import key material into AWS KMS from your existing key management infrastructure. For more information about importing key material into AWS KMS, see Importing Key Material in the AWS Key Management Service Developer Guide .
You must specify the key ID of the customer master key (CMK) into which you will import key material. This CMK'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 a CMK in a different AWS account.
This operation returns a public key and an import token. Use the public key to encrypt the key material. Store the import token to send with a subsequent ImportKeyMaterial request. The public key and import token from the same response must be used together. These items are valid for 24 hours. When they expire, they cannot be used for a subsequent ImportKeyMaterial request. To get new ones, send another GetParametersForImport request.
Synopsis
- getParametersForImport :: Text -> AlgorithmSpec -> WrappingKeySpec -> GetParametersForImport
- data GetParametersForImport
- gpfiKeyId :: Lens' GetParametersForImport Text
- gpfiWrappingAlgorithm :: Lens' GetParametersForImport AlgorithmSpec
- gpfiWrappingKeySpec :: Lens' GetParametersForImport WrappingKeySpec
- getParametersForImportResponse :: Int -> GetParametersForImportResponse
- data GetParametersForImportResponse
- gpfirsKeyId :: Lens' GetParametersForImportResponse (Maybe Text)
- gpfirsPublicKey :: Lens' GetParametersForImportResponse (Maybe ByteString)
- gpfirsParametersValidTo :: Lens' GetParametersForImportResponse (Maybe UTCTime)
- gpfirsImportToken :: Lens' GetParametersForImportResponse (Maybe ByteString)
- gpfirsResponseStatus :: Lens' GetParametersForImportResponse Int
Creating a Request
getParametersForImport Source #
Arguments
| :: Text | |
| -> AlgorithmSpec | |
| -> WrappingKeySpec | |
| -> GetParametersForImport |
Creates a value of GetParametersForImport with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
gpfiKeyId- The identifier of the CMK into which you will import key material. The CMK'sOriginmust beEXTERNAL. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. For example: * Key ID:1234abcd-12ab-34cd-56ef-1234567890ab* Key ARN:arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890abTo get the key ID and key ARN for a CMK, useListKeysorDescribeKey.gpfiWrappingAlgorithm- The algorithm you will use to encrypt the key material before importing it withImportKeyMaterial. For more information, see Encrypt the Key Material in the AWS Key Management Service Developer Guide .gpfiWrappingKeySpec- The type of wrapping key (public key) to return in the response. Only 2048-bit RSA public keys are supported.
data GetParametersForImport Source #
See: getParametersForImport smart constructor.
Instances
Request Lenses
gpfiKeyId :: Lens' GetParametersForImport Text Source #
The identifier of the CMK into which you will import key material. The CMK's Origin must be EXTERNAL . Specify the key ID or the Amazon Resource Name (ARN) of the CMK. 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 CMK, use ListKeys or DescribeKey .
gpfiWrappingAlgorithm :: 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 AWS Key Management Service Developer Guide .
gpfiWrappingKeySpec :: 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
getParametersForImportResponse Source #
Arguments
| :: Int | |
| -> GetParametersForImportResponse |
Creates a value of GetParametersForImportResponse with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
gpfirsKeyId- The identifier of the CMK to use in a subsequentImportKeyMaterialrequest. This is the same CMK specified in theGetParametersForImportrequest.gpfirsPublicKey- The public key to use to encrypt the key material before importing it withImportKeyMaterial.-- Note: ThisLensautomatically encodes and decodes Base64 data. The underlying isomorphism will encode to Base64 representation during serialisation, and decode from Base64 representation during deserialisation. ThisLensaccepts and returns only raw unencoded data.gpfirsParametersValidTo- The time at which the import token and public key are no longer valid. After this time, you cannot use them to make anImportKeyMaterialrequest and you must send anotherGetParametersForImportrequest to get new ones.gpfirsImportToken- The import token to send in a subsequentImportKeyMaterialrequest.-- Note: ThisLensautomatically encodes and decodes Base64 data. The underlying isomorphism will encode to Base64 representation during serialisation, and decode from Base64 representation during deserialisation. ThisLensaccepts and returns only raw unencoded data.gpfirsResponseStatus- -- | The response status code.
data GetParametersForImportResponse Source #
See: getParametersForImportResponse smart constructor.
Instances
Response Lenses
gpfirsKeyId :: Lens' GetParametersForImportResponse (Maybe Text) Source #
The identifier of the CMK to use in a subsequent ImportKeyMaterial request. This is the same CMK specified in the GetParametersForImport request.
gpfirsPublicKey :: 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.
gpfirsParametersValidTo :: 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.
gpfirsImportToken :: 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.
gpfirsResponseStatus :: Lens' GetParametersForImportResponse Int Source #
- - | The response status code.