class Amazonite::Kms::GrantConstraints

Overview

Use this structure to allow cryptographic operations in the grant only when the operation request meets the specified constraints.

KMS supports the following grant constraints:

In a cryptographic operation, the encryption context in the decryption operation must be an exact, case-sensitive match for the keys and values in the encryption context of the encryption operation. Only the order of the pairs can vary.

However, in a grant constraint, the key in each key-value pair is not case sensitive, but the value is case sensitive.

To avoid confusion, do not use multiple encryption context pairs that differ only by case. To require a fully case-sensitive encryption context, use the kms:EncryptionContext: and kms:EncryptionContextKeys conditions in an IAM or key policy. For details, see kms:EncryptionContext:context-key in the * Key Management Service Developer Guide *.

Included Modules

Defined in:

kms/grant_constraints.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(encryption_context_subset : Hash(String, String) | Nil = nil, encryption_context_equals : Hash(String, String) | Nil = nil, source_arn : String | Nil = nil) #

[View source]
def self.new(*, __pull_for_json_serializable pull : JSON::PullParser) #

[View source]

Instance Method Detail

def ==(other : self) #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


def encryption_context_equals : Hash(String, String) | Nil #

A list of key-value pairs that must match the encryption context in the cryptographic operation request. The grant allows the operation only when the encryption context in the request is the same as the encryption context specified in this constraint.


[View source]
def encryption_context_equals=(encryption_context_equals : Hash(String, String) | Nil) #

A list of key-value pairs that must match the encryption context in the cryptographic operation request. The grant allows the operation only when the encryption context in the request is the same as the encryption context specified in this constraint.


[View source]
def encryption_context_subset : Hash(String, String) | Nil #

A list of key-value pairs that must be included in the encryption context of the cryptographic operation request. The grant allows the cryptographic operation only when the encryption context in the request includes the key-value pairs specified in this constraint, although it can include additional key-value pairs.


[View source]
def encryption_context_subset=(encryption_context_subset : Hash(String, String) | Nil) #

A list of key-value pairs that must be included in the encryption context of the cryptographic operation request. The grant allows the cryptographic operation only when the encryption context in the request includes the key-value pairs specified in this constraint, although it can include additional key-value pairs.


[View source]
def hash(hasher) #
Description copied from class Reference

See Object#hash(hasher)


def source_arn : String | Nil #

The Amazon Resource Name (ARN) of an Amazon Web Services resource on behalf of which the request is made. This is effectively the same as having the aws:SourceArn global condition key in the grant. The SourceArn constraint ensures that the principal can use the KMS key only when the request is made on behalf of the specified resource.


[View source]
def source_arn=(source_arn : String | Nil) #

The Amazon Resource Name (ARN) of an Amazon Web Services resource on behalf of which the request is made. This is effectively the same as having the aws:SourceArn global condition key in the grant. The SourceArn constraint ensures that the principal can use the KMS key only when the request is made on behalf of the specified resource.


[View source]
def validate! : Nil #

[View source]