Struct: kms.ReEncryptInput

import "../ibm-cos-sdk-go/service/kms"

Implemented Interfaces

s3crypto.Cipher, s3manager.ReadSeekerWriteTo, request.Validator, s3manager.WriterReadFrom

Structure Field Summary collapse

Service Operations collapse

Structure Field Details

CiphertextBlob []byte `min:"1" type:"blob" required:"true"`

Ciphertext of the data to reencrypt. CiphertextBlob is automatically base64 encoded/decoded by the SDK.

CiphertextBlob is a required field

DestinationEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"`

Specifies the encryption algorithm that KMS will use to reecrypt the data after it has decrypted it. The default value, SYMMETRIC_DEFAULT, represents the encryption algorithm used for symmetric encryption KMS keys.

This parameter is required only when the destination KMS key is an asymmetric KMS key.

DestinationEncryptionContext map[string]*string `type:"map"`

Specifies that encryption context to use when the reencrypting the data.

Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

A destination encryption context is valid only when the destination KMS key is a symmetric encryption KMS key. The standard ciphertext format for asymmetric KMS keys does not include fields for metadata.

An encryption context is a collection of non-secret key-value pairs that represent additional authenticated data. When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is supported only on operations with symmetric encryption KMS keys. On operations with symmetric encryption KMS keys, an encryption context is optional, but it is strongly recommended.

For more information, see Encryption context (docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) in the Key Management Service Developer Guide.

DestinationKeyId *string `min:"1" type:"string" required:"true"`

A unique identifier for the KMS key that is used to reencrypt the data. Specify a symmetric encryption KMS key or an asymmetric KMS key with a KeyUsage value of ENCRYPT_DECRYPT. To find the KeyUsage value of a KMS key, use the DescribeKey operation.

To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with “alias/”. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.

For example:

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

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

  • Alias name: alias/ExampleAlias

  • Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias

To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name and alias ARN, use ListAliases.

DestinationKeyId is a required field

GrantTokens []*string `type:"list"`

A list of grant tokens.

For more information, see Grant Tokens (docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) in the AWS Key Management Service Developer Guide.

SourceEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"`

Specifies the encryption algorithm that KMS will use to decrypt the ciphertext before it is reencrypted. The default value, SYMMETRIC_DEFAULT, represents the algorithm used for symmetric encryption KMS keys.

Specify the same algorithm that was used to encrypt the ciphertext. If you specify a different algorithm, the decrypt attempt fails.

This parameter is required only when the ciphertext was encrypted under an asymmetric KMS key.

SourceEncryptionContext map[string]*string `type:"map"`

Specifies the encryption context to use to decrypt the ciphertext. Enter the same encryption context that was used to encrypt the ciphertext.

An encryption context is a collection of non-secret key-value pairs that represent additional authenticated data. When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is supported only on operations with symmetric encryption KMS keys. On operations with symmetric encryption KMS keys, an encryption context is optional, but it is strongly recommended.

For more information, see Encryption context (docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) in the Key Management Service Developer Guide.

SourceKeyId *string `min:"1" type:"string"`

Specifies the KMS key that KMS will use to decrypt the ciphertext before it is re-encrypted.

Enter a key ID of the KMS key that was used to encrypt the ciphertext. If you identify a different KMS key, the ReEncrypt operation throws an IncorrectKeyException.

This parameter is required only when the ciphertext was encrypted under an asymmetric KMS key. If you used a symmetric encryption KMS key, KMS can get the KMS key from metadata that it adds to the symmetric ciphertext blob. However, it is always recommended as a best practice. This practice ensures that you use the KMS key that you intend.

To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with “alias/”. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.

For example:

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

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

  • Alias name: alias/ExampleAlias

  • Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias

To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name and alias ARN, use ListAliases.

_ struct{} `type:"structure"`

Method Details

func (s ReEncryptInput) GoString() string

GoString returns the string representation.

API parameter values that are decorated as “sensitive” in the API will not be included in the string output. The member name will be present, but the value will be replaced with “sensitive”.



15825
15826
15827
// File 'service/kms/api.go', line 15825

func (s ReEncryptInput) GoString() string { return s.String() }

func (s *ReEncryptInput) SetCiphertextBlob(v []byte) *ReEncryptInput

