Struct: kms.SignInput

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

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.

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

Identifies an asymmetric KMS key. KMS uses the private key in the asymmetric KMS key to sign the message. The KeyUsage type of the KMS key must be SIGN_VERIFY. To find the KeyUsage 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.

KeyId is a required field

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

Specifies the message or message digest to sign. Messages can be 0-4096 bytes. To sign a larger message, provide a message digest.

If you provide a message digest, use the DIGEST value of MessageType to prevent the digest from being hashed again while signing.

Message is a sensitive parameter and its value will be replaced with “sensitive” in string returned by SignInput's String and GoString methods.

Message is automatically base64 encoded/decoded by the SDK.

Message is a required field

MessageType *string `type:"string" enum:"MessageType"`

Tells AWS KMS whether the value of the Message parameter is a message or message digest. The default value, RAW, indicates a message. To indicate a message digest, enter DIGEST.

SigningAlgorithm *string `type:"string" required:"true" enum:"SigningAlgorithmSpec"`

Specifies the signing algorithm to use when signing the message.

Choose an algorithm that is compatible with the type and size of the specified asymmetric KMS key. When signing with RSA key pairs, RSASSA-PSS algorithms are preferred. We include RSASSA-PKCS1-v1_5 algorithms for compatibility with existing applications.

SigningAlgorithm is a required field

_ struct{} `type:"structure"`

Method Details

func (s SignInput) 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”.



16363
16364
16365
// File 'service/kms/api.go', line 16363

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

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

SetGrantTokens sets the GrantTokens field's value.



16393
16394
16395
16396
// File 'service/kms/api.go', line 16393

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

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

SetKeyId sets the KeyId field's value.



16399
16400
16401
16402
// File 'service/kms/api.go', line 16399

func (s *SignInput) SetKeyId(v string) *SignInput { s.KeyId = &v return s }

func (s *SignInput) SetMessage(v []byte) *SignInput

SetMessage sets the Message field's value.



16405
16406
16407
16408
// File 'service/kms/api.go', line 16405

func (s *SignInput) SetMessage(v []byte) *SignInput { s.Message = v return s }

func (s *SignInput) SetMessageType(v string) *SignInput

SetMessageType sets the MessageType field's value.



16411
16412
16413
16414
// File 'service/kms/api.go', line 16411

func (s *SignInput) SetMessageType(v string) *SignInput { s.MessageType = &v return s }

func (s *SignInput) SetSigningAlgorithm(v string) *SignInput

SetSigningAlgorithm sets the SigningAlgorithm field's value.



16417
16418
16419
16420
// File 'service/kms/api.go', line 16417

func (s *SignInput) SetSigningAlgorithm(v string) *SignInput { s.SigningAlgorithm = &v return s }

func (s SignInput) 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”.



16354
16355
16356
// File 'service/kms/api.go', line 16354

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

func (s *SignInput) Validate() error

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



16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
// File 'service/kms/api.go', line 16368

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