Skip to content

Commit d2c379c

Browse files
Replace KMS with AWS KMS (#177)
1 parent f18c383 commit d2c379c

15 files changed

+100
-100
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* <p>
3333
* If you are using the AWS Encryption SDK with AWS KMS,
3434
* you can use AWS KMS to provide additional powerful controls using the encryption context.
35-
* For more information on that, see the KMS developer guide:
35+
* For more information on that, see the AWS KMS developer guide:
3636
* <p>
3737
* https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
3838
* <p>

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

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

2222
/**
23-
* By default, the KMS keyring uses a client supplier that
23+
* By default, the AWS KMS keyring uses a client supplier that
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>
@@ -36,13 +36,13 @@
3636
* <p>
3737
* https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/choose-keyring.html#use-kms-keyring
3838
* <p>
39-
* For an example of how to use the KMS keyring with CMKs in multiple regions,
39+
* For an example of how to use the AWS KMS keyring with CMKs in multiple regions,
4040
* see the {@link MultipleRegions} example.
4141
* <p>
42-
* For another example of how to use the KMS keyring with a custom client configuration,
42+
* For another example of how to use the AWS KMS keyring with a custom client configuration,
4343
* see the {@link CustomKmsClientConfig} example.
4444
* <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,
4646
* see the {@link DiscoveryDecrypt}, {@link DiscoveryDecryptInRegionOnly},
4747
* and {@link DiscoveryDecryptWithPreferredRegions} examples.
4848
*/
@@ -79,7 +79,7 @@ public AWSKMS getClient(String regionId) {
7979
}
8080

8181
/**
82-
* Demonstrate an encrypt/decrypt cycle using a KMS keyring with a custom client supplier.
82+
* Demonstrate an encrypt/decrypt cycle using an AWS KMS keyring with a custom client supplier.
8383
*
8484
* @param awsKmsCmk The ARN of an AWS KMS CMK that protects data keys
8585
* @param sourcePlaintext Plaintext to encrypt

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

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

2222
/**
23-
* By default, the KMS keyring uses the default configurations
23+
* By default, the AWS KMS keyring uses the default configurations
2424
* for all KMS clients and uses the default discoverable credentials.
2525
* If you need to change this configuration,
2626
* you can configure the client supplier.
2727
* <p>
28-
* This example shows how to use custom-configured clients with the KMS keyring.
28+
* This example shows how to use custom-configured clients with the AWS KMS keyring.
2929
* <p>
3030
* https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/choose-keyring.html#use-kms-keyring
3131
* <p>
32-
* For an example of how to use the KMS keyring with CMKs in multiple regions,
32+
* For an example of how to use the AWS KMS keyring with CMKs in multiple regions,
3333
* see the {@link MultipleRegions} example.
3434
* <p>
35-
* For another example of how to use the KMS keyring with a custom client configuration,
35+
* For another example of how to use the AWS KMS keyring with a custom client configuration,
3636
* see the {@link CustomKmsClientConfig} example.
3737
* <p>
38-
* For examples of how to use the KMS Discovery keyring on decrypt,
38+
* For examples of how to use the AWS KMS Discovery keyring on decrypt,
3939
* see the {@link DiscoveryDecrypt}, {@link DiscoveryDecryptInRegionOnly},
4040
* and {@link DiscoveryDecryptWithPreferredRegions} examples.
4141
*/
4242
public class CustomKmsClientConfig {
4343

4444
/**
45-
* Demonstrate an encrypt/decrypt cycle using a KMS keyring with custom KMS client configuration.
45+
* Demonstrate an encrypt/decrypt cycle using an AWS KMS keyring with custom KMS client configuration.
4646
*
4747
* @param awsKmsCmk The ARN of an AWS KMS CMK that protects data keys
4848
* @param sourcePlaintext Plaintext to encrypt

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

+11-11
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,33 @@
1616
import java.util.Map;
1717

1818
/**
19-
* When you give the KMS keyring specific key IDs it will use those CMKs and nothing else.
19+
* When you give the AWS 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,
2222
* especially when you don't know which CMKs were used to encrypt a message.
23-
* To address this need, you can use a KMS discovery keyring.
24-
* The KMS discovery keyring does nothing on encrypt
25-
* but attempts to decrypt *any* data keys that were encrypted under a KMS CMK.
23+
* To address this need, you can use an AWS KMS discovery keyring.
24+
* The AWS KMS discovery keyring does nothing on encrypt
25+
* but attempts to decrypt *any* data keys that were encrypted under an AWS KMS CMK.
2626
* <p>
27-
* This example shows how to configure and use a KMS discovery keyring.
27+
* This example shows how to configure and use an AWS KMS discovery keyring.
2828
* <p>
2929
* https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/choose-keyring.html#use-kms-keyring
3030
* <p>
31-
* For an example of how to use the KMS keyring with CMKs in multiple regions,
31+
* For an example of how to use the AWS KMS keyring with CMKs in multiple regions,
3232
* see the {@link MultipleRegions} example.
3333
* <p>
34-
* For examples of how to use the KMS keyring with custom client configurations,
34+
* For examples of how to use the AWS KMS keyring with custom client configurations,
3535
* see the {@link CustomClientSupplier}
3636
* and {@link CustomKmsClientConfig} examples.
3737
* <p>
38-
* For examples of how to use the KMS discovery keyring on decrypt,
38+
* For examples of how to use the AWS KMS discovery keyring on decrypt,
3939
* see the {@link DiscoveryDecryptInRegionOnly},
4040
* and {@link DiscoveryDecryptWithPreferredRegions} examples.
4141
*/
4242
public class DiscoveryDecrypt {
4343

4444
/**
45-
* Demonstrate configuring a KMS discovery keyring for decryption.
45+
* Demonstrate configuring an AWS KMS discovery keyring for decryption.
4646
*
4747
* @param awsKmsCmk The ARN of an AWS KMS CMK that protects data keys
4848
* @param sourcePlaintext Plaintext to encrypt
@@ -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 a KMS discovery keyring to use on decrypt.
66+
// Create an AWS KMS discovery keyring to use on decrypt.
6767
final Keyring decryptKeyring = StandardKeyrings.awsKmsDiscoveryBuilder().build();
6868

6969
// Encrypt your plaintext data.
@@ -77,7 +77,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
7777
// Demonstrate that the ciphertext and plaintext are different.
7878
assert !Arrays.equals(ciphertext, sourcePlaintext);
7979

80-
// Decrypt your encrypted data using the KMS discovery keyring.
80+
// Decrypt your encrypted data using the AWS KMS discovery keyring.
8181
//
8282
// You do not need to specify the encryption context on decrypt because
8383
// the header of the encrypted message includes the encryption context.

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

+12-12
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,36 @@
2020
import static java.util.Collections.singleton;
2121

2222
/**
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.
2424
* This is true both on encrypt and on decrypt.
2525
* However, sometimes you need more flexibility on decrypt,
2626
* 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.
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 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.
3333
* <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.
3535
* <p>
3636
* https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/choose-keyring.html#use-kms-keyring
3737
* <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,
3939
* see the {@link MultipleRegions} example.
4040
* <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,
4242
* see the {@link CustomClientSupplier}
4343
* and {@link CustomKmsClientConfig} examples.
4444
* <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,
4646
* see the {@link DiscoveryDecrypt},
4747
* and {@link DiscoveryDecryptWithPreferredRegions} examples.
4848
*/
4949
public class DiscoveryDecryptInRegionOnly {
5050

5151
/**
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.
5353
*
5454
* @param awsKmsCmk The ARN of an AWS KMS CMK that protects data keys
5555
* @param sourcePlaintext Plaintext to encrypt
@@ -73,7 +73,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
7373
// Extract the region from the CMK ARN.
7474
final String decryptRegion = Arn.fromString(awsKmsCmk.toString()).getRegion();
7575

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.
7777
//
7878
// The client supplier that we specify here will only supply clients for the specified region.
7979
// 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
9393
// Demonstrate that the ciphertext and plaintext are different.
9494
assert !Arrays.equals(ciphertext, sourcePlaintext);
9595

96-
// Decrypt your encrypted data using the KMS discovery keyring.
96+
// Decrypt your encrypted data using the AWS KMS discovery keyring.
9797
//
9898
// You do not need to specify the encryption context on decrypt because
9999
// the header of the encrypted message includes the encryption context.

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

+10-10
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,35 @@
2020
import static java.util.Collections.singleton;
2121

2222
/**
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.
2424
* This is true both on encrypt and on decrypt.
2525
* However, sometimes you need more flexibility on decrypt,
2626
* especially if you might not know beforehand 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 will do nothing on encrypt
29-
* but will attempt 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 will do nothing on encrypt
29+
* but will attempt to decrypt *any* data keys that were encrypted under an AWS 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 to restrict what regions an AWS KMS keyring can talk to.
3333
* <p>
3434
* A more complex but more common use-case is that you would *prefer* to stay within a region,
3535
* but you would rather make calls to other regions than fail to decrypt the message.
3636
* In this case, you want a keyring that will try to decrypt data keys in this region first,
3737
* then try other regions.
3838
* <p>
39-
* This example shows how to configure and use a multi-keyring with the KMS keyring
39+
* This example shows how to configure and use a multi-keyring with the AWS KMS keyring
4040
* to prefer the current AWS region while also failing over to other AWS regions.
4141
* <p>
4242
* https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/choose-keyring.html#use-kms-keyring
4343
* <p>
44-
* For an example of how to use the KMS keyring with CMKs in multiple regions,
44+
* For an example of how to use the AWS KMS keyring with CMKs in multiple regions,
4545
* see the {@link MultipleRegions} example.
4646
* <p>
47-
* For examples of how to use the KMS keyring with custom client configurations,
47+
* For examples of how to use the AWS KMS keyring with custom client configurations,
4848
* see the {@link CustomClientSupplier}
4949
* and {@link CustomKmsClientConfig} examples.
5050
* <p>
51-
* For examples of how to use the KMS discovery keyring on decrypt,
51+
* For examples of how to use the AWS KMS discovery keyring on decrypt,
5252
* see the {@link DiscoveryDecrypt},
5353
* and {@link DiscoveryDecryptInRegionOnly} examples.
5454
*/
@@ -79,7 +79,7 @@ public static void run(final AwsKmsCmkId awsKmsCmk, final byte[] sourcePlaintext
7979
// To create our decrypt keyring, we need to know our current default AWS region.
8080
final String localRegion = AWSKMSClientBuilder.standard().getRegion();
8181

82-
// Now, use that region name to create two KMS discovery keyrings:
82+
// Now, use that region name to create two AWS KMS discovery keyrings:
8383
//
8484
// One that only works in the local region
8585
final Keyring localRegionDecryptKeyring = StandardKeyrings.awsKmsDiscoveryBuilder()

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,29 @@
1818
import java.util.Map;
1919

2020
/**
21-
* This example shows how to configure and use a KMS keyring with CMKs in multiple regions.
21+
* This example shows how to configure and use an AWS KMS keyring with CMKs in multiple regions.
2222
* <p>
2323
* https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/choose-keyring.html#use-kms-keyring
2424
* <p>
25-
* For an example of how to use the KMS keyring with a single CMK,
25+
* For an example of how to use the AWS KMS keyring with a single CMK,
2626
* see the {@link SingleCmk} example.
2727
* <p>
28-
* For examples of how to use the KMS keyring with custom client configurations,
28+
* For examples of how to use the AWS KMS keyring with custom client configurations,
2929
* see the {@link CustomClientSupplier}
3030
* and {@link CustomKmsClientConfig} examples.
3131
* <p>
32-
* For examples of how to use the KMS Discovery keyring on decrypt,
32+
* For examples of how to use the AWS KMS Discovery keyring on decrypt,
3333
* see the {@link DiscoveryDecrypt},
3434
* {@link DiscoveryDecryptInRegionOnly},
3535
* and {@link DiscoveryDecryptWithPreferredRegions} examples.
3636
*/
3737
public class MultipleRegions {
3838

3939
/**
40-
* Demonstrate an encrypt/decrypt cycle using a KMS keyring with CMKs in multiple regions.
40+
* Demonstrate an encrypt/decrypt cycle using an AWS KMS keyring with CMKs in multiple regions.
4141
*
4242
* @param awsKmsGeneratorCmk The ARN of an AWS KMS CMK that protects data keys
43-
* @param awsKmsAdditionalCmks Additional ARNs of secondary KMS CMKs
43+
* @param awsKmsAdditionalCmks Additional ARNs of secondary AWS KMS CMKs
4444
* @param sourcePlaintext Plaintext to encrypt
4545
*/
4646
public static void run(final AwsKmsCmkId awsKmsGeneratorCmk, final List<AwsKmsCmkId> awsKmsAdditionalCmks, byte[] sourcePlaintext) {

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@
1616
import java.util.Map;
1717

1818
/**
19-
* This example shows how to configure and use a KMS keyring with a single KMS CMK.
19+
* This example shows how to configure and use an AWS KMS keyring with a single KMS CMK.
2020
* <p>
2121
* https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/choose-keyring.html#use-kms-keyring
2222
* <p>
23-
* For an example of how to use the KMS keyring with CMKs in multiple regions,
23+
* For an example of how to use the AWS KMS keyring with CMKs in multiple regions,
2424
* see the {@link MultipleRegions} example.
2525
* <p>
26-
* For examples of how to use the KMS keyring with custom client configurations,
26+
* For examples of how to use the AWS KMS keyring with custom client configurations,
2727
* see the {@link CustomClientSupplier}
2828
* and {@link CustomKmsClientConfig} examples.
2929
* <p>
30-
* For examples of how to use the KMS Discovery keyring on decrypt,
30+
* For examples of how to use the AWS KMS Discovery keyring on decrypt,
3131
* see the {@link DiscoveryDecrypt},
3232
* {@link DiscoveryDecryptInRegionOnly},
3333
* and {@link DiscoveryDecryptWithPreferredRegions} examples.
3434
*/
3535
public class SingleCmk {
3636

3737
/**
38-
* Demonstrate an encrypt/decrypt cycle using a KMS keyring with a single CMK.
38+
* Demonstrate an encrypt/decrypt cycle using an AWS KMS keyring with a single CMK.
3939
*
4040
* @param awsKmsCmk The ARN of an AWS KMS CMK that protects data keys
4141
* @param sourcePlaintext Plaintext to encrypt

0 commit comments

Comments
 (0)