20
20
import static java .util .Collections .singleton ;
21
21
22
22
/**
23
- * When you give the KMS keyring specific key IDs it will use those CMKs and nothing else.
23
+ * When you give the AWS KMS keyring specific key IDs it will use those CMKs and nothing else.
24
24
* This is true both on encrypt and on decrypt.
25
25
* However, sometimes you need more flexibility on decrypt,
26
26
* especially if you don't know which CMK was used to encrypt a message.
27
- * To address this need, you can use a KMS discovery keyring.
28
- * The KMS discovery keyring does nothing on encrypt
29
- * but attempts to decrypt *any* data keys that were encrypted under a KMS CMK.
27
+ * To address this need, you can use an AWS KMS discovery keyring.
28
+ * The AWS KMS discovery keyring does nothing on encrypt
29
+ * but attempts to decrypt *any* data keys that were encrypted under an AWS KMS CMK.
30
30
* <p>
31
31
* However, sometimes you need to be a *bit* more restrictive than that.
32
- * To address this need, you can use a client supplier that restricts the regions a KMS keyring can talk to.
32
+ * To address this need, you can use a client supplier that restricts the regions an AWS KMS keyring can talk to.
33
33
* <p>
34
- * This example shows how to configure and use a KMS regional discovery keyring that is restricted to one region.
34
+ * This example shows how to configure and use an AWS KMS regional discovery keyring that is restricted to one region.
35
35
* <p>
36
36
* https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/choose-keyring.html#use-kms-keyring
37
37
* <p>
38
- * For an example of how to use the KMS keyring with CMKs in multiple regions,
38
+ * For an example of how to use the AWS KMS keyring with CMKs in multiple regions,
39
39
* see the {@link MultipleRegions} example.
40
40
* <p>
41
- * For examples of how to use the KMS keyring with custom client configurations,
41
+ * For examples of how to use the AWS KMS keyring with custom client configurations,
42
42
* see the {@link CustomClientSupplier}
43
43
* and {@link CustomKmsClientConfig} examples.
44
44
* <p>
45
- * For examples of how to use the KMS discovery keyring on decrypt,
45
+ * For examples of how to use the AWS KMS discovery keyring on decrypt,
46
46
* see the {@link DiscoveryDecrypt},
47
47
* and {@link DiscoveryDecryptWithPreferredRegions} examples.
48
48
*/
49
49
public class DiscoveryDecryptInRegionOnly {
50
50
51
51
/**
52
- * Demonstrate configuring a KMS keyring to only work within a single region.
52
+ * Demonstrate configuring an AWS KMS keyring to only work within a single region.
53
53
*
54
54
* @param awsKmsCmk The ARN of an AWS KMS CMK that protects data keys
55
55
* @param sourcePlaintext Plaintext to encrypt
@@ -73,7 +73,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
73
73
// Extract the region from the CMK ARN.
74
74
final String decryptRegion = Arn .fromString (awsKmsCmk .toString ()).getRegion ();
75
75
76
- // Create the KMS discovery keyring that we will use on decrypt.
76
+ // Create the AWS KMS discovery keyring that we will use on decrypt.
77
77
//
78
78
// The client supplier that we specify here will only supply clients for the specified region.
79
79
// The keyring only attempts to decrypt data keys if it can get a client for that region,
@@ -93,7 +93,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
93
93
// Demonstrate that the ciphertext and plaintext are different.
94
94
assert !Arrays .equals (ciphertext , sourcePlaintext );
95
95
96
- // Decrypt your encrypted data using the KMS discovery keyring.
96
+ // Decrypt your encrypted data using the AWS KMS discovery keyring.
97
97
//
98
98
// You do not need to specify the encryption context on decrypt because
99
99
// the header of the encrypted message includes the encryption context.
0 commit comments