AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Container for the parameters to the GetParametersForImport operation. 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.

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, after which they cannot be used for a subsequent ImportKeyMaterial request. To retrieve new ones, send another GetParametersForImport request.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.KeyManagementService.AmazonKeyManagementServiceRequest
      Amazon.KeyManagementService.Model.GetParametersForImportRequest

Namespace: Amazon.KeyManagementService.Model
Assembly: AWSSDK.KeyManagementService.dll
Version: 3.x.y.z

Syntax

C#
public class GetParametersForImportRequest : AmazonKeyManagementServiceRequest
         IAmazonWebServiceRequest

The GetParametersForImportRequest type exposes the following members

Constructors

Properties

NameTypeDescription
Public Property KeyId System.String

Gets and sets the property KeyId.

The identifier of the CMK into which you will import key material. The CMK's Origin must be EXTERNAL.

A valid identifier is the unique key ID or the Amazon Resource Name (ARN) of the CMK. Examples:

  • Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab

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

Public Property WrappingAlgorithm Amazon.KeyManagementService.AlgorithmSpec

Gets and sets the property 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 AWS Key Management Service Developer Guide.

Public Property WrappingKeySpec Amazon.KeyManagementService.WrappingKeySpec

Gets and sets the property WrappingKeySpec.

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

Examples

The following example retrieves the public key and import token for the specified CMK.

To retrieve the public key and import token for a customer master key (CMK)


var response = client.GetParametersForImport(new GetParametersForImportRequest 
{
    KeyId = "1234abcd-12ab-34cd-56ef-1234567890ab", // The identifier of the CMK for which to retrieve the public key and import token. You can use the key ID or the Amazon Resource Name (ARN) of the CMK.
    WrappingAlgorithm = "RSAES_OAEP_SHA_1", // The algorithm that you will use to encrypt the key material before importing it.
    WrappingKeySpec = "RSA_2048" // The type of wrapping key (public key) to return in the response.
});

MemoryStream importToken = response.ImportToken; // The import token to send with a subsequent ImportKeyMaterial request.
string keyId = response.KeyId; // The ARN of the CMK for which you are retrieving the public key and import token. This is the same CMK specified in the request.
DateTime parametersValidTo = response.ParametersValidTo; // The time at which the import token and public key are no longer valid.
MemoryStream publicKey = response.PublicKey; // The public key to use to encrypt the key material before importing it.

            

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms