Skip to content

Commit a48b3d3

Browse files
authored
docs: add note in every example pointing out that encryption context is not secret (#267)
1 parent b10c415 commit a48b3d3

26 files changed

+26
-0
lines changed

examples/src/crypto_materials_manager/caching/simple_cache.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def run(aws_kms_cmk, source_plaintext):
3636
:param bytes source_plaintext: Plaintext to encrypt
3737
"""
3838
# Prepare your encryption context.
39+
# Remember that your encryption context is NOT SECRET.
3940
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
4041
encryption_context = {
4142
"encryption": "context",

examples/src/crypto_materials_manager/custom/algorithm_suite_enforcement.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def run(aws_kms_cmk, source_plaintext):
8282
:param bytes source_plaintext: Plaintext to encrypt
8383
"""
8484
# Prepare your encryption context.
85+
# Remember that your encryption context is NOT SECRET.
8586
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
8687
encryption_context = {
8788
"encryption": "context",

examples/src/crypto_materials_manager/custom/requiring_encryption_context_fields.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def run(aws_kms_cmk, source_plaintext):
7777
:param bytes source_plaintext: Plaintext to encrypt
7878
"""
7979
# Prepare your encryption context.
80+
# Remember that your encryption context is NOT SECRET.
8081
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
8182
encryption_context = {
8283
"encryption": "context",

examples/src/file_streaming_defaults.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def run(aws_kms_cmk, source_plaintext_filename):
3030
decrypted_filename = ciphertext_filename + ".decrypted"
3131

3232
# Prepare your encryption context.
33+
# Remember that your encryption context is NOT SECRET.
3334
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
3435
encryption_context = {
3536
"encryption": "context",

examples/src/in_memory_streaming_defaults.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def run(aws_kms_cmk, source_plaintext):
2525
:param bytes source_plaintext: Plaintext to encrypt
2626
"""
2727
# Prepare your encryption context.
28+
# Remember that your encryption context is NOT SECRET.
2829
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
2930
encryption_context = {
3031
"encryption": "context",

examples/src/keyring/aws_kms/act_like_aws_kms_master_key_provider.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def run(aws_kms_cmk, aws_kms_additional_cmks, source_plaintext):
4646
:param bytes source_plaintext: Plaintext to encrypt
4747
"""
4848
# Prepare your encryption context.
49+
# Remember that your encryption context is NOT SECRET.
4950
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
5051
encryption_context = {
5152
"encryption": "context",

examples/src/keyring/aws_kms/custom_client_supplier.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def run(aws_kms_cmk, source_plaintext):
7878
:param bytes source_plaintext: Plaintext to encrypt
7979
"""
8080
# Prepare your encryption context.
81+
# Remember that your encryption context is NOT SECRET.
8182
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
8283
encryption_context = {
8384
"encryption": "context",

examples/src/keyring/aws_kms/custom_kms_client_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def run(aws_kms_cmk, source_plaintext):
3838
:param bytes source_plaintext: Plaintext to encrypt
3939
"""
4040
# Prepare your encryption context.
41+
# Remember that your encryption context is NOT SECRET.
4142
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
4243
encryption_context = {
4344
"encryption": "context",

examples/src/keyring/aws_kms/discovery_decrypt.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def run(aws_kms_cmk, source_plaintext):
4141
:param bytes source_plaintext: Plaintext to encrypt
4242
"""
4343
# Prepare your encryption context.
44+
# Remember that your encryption context is NOT SECRET.
4445
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
4546
encryption_context = {
4647
"encryption": "context",

examples/src/keyring/aws_kms/discovery_decrypt_in_region_only.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def run(aws_kms_cmk, source_plaintext):
4545
:param bytes source_plaintext: Plaintext to encrypt
4646
"""
4747
# Prepare your encryption context.
48+
# Remember that your encryption context is NOT SECRET.
4849
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
4950
encryption_context = {
5051
"encryption": "context",

examples/src/keyring/aws_kms/discovery_decrypt_with_preferred_regions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def run(aws_kms_cmk, source_plaintext):
5454
:param bytes source_plaintext: Plaintext to encrypt
5555
"""
5656
# Prepare your encryption context.
57+
# Remember that your encryption context is NOT SECRET.
5758
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
5859
encryption_context = {
5960
"encryption": "context",

examples/src/keyring/aws_kms/multiple_regions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def run(aws_kms_generator_cmk, aws_kms_additional_cmks, source_plaintext):
3636
:param bytes source_plaintext: Plaintext to encrypt
3737
"""
3838
# Prepare your encryption context.
39+
# Remember that your encryption context is NOT SECRET.
3940
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
4041
encryption_context = {
4142
"encryption": "context",

examples/src/keyring/aws_kms/single_cmk.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def run(aws_kms_cmk, source_plaintext):
2929
:param bytes source_plaintext: Plaintext to encrypt
3030
"""
3131
# Prepare your encryption context.
32+
# Remember that your encryption context is NOT SECRET.
3233
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
3334
encryption_context = {
3435
"encryption": "context",

examples/src/keyring/multi/aws_kms_with_escrow.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def run(aws_kms_cmk, source_plaintext):
3737
:param bytes source_plaintext: Plaintext to encrypt
3838
"""
3939
# Prepare your encryption context.
40+
# Remember that your encryption context is NOT SECRET.
4041
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
4142
encryption_context = {
4243
"encryption": "context",

examples/src/keyring/raw_aes/raw_aes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def run(source_plaintext):
2020
:param bytes source_plaintext: Plaintext to encrypt
2121
"""
2222
# Prepare your encryption context.
23+
# Remember that your encryption context is NOT SECRET.
2324
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
2425
encryption_context = {
2526
"encryption": "context",

examples/src/keyring/raw_rsa/keypair.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def run(source_plaintext):
2525
:param bytes source_plaintext: Plaintext to encrypt
2626
"""
2727
# Prepare your encryption context.
28+
# Remember that your encryption context is NOT SECRET.
2829
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
2930
encryption_context = {
3031
"encryption": "context",

examples/src/keyring/raw_rsa/keypair_from_pem.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def run(source_plaintext):
2828
:param bytes source_plaintext: Plaintext to encrypt
2929
"""
3030
# Prepare your encryption context.
31+
# Remember that your encryption context is NOT SECRET.
3132
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
3233
encryption_context = {
3334
"encryption": "context",

examples/src/keyring/raw_rsa/public_private_key_separate.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def run(source_plaintext):
3535
:param bytes source_plaintext: Plaintext to encrypt
3636
"""
3737
# Prepare your encryption context.
38+
# Remember that your encryption context is NOT SECRET.
3839
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
3940
encryption_context = {
4041
"encryption": "context",

examples/src/master_key_provider/aws_kms/discovery_decrypt.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def run(aws_kms_cmk, source_plaintext):
3131
:param bytes source_plaintext: Plaintext to encrypt
3232
"""
3333
# Prepare your encryption context.
34+
# Remember that your encryption context is NOT SECRET.
3435
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
3536
encryption_context = {
3637
"encryption": "context",

examples/src/master_key_provider/aws_kms/multiple_regions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def run(aws_kms_generator_cmk, aws_kms_additional_cmks, source_plaintext):
3434
:param bytes source_plaintext: Plaintext to encrypt
3535
"""
3636
# Prepare your encryption context.
37+
# Remember that your encryption context is NOT SECRET.
3738
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
3839
encryption_context = {
3940
"encryption": "context",

examples/src/master_key_provider/aws_kms/single_cmk.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def run(aws_kms_cmk, source_plaintext):
2727
:param bytes source_plaintext: Plaintext to encrypt
2828
"""
2929
# Prepare your encryption context.
30+
# Remember that your encryption context is NOT SECRET.
3031
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
3132
encryption_context = {
3233
"encryption": "context",

examples/src/master_key_provider/multi/aws_kms_with_escrow.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def run(aws_kms_cmk, source_plaintext):
4141
:param bytes source_plaintext: Plaintext to encrypt
4242
"""
4343
# Prepare your encryption context.
44+
# Remember that your encryption context is NOT SECRET.
4445
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
4546
encryption_context = {
4647
"encryption": "context",

examples/src/master_key_provider/raw_aes/raw_aes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def run(source_plaintext):
2525
:param bytes source_plaintext: Plaintext to encrypt
2626
"""
2727
# Prepare your encryption context.
28+
# Remember that your encryption context is NOT SECRET.
2829
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
2930
encryption_context = {
3031
"encryption": "context",

examples/src/master_key_provider/raw_rsa/private_key_only_from_pem.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def run(source_plaintext):
3030
:param bytes source_plaintext: Plaintext to encrypt
3131
"""
3232
# Prepare your encryption context.
33+
# Remember that your encryption context is NOT SECRET.
3334
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
3435
encryption_context = {
3536
"encryption": "context",

examples/src/onestep_defaults.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def run(aws_kms_cmk, source_plaintext):
2020
:param bytes source_plaintext: Plaintext to encrypt
2121
"""
2222
# Prepare your encryption context.
23+
# Remember that your encryption context is NOT SECRET.
2324
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
2425
encryption_context = {
2526
"encryption": "context",

examples/src/onestep_unsigned.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def run(aws_kms_cmk, source_plaintext):
3333
:param bytes source_plaintext: Plaintext to encrypt
3434
"""
3535
# Prepare your encryption context.
36+
# Remember that your encryption context is NOT SECRET.
3637
# https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
3738
encryption_context = {
3839
"encryption": "context",

0 commit comments

Comments
 (0)