Skip to content

Commit 33775ff

Browse files
committed
update
1 parent eaec831 commit 33775ff

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

src/examples/java/com/amazonaws/crypto/examples/keyrings/hierarchical/SharedCacheAcrossHierarchicalKeyringsExample.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
* - Same Branch Key ID
6666
* then they WILL share the cache entries in the Shared Cache.
6767
* Please make sure that you set all of Partition ID, Logical Key Store Name and Branch Key ID
68-
* to be the same for two Hierarchical Keyrings only if you want them to share cache entries.
68+
* to be the same for two Hierarchical Keyrings if and only if you want them to share cache entries.
6969
*
7070
* <p>This example first creates a shared cache that you can use across multiple Hierarchical Keyrings.
7171
* The example then configures a Hierarchical Keyring (HK1 and HK2) with the shared cache,
@@ -80,8 +80,9 @@
8080
* table must be configured with the following primary key configuration: - Partition key is named
8181
* "partition_key" with type (S) - Sort key is named "sort_key" with type (S)
8282
*
83-
* <p>This example also requires using a KMS Key. You need the following access on this key: -
84-
* GenerateDataKeyWithoutPlaintext - Decrypt
83+
* <p>This example also requires using a KMS Key. You need the following access on this key:
84+
* - GenerateDataKeyWithoutPlaintext
85+
* - Decrypt
8586
*/
8687
public class SharedCacheAcrossHierarchicalKeyringsExample {
8788
private static final byte[] EXAMPLE_DATA = "Hello World".getBytes(StandardCharsets.UTF_8);
@@ -204,16 +205,16 @@ public static void encryptAndDecryptWithKeyring(
204205
// HK1 (which uses Key Store instance K1) and HK2 (which uses Key Store
205206
// instance K2) will NOT be able to share cache entries.
206207
final KeyStore keystore2 =
207-
KeyStore.builder()
208-
.KeyStoreConfig(
209-
KeyStoreConfig.builder()
210-
.ddbClient(DynamoDbClient.create())
211-
.ddbTableName(keyStoreTableName)
212-
.logicalKeyStoreName(logicalKeyStoreName)
213-
.kmsClient(KmsClient.create())
214-
.kmsConfiguration(KMSConfiguration.builder().kmsKeyArn(kmsKeyId).build())
215-
.build())
216-
.build();
208+
KeyStore.builder()
209+
.KeyStoreConfig(
210+
KeyStoreConfig.builder()
211+
.ddbClient(DynamoDbClient.create())
212+
.ddbTableName(keyStoreTableName)
213+
.logicalKeyStoreName(logicalKeyStoreName)
214+
.kmsClient(KmsClient.create())
215+
.kmsConfiguration(KMSConfiguration.builder().kmsKeyArn(kmsKeyId).build())
216+
.build())
217+
.build();
217218

218219
// Create the Hierarchical Keyring HK2 with Key Store instance K2, the shared Cache
219220
// and the same partitionId and BranchKeyId used in HK1 because we want to share cache entries

0 commit comments

Comments
 (0)