Skip to content

Commit 351ed09

Browse files
Apply suggestions from code review
Co-authored-by: Lucas McDonald <[email protected]>
1 parent a628e11 commit 351ed09

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Examples/runtimes/java/DynamoDbEncryption/src/main/java/software/amazon/cryptography/examples/keyring/KmsEcdhKeyringExample.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ public static void KmsEcdhKeyringGetItemPutItem(
129129
// Create a KMS ECDH keyring.
130130
// This keyring uses the KmsPrivateKeyToStaticPublicKey configuration. This configuration calls for both of
131131
// the keys to be on the same curve (P256, P384, P521).
132-
// On encrypt, the keyring calls AWS KMS to derive the shared from the sender's KMS ECC Key ARN and the recipient's public key.
133-
// For this example, on decrypt, the keyring calls AWS KMS to derive the shared from the sender's KMS ECC Key ARN and the recipient's public key;
134-
// however, on decrypt the recipient can construct a keyring such that the shared secret is calculated with
132+
// On encrypt, the keyring calls AWS KMS to derive the shared secret from the sender's KMS ECC Key ARN and the recipient's public key.
133+
// For this example, on decrypt, the keyring calls AWS KMS to derive the shared secret from the sender's KMS ECC Key ARN and the recipient's public key;
134+
// however, on decrypt, the recipient can construct a keyring such that the shared secret is calculated with
135135
// the recipient's private key and the sender's public key. In both scenarios the shared secret will be the same.
136136
// For more information on this configuration see:
137137
// https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/use-kms-ecdh-keyring.html#kms-ecdh-create
138-
// The DynamoDb encryption client uses this to encrypt and decrypt items.
138+
// The DynamoDb encryption client uses this keyring to encrypt and decrypt items.
139139
// This keyring takes in:
140140
// - kmsClient
141141
// - kmsKeyId: Must be an ARN representing a KMS ECC key meant for KeyAgreement

Examples/runtimes/java/DynamoDbEncryption/src/main/java/software/amazon/cryptography/examples/keyring/RawEcdhKeyringExample.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -736,8 +736,8 @@ public static boolean shouldGenerateNewEccKeyPairs() {
736736

737737
// If keys already exist: do not overwrite existing keys
738738
return (
739-
!privateKeyFileSender.exists() ||
740-
!publicKeyFileRecipient.exists() ||
739+
!privateKeyFileSender.exists() &&
740+
!publicKeyFileRecipient.exists() &&
741741
!privateKeyFileRecipient.exists()
742742
);
743743
// If no keys are present, generate new keys

0 commit comments

Comments
 (0)