Skip to content

Commit bfc32c5

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

26 files changed

+26
-0
lines changed

src/examples/java/com/amazonaws/crypto/examples/FileStreamingDefaults.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final File sourcePlaintextFi
5454
decryptedFile.deleteOnExit();
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
final Map<String, String> encryptionContext = new HashMap<>();
5960
encryptionContext.put("encryption", "context");

src/examples/java/com/amazonaws/crypto/examples/InMemoryStreamingDefaults.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
4444
final AwsCrypto awsEncryptionSdk = new AwsCrypto();
4545

4646
// Prepare your encryption context.
47+
// Remember that your encryption context is NOT SECRET.
4748
// https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
4849
final Map<String, String> encryptionContext = new HashMap<>();
4950
encryptionContext.put("encryption", "context");

src/examples/java/com/amazonaws/crypto/examples/OneStepDefaults.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
3636
final AwsCrypto awsEncryptionSdk = new AwsCrypto();
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
final Map<String, String> encryptionContext = new HashMap<>();
4142
encryptionContext.put("encryption", "context");

src/examples/java/com/amazonaws/crypto/examples/OneStepUnsigned.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
5050
awsEncryptionSdk.setEncryptionAlgorithm(CryptoAlgorithm.ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256);
5151

5252
// Prepare your encryption context.
53+
// Remember that your encryption context is NOT SECRET.
5354
// https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
5455
final Map<String, String> encryptionContext = new HashMap<>();
5556
encryptionContext.put("encryption", "context");

src/examples/java/com/amazonaws/crypto/examples/cryptomaterialsmanager/caching/SimpleCache.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
5454
final AwsCrypto awsEncryptionSdk = new AwsCrypto();
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
final Map<String, String> encryptionContext = new HashMap<>();
5960
encryptionContext.put("encryption", "context");

src/examples/java/com/amazonaws/crypto/examples/cryptomaterialsmanager/custom/AlgorithmSuiteEnforcement.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
114114
final AwsCrypto awsEncryptionSdk = new AwsCrypto();
115115

116116
// Prepare your encryption context.
117+
// Remember that your encryption context is NOT SECRET.
117118
// https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
118119
final Map<String, String> encryptionContext = new HashMap<>();
119120
encryptionContext.put("encryption", "context");

src/examples/java/com/amazonaws/crypto/examples/cryptomaterialsmanager/custom/RequiringEncryptionContextFields.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
103103
final AwsCrypto awsEncryptionSdk = new AwsCrypto();
104104

105105
// Prepare your encryption context.
106+
// Remember that your encryption context is NOT SECRET.
106107
// https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
107108
final Map<String, String> encryptionContext = new HashMap<>();
108109
encryptionContext.put("encryption", "context");

src/examples/java/com/amazonaws/crypto/examples/keyring/awskms/ActLikeAwsKmsMasterKeyProvider.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final List<AwsKmsCmkId> awsK
5959
final AwsCrypto awsEncryptionSdk = new AwsCrypto();
6060

6161
// Prepare your encryption context.
62+
// Remember that your encryption context is NOT SECRET.
6263
// https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
6364
final Map<String, String> encryptionContext = new HashMap<>();
6465
encryptionContext.put("encryption", "context");

src/examples/java/com/amazonaws/crypto/examples/keyring/awskms/CustomClientSupplier.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
8989
final AwsCrypto awsEncryptionSdk = new AwsCrypto();
9090

9191
// Prepare your encryption context.
92+
// Remember that your encryption context is NOT SECRET.
9293
// https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
9394
final Map<String, String> encryptionContext = new HashMap<>();
9495
encryptionContext.put("encryption", "context");

src/examples/java/com/amazonaws/crypto/examples/keyring/awskms/CustomKmsClientConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
5252
final AwsCrypto awsEncryptionSdk = new AwsCrypto();
5353

5454
// Prepare your encryption context.
55+
// Remember that your encryption context is NOT SECRET.
5556
// https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#encryption-context
5657
final Map<String, String> encryptionContext = new HashMap<>();
5758
encryptionContext.put("encryption", "context");

0 commit comments

Comments
 (0)