@@ -180,7 +180,7 @@ public static void SharedCacheAcrossHierarchicalKeyringsGetItemPutItem(
180180 final IKeyring hierarchicalKeyring1 =
181181 matProv .CreateAwsKmsHierarchicalKeyring (keyringInput1 );
182182
183- // 4 . Configure which attributes are encrypted and/or signed when writing new items.
183+ // 5 . Configure which attributes are encrypted and/or signed when writing new items.
184184 // For each attribute that may exist on the items we plan to write to our DynamoDbTable,
185185 // we must explicitly configure how they should be treated during item encryption:
186186 // - ENCRYPT_AND_SIGN: The attribute is encrypted and included in the signature
@@ -194,14 +194,14 @@ public static void SharedCacheAcrossHierarchicalKeyringsGetItemPutItem(
194194 CryptoAction .ENCRYPT_AND_SIGN
195195 );
196196
197- // 5 . Get the DDB Client for Hierarchical Keyring 1.
197+ // 6 . Get the DDB Client for Hierarchical Keyring 1.
198198 final DynamoDbClient ddbClient1 = GetDdbClient (
199199 ddbTableName ,
200200 hierarchicalKeyring1 ,
201201 attributeActionsOnEncrypt
202202 );
203203
204- // 6 . Encrypt Decrypt roundtrip with ddbClient1
204+ // 7 . Encrypt Decrypt roundtrip with ddbClient1
205205 PutGetItems (ddbTableName , ddbClient1 );
206206
207207 // Through the above encrypt and decrypt roundtrip, the cache will be populated and
@@ -210,7 +210,7 @@ public static void SharedCacheAcrossHierarchicalKeyringsGetItemPutItem(
210210 // - Same Logical Key Store Name of the Key Store for the Hierarchical Keyring
211211 // - Same Branch Key ID
212212
213- // 7 . Configure your KeyStore resource keystore2.
213+ // 8 . Configure your KeyStore resource keystore2.
214214 // This SHOULD be the same configuration that you used
215215 // to initially create and populate your physical KeyStore.
216216 // Note that keyStoreTableName is the physical Key Store,
@@ -243,13 +243,13 @@ public static void SharedCacheAcrossHierarchicalKeyringsGetItemPutItem(
243243 )
244244 .build ();
245245
246- // 8 . Create the Hierarchical Keyring HK2 with Key Store instance K2, the shared Cache
246+ // 9 . Create the Hierarchical Keyring HK2 with Key Store instance K2, the shared Cache
247247 // and the same partitionId and BranchKeyId used in HK1 because we want to share cache entries
248248 // (and experience cache HITS).
249249
250- // Please make sure that you read the guidance on how to set Partition ID, Logical Key Store Name and
251- // Branch Key ID at the top of this example before creating Hierarchical Keyrings with a Shared Cache.
252- // partitionId for this example is a random UUID
250+ Please make sure that you read the guidance on how to set Partition ID , Logical Key Store Name and
251+ Branch Key ID at the top of this example before creating Hierarchical Keyrings with a Shared Cache .
252+ partitionId for this example is a random UUID
253253 final CreateAwsKmsHierarchicalKeyringInput keyringInput2 =
254254 CreateAwsKmsHierarchicalKeyringInput
255255 .builder ()
@@ -262,14 +262,14 @@ public static void SharedCacheAcrossHierarchicalKeyringsGetItemPutItem(
262262 final IKeyring hierarchicalKeyring2 =
263263 matProv .CreateAwsKmsHierarchicalKeyring (keyringInput2 );
264264
265- // 9 . Get the DDB Client for Hierarchical Keyring 2.
265+ // 10 . Get the DDB Client for Hierarchical Keyring 2.
266266 final DynamoDbClient ddbClient2 = GetDdbClient (
267267 ddbTableName ,
268268 hierarchicalKeyring2 ,
269269 attributeActionsOnEncrypt
270270 );
271271
272- // 10 . Encrypt Decrypt roundtrip with ddbClient2
272+ // 11 . Encrypt Decrypt roundtrip with ddbClient2
273273 PutGetItems (ddbTableName , ddbClient2 );
274274 }
275275
@@ -352,12 +352,12 @@ public static void PutGetItems(
352352 String ddbTableName ,
353353 DynamoDbClient ddbClient
354354 ) {
355- // Put an item into our table using the given ddb client.
356- // Before the item gets sent to DynamoDb, it will be encrypted
357- // client-side, according to our configuration.
358- // This example creates a Hierarchical Keyring for a single BranchKeyId. You can, however, use a
359- // BranchKeyIdSupplier as per your use-case. See the HierarchicalKeyringsExample.java for more
360- // information.
355+ Put an item into our table using the given ddb client .
356+ Before the item gets sent to DynamoDb , it will be encrypted
357+ client -side , according to our configuration .
358+ This example creates a Hierarchical Keyring for a single BranchKeyId . You can , however , use a
359+ BranchKeyIdSupplier as per your use -case . See the HierarchicalKeyringsExample .java for more
360+ information .
361361 final HashMap <String , AttributeValue > item = new HashMap <>();
362362 item .put ("partition_key" , AttributeValue .builder ().s ("id" ).build ());
363363 item .put ("sort_key" , AttributeValue .builder ().n ("0" ).build ());
@@ -377,12 +377,12 @@ public static void PutGetItems(
377377 // Demonstrate that PutItem succeeded
378378 assert 200 == putResponse .sdkHttpResponse ().statusCode ();
379379
380- // Get the item back from our table using the same client.
381- // The client will decrypt the item client-side, and return
382- // back the original item.
383- // This example creates a Hierarchical Keyring for a single BranchKeyId. You can, however, use a
384- // BranchKeyIdSupplier as per your use-case. See the HierarchicalKeyringsExample.java for more
385- // information.
380+ Get the item back from our table using the same client .
381+ The client will decrypt the item client -side , and return
382+ back the original item .
383+ This example creates a Hierarchical Keyring for a single BranchKeyId . You can , however , use a
384+ BranchKeyIdSupplier as per your use -case . See the HierarchicalKeyringsExample .java for more
385+ information .
386386 final HashMap <String , AttributeValue > keyToGet = new HashMap <>();
387387 keyToGet .put ("partition_key" , AttributeValue .builder ().s ("id" ).build ());
388388 keyToGet .put ("sort_key" , AttributeValue .builder ().n ("0" ).build ());
0 commit comments