SetCiphertextBlob sets the CiphertextBlob field's value.



15855
15856
15857
15858
// File 'service/kms/api.go', line 15855

func (s *ReEncryptInput) SetCiphertextBlob(v []byte) *ReEncryptInput { s.CiphertextBlob = v return s }

func (s *ReEncryptInput) SetDestinationEncryptionAlgorithm(v string) *ReEncryptInput

SetDestinationEncryptionAlgorithm sets the DestinationEncryptionAlgorithm field's value.



15861
15862
15863
15864
// File 'service/kms/api.go', line 15861

func (s *ReEncryptInput) SetDestinationEncryptionAlgorithm(v string) *ReEncryptInput { s.DestinationEncryptionAlgorithm = &v return s }

func (s *ReEncryptInput) SetDestinationEncryptionContext(v map[string]*string) *ReEncryptInput

SetDestinationEncryptionContext sets the DestinationEncryptionContext field's value.



15867
15868
15869
15870
// File 'service/kms/api.go', line 15867

func (s *ReEncryptInput) SetDestinationEncryptionContext(v map[string]*string) *ReEncryptInput { s.DestinationEncryptionContext = v return s }

func (s *ReEncryptInput) SetDestinationKeyId(v string) *ReEncryptInput

SetDestinationKeyId sets the DestinationKeyId field's value.



15873
15874
15875
15876
// File 'service/kms/api.go', line 15873

func (s *ReEncryptInput) SetDestinationKeyId(v string) *ReEncryptInput { s.DestinationKeyId = &v return s }

func (s *ReEncryptInput) SetGrantTokens(v []*string) *ReEncryptInput

SetGrantTokens sets the GrantTokens field's value.



15879
15880
15881
15882
// File 'service/kms/api.go', line 15879

func (s *ReEncryptInput) SetGrantTokens(v []*string) *ReEncryptInput { s.GrantTokens = v return s }

func (s *ReEncryptInput) SetSourceEncryptionAlgorithm(v string) *ReEncryptInput

SetSourceEncryptionAlgorithm sets the SourceEncryptionAlgorithm field's value.



15885
15886
15887
15888
// File 'service/kms/api.go', line 15885

func (s *ReEncryptInput) SetSourceEncryptionAlgorithm(v string) *ReEncryptInput { s.SourceEncryptionAlgorithm = &v return s }

func (s *ReEncryptInput) SetSourceEncryptionContext(v map[string]*string) *ReEncryptInput

SetSourceEncryptionContext sets the SourceEncryptionContext field's value.



15891
15892
15893
15894
// File 'service/kms/api.go', line 15891

func (s *ReEncryptInput) SetSourceEncryptionContext(v map[string]*string) *ReEncryptInput { s.SourceEncryptionContext = v return s }

func (s *ReEncryptInput) SetSourceKeyId(v string) *ReEncryptInput

SetSourceKeyId sets the SourceKeyId field's value.



15897
15898
15899
15900
// File 'service/kms/api.go', line 15897

func (s *ReEncryptInput) SetSourceKeyId(v string) *ReEncryptInput { s.SourceKeyId = &v return s }

func (s ReEncryptInput) String() string

String returns the string representation.

API parameter values that are decorated as “sensitive” in the API will not be included in the string output. The member name will be present, but the value will be replaced with “sensitive”.



15816
15817
15818
// File 'service/kms/api.go', line 15816

func (s ReEncryptInput) String() string { return awsutil.Prettify(s) }

func (s *ReEncryptInput) Validate() error

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



15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
// File 'service/kms/api.go', line 15830

func (s *ReEncryptInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ReEncryptInput"} if s.CiphertextBlob == nil { invalidParams.Add(request.NewErrParamRequired("CiphertextBlob")) } if s.CiphertextBlob != nil && len(s.CiphertextBlob) < 1 { invalidParams.Add(request.NewErrParamMinLen("CiphertextBlob", 1)) } if s.DestinationKeyId == nil { invalidParams.Add(request.NewErrParamRequired("DestinationKeyId")) } if s.DestinationKeyId != nil && len(*s.DestinationKeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("DestinationKeyId", 1)) } if s.SourceKeyId != nil && len(*s.SourceKeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("SourceKeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil }