Skip to content

Commit 6d73307

Browse files
show migration path in deprecation notice
1 parent 513c4ff commit 6d73307

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/main/java/org/cryptomator/siv/SivMode.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
/**
99
* Implements the RFC 5297 SIV mode.
10+
*
11+
* @deprecated Use {@link SivEngine} instead.
1012
*/
1113
@Deprecated
1214
public final class SivMode {
@@ -23,7 +25,9 @@ public SivMode() {
2325
* @param plaintext Your plaintext, which shall be encrypted.
2426
* @param associatedData Optional associated data, which gets authenticated but not encrypted.
2527
* @return IV + Ciphertext as a concatenated byte array.
28+
* @deprecated Use {@link SivEngine#encrypt(byte[], byte[]...)} instead.
2629
*/
30+
@Deprecated
2731
public byte[] encrypt(SecretKey key, byte[] plaintext, byte[]... associatedData) {
2832
final byte[] keyBytes = key.getEncoded();
2933
if (keyBytes == null) {
@@ -45,7 +49,9 @@ public byte[] encrypt(SecretKey key, byte[] plaintext, byte[]... associatedData)
4549
* @param associatedData Optional associated data, which gets authenticated but not encrypted.
4650
* @return IV + Ciphertext as a concatenated byte array.
4751
* @throws IllegalArgumentException if keys are invalid or {@link SecretKey#getEncoded()} is not supported.
52+
* @deprecated Use {@link SivEngine#encrypt(byte[], byte[]...)} instead.
4853
*/
54+
@Deprecated
4955
public byte[] encrypt(SecretKey ctrKey, SecretKey macKey, byte[] plaintext, byte[]... associatedData) {
5056
final byte[] ctrKeyBytes = ctrKey.getEncoded();
5157
final byte[] macKeyBytes = macKey.getEncoded();
@@ -69,7 +75,9 @@ public byte[] encrypt(SecretKey ctrKey, SecretKey macKey, byte[] plaintext, byte
6975
* @param associatedData Optional associated data, which gets authenticated but not encrypted.
7076
* @return IV + Ciphertext as a concatenated byte array.
7177
* @throws IllegalArgumentException if the either of the two keys is of invalid length.
78+
* @deprecated Use {@link SivEngine#encrypt(byte[], byte[]...)} instead.
7279
*/
80+
@Deprecated
7381
public byte[] encrypt(byte[] ctrKey, byte[] macKey, byte[] plaintext, byte[]... associatedData) {
7482
byte[] combinedKey = new byte[ctrKey.length + macKey.length];
7583
try {
@@ -90,7 +98,9 @@ public byte[] encrypt(byte[] ctrKey, byte[] macKey, byte[] plaintext, byte[]...
9098
* @throws IllegalArgumentException If keys are invalid.
9199
* @throws UnauthenticCiphertextException If the authentication failed, e.g. because ciphertext and/or associatedData are corrupted.
92100
* @throws IllegalBlockSizeException If the provided ciphertext is of invalid length.
101+
* @deprecated Use {@link SivEngine#decrypt(byte[], byte[]...)} instead.
93102
*/
103+
@Deprecated
94104
public byte[] decrypt(SecretKey key, byte[] ciphertext, byte[]... associatedData) throws UnauthenticCiphertextException, IllegalBlockSizeException {
95105
final byte[] keyBytes = key.getEncoded();
96106
if (keyBytes == null) {
@@ -116,7 +126,9 @@ public byte[] decrypt(SecretKey key, byte[] ciphertext, byte[]... associatedData
116126
* @throws IllegalArgumentException If keys are invalid or {@link SecretKey#getEncoded()} is not supported.
117127
* @throws UnauthenticCiphertextException If the authentication failed, e.g. because ciphertext and/or associatedData are corrupted.
118128
* @throws IllegalBlockSizeException If the provided ciphertext is of invalid length.
129+
* @deprecated Use {@link SivEngine#decrypt(byte[], byte[]...)} instead.
119130
*/
131+
@Deprecated
120132
public byte[] decrypt(SecretKey ctrKey, SecretKey macKey, byte[] ciphertext, byte[]... associatedData) throws UnauthenticCiphertextException, IllegalBlockSizeException {
121133
final byte[] ctrKeyBytes = ctrKey.getEncoded();
122134
final byte[] macKeyBytes = macKey.getEncoded();
@@ -142,7 +154,9 @@ public byte[] decrypt(SecretKey ctrKey, SecretKey macKey, byte[] ciphertext, byt
142154
* @throws IllegalArgumentException If the either of the two keys is of invalid length.
143155
* @throws UnauthenticCiphertextException If the authentication failed, e.g. because ciphertext and/or associatedData are corrupted.
144156
* @throws IllegalBlockSizeException If the provided ciphertext is of invalid length.
157+
* @deprecated Use {@link SivEngine#decrypt(byte[], byte[]...)} instead.
145158
*/
159+
@Deprecated
146160
public byte[] decrypt(byte[] ctrKey, byte[] macKey, byte[] ciphertext, byte[]... associatedData) throws UnauthenticCiphertextException, IllegalBlockSizeException {
147161
byte[] combinedKey = new byte[ctrKey.length + macKey.length];
148162
try {

0 commit comments

Comments
 (0)