3
3
"""
4
4
This example sets up the AWS KMS MRK (multi-region key) Discovery Keyring
5
5
6
- AWS KMS discovery keyring is an AWS KMS keyring that doesn't specify any wrapping keys.
7
- The AWS Encryption SDK provides a standard AWS KMS discovery keyring and a discovery keyring
8
- for AWS KMS multi-Region keys. Because it doesn't specify any wrapping keys, a discovery keyring
9
- can't encrypt data. If you use a discovery keyring to encrypt data, alone or in a multi-keyring,
10
- the encrypt operation fails.
6
+ The AWS KMS discovery keyring is an AWS KMS keyring that doesn't specify any wrapping keys.
11
7
12
8
When decrypting, an MRK discovery keyring allows the AWS Encryption SDK to ask AWS KMS to decrypt
13
9
any encrypted data key by using the AWS KMS MRK that encrypted it, regardless of who owns or
14
10
has access to that AWS KMS key. The call succeeds only when the caller has kms:Decrypt
15
11
permission on the AWS KMS MRK.
16
12
13
+ The AWS Encryption SDK provides a standard AWS KMS discovery keyring and a discovery keyring
14
+ for AWS KMS multi-Region keys. Because it doesn't specify any wrapping keys, a discovery keyring
15
+ can't encrypt data. If you use a discovery keyring to encrypt data, alone or in a multi-keyring,
16
+ the encrypt operation fails.
17
+
17
18
The AWS Key Management Service (AWS KMS) MRK keyring interacts with AWS KMS to
18
19
create, encrypt, and decrypt data keys with multi-region AWS KMS keys (MRKs).
19
20
This example creates a KMS MRK Keyring and then encrypts a custom input EXAMPLE_DATA
27
28
For information about using multi-Region keys with the AWS Encryption SDK, see
28
29
https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/configure.html#config-mrks
29
30
30
- For more info on KMS MRK (multi-region keys), see the KMS documentation:
31
+ For more info on KMS MRKs (multi-region keys), see the KMS documentation:
31
32
https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html
32
33
33
34
For more information on how to use KMS Discovery keyrings, see
@@ -63,8 +64,9 @@ def encrypt_and_decrypt_with_keyring(
63
64
mrk_encrypt_region : str ,
64
65
mrk_replica_decrypt_region : str
65
66
):
66
- """Demonstrate an encrypt/decrypt cycle using an AWS KMS MRK Discovery keyring.
67
+ """Demonstrate decryption using an AWS KMS MRK Discovery keyring.
67
68
69
+ Since discovery keyrings cannot be used to encrypt, we use KMS MRK keyring for encryption
68
70
Usage: encrypt_and_decrypt_with_keyring(mrk_key_id_encrypt,
69
71
aws_account_id,
70
72
mrk_encrypt_region,
@@ -79,9 +81,9 @@ def encrypt_and_decrypt_with_keyring(
79
81
:type mrk_encrypt_region: string
80
82
:param mrk_replica_decrypt_region: AWS Region for decryption of your data keys.
81
83
This example assumes you have already replicated your mrk_key_id_encrypt to the
82
- region mrk_replica_decrypt_region. Therfore , this mrk_replica_decrypt_region should
83
- be the region of the mrk replica key id . However, since we are using a discovery keyring,
84
- we don't need to provide the mrk replica key id
84
+ region mrk_replica_decrypt_region. Therefore , this mrk_replica_decrypt_region should
85
+ be the region of the MRK replica. However, since we are using a discovery keyring,
86
+ we don't need to provide the replica MRK ID.
85
87
:type mrk_replica_decrypt_region: string
86
88
87
89
For more information on KMS Key identifiers for multi-region keys, see
0 commit comments