Skip to content

fix: Fix errors in the example code in README.md #1306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ public class StringExample {

// The AWS Encryption SDK may add information to the encryption context, so check to
// ensure all of the values that you specified when encrypting are *included* in the returned encryption context.
if (!context.entrySet().stream
if (!context.entrySet().stream()
.allMatch( e -> e.getValue().equals(decryptResult.getEncryptionContext().get(e.getKey())))) {
throw new IllegalStateException("Wrong Encryption Context!");
}

assert Arrays.equals(decryptResult.getResult(), data.getBytes(StandardCharsets.UTF_8));
assert Arrays.equals(decryptResult.getResult(), plaintext.getBytes(StandardCharsets.UTF_8));

// The data is correct, so return it.
System.out.println("Decrypted: " + new String(decryptResult.getResult(), StandardCharsets.UTF_8));
Expand Down