Skip to content

Commit 3436adf

Browse files
Wording changes based on feedback
1 parent ada84e8 commit 3436adf

16 files changed

+49
-49
lines changed

src/examples/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ in the [`examples`](./java/com/amazonaws/crypto/examples) directory.
1616

1717
## Configuration
1818

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

2828
* Using AWS Key Management Service (AWS KMS)
29-
* How to use a single AWS KMS CMK
29+
* How to use one AWS KMS CMK
3030
* [with keyrings](./java/com/amazonaws/crypto/examples/keyring/awskms/SingleCmk.java)
3131
* How to use multiple AWS KMS CMKs in different regions
3232
* [with keyrings](./java/com/amazonaws/crypto/examples/keyring/awskms/MultipleRegions.java)

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
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 because
77+
// the header of the encrypted message includes the encryption context.
7878
final AwsCryptoInputStream decryptingStream = awsEncryptionSdk.createDecryptingInputStream(
7979
CreateDecryptingInputStreamRequest.builder()
8080
.keyring(keyring)

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
6060

6161
// Decrypt your encrypted data using the same keyring you used on encrypt.
6262
//
63-
// We do not need to specify the encryption context on decrypt
64-
// because the header message includes the encryption context.
63+
// You do not need to specify the encryption context on decrypt because
64+
// the header of the encrypted message includes the encryption context.
6565
final AwsCryptoResult<byte[]> decryptResult = awsEncryptionSdk.decrypt(
6666
DecryptRequest.builder()
6767
.keyring(keyring)

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
7474

7575
// Decrypt your encrypted data using the same keyring you used on encrypt.
7676
//
77-
// We do not need to specify the encryption context on decrypt
78-
// because the header message includes the encryption context.
77+
// You do not need to specify the encryption context on decrypt because
78+
// the header of the encrypted message includes the encryption context.
7979
final AwsCryptoResult<byte[]> decryptResult = awsEncryptionSdk.decrypt(
8080
DecryptRequest.builder()
8181
.keyring(keyring)

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
* supplies a client with the same configuration for every region.
2525
* If you need different behavior, you can write your own client supplier.
2626
* <p>
27-
* One use-case where you might need this is
28-
* if you need different credentials to talk to different AWS regions.
27+
* You might use this
28+
* if you need different credentials in different AWS regions.
2929
* This might be because you are crossing partitions (ex: "aws" and "aws-cn")
3030
* or if you are working with regions that have separate authentication silos
3131
* like "ap-east-1" and "me-south-1".
@@ -116,8 +116,8 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
116116

117117
// Decrypt your encrypted data using the same keyring you used on encrypt.
118118
//
119-
// We do not need to specify the encryption context on decrypt
120-
// because the header message includes the encryption context.
119+
// You do not need to specify the encryption context on decrypt because
120+
// the header of the encrypted message includes the encryption context.
121121
final AwsCryptoResult<byte[]> decryptResult = awsEncryptionSdk.decrypt(
122122
DecryptRequest.builder()
123123
.keyring(keyring)

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
import java.util.Map;
2121

2222
/**
23-
* By default, the KMS keyring will use the default configurations
24-
* for all KMS clients and will use the default discoverable credentials.
25-
* If you need to change these configurations,
26-
* you can do that using the client supplier.
23+
* By default, the KMS keyring uses the default configurations
24+
* for all KMS clients and uses the default discoverable credentials.
25+
* If you need to change this configuration,
26+
* you can configure the client supplier.
2727
* <p>
2828
* This example shows how to use custom-configured clients with the KMS keyring.
2929
* <p>
@@ -95,8 +95,8 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
9595

9696
// Decrypt your encrypted data using the same keyring you used on encrypt.
9797
//
98-
// We do not need to specify the encryption context on decrypt
99-
// because the header message includes the encryption context.
98+
// You do not need to specify the encryption context on decrypt because
99+
// the header of the encrypted message includes the encryption context.
100100
final AwsCryptoResult<byte[]> decryptResult = awsEncryptionSdk.decrypt(
101101
DecryptRequest.builder()
102102
.keyring(keyring)

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
* When you give the KMS keyring specific key IDs it will use those CMKs and nothing else.
2020
* This is true both on encrypt and on decrypt.
2121
* However, sometimes you need more flexibility on decrypt,
22-
* especially if you might not know beforehand which CMK was used to encrypt a message.
22+
* especially when you don't know which CMKs were used to encrypt a message.
2323
* To address this need, you can use a KMS discovery keyring.
24-
* The KMS discovery keyring will do nothing on encrypt
25-
* but will attempt to decrypt *any* data keys that were encrypted under a KMS CMK.
24+
* The KMS discovery keyring does nothing on encrypt
25+
* but attempts to decrypt *any* data keys that were encrypted under a KMS CMK.
2626
* <p>
2727
* This example shows how to configure and use a KMS discovery keyring.
2828
* <p>
@@ -63,7 +63,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
6363
// Create the keyring that determines how your data keys are protected.
6464
final Keyring encryptKeyring = StandardKeyrings.awsKms(awsKmsCmk);
6565

66-
// Create the KMS discovery keyring that we will use on decrypt.
66+
// Create a KMS discovery keyring to use on decrypt.
6767
final Keyring decryptKeyring = StandardKeyrings.awsKmsDiscoveryBuilder().build();
6868

6969
// Encrypt your plaintext data.
@@ -79,8 +79,8 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
7979

8080
// Decrypt your encrypted data using the KMS discovery keyring.
8181
//
82-
// We do not need to specify the encryption context on decrypt
83-
// because the header message includes the encryption context.
82+
// You do not need to specify the encryption context on decrypt because
83+
// the header of the encrypted message includes the encryption context.
8484
final AwsCryptoResult<byte[]> decryptResult = awsEncryptionSdk.decrypt(
8585
DecryptRequest.builder()
8686
.keyring(decryptKeyring)

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
* When you give the KMS keyring specific key IDs it will use those CMKs and nothing else.
2424
* This is true both on encrypt and on decrypt.
2525
* However, sometimes you need more flexibility on decrypt,
26-
* especially if you might not know beforehand which CMK was used to encrypt a message.
26+
* especially if you don't know which CMK was used to encrypt a message.
2727
* To address this need, you can use a KMS discovery keyring.
28-
* The KMS discovery keyring will do nothing on encrypt
29-
* but will attempt to decrypt *any* data keys that were encrypted under a KMS CMK.
28+
* The KMS discovery keyring does nothing on encrypt
29+
* but attempts to decrypt *any* data keys that were encrypted under a KMS CMK.
3030
* <p>
3131
* However, sometimes you need to be a *bit* more restrictive than that.
32-
* To address this need, you can use a client supplier to restrict what regions a KMS keyring can talk to.
32+
* To address this need, you can use a client supplier that restricts the regions a KMS keyring can talk to.
3333
* <p>
3434
* This example shows how to configure and use a KMS regional discovery keyring that is restricted to one region.
3535
* <p>
@@ -95,8 +95,8 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
9595

9696
// Decrypt your encrypted data using the KMS discovery keyring.
9797
//
98-
// We do not need to specify the encryption context on decrypt
99-
// because the header message includes the encryption context.
98+
// You do not need to specify the encryption context on decrypt because
99+
// the header of the encrypted message includes the encryption context.
100100
final AwsCryptoResult<byte[]> decryptResult = awsEncryptionSdk.decrypt(
101101
DecryptRequest.builder()
102102
.keyring(decryptKeyring)

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
111111

112112
// Decrypt your encrypted data using the multi-keyring.
113113
//
114-
// We do not need to specify the encryption context on decrypt
115-
// because the header message includes the encryption context.
114+
// You do not need to specify the encryption context on decrypt because
115+
// the header of the encrypted message includes the encryption context.
116116
final AwsCryptoResult<byte[]> decryptResult = awsEncryptionSdk.decrypt(
117117
DecryptRequest.builder()
118118
.keyring(decryptKeyring)

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ public static void run(final AwsKmsCmkId awsKmsGeneratorCmk, final List<AwsKmsCm
9292

9393
// Decrypt your encrypted data separately using the single-CMK keyrings.
9494
//
95-
// We do not need to specify the encryption context on decrypt
96-
// because the header message includes the encryption context.
95+
// You do not need to specify the encryption context on decrypt because
96+
// the header of the encrypted message includes the encryption context.
9797
final AwsCryptoResult<byte[]> decryptResult1 = awsEncryptionSdk.decrypt(
9898
DecryptRequest.builder()
9999
.keyring(singleCmkKeyringThatGenerated)

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
6969

7070
// Decrypt your encrypted data using the same keyring you used on encrypt.
7171
//
72-
// We do not need to specify the encryption context on decrypt
73-
// because the header message includes the encryption context.
72+
// You do not need to specify the encryption context on decrypt because
73+
// the header of the encrypted message includes the encryption context.
7474
final AwsCryptoResult<byte[]> decryptResult = awsEncryptionSdk.decrypt(
7575
DecryptRequest.builder()
7676
.keyring(keyring)

src/examples/java/com/amazonaws/crypto/examples/keyring/multi/AwsKmsWithEscrow.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
119119

120120
// Decrypt your encrypted data separately using the KMS keyring and the escrow decrypt keyring.
121121
//
122-
// We do not need to specify the encryption context on decrypt
123-
// because the header message includes the encryption context.
122+
// You do not need to specify the encryption context on decrypt because
123+
// the header of the encrypted message includes the encryption context.
124124
final AwsCryptoResult<byte[]> decryptedKmsResult = awsEncryptionSdk.decrypt(
125125
DecryptRequest.builder()
126126
.keyring(kmsKeyring)

src/examples/java/com/amazonaws/crypto/examples/keyring/rawaes/RawAes.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public static void run(final byte[] sourcePlaintext) {
7878

7979
// Decrypt your encrypted data using the same keyring you used on encrypt.
8080
//
81-
// We do not need to specify the encryption context on decrypt
82-
// because the header message includes the encryption context.
81+
// You do not need to specify the encryption context on decrypt because
82+
// the header of the encrypted message includes the encryption context.
8383
final AwsCryptoResult<byte[]> decryptResult = awsEncryptionSdk.decrypt(
8484
DecryptRequest.builder()
8585
.keyring(keyring)

src/examples/java/com/amazonaws/crypto/examples/keyring/rawrsa/PublicPrivateKeySeparate.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ public static void run(final byte[] sourcePlaintext) throws GeneralSecurityExcep
124124

125125
// Decrypt your encrypted data using the decrypt keyring.
126126
//
127-
// We do not need to specify the encryption context on decrypt
128-
// because the header message includes the encryption context.
127+
// You do not need to specify the encryption context on decrypt because
128+
// the header of the encrypted message includes the encryption context.
129129
final AwsCryptoResult<byte[]> decryptResult = awsEncryptionSdk.decrypt(
130130
DecryptRequest.builder()
131131
.keyring(privateKeyKeyring)

src/examples/java/com/amazonaws/crypto/examples/keyring/rawrsa/RawRsa.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public static void run(final byte[] sourcePlaintext) throws GeneralSecurityExcep
8989

9090
// Decrypt your encrypted data using the same keyring you used on encrypt.
9191
//
92-
// We do not need to specify the encryption context on decrypt
93-
// because the header message includes the encryption context.
92+
// You do not need to specify the encryption context on decrypt because
93+
// the header of the encrypted message includes the encryption context.
9494
final AwsCryptoResult<byte[]> decryptResult = awsEncryptionSdk.decrypt(
9595
DecryptRequest.builder()
9696
.keyring(keyring)

src/examples/java/com/amazonaws/crypto/examples/keyring/rawrsa/RawRsaDerEncoded.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ public static void run(final byte[] sourcePlaintext) throws GeneralSecurityExcep
111111

112112
// Decrypt your encrypted data using the same keyring you used on encrypt.
113113
//
114-
// We do not need to specify the encryption context on decrypt
115-
// because the header message includes the encryption context.
114+
// You do not need to specify the encryption context on decrypt because
115+
// the header of the encrypted message includes the encryption context.
116116
final AwsCryptoResult<byte[]> decryptResult = awsEncryptionSdk.decrypt(
117117
DecryptRequest.builder()
118118
.keyring(keyring)

0 commit comments

Comments
 (0)