Skip to content

Commit dd59a36

Browse files
mattsb42-awsjuneb
andauthored
docs: apply suggestions from code review
Co-Authored-By: June Blender <juneb@users.noreply.github.com>
1 parent b8fdf96 commit dd59a36

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

examples/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ in the [`examples/src/`](./src) directory.
2121

2222
## Configuration
2323

24-
To use the library APIs,
24+
To use the encryption and decryption APIs,
2525
you need to describe how you want the library to protect your data keys.
26-
You can do this using
26+
You can do this by configuring
2727
[keyrings](#keyrings) or [cryptographic materials managers](#cryptographic-materials-managers),
28-
or using [master key providers](#master-key-providers).
28+
or by configuring [master key providers](#master-key-providers).
2929
These examples will show you how to use the configuration tools that we include for you
30-
as well as how to create some of your own.
30+
and how to create some of your own.
3131
We start with AWS KMS examples, then show how to use other wrapping keys.
3232

3333
* Using AWS Key Management Service (AWS KMS)
34-
* How to use a single AWS KMS CMK
34+
* How to use one AWS KMS CMK
3535
* [with keyrings](./src/keyring/aws_kms/single_cmk.py)
3636
* How to use multiple AWS KMS CMKs in different regions
3737
* [with keyrings](./src/keyring/aws_kms/multiple_regions.py)

examples/src/keyring/aws_kms/custom_client_supplier.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
supplies a client with the same configuration for every region.
66
If you need different behavior, you can write your own client supplier.
77
8-
One use-case where you might need this is
9-
if you need different credentials to talk to different AWS regions.
8+
You might use this
9+
if you need different credentials in different AWS regions.
1010
This might be because you are crossing partitions (ex: ``aws`` and ``aws-cn``)
1111
or if you are working with regions that have separate authentication silos
1212
like ``ap-east-1`` and ``me-south-1``.
@@ -38,7 +38,7 @@
3838
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
3939
from typing import Union # noqa pylint: disable=unused-import
4040
except ImportError: # pragma: no cover
41-
# We only actually need these imports when running the mypy checks
41+
# We only need these imports when running the mypy checks
4242
pass
4343

4444

examples/src/keyring/aws_kms/custom_kms_client_config.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
"""
4-
By default, the KMS keyring will use the default configurations
5-
for all KMS clients and will use the default discoverable credentials.
6-
If you need to change these configurations,
7-
you can do that using the client supplier.
4+
By default, the KMS keyring uses the default configurations
5+
for all KMS clients and uses the default discoverable credentials.
6+
If you need to change this configuration,
7+
you can configure the client supplier.
88
99
This example shows how to use custom-configured clients with the KMS keyring.
1010
@@ -73,8 +73,8 @@ def run(aws_kms_cmk, source_plaintext):
7373

7474
# Decrypt your encrypted data using the same keyring you used on encrypt.
7575
#
76-
# We do not need to specify the encryption context on decrypt
77-
# because the header message includes the encryption context.
76+
# You do not need to specify the encryption context on decrypt
77+
# because the header of the encrypted message includes the encryption context.
7878
decrypted, decrypt_header = aws_encryption_sdk.decrypt(source=ciphertext, keyring=keyring)
7979

8080
# Demonstrate that the decrypted plaintext is identical to the original plaintext.

examples/src/keyring/aws_kms/discovery_decrypt.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
When you give the KMS keyring specific key IDs it will use those CMKs and nothing else.
55
This is true both on encrypt and on decrypt.
66
However, sometimes you need more flexibility on decrypt,
7-
especially if you might not know beforehand which CMK was used to encrypt a message.
7+
especially when you don't know which CMKs were used to encrypt a message.
88
To address this need, you can use a KMS discovery keyring.
9-
The KMS discovery keyring will do nothing on encrypt
10-
but will attempt to decrypt *any* data keys that were encrypted under a KMS CMK.
9+
The KMS discovery keyring does nothing on encrypt,
10+
but attempts to decrypt *any* data keys that were encrypted under a KMS CMK.
1111
12-
This example shows how to configure and use a KMS keyring in discovery mode.
12+
This example shows how to configure and use a KMS discovery keyring.
1313
1414
https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/choose-keyring.html#use-kms-keyring
1515
@@ -20,7 +20,7 @@
2020
see the ``keyring/aws_kms/custom_client_supplier``
2121
and ``keyring/aws_kms/custom_kms_client_config`` examples.
2222
23-
For examples of how to use the KMS keyring in discovery mode on decrypt,
23+
For examples of how to use the KMS discovery keyring on decrypt,
2424
see the ``keyring/aws_kms/discovery_decrypt_in_region_only``
2525
and ``keyring/aws_kms/discovery_decrypt_with_preferred_region`` examples.
2626
"""
@@ -30,7 +30,7 @@
3030

3131
def run(aws_kms_cmk, source_plaintext):
3232
# type: (str, bytes) -> None
33-
"""Demonstrate configuring a KMS keyring to use discovery mode for decryption.
33+
"""Demonstrate configuring a KMS discovery keyring for decryption.
3434
3535
:param str aws_kms_cmk: The ARN of an AWS KMS CMK that protects data keys
3636
:param bytes source_plaintext: Plaintext to encrypt
@@ -48,7 +48,7 @@ def run(aws_kms_cmk, source_plaintext):
4848
# Create the keyring that determines how your data keys are protected.
4949
encrypt_keyring = KmsKeyring(generator_key_id=aws_kms_cmk)
5050

51-
# Create the KMS discovery keyring that we will use on decrypt.
51+
# Create a KMS discovery keyring to use on decrypt.
5252
#
5353
# Because we do not specify any key IDs, this keyring is created in discovery mode.
5454
decrypt_keyring = KmsKeyring()
@@ -63,8 +63,8 @@ def run(aws_kms_cmk, source_plaintext):
6363

6464
# Decrypt your encrypted data using the KMS discovery keyring.
6565
#
66-
# We do not need to specify the encryption context on decrypt
67-
# because the header message includes the encryption context.
66+
# You do not need to specify the encryption context on decrypt
67+
# because the header of the encrypted message includes the encryption context.
6868
decrypted, decrypt_header = aws_encryption_sdk.decrypt(source=ciphertext, keyring=decrypt_keyring)
6969

7070
# Demonstrate that the decrypted plaintext is identical to the original plaintext.

examples/src/keyring/aws_kms/discovery_decrypt_in_region_only.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
When you give the KMS keyring specific key IDs it will use those CMKs and nothing else.
55
This is true both on encrypt and on decrypt.
66
However, sometimes you need more flexibility on decrypt,
7-
especially if you might not know beforehand which CMK was used to encrypt a message.
7+
especially if you don't know which CMK was used to encrypt a message.
88
To address this need, you can use a KMS discovery keyring.
9-
The KMS discovery keyring will do nothing on encrypt
10-
but will attempt to decrypt *any* data keys that were encrypted under a KMS CMK.
9+
The KMS discovery keyring does nothing on encrypt
10+
but attempts to decrypt *any* data keys that were encrypted under a KMS CMK.
1111
1212
However, sometimes you need to be a *bit* more restrictive than that.
13-
To address this need, you can use a client supplier to restrict what regions a KMS keyring can talk to.
13+
To address this need, you can use a client supplier that restricts the regions a KMS keyring can talk to.
1414
1515
This example shows how to configure and use a KMS regional discovery keyring that is restricted to one region.
1616

0 commit comments

Comments
 (0)