Documentation ¶
Overview ¶
Package kms provides a client for AWS Key Management Service.
Index ¶
- Constants
- type AliasListEntry
- type CancelKeyDeletionInput
- type CancelKeyDeletionOutput
- type CreateAliasInput
- type CreateAliasOutput
- type CreateGrantInput
- type CreateGrantOutput
- type CreateKeyInput
- type CreateKeyOutput
- type DecryptInput
- type DecryptOutput
- type DeleteAliasInput
- type DeleteAliasOutput
- type DescribeKeyInput
- type DescribeKeyOutput
- type DisableKeyInput
- type DisableKeyOutput
- type DisableKeyRotationInput
- type DisableKeyRotationOutput
- type EnableKeyInput
- type EnableKeyOutput
- type EnableKeyRotationInput
- type EnableKeyRotationOutput
- type EncryptInput
- type EncryptOutput
- type GenerateDataKeyInput
- type GenerateDataKeyOutput
- type GenerateDataKeyWithoutPlaintextInput
- type GenerateDataKeyWithoutPlaintextOutput
- type GenerateRandomInput
- type GenerateRandomOutput
- type GetKeyPolicyInput
- type GetKeyPolicyOutput
- type GetKeyRotationStatusInput
- type GetKeyRotationStatusOutput
- type GrantConstraints
- type GrantListEntry
- type KMS
- func (c *KMS) CancelKeyDeletion(input *CancelKeyDeletionInput) (*CancelKeyDeletionOutput, error)
- func (c *KMS) CancelKeyDeletionRequest(input *CancelKeyDeletionInput) (req *request.Request, output *CancelKeyDeletionOutput)
- func (c *KMS) CreateAlias(input *CreateAliasInput) (*CreateAliasOutput, error)
- func (c *KMS) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, output *CreateAliasOutput)
- func (c *KMS) CreateGrant(input *CreateGrantInput) (*CreateGrantOutput, error)
- func (c *KMS) CreateGrantRequest(input *CreateGrantInput) (req *request.Request, output *CreateGrantOutput)
- func (c *KMS) CreateKey(input *CreateKeyInput) (*CreateKeyOutput, error)
- func (c *KMS) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, output *CreateKeyOutput)
- func (c *KMS) Decrypt(input *DecryptInput) (*DecryptOutput, error)
- func (c *KMS) DecryptRequest(input *DecryptInput) (req *request.Request, output *DecryptOutput)
- func (c *KMS) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error)
- func (c *KMS) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, output *DeleteAliasOutput)
- func (c *KMS) DescribeKey(input *DescribeKeyInput) (*DescribeKeyOutput, error)
- func (c *KMS) DescribeKeyRequest(input *DescribeKeyInput) (req *request.Request, output *DescribeKeyOutput)
- func (c *KMS) DisableKey(input *DisableKeyInput) (*DisableKeyOutput, error)
- func (c *KMS) DisableKeyRequest(input *DisableKeyInput) (req *request.Request, output *DisableKeyOutput)
- func (c *KMS) DisableKeyRotation(input *DisableKeyRotationInput) (*DisableKeyRotationOutput, error)
- func (c *KMS) DisableKeyRotationRequest(input *DisableKeyRotationInput) (req *request.Request, output *DisableKeyRotationOutput)
- func (c *KMS) EnableKey(input *EnableKeyInput) (*EnableKeyOutput, error)
- func (c *KMS) EnableKeyRequest(input *EnableKeyInput) (req *request.Request, output *EnableKeyOutput)
- func (c *KMS) EnableKeyRotation(input *EnableKeyRotationInput) (*EnableKeyRotationOutput, error)
- func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) (req *request.Request, output *EnableKeyRotationOutput)
- func (c *KMS) Encrypt(input *EncryptInput) (*EncryptOutput, error)
- func (c *KMS) EncryptRequest(input *EncryptInput) (req *request.Request, output *EncryptOutput)
- func (c *KMS) GenerateDataKey(input *GenerateDataKeyInput) (*GenerateDataKeyOutput, error)
- func (c *KMS) GenerateDataKeyRequest(input *GenerateDataKeyInput) (req *request.Request, output *GenerateDataKeyOutput)
- func (c *KMS) GenerateDataKeyWithoutPlaintext(input *GenerateDataKeyWithoutPlaintextInput) (*GenerateDataKeyWithoutPlaintextOutput, error)
- func (c *KMS) GenerateDataKeyWithoutPlaintextRequest(input *GenerateDataKeyWithoutPlaintextInput) (req *request.Request, output *GenerateDataKeyWithoutPlaintextOutput)
- func (c *KMS) GenerateRandom(input *GenerateRandomInput) (*GenerateRandomOutput, error)
- func (c *KMS) GenerateRandomRequest(input *GenerateRandomInput) (req *request.Request, output *GenerateRandomOutput)
- func (c *KMS) GetKeyPolicy(input *GetKeyPolicyInput) (*GetKeyPolicyOutput, error)
- func (c *KMS) GetKeyPolicyRequest(input *GetKeyPolicyInput) (req *request.Request, output *GetKeyPolicyOutput)
- func (c *KMS) GetKeyRotationStatus(input *GetKeyRotationStatusInput) (*GetKeyRotationStatusOutput, error)
- func (c *KMS) GetKeyRotationStatusRequest(input *GetKeyRotationStatusInput) (req *request.Request, output *GetKeyRotationStatusOutput)
- func (c *KMS) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error)
- func (c *KMS) ListAliasesPages(input *ListAliasesInput, ...) error
- func (c *KMS) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, output *ListAliasesOutput)
- func (c *KMS) ListGrants(input *ListGrantsInput) (*ListGrantsResponse, error)
- func (c *KMS) ListGrantsPages(input *ListGrantsInput, ...) error
- func (c *KMS) ListGrantsRequest(input *ListGrantsInput) (req *request.Request, output *ListGrantsResponse)
- func (c *KMS) ListKeyPolicies(input *ListKeyPoliciesInput) (*ListKeyPoliciesOutput, error)
- func (c *KMS) ListKeyPoliciesPages(input *ListKeyPoliciesInput, ...) error
- func (c *KMS) ListKeyPoliciesRequest(input *ListKeyPoliciesInput) (req *request.Request, output *ListKeyPoliciesOutput)
- func (c *KMS) ListKeys(input *ListKeysInput) (*ListKeysOutput, error)
- func (c *KMS) ListKeysPages(input *ListKeysInput, ...) error
- func (c *KMS) ListKeysRequest(input *ListKeysInput) (req *request.Request, output *ListKeysOutput)
- func (c *KMS) ListRetirableGrants(input *ListRetirableGrantsInput) (*ListGrantsResponse, error)
- func (c *KMS) ListRetirableGrantsRequest(input *ListRetirableGrantsInput) (req *request.Request, output *ListGrantsResponse)
- func (c *KMS) PutKeyPolicy(input *PutKeyPolicyInput) (*PutKeyPolicyOutput, error)
- func (c *KMS) PutKeyPolicyRequest(input *PutKeyPolicyInput) (req *request.Request, output *PutKeyPolicyOutput)
- func (c *KMS) ReEncrypt(input *ReEncryptInput) (*ReEncryptOutput, error)
- func (c *KMS) ReEncryptRequest(input *ReEncryptInput) (req *request.Request, output *ReEncryptOutput)
- func (c *KMS) RetireGrant(input *RetireGrantInput) (*RetireGrantOutput, error)
- func (c *KMS) RetireGrantRequest(input *RetireGrantInput) (req *request.Request, output *RetireGrantOutput)
- func (c *KMS) RevokeGrant(input *RevokeGrantInput) (*RevokeGrantOutput, error)
- func (c *KMS) RevokeGrantRequest(input *RevokeGrantInput) (req *request.Request, output *RevokeGrantOutput)
- func (c *KMS) ScheduleKeyDeletion(input *ScheduleKeyDeletionInput) (*ScheduleKeyDeletionOutput, error)
- func (c *KMS) ScheduleKeyDeletionRequest(input *ScheduleKeyDeletionInput) (req *request.Request, output *ScheduleKeyDeletionOutput)
- func (c *KMS) UpdateAlias(input *UpdateAliasInput) (*UpdateAliasOutput, error)
- func (c *KMS) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, output *UpdateAliasOutput)
- func (c *KMS) UpdateKeyDescription(input *UpdateKeyDescriptionInput) (*UpdateKeyDescriptionOutput, error)
- func (c *KMS) UpdateKeyDescriptionRequest(input *UpdateKeyDescriptionInput) (req *request.Request, output *UpdateKeyDescriptionOutput)
- type KeyListEntry
- type KeyMetadata
- type ListAliasesInput
- type ListAliasesOutput
- type ListGrantsInput
- type ListGrantsResponse
- type ListKeyPoliciesInput
- type ListKeyPoliciesOutput
- type ListKeysInput
- type ListKeysOutput
- type ListRetirableGrantsInput
- type PutKeyPolicyInput
- type PutKeyPolicyOutput
- type ReEncryptInput
- type ReEncryptOutput
- type RetireGrantInput
- type RetireGrantOutput
- type RevokeGrantInput
- type RevokeGrantOutput
- type ScheduleKeyDeletionInput
- type ScheduleKeyDeletionOutput
- type UpdateAliasInput
- type UpdateAliasOutput
- type UpdateKeyDescriptionInput
- type UpdateKeyDescriptionOutput
Examples ¶
- KMS.CancelKeyDeletion
- KMS.CreateAlias
- KMS.CreateGrant
- KMS.CreateKey
- KMS.Decrypt
- KMS.DeleteAlias
- KMS.DescribeKey
- KMS.DisableKey
- KMS.DisableKeyRotation
- KMS.EnableKey
- KMS.EnableKeyRotation
- KMS.Encrypt
- KMS.GenerateDataKey
- KMS.GenerateDataKeyWithoutPlaintext
- KMS.GenerateRandom
- KMS.GetKeyPolicy
- KMS.GetKeyRotationStatus
- KMS.ListAliases
- KMS.ListGrants
- KMS.ListKeyPolicies
- KMS.ListKeys
- KMS.ListRetirableGrants
- KMS.PutKeyPolicy
- KMS.ReEncrypt
- KMS.RetireGrant
- KMS.RevokeGrant
- KMS.ScheduleKeyDeletion
- KMS.UpdateAlias
- KMS.UpdateKeyDescription
Constants ¶
const ( // @enum DataKeySpec DataKeySpecAes256 = "AES_256" // @enum DataKeySpec DataKeySpecAes128 = "AES_128" )
const ( // @enum GrantOperation GrantOperationDecrypt = "Decrypt" // @enum GrantOperation GrantOperationEncrypt = "Encrypt" // @enum GrantOperation GrantOperationGenerateDataKey = "GenerateDataKey" // @enum GrantOperation GrantOperationGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext" // @enum GrantOperation GrantOperationReEncryptFrom = "ReEncryptFrom" // @enum GrantOperation GrantOperationReEncryptTo = "ReEncryptTo" // @enum GrantOperation GrantOperationCreateGrant = "CreateGrant" // @enum GrantOperation GrantOperationRetireGrant = "RetireGrant" // @enum GrantOperation GrantOperationDescribeKey = "DescribeKey" )
const ( // @enum KeyState KeyStateEnabled = "Enabled" // @enum KeyState KeyStateDisabled = "Disabled" // @enum KeyState KeyStatePendingDeletion = "PendingDeletion" )
const (
// @enum KeyUsageType
KeyUsageTypeEncryptDecrypt = "ENCRYPT_DECRYPT"
)
const ServiceName = "kms"
A ServiceName is the name of the service the client will make API calls to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AliasListEntry ¶
type AliasListEntry struct { // String that contains the key ARN. AliasArn *string `min:"20" type:"string"` // String that contains the alias. AliasName *string `min:"1" type:"string"` // String that contains the key identifier pointed to by the alias. TargetKeyId *string `min:"1" type:"string"` // contains filtered or unexported fields }
Contains information about an alias.
func (AliasListEntry) GoString ¶
func (s AliasListEntry) GoString() string
GoString returns the string representation
func (AliasListEntry) String ¶
func (s AliasListEntry) String() string
String returns the string representation
type CancelKeyDeletionInput ¶
type CancelKeyDeletionInput struct { // The unique identifier for the customer master key (CMK) for which to cancel // deletion. // // To specify this value, use 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-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To obtain the unique key ID and key ARN for a given CMK, use ListKeys // or DescribeKey. KeyId *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (CancelKeyDeletionInput) GoString ¶
func (s CancelKeyDeletionInput) GoString() string
GoString returns the string representation
func (CancelKeyDeletionInput) String ¶
func (s CancelKeyDeletionInput) String() string
String returns the string representation
func (*CancelKeyDeletionInput) Validate ¶
func (s *CancelKeyDeletionInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type CancelKeyDeletionOutput ¶
type CancelKeyDeletionOutput struct { // The unique identifier of the master key for which deletion is canceled. KeyId *string `min:"1" type:"string"` // contains filtered or unexported fields }
func (CancelKeyDeletionOutput) GoString ¶
func (s CancelKeyDeletionOutput) GoString() string
GoString returns the string representation
func (CancelKeyDeletionOutput) String ¶
func (s CancelKeyDeletionOutput) String() string
String returns the string representation
type CreateAliasInput ¶
type CreateAliasInput struct { // String that contains the display name. The name must start with the word // "alias" followed by a forward slash (alias/). Aliases that begin with "alias/AWS" // are reserved. AliasName *string `min:"1" type:"string" required:"true"` // An identifier of the key for which you are creating the alias. This value // cannot be another alias but can be a globally unique identifier or a fully // specified ARN to a key. // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 TargetKeyId *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (CreateAliasInput) GoString ¶
func (s CreateAliasInput) GoString() string
GoString returns the string representation
func (CreateAliasInput) String ¶
func (s CreateAliasInput) String() string
String returns the string representation
func (*CreateAliasInput) Validate ¶
func (s *CreateAliasInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type CreateAliasOutput ¶
type CreateAliasOutput struct {
// contains filtered or unexported fields
}
func (CreateAliasOutput) GoString ¶
func (s CreateAliasOutput) GoString() string
GoString returns the string representation
func (CreateAliasOutput) String ¶
func (s CreateAliasOutput) String() string
String returns the string representation
type CreateGrantInput ¶
type CreateGrantInput struct { // The conditions under which the operations permitted by the grant are allowed. // // You can use this value to allow the operations permitted by the grant only // when a specified encryption context is present. For more information, see // Encryption Context (http://docs.aws.amazon.com/kms/latest/developerguide/encrypt-context.html) // in the AWS Key Management Service Developer Guide. Constraints *GrantConstraints `type:"structure"` // A list of grant tokens. // // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) // in the AWS Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // The principal that is given permission to perform the operations that the // grant permits. // // To specify the principal, use the Amazon Resource Name (ARN) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // of an AWS principal. Valid AWS principals include AWS accounts (root), IAM // users, federated users, and assumed role users. For examples of the ARN syntax // to use for specifying a principal, see AWS Identity and Access Management // (IAM) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam) // in the Example ARNs section of the AWS General Reference. GranteePrincipal *string `min:"1" type:"string" required:"true"` // The unique identifier for the customer master key (CMK) that the grant applies // to. // // To specify this value, use the globally unique key ID or the Amazon Resource // Name (ARN) of the key. Examples: // // Globally unique key ID: 12345678-1234-1234-1234-123456789012 // // Key ARN: arn:aws:kms:us-west-2:123456789012:key/12345678-1234-1234-1234-123456789012 KeyId *string `min:"1" type:"string" required:"true"` // A friendly name for identifying the grant. Use this value to prevent unintended // creation of duplicate grants when retrying this request. // // When this value is absent, all CreateGrant requests result in a new grant // with a unique GrantId even if all the supplied parameters are identical. // This can result in unintended duplicates when you retry the CreateGrant request. // // When this value is present, you can retry a CreateGrant request with identical // parameters; if the grant already exists, the original GrantId is returned // without creating a new grant. Note that the returned grant token is unique // with every CreateGrant request, even when a duplicate GrantId is returned. // All grant tokens obtained in this way can be used interchangeably. Name *string `min:"1" type:"string"` // A list of operations that the grant permits. The list can contain any combination // of one or more of the following values: // // Decrypt // // Encrypt // // GenerateDataKey // // GenerateDataKeyWithoutPlaintext // // ReEncryptFrom (http://docs.aws.amazon.com/kms/latest/APIReference/API_ReEncrypt.html) // // ReEncryptTo (http://docs.aws.amazon.com/kms/latest/APIReference/API_ReEncrypt.html) // // CreateGrant // // RetireGrant // // DescribeKey Operations []*string `type:"list"` // The principal that is given permission to retire the grant by using RetireGrant // operation. // // To specify the principal, use the Amazon Resource Name (ARN) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // of an AWS principal. Valid AWS principals include AWS accounts (root), IAM // users, federated users, and assumed role users. For examples of the ARN syntax // to use for specifying a principal, see AWS Identity and Access Management // (IAM) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam) // in the Example ARNs section of the AWS General Reference. RetiringPrincipal *string `min:"1" type:"string"` // contains filtered or unexported fields }
func (CreateGrantInput) GoString ¶
func (s CreateGrantInput) GoString() string
GoString returns the string representation
func (CreateGrantInput) String ¶
func (s CreateGrantInput) String() string
String returns the string representation
func (*CreateGrantInput) Validate ¶
func (s *CreateGrantInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type CreateGrantOutput ¶
type CreateGrantOutput struct { // The unique identifier for the grant. // // You can use the GrantId in a subsequent RetireGrant or RevokeGrant operation. GrantId *string `min:"1" type:"string"` // The grant token. // // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) // in the AWS Key Management Service Developer Guide. GrantToken *string `min:"1" type:"string"` // contains filtered or unexported fields }
func (CreateGrantOutput) GoString ¶
func (s CreateGrantOutput) GoString() string
GoString returns the string representation
func (CreateGrantOutput) String ¶
func (s CreateGrantOutput) String() string
String returns the string representation
type CreateKeyInput ¶
type CreateKeyInput struct { // A flag to indicate whether to bypass the key policy lockout safety check. // // Setting this value to true increases the likelihood that the CMK becomes // unmanageable. Do not set this value to true indiscriminately. // // For more information, refer to the scenario in the Default Key Policy (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) // section in the AWS Key Management Service Developer Guide. // // Use this parameter only when you include a policy in the request and you // intend to prevent the principal making the request from making a subsequent // PutKeyPolicy request on the CMK. // // The default value is false. BypassPolicyLockoutSafetyCheck *bool `type:"boolean"` // A description of the CMK. // // Use a description that helps you decide whether the CMK is appropriate for // a task. Description *string `type:"string"` // The intended use of the CMK. // // You can use CMKs only for symmetric encryption and decryption. KeyUsage *string `type:"string" enum:"KeyUsageType"` // The key policy to attach to the CMK. // // If you specify a key policy, it must meet the following criteria: // // It must allow the principal making the CreateKey request to make a subsequent // PutKeyPolicy request on the CMK. This reduces the likelihood that the CMK // becomes unmanageable. For more information, refer to the scenario in the // Default Key Policy (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) // section in the AWS Key Management Service Developer Guide. // // The principal(s) specified in the key policy must exist and be visible // to AWS KMS. When you create a new AWS principal (for example, an IAM user // or role), you might need to enforce a delay before specifying the new principal // in a key policy because the new principal might not immediately be visible // to AWS KMS. For more information, see Changes that I make are not always // immediately visible (http://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency) // in the IAM User Guide. // // If you do not specify a policy, AWS KMS attaches a default key policy // to the CMK. For more information, see Default Key Policy (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) // in the AWS Key Management Service Developer Guide. // // The policy size limit is 32 KiB (32768 bytes). Policy *string `min:"1" type:"string"` // contains filtered or unexported fields }
func (CreateKeyInput) GoString ¶
func (s CreateKeyInput) GoString() string
GoString returns the string representation
func (CreateKeyInput) String ¶
func (s CreateKeyInput) String() string
String returns the string representation
func (*CreateKeyInput) Validate ¶
func (s *CreateKeyInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type CreateKeyOutput ¶
type CreateKeyOutput struct { // Metadata associated with the CMK. KeyMetadata *KeyMetadata `type:"structure"` // contains filtered or unexported fields }
func (CreateKeyOutput) GoString ¶
func (s CreateKeyOutput) GoString() string
GoString returns the string representation
func (CreateKeyOutput) String ¶
func (s CreateKeyOutput) String() string
String returns the string representation
type DecryptInput ¶
type DecryptInput struct { // Ciphertext to be decrypted. The blob includes metadata. // // CiphertextBlob is automatically base64 encoded/decoded by the SDK. CiphertextBlob []byte `min:"1" type:"blob" required:"true"` // The encryption context. If this was specified in the Encrypt function, it // must be specified here or the decryption operation will fail. For more information, // see Encryption Context (http://docs.aws.amazon.com/kms/latest/developerguide/encrypt-context.html). EncryptionContext map[string]*string `type:"map"` // A list of grant tokens. // // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) // in the AWS Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // contains filtered or unexported fields }
func (DecryptInput) GoString ¶
func (s DecryptInput) GoString() string
GoString returns the string representation
func (DecryptInput) String ¶
func (s DecryptInput) String() string
String returns the string representation
func (*DecryptInput) Validate ¶
func (s *DecryptInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type DecryptOutput ¶
type DecryptOutput struct { // ARN of the key used to perform the decryption. This value is returned if // no errors are encountered during the operation. KeyId *string `min:"1" type:"string"` // Decrypted plaintext data. This value may not be returned if the customer // master key is not available or if you didn't have permission to use it. // // Plaintext is automatically base64 encoded/decoded by the SDK. Plaintext []byte `min:"1" type:"blob"` // contains filtered or unexported fields }
func (DecryptOutput) GoString ¶
func (s DecryptOutput) GoString() string
GoString returns the string representation
func (DecryptOutput) String ¶
func (s DecryptOutput) String() string
String returns the string representation
type DeleteAliasInput ¶
type DeleteAliasInput struct { // The alias to be deleted. The name must start with the word "alias" followed // by a forward slash (alias/). Aliases that begin with "alias/AWS" are reserved. AliasName *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (DeleteAliasInput) GoString ¶
func (s DeleteAliasInput) GoString() string
GoString returns the string representation
func (DeleteAliasInput) String ¶
func (s DeleteAliasInput) String() string
String returns the string representation
func (*DeleteAliasInput) Validate ¶
func (s *DeleteAliasInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type DeleteAliasOutput ¶
type DeleteAliasOutput struct {
// contains filtered or unexported fields
}
func (DeleteAliasOutput) GoString ¶
func (s DeleteAliasOutput) GoString() string
GoString returns the string representation
func (DeleteAliasOutput) String ¶
func (s DeleteAliasOutput) String() string
String returns the string representation
type DescribeKeyInput ¶
type DescribeKeyInput struct { // A list of grant tokens. // // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) // in the AWS Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // A unique identifier for the customer master key. This value can be a globally // unique identifier, a fully specified ARN to either an alias or a key, or // an alias name prefixed by "alias/". // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 // // Alias Name Example - alias/MyAliasName KeyId *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (DescribeKeyInput) GoString ¶
func (s DescribeKeyInput) GoString() string
GoString returns the string representation
func (DescribeKeyInput) String ¶
func (s DescribeKeyInput) String() string
String returns the string representation
func (*DescribeKeyInput) Validate ¶
func (s *DescribeKeyInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type DescribeKeyOutput ¶
type DescribeKeyOutput struct { // Metadata associated with the key. KeyMetadata *KeyMetadata `type:"structure"` // contains filtered or unexported fields }
func (DescribeKeyOutput) GoString ¶
func (s DescribeKeyOutput) GoString() string
GoString returns the string representation
func (DescribeKeyOutput) String ¶
func (s DescribeKeyOutput) String() string
String returns the string representation
type DisableKeyInput ¶
type DisableKeyInput struct { // A unique identifier for the CMK. // // Use the CMK's unique identifier or its Amazon Resource Name (ARN). For example: // // Unique ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab KeyId *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (DisableKeyInput) GoString ¶
func (s DisableKeyInput) GoString() string
GoString returns the string representation
func (DisableKeyInput) String ¶
func (s DisableKeyInput) String() string
String returns the string representation
func (*DisableKeyInput) Validate ¶
func (s *DisableKeyInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type DisableKeyOutput ¶
type DisableKeyOutput struct {
// contains filtered or unexported fields
}
func (DisableKeyOutput) GoString ¶
func (s DisableKeyOutput) GoString() string
GoString returns the string representation
func (DisableKeyOutput) String ¶
func (s DisableKeyOutput) String() string
String returns the string representation
type DisableKeyRotationInput ¶
type DisableKeyRotationInput struct { // A unique identifier for the customer master key. This value can be a globally // unique identifier or the fully specified ARN to a key. // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 KeyId *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (DisableKeyRotationInput) GoString ¶
func (s DisableKeyRotationInput) GoString() string
GoString returns the string representation
func (DisableKeyRotationInput) String ¶
func (s DisableKeyRotationInput) String() string
String returns the string representation
func (*DisableKeyRotationInput) Validate ¶
func (s *DisableKeyRotationInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type DisableKeyRotationOutput ¶
type DisableKeyRotationOutput struct {
// contains filtered or unexported fields
}
func (DisableKeyRotationOutput) GoString ¶
func (s DisableKeyRotationOutput) GoString() string
GoString returns the string representation
func (DisableKeyRotationOutput) String ¶
func (s DisableKeyRotationOutput) String() string
String returns the string representation
type EnableKeyInput ¶
type EnableKeyInput struct { // A unique identifier for the customer master key. This value can be a globally // unique identifier or the fully specified ARN to a key. // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 KeyId *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (EnableKeyInput) GoString ¶
func (s EnableKeyInput) GoString() string
GoString returns the string representation
func (EnableKeyInput) String ¶
func (s EnableKeyInput) String() string
String returns the string representation
func (*EnableKeyInput) Validate ¶
func (s *EnableKeyInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type EnableKeyOutput ¶
type EnableKeyOutput struct {
// contains filtered or unexported fields
}
func (EnableKeyOutput) GoString ¶
func (s EnableKeyOutput) GoString() string
GoString returns the string representation
func (EnableKeyOutput) String ¶
func (s EnableKeyOutput) String() string
String returns the string representation
type EnableKeyRotationInput ¶
type EnableKeyRotationInput struct { // A unique identifier for the customer master key. This value can be a globally // unique identifier or the fully specified ARN to a key. // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 KeyId *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (EnableKeyRotationInput) GoString ¶
func (s EnableKeyRotationInput) GoString() string
GoString returns the string representation
func (EnableKeyRotationInput) String ¶
func (s EnableKeyRotationInput) String() string
String returns the string representation
func (*EnableKeyRotationInput) Validate ¶
func (s *EnableKeyRotationInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type EnableKeyRotationOutput ¶
type EnableKeyRotationOutput struct {
// contains filtered or unexported fields
}
func (EnableKeyRotationOutput) GoString ¶
func (s EnableKeyRotationOutput) GoString() string
GoString returns the string representation
func (EnableKeyRotationOutput) String ¶
func (s EnableKeyRotationOutput) String() string
String returns the string representation
type EncryptInput ¶
type EncryptInput struct { // Name/value pair that specifies the encryption context to be used for authenticated // encryption. If used here, the same value must be supplied to the Decrypt // API or decryption will fail. For more information, see Encryption Context // (http://docs.aws.amazon.com/kms/latest/developerguide/encrypt-context.html). EncryptionContext map[string]*string `type:"map"` // A list of grant tokens. // // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) // in the AWS Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // A unique identifier for the customer master key. This value can be a globally // unique identifier, a fully specified ARN to either an alias or a key, or // an alias name prefixed by "alias/". // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 // // Alias Name Example - alias/MyAliasName KeyId *string `min:"1" type:"string" required:"true"` // Data to be encrypted. // // Plaintext is automatically base64 encoded/decoded by the SDK. Plaintext []byte `min:"1" type:"blob" required:"true"` // contains filtered or unexported fields }
func (EncryptInput) GoString ¶
func (s EncryptInput) GoString() string
GoString returns the string representation
func (EncryptInput) String ¶
func (s EncryptInput) String() string
String returns the string representation
func (*EncryptInput) Validate ¶
func (s *EncryptInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type EncryptOutput ¶
type EncryptOutput struct { // The encrypted plaintext. If you are using the CLI, the value is Base64 encoded. // Otherwise, it is not encoded. // // CiphertextBlob is automatically base64 encoded/decoded by the SDK. CiphertextBlob []byte `min:"1" type:"blob"` // The ID of the key used during encryption. KeyId *string `min:"1" type:"string"` // contains filtered or unexported fields }
func (EncryptOutput) GoString ¶
func (s EncryptOutput) GoString() string
GoString returns the string representation
func (EncryptOutput) String ¶
func (s EncryptOutput) String() string
String returns the string representation
type GenerateDataKeyInput ¶
type GenerateDataKeyInput struct { // Name/value pair that contains additional data to be authenticated during // the encryption and decryption processes that use the key. This value is logged // by AWS CloudTrail to provide context around the data encrypted by the key. EncryptionContext map[string]*string `type:"map"` // A list of grant tokens. // // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) // in the AWS Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // A unique identifier for the customer master key. This value can be a globally // unique identifier, a fully specified ARN to either an alias or a key, or // an alias name prefixed by "alias/". // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 // // Alias Name Example - alias/MyAliasName KeyId *string `min:"1" type:"string" required:"true"` // Value that identifies the encryption algorithm and key size to generate a // data key for. Currently this can be AES_128 or AES_256. KeySpec *string `type:"string" enum:"DataKeySpec"` // Integer that contains the number of bytes to generate. Common values are // 128, 256, 512, and 1024. 1024 is the current limit. We recommend that you // use the KeySpec parameter instead. NumberOfBytes *int64 `min:"1" type:"integer"` // contains filtered or unexported fields }
func (GenerateDataKeyInput) GoString ¶
func (s GenerateDataKeyInput) GoString() string
GoString returns the string representation
func (GenerateDataKeyInput) String ¶
func (s GenerateDataKeyInput) String() string
String returns the string representation
func (*GenerateDataKeyInput) Validate ¶
func (s *GenerateDataKeyInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type GenerateDataKeyOutput ¶
type GenerateDataKeyOutput struct { // Ciphertext that contains the encrypted data key. You must store the blob // and enough information to reconstruct the encryption context so that the // data encrypted by using the key can later be decrypted. You must provide // both the ciphertext blob and the encryption context to the Decrypt API to // recover the plaintext data key and decrypt the object. // // If you are using the CLI, the value is Base64 encoded. Otherwise, it is // not encoded. // // CiphertextBlob is automatically base64 encoded/decoded by the SDK. CiphertextBlob []byte `min:"1" type:"blob"` // System generated unique identifier of the key to be used to decrypt the encrypted // copy of the data key. KeyId *string `min:"1" type:"string"` // Plaintext that contains the data key. Use this for encryption and decryption // and then remove it from memory as soon as possible. // // Plaintext is automatically base64 encoded/decoded by the SDK. Plaintext []byte `min:"1" type:"blob"` // contains filtered or unexported fields }
func (GenerateDataKeyOutput) GoString ¶
func (s GenerateDataKeyOutput) GoString() string
GoString returns the string representation
func (GenerateDataKeyOutput) String ¶
func (s GenerateDataKeyOutput) String() string
String returns the string representation
type GenerateDataKeyWithoutPlaintextInput ¶
type GenerateDataKeyWithoutPlaintextInput struct { // Name:value pair that contains additional data to be authenticated during // the encryption and decryption processes. EncryptionContext map[string]*string `type:"map"` // A list of grant tokens. // // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) // in the AWS Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // A unique identifier for the customer master key. This value can be a globally // unique identifier, a fully specified ARN to either an alias or a key, or // an alias name prefixed by "alias/". // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 // // Alias Name Example - alias/MyAliasName KeyId *string `min:"1" type:"string" required:"true"` // Value that identifies the encryption algorithm and key size. Currently this // can be AES_128 or AES_256. KeySpec *string `type:"string" enum:"DataKeySpec"` // Integer that contains the number of bytes to generate. Common values are // 128, 256, 512, 1024 and so on. We recommend that you use the KeySpec parameter // instead. NumberOfBytes *int64 `min:"1" type:"integer"` // contains filtered or unexported fields }
func (GenerateDataKeyWithoutPlaintextInput) GoString ¶
func (s GenerateDataKeyWithoutPlaintextInput) GoString() string
GoString returns the string representation
func (GenerateDataKeyWithoutPlaintextInput) String ¶
func (s GenerateDataKeyWithoutPlaintextInput) String() string
String returns the string representation
func (*GenerateDataKeyWithoutPlaintextInput) Validate ¶
func (s *GenerateDataKeyWithoutPlaintextInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type GenerateDataKeyWithoutPlaintextOutput ¶
type GenerateDataKeyWithoutPlaintextOutput struct { // Ciphertext that contains the wrapped data key. You must store the blob and // encryption context so that the key can be used in a future decrypt operation. // // If you are using the CLI, the value is Base64 encoded. Otherwise, it is // not encoded. // // CiphertextBlob is automatically base64 encoded/decoded by the SDK. CiphertextBlob []byte `min:"1" type:"blob"` // System generated unique identifier of the key to be used to decrypt the encrypted // copy of the data key. KeyId *string `min:"1" type:"string"` // contains filtered or unexported fields }
func (GenerateDataKeyWithoutPlaintextOutput) GoString ¶
func (s GenerateDataKeyWithoutPlaintextOutput) GoString() string
GoString returns the string representation
func (GenerateDataKeyWithoutPlaintextOutput) String ¶
func (s GenerateDataKeyWithoutPlaintextOutput) String() string
String returns the string representation
type GenerateRandomInput ¶
type GenerateRandomInput struct { // Integer that contains the number of bytes to generate. Common values are // 128, 256, 512, 1024 and so on. The current limit is 1024 bytes. NumberOfBytes *int64 `min:"1" type:"integer"` // contains filtered or unexported fields }
func (GenerateRandomInput) GoString ¶
func (s GenerateRandomInput) GoString() string
GoString returns the string representation
func (GenerateRandomInput) String ¶
func (s GenerateRandomInput) String() string
String returns the string representation
func (*GenerateRandomInput) Validate ¶
func (s *GenerateRandomInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type GenerateRandomOutput ¶
type GenerateRandomOutput struct { // Plaintext that contains the unpredictable byte string. // // Plaintext is automatically base64 encoded/decoded by the SDK. Plaintext []byte `min:"1" type:"blob"` // contains filtered or unexported fields }
func (GenerateRandomOutput) GoString ¶
func (s GenerateRandomOutput) GoString() string
GoString returns the string representation
func (GenerateRandomOutput) String ¶
func (s GenerateRandomOutput) String() string
String returns the string representation
type GetKeyPolicyInput ¶
type GetKeyPolicyInput struct { // A unique identifier for the customer master key. This value can be a globally // unique identifier or the fully specified ARN to a key. // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 KeyId *string `min:"1" type:"string" required:"true"` // String that contains the name of the policy. Currently, this must be "default". // Policy names can be discovered by calling ListKeyPolicies. PolicyName *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (GetKeyPolicyInput) GoString ¶
func (s GetKeyPolicyInput) GoString() string
GoString returns the string representation
func (GetKeyPolicyInput) String ¶
func (s GetKeyPolicyInput) String() string
String returns the string representation
func (*GetKeyPolicyInput) Validate ¶
func (s *GetKeyPolicyInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type GetKeyPolicyOutput ¶
type GetKeyPolicyOutput struct { // A policy document in JSON format. Policy *string `min:"1" type:"string"` // contains filtered or unexported fields }
func (GetKeyPolicyOutput) GoString ¶
func (s GetKeyPolicyOutput) GoString() string
GoString returns the string representation
func (GetKeyPolicyOutput) String ¶
func (s GetKeyPolicyOutput) String() string
String returns the string representation
type GetKeyRotationStatusInput ¶
type GetKeyRotationStatusInput struct { // A unique identifier for the customer master key. This value can be a globally // unique identifier or the fully specified ARN to a key. // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 KeyId *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (GetKeyRotationStatusInput) GoString ¶
func (s GetKeyRotationStatusInput) GoString() string
GoString returns the string representation
func (GetKeyRotationStatusInput) String ¶
func (s GetKeyRotationStatusInput) String() string
String returns the string representation
func (*GetKeyRotationStatusInput) Validate ¶
func (s *GetKeyRotationStatusInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type GetKeyRotationStatusOutput ¶
type GetKeyRotationStatusOutput struct { // A Boolean value that specifies whether key rotation is enabled. KeyRotationEnabled *bool `type:"boolean"` // contains filtered or unexported fields }
func (GetKeyRotationStatusOutput) GoString ¶
func (s GetKeyRotationStatusOutput) GoString() string
GoString returns the string representation
func (GetKeyRotationStatusOutput) String ¶
func (s GetKeyRotationStatusOutput) String() string
String returns the string representation
type GrantConstraints ¶
type GrantConstraints struct { // Contains a list of key-value pairs that must be present in the encryption // context of a subsequent operation permitted by the grant. When a subsequent // operation permitted by the grant includes an encryption context that matches // this list, the grant allows the operation. Otherwise, the operation is not // allowed. EncryptionContextEquals map[string]*string `type:"map"` // Contains a list of key-value pairs, a subset of which must be present in // the encryption context of a subsequent operation permitted by the grant. // When a subsequent operation permitted by the grant includes an encryption // context that matches this list or is a subset of this list, the grant allows // the operation. Otherwise, the operation is not allowed. EncryptionContextSubset map[string]*string `type:"map"` // contains filtered or unexported fields }
A structure for specifying the conditions under which the operations permitted by the grant are allowed.
You can use this structure to allow the operations permitted by the grant only when a specified encryption context is present. For more information about encryption context, see Encryption Context (http://docs.aws.amazon.com/kms/latest/developerguide/encrypt-context.html) in the AWS Key Management Service Developer Guide.
func (GrantConstraints) GoString ¶
func (s GrantConstraints) GoString() string
GoString returns the string representation
func (GrantConstraints) String ¶
func (s GrantConstraints) String() string
String returns the string representation
type GrantListEntry ¶
type GrantListEntry struct { // The conditions under which the grant's operations are allowed. Constraints *GrantConstraints `type:"structure"` // The date and time when the grant was created. CreationDate *time.Time `type:"timestamp" timestampFormat:"unix"` // The unique identifier for the grant. GrantId *string `min:"1" type:"string"` // The principal that receives the grant's permissions. GranteePrincipal *string `min:"1" type:"string"` // The AWS account under which the grant was issued. IssuingAccount *string `min:"1" type:"string"` // The unique identifier for the customer master key (CMK) to which the grant // applies. KeyId *string `min:"1" type:"string"` // The friendly name that identifies the grant. If a name was provided in the // CreateGrant request, that name is returned. Otherwise this value is null. Name *string `min:"1" type:"string"` // The list of operations permitted by the grant. Operations []*string `type:"list"` // The principal that can retire the grant. RetiringPrincipal *string `min:"1" type:"string"` // contains filtered or unexported fields }
Contains information about an entry in a list of grants.
func (GrantListEntry) GoString ¶
func (s GrantListEntry) GoString() string
GoString returns the string representation
func (GrantListEntry) String ¶
func (s GrantListEntry) String() string
String returns the string representation
type KMS ¶
AWS Key Management Service (AWS KMS) is an encryption and key management web service. This guide describes the AWS KMS operations that you can call programmatically. For general information about AWS KMS, see the AWS Key Management Service Developer Guide (http://docs.aws.amazon.com/kms/latest/developerguide/).
AWS provides SDKs that consist of libraries and sample code for various
programming languages and platforms (Java, Ruby, .Net, iOS, Android, etc.). The SDKs provide a convenient way to create programmatic access to AWS KMS and other AWS services. For example, the SDKs take care of tasks such as signing requests (see below), managing errors, and retrying requests automatically. For more information about the AWS SDKs, including how to download and install them, see Tools for Amazon Web Services (http://aws.amazon.com/tools/).
We recommend that you use the AWS SDKs to make programmatic API calls to
AWS KMS.
Clients must support TLS (Transport Layer Security) 1.0. We recommend TLS 1.2. Clients must also support cipher suites with Perfect Forward Secrecy (PFS) such as Ephemeral Diffie-Hellman (DHE) or Elliptic Curve Ephemeral Diffie-Hellman (ECDHE). Most modern systems such as Java 7 and later support these modes.
Signing Requests
Requests must be signed by using an access key ID and a secret access key. We strongly recommend that you do not use your AWS account (root) access key ID and secret key for everyday work with AWS KMS. Instead, use the access key ID and secret access key for an IAM user, or you can use the AWS Security Token Service to generate temporary security credentials that you can use to sign requests.
All AWS KMS operations require Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).
Logging API Requests
AWS KMS supports AWS CloudTrail, a service that logs AWS API calls and related events for your AWS account and delivers them to an Amazon S3 bucket that you specify. By using the information collected by CloudTrail, you can determine what requests were made to AWS KMS, who made the request, when it was made, and so on. To learn more about CloudTrail, including how to turn it on and find your log files, see the AWS CloudTrail User Guide (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/).
Additional Resources
For more information about credentials and request signing, see the following:
AWS Security Credentials (http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)
- This topic provides general information about the types of credentials used for accessing AWS.
Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html)
- This section of the IAM User Guide describes how to create and use temporary security credentials.
Signature Version 4 Signing Process (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html)
- This set of topics walks you through the process of signing a request using an access key ID and a secret access key.
Commonly Used APIs
Of the APIs discussed in this guide, the following will prove the most useful for most applications. You will likely perform actions other than these, such as creating keys and assigning policies, by using the console.
Encrypt Decrypt GenerateDataKey GenerateDataKeyWithoutPlaintext
The service client's operations are safe to be used concurrently. It is not safe to mutate any of the client's properties though.
func New ¶
func New(p client.ConfigProvider, cfgs ...*aws.Config) *KMS
New creates a new instance of the KMS client with a session. If additional configuration is needed for the client instance use the optional aws.Config parameter to add your extra config.
Example:
// Create a KMS client from just a session. svc := kms.New(mySession) // Create a KMS client with additional configuration svc := kms.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func (*KMS) CancelKeyDeletion ¶
func (c *KMS) CancelKeyDeletion(input *CancelKeyDeletionInput) (*CancelKeyDeletionOutput, error)
Cancels the deletion of a customer master key (CMK). When this operation is successful, the CMK is set to the Disabled state. To enable a CMK, use EnableKey.
For more information about scheduling and canceling deletion of a CMK, see Deleting Customer Master Keys (http://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) in the AWS Key Management Service Developer Guide.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.CancelKeyDeletionInput{ KeyId: aws.String("KeyIdType"), // Required } resp, err := svc.CancelKeyDeletion(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) CancelKeyDeletionRequest ¶
func (c *KMS) CancelKeyDeletionRequest(input *CancelKeyDeletionInput) (req *request.Request, output *CancelKeyDeletionOutput)
CancelKeyDeletionRequest generates a "aws/request.Request" representing the client's request for the CancelKeyDeletion operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the CancelKeyDeletion method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the CancelKeyDeletionRequest method. req, resp := client.CancelKeyDeletionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) CreateAlias ¶
func (c *KMS) CreateAlias(input *CreateAliasInput) (*CreateAliasOutput, error)
Creates a display name for a customer master key. An alias can be used to identify a key and should be unique. The console enforces a one-to-one mapping between the alias and a key. An alias name can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). An alias must start with the word "alias" followed by a forward slash (alias/). An alias that begins with "aws" after the forward slash (alias/aws...) is reserved by Amazon Web Services (AWS).
The alias and the key it is mapped to must be in the same AWS account and the same region.
To map an alias to a different key, call UpdateAlias.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.CreateAliasInput{ AliasName: aws.String("AliasNameType"), // Required TargetKeyId: aws.String("KeyIdType"), // Required } resp, err := svc.CreateAlias(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) CreateAliasRequest ¶
func (c *KMS) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, output *CreateAliasOutput)
CreateAliasRequest generates a "aws/request.Request" representing the client's request for the CreateAlias operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the CreateAlias method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the CreateAliasRequest method. req, resp := client.CreateAliasRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) CreateGrant ¶
func (c *KMS) CreateGrant(input *CreateGrantInput) (*CreateGrantOutput, error)
Adds a grant to a key to specify who can use the key and under what conditions. Grants are alternate permission mechanisms to key policies.
For more information about grants, see Grants (http://docs.aws.amazon.com/kms/latest/developerguide/grants.html) in the AWS Key Management Service Developer Guide.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.CreateGrantInput{ GranteePrincipal: aws.String("PrincipalIdType"), // Required KeyId: aws.String("KeyIdType"), // Required Constraints: &kms.GrantConstraints{ EncryptionContextEquals: map[string]*string{ "Key": aws.String("EncryptionContextValue"), // Required // More values... }, EncryptionContextSubset: map[string]*string{ "Key": aws.String("EncryptionContextValue"), // Required // More values... }, }, GrantTokens: []*string{ aws.String("GrantTokenType"), // Required // More values... }, Name: aws.String("GrantNameType"), Operations: []*string{ aws.String("GrantOperation"), // Required // More values... }, RetiringPrincipal: aws.String("PrincipalIdType"), } resp, err := svc.CreateGrant(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) CreateGrantRequest ¶
func (c *KMS) CreateGrantRequest(input *CreateGrantInput) (req *request.Request, output *CreateGrantOutput)
CreateGrantRequest generates a "aws/request.Request" representing the client's request for the CreateGrant operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the CreateGrant method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the CreateGrantRequest method. req, resp := client.CreateGrantRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) CreateKey ¶
func (c *KMS) CreateKey(input *CreateKeyInput) (*CreateKeyOutput, error)
Creates a customer master key (CMK).
You can use a CMK to encrypt small amounts of data (4 KiB or less) directly, but CMKs are more commonly used to encrypt data encryption keys (DEKs), which are used to encrypt raw data. For more information about DEKs and the difference between CMKs and DEKs, see the following:
The GenerateDataKey operation AWS Key Management Service Concepts (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html)
in the AWS Key Management Service Developer Guide
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.CreateKeyInput{ BypassPolicyLockoutSafetyCheck: aws.Bool(true), Description: aws.String("DescriptionType"), KeyUsage: aws.String("KeyUsageType"), Policy: aws.String("PolicyType"), } resp, err := svc.CreateKey(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) CreateKeyRequest ¶
func (c *KMS) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, output *CreateKeyOutput)
CreateKeyRequest generates a "aws/request.Request" representing the client's request for the CreateKey operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the CreateKey method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the CreateKeyRequest method. req, resp := client.CreateKeyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) Decrypt ¶
func (c *KMS) Decrypt(input *DecryptInput) (*DecryptOutput, error)
Decrypts ciphertext. Ciphertext is plaintext that has been previously encrypted by using any of the following functions:
GenerateDataKey GenerateDataKeyWithoutPlaintext Encrypt Note that if a caller has been granted access permissions to all keys
(through, for example, IAM user policies that grant Decrypt permission on all resources), then ciphertext encrypted by using keys in other accounts where the key grants access to the caller can be decrypted. To remedy this, we recommend that you do not grant Decrypt access in an IAM user policy. Instead grant Decrypt access only in key policies. If you must grant Decrypt access in an IAM user policy, you should scope the resource to specific keys or to specific trusted accounts.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.DecryptInput{ CiphertextBlob: []byte("PAYLOAD"), // Required EncryptionContext: map[string]*string{ "Key": aws.String("EncryptionContextValue"), // Required // More values... }, GrantTokens: []*string{ aws.String("GrantTokenType"), // Required // More values... }, } resp, err := svc.Decrypt(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) DecryptRequest ¶
func (c *KMS) DecryptRequest(input *DecryptInput) (req *request.Request, output *DecryptOutput)
DecryptRequest generates a "aws/request.Request" representing the client's request for the Decrypt operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the Decrypt method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the DecryptRequest method. req, resp := client.DecryptRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) DeleteAlias ¶
func (c *KMS) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error)
Deletes the specified alias. To map an alias to a different key, call UpdateAlias.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.DeleteAliasInput{ AliasName: aws.String("AliasNameType"), // Required } resp, err := svc.DeleteAlias(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) DeleteAliasRequest ¶
func (c *KMS) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, output *DeleteAliasOutput)
DeleteAliasRequest generates a "aws/request.Request" representing the client's request for the DeleteAlias operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DeleteAlias method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the DeleteAliasRequest method. req, resp := client.DeleteAliasRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) DescribeKey ¶
func (c *KMS) DescribeKey(input *DescribeKeyInput) (*DescribeKeyOutput, error)
Provides detailed information about the specified customer master key.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.DescribeKeyInput{ KeyId: aws.String("KeyIdType"), // Required GrantTokens: []*string{ aws.String("GrantTokenType"), // Required // More values... }, } resp, err := svc.DescribeKey(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) DescribeKeyRequest ¶
func (c *KMS) DescribeKeyRequest(input *DescribeKeyInput) (req *request.Request, output *DescribeKeyOutput)
DescribeKeyRequest generates a "aws/request.Request" representing the client's request for the DescribeKey operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DescribeKey method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the DescribeKeyRequest method. req, resp := client.DescribeKeyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) DisableKey ¶
func (c *KMS) DisableKey(input *DisableKeyInput) (*DisableKeyOutput, error)
Sets the state of a customer master key (CMK) to disabled, thereby preventing its use for cryptographic operations. For more information about how key state affects the use of a CMK, see How Key State Affects the Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the AWS Key Management Service Developer Guide.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.DisableKeyInput{ KeyId: aws.String("KeyIdType"), // Required } resp, err := svc.DisableKey(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) DisableKeyRequest ¶
func (c *KMS) DisableKeyRequest(input *DisableKeyInput) (req *request.Request, output *DisableKeyOutput)
DisableKeyRequest generates a "aws/request.Request" representing the client's request for the DisableKey operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DisableKey method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the DisableKeyRequest method. req, resp := client.DisableKeyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) DisableKeyRotation ¶
func (c *KMS) DisableKeyRotation(input *DisableKeyRotationInput) (*DisableKeyRotationOutput, error)
Disables rotation of the specified key.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.DisableKeyRotationInput{ KeyId: aws.String("KeyIdType"), // Required } resp, err := svc.DisableKeyRotation(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) DisableKeyRotationRequest ¶
func (c *KMS) DisableKeyRotationRequest(input *DisableKeyRotationInput) (req *request.Request, output *DisableKeyRotationOutput)
DisableKeyRotationRequest generates a "aws/request.Request" representing the client's request for the DisableKeyRotation operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DisableKeyRotation method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the DisableKeyRotationRequest method. req, resp := client.DisableKeyRotationRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) EnableKey ¶
func (c *KMS) EnableKey(input *EnableKeyInput) (*EnableKeyOutput, error)
Marks a key as enabled, thereby permitting its use.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.EnableKeyInput{ KeyId: aws.String("KeyIdType"), // Required } resp, err := svc.EnableKey(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) EnableKeyRequest ¶
func (c *KMS) EnableKeyRequest(input *EnableKeyInput) (req *request.Request, output *EnableKeyOutput)
EnableKeyRequest generates a "aws/request.Request" representing the client's request for the EnableKey operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the EnableKey method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the EnableKeyRequest method. req, resp := client.EnableKeyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) EnableKeyRotation ¶
func (c *KMS) EnableKeyRotation(input *EnableKeyRotationInput) (*EnableKeyRotationOutput, error)
Enables rotation of the specified customer master key.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.EnableKeyRotationInput{ KeyId: aws.String("KeyIdType"), // Required } resp, err := svc.EnableKeyRotation(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) EnableKeyRotationRequest ¶
func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) (req *request.Request, output *EnableKeyRotationOutput)
EnableKeyRotationRequest generates a "aws/request.Request" representing the client's request for the EnableKeyRotation operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the EnableKeyRotation method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the EnableKeyRotationRequest method. req, resp := client.EnableKeyRotationRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) Encrypt ¶
func (c *KMS) Encrypt(input *EncryptInput) (*EncryptOutput, error)
Encrypts plaintext into ciphertext by using a customer master key. The Encrypt function has two primary use cases:
You can encrypt up to 4 KB of arbitrary data such as an RSA key, a database
password, or other sensitive customer information.
If you are moving encrypted data from one region to another, you can use
this API to encrypt in the new region the plaintext data key that was used to encrypt the data in the original region. This provides you with an encrypted copy of the data key that can be decrypted in the new region and used there to decrypt the encrypted data.
Unless you are moving encrypted data from one region to another, you don't
use this function to encrypt a generated data key within a region. You retrieve data keys already encrypted by calling the GenerateDataKey or GenerateDataKeyWithoutPlaintext function. Data keys don't need to be encrypted again by calling Encrypt.
If you want to encrypt data locally in your application, you can use the GenerateDataKey function to return a plaintext data encryption key and a copy of the key encrypted under the customer master key (CMK) of your choosing.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.EncryptInput{ KeyId: aws.String("KeyIdType"), // Required Plaintext: []byte("PAYLOAD"), // Required EncryptionContext: map[string]*string{ "Key": aws.String("EncryptionContextValue"), // Required // More values... }, GrantTokens: []*string{ aws.String("GrantTokenType"), // Required // More values... }, } resp, err := svc.Encrypt(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) EncryptRequest ¶
func (c *KMS) EncryptRequest(input *EncryptInput) (req *request.Request, output *EncryptOutput)
EncryptRequest generates a "aws/request.Request" representing the client's request for the Encrypt operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the Encrypt method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the EncryptRequest method. req, resp := client.EncryptRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) GenerateDataKey ¶
func (c *KMS) GenerateDataKey(input *GenerateDataKeyInput) (*GenerateDataKeyOutput, error)
Generates a data key that you can use in your application to locally encrypt data. This call returns a plaintext version of the key in the Plaintext field of the response object and an encrypted copy of the key in the CiphertextBlob field. The key is encrypted by using the master key specified by the KeyId field. To decrypt the encrypted key, pass it to the Decrypt API.
We recommend that you use the following pattern to locally encrypt data: call the GenerateDataKey API, use the key returned in the Plaintext response field to locally encrypt data, and then erase the plaintext data key from memory. Store the encrypted data key (contained in the CiphertextBlob field) alongside of the locally encrypted data.
You should not call the Encrypt function to re-encrypt your data keys within
a region. GenerateDataKey always returns the data key encrypted and tied to the customer master key that will be used to decrypt it. There is no need to decrypt it twice.
If you decide to use the optional EncryptionContext parameter, you must
also store the context in full or at least store enough information along with the encrypted data to be able to reconstruct the context when submitting the ciphertext to the Decrypt API. It is a good practice to choose a context that you can reconstruct on the fly to better secure the ciphertext. For more information about how this parameter is used, see Encryption Context (http://docs.aws.amazon.com/kms/latest/developerguide/encrypt-context.html).
To decrypt data, pass the encrypted data key to the Decrypt API. Decrypt uses the associated master key to decrypt the encrypted data key and returns it as plaintext. Use the plaintext data key to locally decrypt your data and then erase the key from memory. You must specify the encryption context, if any, that you specified when you generated the key. The encryption context is logged by CloudTrail, and you can use this log to help track the use of particular data.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.GenerateDataKeyInput{ KeyId: aws.String("KeyIdType"), // Required EncryptionContext: map[string]*string{ "Key": aws.String("EncryptionContextValue"), // Required // More values... }, GrantTokens: []*string{ aws.String("GrantTokenType"), // Required // More values... }, KeySpec: aws.String("DataKeySpec"), NumberOfBytes: aws.Int64(1), } resp, err := svc.GenerateDataKey(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) GenerateDataKeyRequest ¶
func (c *KMS) GenerateDataKeyRequest(input *GenerateDataKeyInput) (req *request.Request, output *GenerateDataKeyOutput)
GenerateDataKeyRequest generates a "aws/request.Request" representing the client's request for the GenerateDataKey operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GenerateDataKey method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the GenerateDataKeyRequest method. req, resp := client.GenerateDataKeyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) GenerateDataKeyWithoutPlaintext ¶
func (c *KMS) GenerateDataKeyWithoutPlaintext(input *GenerateDataKeyWithoutPlaintextInput) (*GenerateDataKeyWithoutPlaintextOutput, error)
Returns a data key encrypted by a customer master key without the plaintext copy of that key. Otherwise, this API functions exactly like GenerateDataKey. You can use this API to, for example, satisfy an audit requirement that an encrypted key be made available without exposing the plaintext copy of that key.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.GenerateDataKeyWithoutPlaintextInput{ KeyId: aws.String("KeyIdType"), // Required EncryptionContext: map[string]*string{ "Key": aws.String("EncryptionContextValue"), // Required // More values... }, GrantTokens: []*string{ aws.String("GrantTokenType"), // Required // More values... }, KeySpec: aws.String("DataKeySpec"), NumberOfBytes: aws.Int64(1), } resp, err := svc.GenerateDataKeyWithoutPlaintext(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) GenerateDataKeyWithoutPlaintextRequest ¶
func (c *KMS) GenerateDataKeyWithoutPlaintextRequest(input *GenerateDataKeyWithoutPlaintextInput) (req *request.Request, output *GenerateDataKeyWithoutPlaintextOutput)
GenerateDataKeyWithoutPlaintextRequest generates a "aws/request.Request" representing the client's request for the GenerateDataKeyWithoutPlaintext operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GenerateDataKeyWithoutPlaintext method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the GenerateDataKeyWithoutPlaintextRequest method. req, resp := client.GenerateDataKeyWithoutPlaintextRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) GenerateRandom ¶
func (c *KMS) GenerateRandom(input *GenerateRandomInput) (*GenerateRandomOutput, error)
Generates an unpredictable byte string.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.GenerateRandomInput{ NumberOfBytes: aws.Int64(1), } resp, err := svc.GenerateRandom(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) GenerateRandomRequest ¶
func (c *KMS) GenerateRandomRequest(input *GenerateRandomInput) (req *request.Request, output *GenerateRandomOutput)
GenerateRandomRequest generates a "aws/request.Request" representing the client's request for the GenerateRandom operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GenerateRandom method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the GenerateRandomRequest method. req, resp := client.GenerateRandomRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) GetKeyPolicy ¶
func (c *KMS) GetKeyPolicy(input *GetKeyPolicyInput) (*GetKeyPolicyOutput, error)
Retrieves a policy attached to the specified key.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.GetKeyPolicyInput{ KeyId: aws.String("KeyIdType"), // Required PolicyName: aws.String("PolicyNameType"), // Required } resp, err := svc.GetKeyPolicy(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) GetKeyPolicyRequest ¶
func (c *KMS) GetKeyPolicyRequest(input *GetKeyPolicyInput) (req *request.Request, output *GetKeyPolicyOutput)
GetKeyPolicyRequest generates a "aws/request.Request" representing the client's request for the GetKeyPolicy operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GetKeyPolicy method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the GetKeyPolicyRequest method. req, resp := client.GetKeyPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) GetKeyRotationStatus ¶
func (c *KMS) GetKeyRotationStatus(input *GetKeyRotationStatusInput) (*GetKeyRotationStatusOutput, error)
Retrieves a Boolean value that indicates whether key rotation is enabled for the specified key.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.GetKeyRotationStatusInput{ KeyId: aws.String("KeyIdType"), // Required } resp, err := svc.GetKeyRotationStatus(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) GetKeyRotationStatusRequest ¶
func (c *KMS) GetKeyRotationStatusRequest(input *GetKeyRotationStatusInput) (req *request.Request, output *GetKeyRotationStatusOutput)
GetKeyRotationStatusRequest generates a "aws/request.Request" representing the client's request for the GetKeyRotationStatus operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GetKeyRotationStatus method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the GetKeyRotationStatusRequest method. req, resp := client.GetKeyRotationStatusRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) ListAliases ¶
func (c *KMS) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error)
Lists all of the key aliases in the account.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.ListAliasesInput{ Limit: aws.Int64(1), Marker: aws.String("MarkerType"), } resp, err := svc.ListAliases(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) ListAliasesPages ¶
func (c *KMS) ListAliasesPages(input *ListAliasesInput, fn func(p *ListAliasesOutput, lastPage bool) (shouldContinue bool)) error
ListAliasesPages iterates over the pages of a ListAliases operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.
See ListAliases method for more information on how to use this operation.
Note: This operation can generate multiple requests to a service.
// Example iterating over at most 3 pages of a ListAliases operation. pageNum := 0 err := client.ListAliasesPages(params, func(page *ListAliasesOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })
func (*KMS) ListAliasesRequest ¶
func (c *KMS) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, output *ListAliasesOutput)
ListAliasesRequest generates a "aws/request.Request" representing the client's request for the ListAliases operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListAliases method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the ListAliasesRequest method. req, resp := client.ListAliasesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) ListGrants ¶
func (c *KMS) ListGrants(input *ListGrantsInput) (*ListGrantsResponse, error)
List the grants for a specified key.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.ListGrantsInput{ KeyId: aws.String("KeyIdType"), // Required Limit: aws.Int64(1), Marker: aws.String("MarkerType"), } resp, err := svc.ListGrants(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) ListGrantsPages ¶
func (c *KMS) ListGrantsPages(input *ListGrantsInput, fn func(p *ListGrantsResponse, lastPage bool) (shouldContinue bool)) error
ListGrantsPages iterates over the pages of a ListGrants operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.
See ListGrants method for more information on how to use this operation.
Note: This operation can generate multiple requests to a service.
// Example iterating over at most 3 pages of a ListGrants operation. pageNum := 0 err := client.ListGrantsPages(params, func(page *ListGrantsResponse, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })
func (*KMS) ListGrantsRequest ¶
func (c *KMS) ListGrantsRequest(input *ListGrantsInput) (req *request.Request, output *ListGrantsResponse)
ListGrantsRequest generates a "aws/request.Request" representing the client's request for the ListGrants operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListGrants method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the ListGrantsRequest method. req, resp := client.ListGrantsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) ListKeyPolicies ¶
func (c *KMS) ListKeyPolicies(input *ListKeyPoliciesInput) (*ListKeyPoliciesOutput, error)
Retrieves a list of policies attached to a key.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.ListKeyPoliciesInput{ KeyId: aws.String("KeyIdType"), // Required Limit: aws.Int64(1), Marker: aws.String("MarkerType"), } resp, err := svc.ListKeyPolicies(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) ListKeyPoliciesPages ¶
func (c *KMS) ListKeyPoliciesPages(input *ListKeyPoliciesInput, fn func(p *ListKeyPoliciesOutput, lastPage bool) (shouldContinue bool)) error
ListKeyPoliciesPages iterates over the pages of a ListKeyPolicies operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.
See ListKeyPolicies method for more information on how to use this operation.
Note: This operation can generate multiple requests to a service.
// Example iterating over at most 3 pages of a ListKeyPolicies operation. pageNum := 0 err := client.ListKeyPoliciesPages(params, func(page *ListKeyPoliciesOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })
func (*KMS) ListKeyPoliciesRequest ¶
func (c *KMS) ListKeyPoliciesRequest(input *ListKeyPoliciesInput) (req *request.Request, output *ListKeyPoliciesOutput)
ListKeyPoliciesRequest generates a "aws/request.Request" representing the client's request for the ListKeyPolicies operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListKeyPolicies method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the ListKeyPoliciesRequest method. req, resp := client.ListKeyPoliciesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) ListKeys ¶
func (c *KMS) ListKeys(input *ListKeysInput) (*ListKeysOutput, error)
Lists the customer master keys.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.ListKeysInput{ Limit: aws.Int64(1), Marker: aws.String("MarkerType"), } resp, err := svc.ListKeys(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) ListKeysPages ¶
func (c *KMS) ListKeysPages(input *ListKeysInput, fn func(p *ListKeysOutput, lastPage bool) (shouldContinue bool)) error
ListKeysPages iterates over the pages of a ListKeys operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.
See ListKeys method for more information on how to use this operation.
Note: This operation can generate multiple requests to a service.
// Example iterating over at most 3 pages of a ListKeys operation. pageNum := 0 err := client.ListKeysPages(params, func(page *ListKeysOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })
func (*KMS) ListKeysRequest ¶
func (c *KMS) ListKeysRequest(input *ListKeysInput) (req *request.Request, output *ListKeysOutput)
ListKeysRequest generates a "aws/request.Request" representing the client's request for the ListKeys operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListKeys method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the ListKeysRequest method. req, resp := client.ListKeysRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) ListRetirableGrants ¶
func (c *KMS) ListRetirableGrants(input *ListRetirableGrantsInput) (*ListGrantsResponse, error)
Returns a list of all grants for which the grant's RetiringPrincipal matches the one specified.
A typical use is to list all grants that you are able to retire. To retire a grant, use RetireGrant.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.ListRetirableGrantsInput{ RetiringPrincipal: aws.String("PrincipalIdType"), // Required Limit: aws.Int64(1), Marker: aws.String("MarkerType"), } resp, err := svc.ListRetirableGrants(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) ListRetirableGrantsRequest ¶
func (c *KMS) ListRetirableGrantsRequest(input *ListRetirableGrantsInput) (req *request.Request, output *ListGrantsResponse)
ListRetirableGrantsRequest generates a "aws/request.Request" representing the client's request for the ListRetirableGrants operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListRetirableGrants method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the ListRetirableGrantsRequest method. req, resp := client.ListRetirableGrantsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) PutKeyPolicy ¶
func (c *KMS) PutKeyPolicy(input *PutKeyPolicyInput) (*PutKeyPolicyOutput, error)
Attaches a key policy to the specified customer master key (CMK).
For more information about key policies, see Key Policies (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) in the AWS Key Management Service Developer Guide.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.PutKeyPolicyInput{ KeyId: aws.String("KeyIdType"), // Required Policy: aws.String("PolicyType"), // Required PolicyName: aws.String("PolicyNameType"), // Required BypassPolicyLockoutSafetyCheck: aws.Bool(true), } resp, err := svc.PutKeyPolicy(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) PutKeyPolicyRequest ¶
func (c *KMS) PutKeyPolicyRequest(input *PutKeyPolicyInput) (req *request.Request, output *PutKeyPolicyOutput)
PutKeyPolicyRequest generates a "aws/request.Request" representing the client's request for the PutKeyPolicy operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the PutKeyPolicy method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the PutKeyPolicyRequest method. req, resp := client.PutKeyPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) ReEncrypt ¶
func (c *KMS) ReEncrypt(input *ReEncryptInput) (*ReEncryptOutput, error)
Encrypts data on the server side with a new customer master key without exposing the plaintext of the data on the client side. The data is first decrypted and then encrypted. This operation can also be used to change the encryption context of a ciphertext.
Unlike other actions, ReEncrypt is authorized twice - once as ReEncryptFrom on the source key and once as ReEncryptTo on the destination key. We therefore recommend that you include the "action":"kms:ReEncrypt*" statement in your key policies to permit re-encryption from or to the key. The statement is included automatically when you authorize use of the key through the console but must be included manually when you set a policy by using the PutKeyPolicy function.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.ReEncryptInput{ CiphertextBlob: []byte("PAYLOAD"), // Required DestinationKeyId: aws.String("KeyIdType"), // Required DestinationEncryptionContext: map[string]*string{ "Key": aws.String("EncryptionContextValue"), // Required // More values... }, GrantTokens: []*string{ aws.String("GrantTokenType"), // Required // More values... }, SourceEncryptionContext: map[string]*string{ "Key": aws.String("EncryptionContextValue"), // Required // More values... }, } resp, err := svc.ReEncrypt(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) ReEncryptRequest ¶
func (c *KMS) ReEncryptRequest(input *ReEncryptInput) (req *request.Request, output *ReEncryptOutput)
ReEncryptRequest generates a "aws/request.Request" representing the client's request for the ReEncrypt operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ReEncrypt method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the ReEncryptRequest method. req, resp := client.ReEncryptRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) RetireGrant ¶
func (c *KMS) RetireGrant(input *RetireGrantInput) (*RetireGrantOutput, error)
Retires a grant. You can retire a grant when you're done using it to clean up. You should revoke a grant when you intend to actively deny operations that depend on it. The following are permitted to call this API:
The account that created the grant The RetiringPrincipal, if present The GranteePrincipal, if RetireGrant is a grantee operation The grant to retire must be identified by its grant token or by a combination
of the key ARN and the grant ID. A grant token is a unique variable-length base64-encoded string. A grant ID is a 64 character unique identifier of a grant. Both are returned by the CreateGrant function.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.RetireGrantInput{ GrantId: aws.String("GrantIdType"), GrantToken: aws.String("GrantTokenType"), KeyId: aws.String("KeyIdType"), } resp, err := svc.RetireGrant(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) RetireGrantRequest ¶
func (c *KMS) RetireGrantRequest(input *RetireGrantInput) (req *request.Request, output *RetireGrantOutput)
RetireGrantRequest generates a "aws/request.Request" representing the client's request for the RetireGrant operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the RetireGrant method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the RetireGrantRequest method. req, resp := client.RetireGrantRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) RevokeGrant ¶
func (c *KMS) RevokeGrant(input *RevokeGrantInput) (*RevokeGrantOutput, error)
Revokes a grant. You can revoke a grant to actively deny operations that depend on it.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.RevokeGrantInput{ GrantId: aws.String("GrantIdType"), // Required KeyId: aws.String("KeyIdType"), // Required } resp, err := svc.RevokeGrant(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) RevokeGrantRequest ¶
func (c *KMS) RevokeGrantRequest(input *RevokeGrantInput) (req *request.Request, output *RevokeGrantOutput)
RevokeGrantRequest generates a "aws/request.Request" representing the client's request for the RevokeGrant operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the RevokeGrant method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the RevokeGrantRequest method. req, resp := client.RevokeGrantRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) ScheduleKeyDeletion ¶
func (c *KMS) ScheduleKeyDeletion(input *ScheduleKeyDeletionInput) (*ScheduleKeyDeletionOutput, error)
Schedules the deletion of a customer master key (CMK). You may provide a waiting period, specified in days, before deletion occurs. If you do not provide a waiting period, the default period of 30 days is used. When this operation is successful, the state of the CMK changes to PendingDeletion. Before the waiting period ends, you can use CancelKeyDeletion to cancel the deletion of the CMK. After the waiting period ends, AWS KMS deletes the CMK and all AWS KMS data associated with it, including all aliases that point to it.
Deleting a CMK is a destructive and potentially dangerous operation. When
a CMK is deleted, all data that was encrypted under the CMK is rendered unrecoverable. To restrict the use of a CMK without deleting it, use DisableKey.
For more information about scheduling a CMK for deletion, see Deleting
Customer Master Keys (http://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) in the AWS Key Management Service Developer Guide.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.ScheduleKeyDeletionInput{ KeyId: aws.String("KeyIdType"), // Required PendingWindowInDays: aws.Int64(1), } resp, err := svc.ScheduleKeyDeletion(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) ScheduleKeyDeletionRequest ¶
func (c *KMS) ScheduleKeyDeletionRequest(input *ScheduleKeyDeletionInput) (req *request.Request, output *ScheduleKeyDeletionOutput)
ScheduleKeyDeletionRequest generates a "aws/request.Request" representing the client's request for the ScheduleKeyDeletion operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ScheduleKeyDeletion method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the ScheduleKeyDeletionRequest method. req, resp := client.ScheduleKeyDeletionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) UpdateAlias ¶
func (c *KMS) UpdateAlias(input *UpdateAliasInput) (*UpdateAliasOutput, error)
Updates an alias to map it to a different key.
An alias is not a property of a key. Therefore, an alias can be mapped to and unmapped from an existing key without changing the properties of the key.
An alias name can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). An alias must start with the word "alias" followed by a forward slash (alias/). An alias that begins with "aws" after the forward slash (alias/aws...) is reserved by Amazon Web Services (AWS).
The alias and the key it is mapped to must be in the same AWS account and the same region.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.UpdateAliasInput{ AliasName: aws.String("AliasNameType"), // Required TargetKeyId: aws.String("KeyIdType"), // Required } resp, err := svc.UpdateAlias(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) UpdateAliasRequest ¶
func (c *KMS) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, output *UpdateAliasOutput)
UpdateAliasRequest generates a "aws/request.Request" representing the client's request for the UpdateAlias operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the UpdateAlias method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the UpdateAliasRequest method. req, resp := client.UpdateAliasRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*KMS) UpdateKeyDescription ¶
func (c *KMS) UpdateKeyDescription(input *UpdateKeyDescriptionInput) (*UpdateKeyDescriptionOutput, error)
Updates the description of a key.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" ) func main() { sess, err := session.NewSession() if err != nil { fmt.Println("failed to create session,", err) return } svc := kms.New(sess) params := &kms.UpdateKeyDescriptionInput{ Description: aws.String("DescriptionType"), // Required KeyId: aws.String("KeyIdType"), // Required } resp, err := svc.UpdateKeyDescription(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*KMS) UpdateKeyDescriptionRequest ¶
func (c *KMS) UpdateKeyDescriptionRequest(input *UpdateKeyDescriptionInput) (req *request.Request, output *UpdateKeyDescriptionOutput)
UpdateKeyDescriptionRequest generates a "aws/request.Request" representing the client's request for the UpdateKeyDescription operation. The "output" return value can be used to capture response data after the request's "Send" method is called.
Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the UpdateKeyDescription method directly instead.
Note: You must call the "Send" method on the returned request object in order to execute the request.
// Example sending a request using the UpdateKeyDescriptionRequest method. req, resp := client.UpdateKeyDescriptionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
type KeyListEntry ¶
type KeyListEntry struct { // ARN of the key. KeyArn *string `min:"20" type:"string"` // Unique identifier of the key. KeyId *string `min:"1" type:"string"` // contains filtered or unexported fields }
Contains information about each entry in the key list.
func (KeyListEntry) GoString ¶
func (s KeyListEntry) GoString() string
GoString returns the string representation
func (KeyListEntry) String ¶
func (s KeyListEntry) String() string
String returns the string representation
type KeyMetadata ¶
type KeyMetadata struct { // The twelve-digit account ID of the AWS account that owns the key. AWSAccountId *string `type:"string"` // The Amazon Resource Name (ARN) of the key. For examples, see AWS Key Management // Service (AWS KMS) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms) // in the Example ARNs section of the AWS General Reference. Arn *string `min:"20" type:"string"` // The date and time when the key was created. CreationDate *time.Time `type:"timestamp" timestampFormat:"unix"` // The date and time after which AWS KMS deletes the customer master key (CMK). // This value is present only when KeyState is PendingDeletion, otherwise this // value is null. DeletionDate *time.Time `type:"timestamp" timestampFormat:"unix"` // The friendly description of the key. Description *string `type:"string"` // Specifies whether the key is enabled. When KeyState is Enabled this value // is true, otherwise it is false. Enabled *bool `type:"boolean"` // The globally unique identifier for the key. KeyId *string `min:"1" type:"string" required:"true"` // The state of the customer master key (CMK). // // For more information about how key state affects the use of a CMK, see How // Key State Affects the Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. KeyState *string `type:"string" enum:"KeyState"` // The cryptographic operations for which you can use the key. Currently the // only allowed value is ENCRYPT_DECRYPT, which means you can use the key for // the Encrypt and Decrypt operations. KeyUsage *string `type:"string" enum:"KeyUsageType"` // contains filtered or unexported fields }
Contains metadata about a customer master key (CMK).
This data type is used as a response element for the CreateKey and DescribeKey operations.
func (KeyMetadata) GoString ¶
func (s KeyMetadata) GoString() string
GoString returns the string representation
func (KeyMetadata) String ¶
func (s KeyMetadata) String() string
String returns the string representation
type ListAliasesInput ¶
type ListAliasesInput struct { // When paginating results, specify the maximum number of items to return in // the response. If additional items exist beyond the number you specify, the // Truncated element in the response is set to true. // // This value is optional. If you include a value, it must be between 1 and // 100, inclusive. If you do not include a value, it defaults to 50. Limit *int64 `min:"1" type:"integer"` // Use this parameter only when paginating results and only in a subsequent // request after you receive a response with truncated results. Set it to the // value of NextMarker from the response you just received. Marker *string `min:"1" type:"string"` // contains filtered or unexported fields }
func (ListAliasesInput) GoString ¶
func (s ListAliasesInput) GoString() string
GoString returns the string representation
func (ListAliasesInput) String ¶
func (s ListAliasesInput) String() string
String returns the string representation
func (*ListAliasesInput) Validate ¶
func (s *ListAliasesInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type ListAliasesOutput ¶
type ListAliasesOutput struct { // A list of key aliases in the user's account. Aliases []*AliasListEntry `type:"list"` // When Truncated is true, this value is present and contains the value to use // for the Marker parameter in a subsequent pagination request. NextMarker *string `min:"1" type:"string"` // A flag that indicates whether there are more items in the list. If your results // were truncated, you can use the Marker parameter to make a subsequent pagination // request to retrieve more items in the list. Truncated *bool `type:"boolean"` // contains filtered or unexported fields }
func (ListAliasesOutput) GoString ¶
func (s ListAliasesOutput) GoString() string
GoString returns the string representation
func (ListAliasesOutput) String ¶
func (s ListAliasesOutput) String() string
String returns the string representation
type ListGrantsInput ¶
type ListGrantsInput struct { // A unique identifier for the customer master key. This value can be a globally // unique identifier or the fully specified ARN to a key. // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 KeyId *string `min:"1" type:"string" required:"true"` // When paginating results, specify the maximum number of items to return in // the response. If additional items exist beyond the number you specify, the // Truncated element in the response is set to true. // // This value is optional. If you include a value, it must be between 1 and // 100, inclusive. If you do not include a value, it defaults to 50. Limit *int64 `min:"1" type:"integer"` // Use this parameter only when paginating results and only in a subsequent // request after you receive a response with truncated results. Set it to the // value of NextMarker from the response you just received. Marker *string `min:"1" type:"string"` // contains filtered or unexported fields }
func (ListGrantsInput) GoString ¶
func (s ListGrantsInput) GoString() string
GoString returns the string representation
func (ListGrantsInput) String ¶
func (s ListGrantsInput) String() string
String returns the string representation
func (*ListGrantsInput) Validate ¶
func (s *ListGrantsInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type ListGrantsResponse ¶
type ListGrantsResponse struct { // A list of grants. Grants []*GrantListEntry `type:"list"` // When Truncated is true, this value is present and contains the value to use // for the Marker parameter in a subsequent pagination request. NextMarker *string `min:"1" type:"string"` // A flag that indicates whether there are more items in the list. If your results // were truncated, you can use the Marker parameter to make a subsequent pagination // request to retrieve more items in the list. Truncated *bool `type:"boolean"` // contains filtered or unexported fields }
func (ListGrantsResponse) GoString ¶
func (s ListGrantsResponse) GoString() string
GoString returns the string representation
func (ListGrantsResponse) String ¶
func (s ListGrantsResponse) String() string
String returns the string representation
type ListKeyPoliciesInput ¶
type ListKeyPoliciesInput struct { // A unique identifier for the customer master key. This value can be a globally // unique identifier, a fully specified ARN to either an alias or a key, or // an alias name prefixed by "alias/". // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 // // Alias Name Example - alias/MyAliasName KeyId *string `min:"1" type:"string" required:"true"` // When paginating results, specify the maximum number of items to return in // the response. If additional items exist beyond the number you specify, the // Truncated element in the response is set to true. // // This value is optional. If you include a value, it must be between 1 and // 1000, inclusive. If you do not include a value, it defaults to 100. // // Currently only 1 policy can be attached to a key. Limit *int64 `min:"1" type:"integer"` // Use this parameter only when paginating results and only in a subsequent // request after you receive a response with truncated results. Set it to the // value of NextMarker from the response you just received. Marker *string `min:"1" type:"string"` // contains filtered or unexported fields }
func (ListKeyPoliciesInput) GoString ¶
func (s ListKeyPoliciesInput) GoString() string
GoString returns the string representation
func (ListKeyPoliciesInput) String ¶
func (s ListKeyPoliciesInput) String() string
String returns the string representation
func (*ListKeyPoliciesInput) Validate ¶
func (s *ListKeyPoliciesInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type ListKeyPoliciesOutput ¶
type ListKeyPoliciesOutput struct { // When Truncated is true, this value is present and contains the value to use // for the Marker parameter in a subsequent pagination request. NextMarker *string `min:"1" type:"string"` // A list of policy names. Currently, there is only one policy and it is named // "Default". PolicyNames []*string `type:"list"` // A flag that indicates whether there are more items in the list. If your results // were truncated, you can use the Marker parameter to make a subsequent pagination // request to retrieve more items in the list. Truncated *bool `type:"boolean"` // contains filtered or unexported fields }
func (ListKeyPoliciesOutput) GoString ¶
func (s ListKeyPoliciesOutput) GoString() string
GoString returns the string representation
func (ListKeyPoliciesOutput) String ¶
func (s ListKeyPoliciesOutput) String() string
String returns the string representation
type ListKeysInput ¶
type ListKeysInput struct { // When paginating results, specify the maximum number of items to return in // the response. If additional items exist beyond the number you specify, the // Truncated element in the response is set to true. // // This value is optional. If you include a value, it must be between 1 and // 1000, inclusive. If you do not include a value, it defaults to 100. Limit *int64 `min:"1" type:"integer"` // Use this parameter only when paginating results and only in a subsequent // request after you receive a response with truncated results. Set it to the // value of NextMarker from the response you just received. Marker *string `min:"1" type:"string"` // contains filtered or unexported fields }
func (ListKeysInput) GoString ¶
func (s ListKeysInput) GoString() string
GoString returns the string representation
func (ListKeysInput) String ¶
func (s ListKeysInput) String() string
String returns the string representation
func (*ListKeysInput) Validate ¶
func (s *ListKeysInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type ListKeysOutput ¶
type ListKeysOutput struct { // A list of keys. Keys []*KeyListEntry `type:"list"` // When Truncated is true, this value is present and contains the value to use // for the Marker parameter in a subsequent pagination request. NextMarker *string `min:"1" type:"string"` // A flag that indicates whether there are more items in the list. If your results // were truncated, you can use the Marker parameter to make a subsequent pagination // request to retrieve more items in the list. Truncated *bool `type:"boolean"` // contains filtered or unexported fields }
func (ListKeysOutput) GoString ¶
func (s ListKeysOutput) GoString() string
GoString returns the string representation
func (ListKeysOutput) String ¶
func (s ListKeysOutput) String() string
String returns the string representation
type ListRetirableGrantsInput ¶
type ListRetirableGrantsInput struct { // When paginating results, specify the maximum number of items to return in // the response. If additional items exist beyond the number you specify, the // Truncated element in the response is set to true. // // This value is optional. If you include a value, it must be between 1 and // 100, inclusive. If you do not include a value, it defaults to 50. Limit *int64 `min:"1" type:"integer"` // Use this parameter only when paginating results and only in a subsequent // request after you receive a response with truncated results. Set it to the // value of NextMarker from the response you just received. Marker *string `min:"1" type:"string"` // The retiring principal for which to list grants. // // To specify the retiring principal, use the Amazon Resource Name (ARN) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // of an AWS principal. Valid AWS principals include AWS accounts (root), IAM // users, federated users, and assumed role users. For examples of the ARN syntax // for specifying a principal, see AWS Identity and Access Management (IAM) // (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam) // in the Example ARNs section of the Amazon Web Services General Reference. RetiringPrincipal *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (ListRetirableGrantsInput) GoString ¶
func (s ListRetirableGrantsInput) GoString() string
GoString returns the string representation
func (ListRetirableGrantsInput) String ¶
func (s ListRetirableGrantsInput) String() string
String returns the string representation
func (*ListRetirableGrantsInput) Validate ¶
func (s *ListRetirableGrantsInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type PutKeyPolicyInput ¶
type PutKeyPolicyInput struct { // A flag to indicate whether to bypass the key policy lockout safety check. // // Setting this value to true increases the likelihood that the CMK becomes // unmanageable. Do not set this value to true indiscriminately. // // For more information, refer to the scenario in the Default Key Policy (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) // section in the AWS Key Management Service Developer Guide. // // Use this parameter only when you intend to prevent the principal making // the request from making a subsequent PutKeyPolicy request on the CMK. // // The default value is false. BypassPolicyLockoutSafetyCheck *bool `type:"boolean"` // A unique identifier for the CMK. // // Use the CMK's unique identifier or its Amazon Resource Name (ARN). For example: // // Unique ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab KeyId *string `min:"1" type:"string" required:"true"` // The key policy to attach to the CMK. // // The key policy must meet the following criteria: // // It must allow the principal making the PutKeyPolicy request to make a // subsequent PutKeyPolicy request on the CMK. This reduces the likelihood that // the CMK becomes unmanageable. For more information, refer to the scenario // in the Default Key Policy (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) // section in the AWS Key Management Service Developer Guide. // // The principal(s) specified in the key policy must exist and be visible // to AWS KMS. When you create a new AWS principal (for example, an IAM user // or role), you might need to enforce a delay before specifying the new principal // in a key policy because the new principal might not immediately be visible // to AWS KMS. For more information, see Changes that I make are not always // immediately visible (http://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency) // in the IAM User Guide. // // The policy size limit is 32 KiB (32768 bytes). Policy *string `min:"1" type:"string" required:"true"` // The name of the key policy. // // This value must be default. PolicyName *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (PutKeyPolicyInput) GoString ¶
func (s PutKeyPolicyInput) GoString() string
GoString returns the string representation
func (PutKeyPolicyInput) String ¶
func (s PutKeyPolicyInput) String() string
String returns the string representation
func (*PutKeyPolicyInput) Validate ¶
func (s *PutKeyPolicyInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type PutKeyPolicyOutput ¶
type PutKeyPolicyOutput struct {
// contains filtered or unexported fields
}
func (PutKeyPolicyOutput) GoString ¶
func (s PutKeyPolicyOutput) GoString() string
GoString returns the string representation
func (PutKeyPolicyOutput) String ¶
func (s PutKeyPolicyOutput) String() string
String returns the string representation
type ReEncryptInput ¶
type ReEncryptInput struct { // Ciphertext of the data to re-encrypt. // // CiphertextBlob is automatically base64 encoded/decoded by the SDK. CiphertextBlob []byte `min:"1" type:"blob" required:"true"` // Encryption context to be used when the data is re-encrypted. DestinationEncryptionContext map[string]*string `type:"map"` // A unique identifier for the customer master key used to re-encrypt the data. // This value can be a globally unique identifier, a fully specified ARN to // either an alias or a key, or an alias name prefixed by "alias/". // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 // // Alias Name Example - alias/MyAliasName DestinationKeyId *string `min:"1" type:"string" required:"true"` // A list of grant tokens. // // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) // in the AWS Key Management Service Developer Guide. GrantTokens []*string `type:"list"` // Encryption context used to encrypt and decrypt the data specified in the // CiphertextBlob parameter. SourceEncryptionContext map[string]*string `type:"map"` // contains filtered or unexported fields }
func (ReEncryptInput) GoString ¶
func (s ReEncryptInput) GoString() string
GoString returns the string representation
func (ReEncryptInput) String ¶
func (s ReEncryptInput) String() string
String returns the string representation
func (*ReEncryptInput) Validate ¶
func (s *ReEncryptInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type ReEncryptOutput ¶
type ReEncryptOutput struct { // The re-encrypted data. If you are using the CLI, the value is Base64 encoded. // Otherwise, it is not encoded. // // CiphertextBlob is automatically base64 encoded/decoded by the SDK. CiphertextBlob []byte `min:"1" type:"blob"` // Unique identifier of the key used to re-encrypt the data. KeyId *string `min:"1" type:"string"` // Unique identifier of the key used to originally encrypt the data. SourceKeyId *string `min:"1" type:"string"` // contains filtered or unexported fields }
func (ReEncryptOutput) GoString ¶
func (s ReEncryptOutput) GoString() string
GoString returns the string representation
func (ReEncryptOutput) String ¶
func (s ReEncryptOutput) String() string
String returns the string representation
type RetireGrantInput ¶
type RetireGrantInput struct { // Unique identifier of the grant to be retired. The grant ID is returned by // the CreateGrant function. // // Grant ID Example - 0123456789012345678901234567890123456789012345678901234567890123 GrantId *string `min:"1" type:"string"` // Token that identifies the grant to be retired. GrantToken *string `min:"1" type:"string"` // A unique identifier for the customer master key associated with the grant. // This value can be a globally unique identifier or a fully specified ARN of // the key. // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 KeyId *string `min:"1" type:"string"` // contains filtered or unexported fields }
func (RetireGrantInput) GoString ¶
func (s RetireGrantInput) GoString() string
GoString returns the string representation
func (RetireGrantInput) String ¶
func (s RetireGrantInput) String() string
String returns the string representation
func (*RetireGrantInput) Validate ¶
func (s *RetireGrantInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type RetireGrantOutput ¶
type RetireGrantOutput struct {
// contains filtered or unexported fields
}
func (RetireGrantOutput) GoString ¶
func (s RetireGrantOutput) GoString() string
GoString returns the string representation
func (RetireGrantOutput) String ¶
func (s RetireGrantOutput) String() string
String returns the string representation
type RevokeGrantInput ¶
type RevokeGrantInput struct { // Identifier of the grant to be revoked. GrantId *string `min:"1" type:"string" required:"true"` // A unique identifier for the customer master key associated with the grant. // This value can be a globally unique identifier or the fully specified ARN // to a key. // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 KeyId *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (RevokeGrantInput) GoString ¶
func (s RevokeGrantInput) GoString() string
GoString returns the string representation
func (RevokeGrantInput) String ¶
func (s RevokeGrantInput) String() string
String returns the string representation
func (*RevokeGrantInput) Validate ¶
func (s *RevokeGrantInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type RevokeGrantOutput ¶
type RevokeGrantOutput struct {
// contains filtered or unexported fields
}
func (RevokeGrantOutput) GoString ¶
func (s RevokeGrantOutput) GoString() string
GoString returns the string representation
func (RevokeGrantOutput) String ¶
func (s RevokeGrantOutput) String() string
String returns the string representation
type ScheduleKeyDeletionInput ¶
type ScheduleKeyDeletionInput struct { // The unique identifier for the customer master key (CMK) to delete. // // To specify this value, use 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-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // To obtain the unique key ID and key ARN for a given CMK, use ListKeys // or DescribeKey. KeyId *string `min:"1" type:"string" required:"true"` // The waiting period, specified in number of days. After the waiting period // ends, AWS KMS deletes the customer master key (CMK). // // This value is optional. If you include a value, it must be between 7 and // 30, inclusive. If you do not include a value, it defaults to 30. PendingWindowInDays *int64 `min:"1" type:"integer"` // contains filtered or unexported fields }
func (ScheduleKeyDeletionInput) GoString ¶
func (s ScheduleKeyDeletionInput) GoString() string
GoString returns the string representation
func (ScheduleKeyDeletionInput) String ¶
func (s ScheduleKeyDeletionInput) String() string
String returns the string representation
func (*ScheduleKeyDeletionInput) Validate ¶
func (s *ScheduleKeyDeletionInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type ScheduleKeyDeletionOutput ¶
type ScheduleKeyDeletionOutput struct { // The date and time after which AWS KMS deletes the customer master key (CMK). DeletionDate *time.Time `type:"timestamp" timestampFormat:"unix"` // The unique identifier of the customer master key (CMK) for which deletion // is scheduled. KeyId *string `min:"1" type:"string"` // contains filtered or unexported fields }
func (ScheduleKeyDeletionOutput) GoString ¶
func (s ScheduleKeyDeletionOutput) GoString() string
GoString returns the string representation
func (ScheduleKeyDeletionOutput) String ¶
func (s ScheduleKeyDeletionOutput) String() string
String returns the string representation
type UpdateAliasInput ¶
type UpdateAliasInput struct { // String that contains the name of the alias to be modified. The name must // start with the word "alias" followed by a forward slash (alias/). Aliases // that begin with "alias/aws" are reserved. AliasName *string `min:"1" type:"string" required:"true"` // Unique identifier of the customer master key to be mapped to the alias. This // value can be a globally unique identifier or the fully specified ARN of a // key. // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 // // You can call ListAliases to verify that the alias is mapped to the correct // TargetKeyId. TargetKeyId *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (UpdateAliasInput) GoString ¶
func (s UpdateAliasInput) GoString() string
GoString returns the string representation
func (UpdateAliasInput) String ¶
func (s UpdateAliasInput) String() string
String returns the string representation
func (*UpdateAliasInput) Validate ¶
func (s *UpdateAliasInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type UpdateAliasOutput ¶
type UpdateAliasOutput struct {
// contains filtered or unexported fields
}
func (UpdateAliasOutput) GoString ¶
func (s UpdateAliasOutput) GoString() string
GoString returns the string representation
func (UpdateAliasOutput) String ¶
func (s UpdateAliasOutput) String() string
String returns the string representation
type UpdateKeyDescriptionInput ¶
type UpdateKeyDescriptionInput struct { // New description for the key. Description *string `type:"string" required:"true"` // A unique identifier for the customer master key. This value can be a globally // unique identifier or the fully specified ARN to a key. // // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 // // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 KeyId *string `min:"1" type:"string" required:"true"` // contains filtered or unexported fields }
func (UpdateKeyDescriptionInput) GoString ¶
func (s UpdateKeyDescriptionInput) GoString() string
GoString returns the string representation
func (UpdateKeyDescriptionInput) String ¶
func (s UpdateKeyDescriptionInput) String() string
String returns the string representation
func (*UpdateKeyDescriptionInput) Validate ¶
func (s *UpdateKeyDescriptionInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type UpdateKeyDescriptionOutput ¶
type UpdateKeyDescriptionOutput struct {
// contains filtered or unexported fields
}
func (UpdateKeyDescriptionOutput) GoString ¶
func (s UpdateKeyDescriptionOutput) GoString() string
GoString returns the string representation
func (UpdateKeyDescriptionOutput) String ¶
func (s UpdateKeyDescriptionOutput) String() string
String returns the string representation