Skip to content

chore(examples): fix comments #705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions examples/src/aws_kms_discovery_keyring_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
with an encryption context. This encrypted ciphertext is then decrypted using the Discovery keyring.
This example also includes some sanity checks for demonstration:
1. Ciphertext and plaintext data are not the same
2. Encryption context is correct in the decrypted message header
3. Decrypted plaintext value matches EXAMPLE_DATA
4. Decryption is only possible if the Discovery Keyring contains the correct AWS Account ID's to
2. Decrypted plaintext value matches EXAMPLE_DATA
3. Decryption is only possible if the Discovery Keyring contains the correct AWS Account ID's to
which the KMS key used for encryption belongs
These sanity checks are for demonstration in the example only. You do not need these in your code.

Expand Down Expand Up @@ -165,8 +164,8 @@ def encrypt_and_decrypt_with_keyring(
assert plaintext_bytes == EXAMPLE_DATA, \
"Decrypted plaintext should be identical to the original plaintext. Invalid decryption"

# 11. Demonstrate that if a discovery keyring (Bob's) doesn't have the correct AWS Account ID's,
# the decrypt will fail with an error message
# 10. Demonstrate that if a different discovery keyring (Bob's) doesn't have the correct
# AWS Account ID's, the decrypt will fail with an error message
# Note that this assumes Account ID used here ('888888888888') is different than the one used
# during encryption
discovery_keyring_input_bob: CreateAwsKmsDiscoveryKeyringInput = \
Expand Down
3 changes: 1 addition & 2 deletions examples/src/aws_kms_discovery_multi_keyring_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
with an encryption context. This encrypted ciphertext is then decrypted using the Discovery Multi
keyring. This example also includes some sanity checks for demonstration:
1. Ciphertext and plaintext data are not the same
2. Encryption context is correct in the decrypted message header
3. Decrypted plaintext value matches EXAMPLE_DATA
2. Decrypted plaintext value matches EXAMPLE_DATA
These sanity checks are for demonstration in the example only. You do not need these in your code.

For more information on how to use KMS Discovery keyrings, see
Expand Down
3 changes: 1 addition & 2 deletions examples/src/aws_kms_keyring_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
decrypt data keys. This example creates a KMS Keyring and then encrypts a custom input EXAMPLE_DATA
with an encryption context. This example also includes some sanity checks for demonstration:
1. Ciphertext and plaintext data are not the same
2. Encryption context is correct in the decrypted message header
3. Decrypted plaintext value matches EXAMPLE_DATA
2. Decrypted plaintext value matches EXAMPLE_DATA
These sanity checks are for demonstration in the example only. You do not need these in your code.

AWS KMS keyrings can be used independently or in a multi-keyring with other keyrings
Expand Down
3 changes: 1 addition & 2 deletions examples/src/aws_kms_mrk_discovery_keyring_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
with an encryption context. This encrypted ciphertext is then decrypted using an
MRK Discovery keyring. This example also includes some sanity checks for demonstration:
1. Ciphertext and plaintext data are not the same
2. Encryption context is correct in the decrypted message header
3. Decrypted plaintext value matches EXAMPLE_DATA
2. Decrypted plaintext value matches EXAMPLE_DATA
These sanity checks are for demonstration in the example only. You do not need these in your code.

For information about using multi-Region keys with the AWS Encryption SDK, see
Expand Down
3 changes: 1 addition & 2 deletions examples/src/aws_kms_mrk_discovery_multi_keyring_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
with an encryption context. This encrypted ciphertext is then decrypted using an
MRK Discovery Multi keyring. This example also includes some sanity checks for demonstration:
1. Ciphertext and plaintext data are not the same
2. Encryption context is correct in the decrypted message header
3. Decrypted plaintext value matches EXAMPLE_DATA
2. Decrypted plaintext value matches EXAMPLE_DATA
These sanity checks are for demonstration in the example only. You do not need these in your code.

For information about using multi-Region keys with the AWS Encryption SDK, see
Expand Down
3 changes: 1 addition & 2 deletions examples/src/aws_kms_mrk_keyring_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
This example creates a KMS MRK Keyring and then encrypts a custom input EXAMPLE_DATA
with an encryption context. This example also includes some sanity checks for demonstration:
1. Ciphertext and plaintext data are not the same
2. Encryption context is correct in the decrypted message header
3. Decrypted plaintext value matches EXAMPLE_DATA
2. Decrypted plaintext value matches EXAMPLE_DATA
These sanity checks are for demonstration in the example only. You do not need these in your code.

AWS KMS MRK keyrings can be used independently or in a multi-keyring with other keyrings
Expand Down
5 changes: 2 additions & 3 deletions examples/src/aws_kms_mrk_multi_keyring_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
Either KMS Key individually is capable of decrypting data encrypted under this keyring.
This example also includes some sanity checks for demonstration:
1. Ciphertext and plaintext data are not the same
2. Encryption context is correct in the decrypted message header
3. Decrypted plaintext value matches EXAMPLE_DATA
4. Ciphertext can be decrypted using an AwsKmsMrkKeyring containing a replica of the
2. Decrypted plaintext value matches EXAMPLE_DATA
3. Ciphertext can be decrypted using an AwsKmsMrkKeyring containing a replica of the
MRK (from the multi-keyring used for encryption) copied from the first region into
the second region
These sanity checks are for demonstration in the example only. You do not need these in your code.
Expand Down
3 changes: 1 addition & 2 deletions examples/src/aws_kms_rsa_keyring_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
EXAMPLE_DATA with an encryption context. This example also includes some sanity checks for
demonstration:
1. Ciphertext and plaintext data are not the same
2. Encryption context is correct in the decrypted message header
3. Decrypted plaintext value matches EXAMPLE_DATA
2. Decrypted plaintext value matches EXAMPLE_DATA
These sanity checks are for demonstration in the example only. You do not need these in your code.

# For more information on how to use KMS keyrings, see
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
and we use an AWS KMS Keyring for this example.
This example also includes some sanity checks for demonstration:
1. Ciphertext and plaintext data are not the same
2. Encryption context is correct in the decrypted message header
3. Decrypted plaintext value matches EXAMPLE_DATA
2. Decrypted plaintext value matches EXAMPLE_DATA
These sanity checks are for demonstration in the example only. You do not need these in your code.

For more information on Cryptographic Material Managers, see
Expand Down
3 changes: 1 addition & 2 deletions examples/src/file_streaming_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
It then decrypts the ciphertext from `ciphertext_filename` to a new file `decrypted_filename`.
This example also includes some sanity checks for demonstration:
1. Ciphertext and plaintext data are not the same
2. Encryption context is correct in the decrypted message header
3. Decrypted plaintext value matches EXAMPLE_DATA
2. Decrypted plaintext value matches EXAMPLE_DATA
These sanity checks are for demonstration in the example only. You do not need these in your code.

For more information on how to use Raw AES keyrings, see
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
with an encryption context for the commitment policy FORBID_ENCRYPT_ALLOW_DECRYPT.
This example also includes some sanity checks for demonstration:
1. Ciphertext and plaintext data are not the same
2. Encryption context is correct in the decrypted message header
3. Decrypted plaintext value matches EXAMPLE_DATA
2. Decrypted plaintext value matches EXAMPLE_DATA
These sanity checks are for demonstration in the example only. You do not need these in your code.

For more information on setting your commitment policy, see
Expand Down
3 changes: 1 addition & 2 deletions examples/src/raw_aes_keyring_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
This example creates a Raw AES Keyring and then encrypts a custom input EXAMPLE_DATA
with an encryption context. This example also includes some sanity checks for demonstration:
1. Ciphertext and plaintext data are not the same
2. Encryption context is correct in the decrypted message header
3. Decrypted plaintext value matches EXAMPLE_DATA
2. Decrypted plaintext value matches EXAMPLE_DATA
These sanity checks are for demonstration in the example only. You do not need these in your code.

The Raw AES keyring encrypts data by using the AES-GCM algorithm and a wrapping key that
Expand Down
5 changes: 2 additions & 3 deletions examples/src/raw_rsa_keyring_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
This example creates a Raw RSA Keyring and then encrypts a custom input EXAMPLE_DATA
with an encryption context. This example also includes some sanity checks for demonstration:
1. Ciphertext and plaintext data are not the same
2. Encryption context is correct in the decrypted message header
3. Decrypted plaintext value matches EXAMPLE_DATA
4. The original ciphertext is not decryptable using a keyring with a different RSA key pair
2. Decrypted plaintext value matches EXAMPLE_DATA
3. The original ciphertext is not decryptable using a keyring with a different RSA key pair
These sanity checks are for demonstration in the example only. You do not need these in your code.

A Raw RSA keyring that encrypts and decrypts must include an asymmetric public key and private
Expand Down
3 changes: 1 addition & 2 deletions examples/src/set_encryption_algorithm_suite_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
with an encryption context and the algorithm suite AES_256_GCM_HKDF_SHA512_COMMIT_KEY.
This example also includes some sanity checks for demonstration:
1. Ciphertext and plaintext data are not the same
2. Encryption context is correct in the decrypted message header
3. Decrypted plaintext value matches EXAMPLE_DATA
2. Decrypted plaintext value matches EXAMPLE_DATA
These sanity checks are for demonstration in the example only. You do not need these in your code.

For more information on how to use Raw AES keyrings, see
Expand Down
Loading