Class: Aws::KMS::Types::GenerateMacRequest

Inherits:
Struct
  • Object
show all
Includes:
Structure
Defined in:
lib/aws-sdk-kms/types.rb

Overview

Note:

When making an API call, you may pass GenerateMacRequest data as a hash:

{
  message: "data", # required
  key_id: "KeyIdType", # required
  mac_algorithm: "HMAC_SHA_224", # required, accepts HMAC_SHA_224, HMAC_SHA_256, HMAC_SHA_384, HMAC_SHA_512
  grant_tokens: ["GrantTokenType"],
}

Constant Summary collapse

SENSITIVE =
[:message]

Instance Attribute Summary collapse

Instance Attribute Details

#grant_tokensArray<String>

A list of grant tokens.

Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved *eventual consistency*. For more information, see [Grant token] and [Using a grant token] in the *Key Management Service Developer Guide*.

[1]: docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token [2]: docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token

Returns:

  • (Array<String>)

2504
2505
2506
2507
2508
2509
2510
2511
# File 'lib/aws-sdk-kms/types.rb', line 2504

class GenerateMacRequest < Struct.new(
  :message,
  :key_id,
  :mac_algorithm,
  :grant_tokens)
  SENSITIVE = [:message]
  include Aws::Structure
end

#key_idString

The HMAC KMS key to use in the operation. The MAC algorithm computes the HMAC for the message and the key as described in [RFC 2104].

To identify an HMAC KMS key, use the DescribeKey operation and see the `KeySpec` field in the response.

[1]: datatracker.ietf.org/doc/html/rfc2104

Returns:

  • (String)

2504
2505
2506
2507
2508
2509
2510
2511
# File 'lib/aws-sdk-kms/types.rb', line 2504

class GenerateMacRequest < Struct.new(
  :message,
  :key_id,
  :mac_algorithm,
  :grant_tokens)
  SENSITIVE = [:message]
  include Aws::Structure
end

#mac_algorithmString

The MAC algorithm used in the operation.

The algorithm must be compatible with the HMAC KMS key that you specify. To find the MAC algorithms that your HMAC KMS key supports, use the DescribeKey operation and see the `MacAlgorithms` field in the `DescribeKey` response.

Returns:

  • (String)

2504
2505
2506
2507
2508
2509
2510
2511
# File 'lib/aws-sdk-kms/types.rb', line 2504

class GenerateMacRequest < Struct.new(
  :message,
  :key_id,
  :mac_algorithm,
  :grant_tokens)
  SENSITIVE = [:message]
  include Aws::Structure
end

#messageString

The message to be hashed. Specify a message of up to 4,096 bytes.

`GenerateMac` and VerifyMac do not provide special handling for message digests. If you generate an HMAC for a hash digest of a message, you must verify the HMAC of the same hash digest.

Returns:

  • (String)

2504
2505
2506
2507
2508
2509
2510
2511
# File 'lib/aws-sdk-kms/types.rb', line 2504

class GenerateMacRequest < Struct.new(
  :message,
  :key_id,
  :mac_algorithm,
  :grant_tokens)
  SENSITIVE = [:message]
  include Aws::Structure
end