AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

ImportKeyMaterialInput

import "github.com/aws/aws-sdk-go/service/kms"

type ImportKeyMaterialInput struct { EncryptedKeyMaterial []byte `min:"1" type:"blob" required:"true"` ExpirationModel *string `type:"string" enum:"ExpirationModelType"` ImportToken []byte `min:"1" type:"blob" required:"true"` KeyId *string `min:"1" type:"string" required:"true"` ValidTo *time.Time `type:"timestamp"` }

EncryptedKeyMaterial

Type: []byte

The encrypted key material to import. It must be encrypted with the public key that you received in the response to a previous GetParametersForImport request, using the wrapping algorithm that you specified in that request.

EncryptedKeyMaterial is automatically base64 encoded/decoded by the SDK.

EncryptedKeyMaterial is a required field

ExpirationModel

Type: *string

Specifies whether the key material expires. The default is KEY_MATERIAL_EXPIRES, in which case you must include the ValidTo parameter. When this parameter is set to KEY_MATERIAL_DOES_NOT_EXPIRE, you must omit the ValidTo parameter.

ImportToken

Type: []byte

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.

ImportToken is automatically base64 encoded/decoded by the SDK.

ImportToken is a required field

KeyId

Type: *string

The identifier of the CMK to import the key material into. 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.

KeyId is a required field

ValidTo

Type: *time.Time

The time at which the imported key material expires. When the key material expires, AWS KMS deletes the key material and the CMK becomes unusable. You must omit this parameter when the ExpirationModel parameter is set to KEY_MATERIAL_DOES_NOT_EXPIRE. Otherwise it is required.

Method

GoString

func (s ImportKeyMaterialInput) GoString() string

GoString returns the string representation

SetEncryptedKeyMaterial

func (s *ImportKeyMaterialInput) SetEncryptedKeyMaterial(v []byte) *ImportKeyMaterialInput

SetEncryptedKeyMaterial sets the EncryptedKeyMaterial field's value.

SetExpirationModel

func (s *ImportKeyMaterialInput) SetExpirationModel(v string) *ImportKeyMaterialInput

SetExpirationModel sets the ExpirationModel field's value.

SetImportToken

func (s *ImportKeyMaterialInput) SetImportToken(v []byte) *ImportKeyMaterialInput

SetImportToken sets the ImportToken field's value.

SetKeyId

func (s *ImportKeyMaterialInput) SetKeyId(v string) *ImportKeyMaterialInput

SetKeyId sets the KeyId field's value.

SetValidTo

func (s *ImportKeyMaterialInput) SetValidTo(v time.Time) *ImportKeyMaterialInput

SetValidTo sets the ValidTo field's value.

String

func (s ImportKeyMaterialInput) String() string

String returns the string representation

Validate

func (s *ImportKeyMaterialInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

On this page: