Skip to content

Commit 15c1def

Browse files
Add comment on not making a defensive copy of plaintext/ciphertext
1 parent 6396c6c commit 15c1def

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/main/java/com/amazonaws/encryptionsdk/DecryptRequest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static class Builder extends AwsCryptoRequest.Builder<Builder> {
4646
private byte[] ciphertext;
4747

4848
/**
49-
* Sets the {@link ParsedCiphertext}. Either {@link ParsedCiphertext} or a
49+
* Sets the {@link ParsedCiphertext} to decrypt. Either {@link ParsedCiphertext} or a
5050
* {@code byte[]} ciphertext is required.
5151
*
5252
* @param parsedCiphertext The {@link ParsedCiphertext}
@@ -59,8 +59,10 @@ public Builder parsedCiphertext(ParsedCiphertext parsedCiphertext) {
5959
}
6060

6161
/**
62-
* Sets the ciphertext. Either {@link ParsedCiphertext} or a
63-
* {@code byte[]} ciphertext is required.
62+
* Sets the ciphertext byte array to decrypt. Either {@link ParsedCiphertext} or a
63+
* {@code byte[]} ciphertext is required. Note that this does not make a defensive
64+
* copy of the ciphertext and so any modifications made to the backing array will be
65+
* reflected in this Builder.
6466
*
6567
* @param ciphertext The ciphertext
6668
* @return The Builder, for method chaining

src/main/java/com/amazonaws/encryptionsdk/EncryptRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public static class Builder extends AwsCryptoRequest.Builder<Builder> {
5353
private Map<String, String> encryptionContext = Collections.emptyMap();
5454

5555
/**
56-
* Sets the {@link Keyring}. Either a {@link CryptoMaterialsManager} or a
57-
* {@link Keyring} is required.
56+
* Sets the plaintext byte array to encrypt. Note that this does not make a defensive copy of the
57+
* plaintext and so any modifications made to the backing array will be reflected in this Builder.
5858
*
5959
* @param plaintext The {@link Keyring}
6060
* @return The Builder, for method chaining

0 commit comments

Comments
 (0)