Skip to content

Commit 4a19b04

Browse files
authored
fix(AwsCrypto): remove pre-mature Deprecation notices (#2118)
* fix(AwsCrypto): remove pre-mature Deprecation notices While the Master Key Provider and Master Key interfaces do not have a long term future, they are still supported, and safe to use. They will not be removed in version 3.x. They MAY be removed in a future Major Version, but only when AWS is preparing to release that new Major Version should AWS publish these deprecation notices. * fix: remove pre-mature Deprecation notices While the Master Key Provider and Master Key interfaces do not have a long term future, they are still supported, and safe to use. They will not be removed in version 3.x. They MAY be removed in a future Major Version, but only when AWS is preparing to release that new Major Version should AWS publish these deprecation notices.
1 parent 9e91dad commit 4a19b04

File tree

4 files changed

+0
-37
lines changed

4 files changed

+0
-37
lines changed

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

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ public int getEncryptionFrameSize() {
294294
* <p>This method is equivalent to calling {@link #estimateCiphertextSize(CryptoMaterialsManager,
295295
* int, Map)} with a {@link DefaultCryptoMaterialsManager} based on the given provider.
296296
*/
297-
@Deprecated
298297
public <K extends MasterKey<K>> long estimateCiphertextSize(
299298
final MasterKeyProvider<K> provider,
300299
final int plaintextSize,
@@ -327,7 +326,6 @@ public <K extends MasterKey<K>> long estimateCiphertextSize(
327326
* Returns the best estimate for the output length of encrypting a plaintext with the provided
328327
* {@code plaintextSize} and {@code encryptionContext}. The actual ciphertext may be shorter.
329328
*/
330-
@Deprecated
331329
public long estimateCiphertextSize(
332330
CryptoMaterialsManager materialsManager,
333331
final int plaintextSize,
@@ -388,7 +386,6 @@ public long estimateCiphertextSize(
388386
* Returns the equivalent to calling {@link #estimateCiphertextSize(MasterKeyProvider, int, Map)}
389387
* with an empty {@code encryptionContext}.
390388
*/
391-
@Deprecated
392389
public <K extends MasterKey<K>> long estimateCiphertextSize(
393390
final MasterKeyProvider<K> provider, final int plaintextSize) {
394391
return estimateCiphertextSize(provider, plaintextSize, EMPTY_MAP);
@@ -407,7 +404,6 @@ public <K extends MasterKey<K>> long estimateCiphertextSize(
407404
* Returns the equivalent to calling {@link #estimateCiphertextSize(CryptoMaterialsManager, int,
408405
* Map)} with an empty {@code encryptionContext}.
409406
*/
410-
@Deprecated
411407
public long estimateCiphertextSize(
412408
final CryptoMaterialsManager materialsManager, final int plaintextSize) {
413409
return estimateCiphertextSize(materialsManager, plaintextSize, EMPTY_MAP);
@@ -488,7 +484,6 @@ public long estimateCiphertextSize(
488484
* <p>This method is equivalent to calling {@link #encryptData(CryptoMaterialsManager, byte[],
489485
* Map)} using a {@link DefaultCryptoMaterialsManager} based on the given provider.
490486
*/
491-
@Deprecated
492487
public <K extends MasterKey<K>> CryptoResult<byte[], K> encryptData(
493488
final MasterKeyProvider<K> provider,
494489
final byte[] plaintext,
@@ -503,7 +498,6 @@ public <K extends MasterKey<K>> CryptoResult<byte[], K> encryptData(
503498
* Returns an encrypted form of {@code plaintext} that has been protected with {@link DataKey
504499
* DataKeys} that are in turn protected by the given CryptoMaterialsProvider.
505500
*/
506-
@Deprecated
507501
public CryptoResult<byte[], ?> encryptData(
508502
CryptoMaterialsManager materialsManager,
509503
final byte[] plaintext,
@@ -548,7 +542,6 @@ private <K extends MasterKey<K>> CryptoResult<byte[], K> encryptData(
548542
* Returns the equivalent to calling {@link #encryptData(MasterKeyProvider, byte[], Map)} with an
549543
* empty {@code encryptionContext}.
550544
*/
551-
@Deprecated
552545
public <K extends MasterKey<K>> CryptoResult<byte[], K> encryptData(
553546
final MasterKeyProvider<K> provider, final byte[] plaintext) {
554547
return encryptData(provider, plaintext, EMPTY_MAP);
@@ -558,7 +551,6 @@ public <K extends MasterKey<K>> CryptoResult<byte[], K> encryptData(
558551
* Returns the equivalent to calling {@link #encryptData(CryptoMaterialsManager, byte[], Map)}
559552
* with an empty {@code encryptionContext}.
560553
*/
561-
@Deprecated
562554
public CryptoResult<byte[], ?> encryptData(
563555
final CryptoMaterialsManager materialsManager, final byte[] plaintext) {
564556
return encryptData(materialsManager, plaintext, EMPTY_MAP);
@@ -650,7 +642,6 @@ public <K extends MasterKey<K>> CryptoResult<String, K> encryptString(
650642
* usable {@link DataKey} in the ciphertext and then decrypts the ciphertext using that {@code
651643
* DataKey}.
652644
*/
653-
@Deprecated
654645
public <K extends MasterKey<K>> CryptoResult<byte[], K> decryptData(
655646
final MasterKeyProvider<K> provider, final byte[] ciphertext) {
656647
return decryptData(provider, new ParsedCiphertext(ciphertext, maxEncryptedDataKeys_));
@@ -664,15 +655,13 @@ public <K extends MasterKey<K>> CryptoResult<byte[], K> decryptData(
664655
* @param ciphertext the ciphertext to attempt to decrypt.
665656
* @return the {@link CryptoResult} with the decrypted data.
666657
*/
667-
@Deprecated
668658
public CryptoResult<byte[], ?> decryptData(
669659
final CryptoMaterialsManager materialsManager, final byte[] ciphertext) {
670660
return decryptData(materialsManager, new ParsedCiphertext(ciphertext, maxEncryptedDataKeys_));
671661
}
672662

673663
/** @see #decryptData(MasterKeyProvider, byte[]) */
674664
@SuppressWarnings("unchecked")
675-
@Deprecated
676665
public <K extends MasterKey<K>> CryptoResult<byte[], K> decryptData(
677666
final MasterKeyProvider<K> provider, final ParsedCiphertext ciphertext) {
678667
Utils.assertNonNull(provider, "provider");
@@ -681,7 +670,6 @@ public <K extends MasterKey<K>> CryptoResult<byte[], K> decryptData(
681670
}
682671

683672
/** @see #decryptData(CryptoMaterialsManager, byte[]) */
684-
@Deprecated
685673
public CryptoResult<byte[], ?> decryptData(
686674
final CryptoMaterialsManager materialsManager, final ParsedCiphertext ciphertext) {
687675
Utils.assertNonNull(materialsManager, "materialsManager");
@@ -888,7 +876,6 @@ public <K extends MasterKey<K>> CryptoResult<String, K> decryptString(
888876
* @see #encryptData(MasterKeyProvider, byte[], Map)
889877
* @see javax.crypto.CipherOutputStream
890878
*/
891-
@Deprecated
892879
public <K extends MasterKey<K>> CryptoOutputStream<K> createEncryptingStream(
893880
final MasterKeyProvider<K> provider,
894881
final OutputStream os,
@@ -919,7 +906,6 @@ public <K extends MasterKey<K>> CryptoOutputStream<K> createEncryptingStream(
919906
* @see #encryptData(MasterKeyProvider, byte[], Map)
920907
* @see javax.crypto.CipherOutputStream
921908
*/
922-
@Deprecated
923909
public CryptoOutputStream<?> createEncryptingStream(
924910
final CryptoMaterialsManager materialsManager,
925911
final OutputStream os,
@@ -947,7 +933,6 @@ public CryptoOutputStream<?> createEncryptingStream(
947933
* Returns the equivalent to calling {@link #createEncryptingStream(MasterKeyProvider,
948934
* OutputStream, Map)} with an empty {@code encryptionContext}.
949935
*/
950-
@Deprecated
951936
public <K extends MasterKey<K>> CryptoOutputStream<K> createEncryptingStream(
952937
final MasterKeyProvider<K> provider, final OutputStream os) {
953938
return createEncryptingStream(provider, os, EMPTY_MAP);
@@ -966,7 +951,6 @@ public <K extends MasterKey<K>> CryptoOutputStream<K> createEncryptingStream(
966951
* Returns the equivalent to calling {@link #createEncryptingStream(CryptoMaterialsManager,
967952
* OutputStream, Map)} with an empty {@code encryptionContext}.
968953
*/
969-
@Deprecated
970954
public CryptoOutputStream<?> createEncryptingStream(
971955
final CryptoMaterialsManager materialsManager, final OutputStream os) {
972956
return createEncryptingStream(materialsManager, os, EMPTY_MAP);
@@ -989,7 +973,6 @@ public CryptoOutputStream<?> createEncryptingStream(
989973
* @see #encryptData(MasterKeyProvider, byte[], Map)
990974
* @see javax.crypto.CipherInputStream
991975
*/
992-
@Deprecated
993976
public <K extends MasterKey<K>> CryptoInputStream<K> createEncryptingStream(
994977
final MasterKeyProvider<K> provider,
995978
final InputStream is,
@@ -1020,7 +1003,6 @@ public <K extends MasterKey<K>> CryptoInputStream<K> createEncryptingStream(
10201003
* @see #encryptData(MasterKeyProvider, byte[], Map)
10211004
* @see javax.crypto.CipherInputStream
10221005
*/
1023-
@Deprecated
10241006
public CryptoInputStream<?> createEncryptingStream(
10251007
CryptoMaterialsManager materialsManager,
10261008
final InputStream is,
@@ -1052,7 +1034,6 @@ public CryptoInputStream<?> createEncryptingStream(
10521034
* Returns the equivalent to calling {@link #createEncryptingStream(MasterKeyProvider,
10531035
* InputStream, Map)} with an empty {@code encryptionContext}.
10541036
*/
1055-
@Deprecated
10561037
public <K extends MasterKey<K>> CryptoInputStream<K> createEncryptingStream(
10571038
final MasterKeyProvider<K> provider, final InputStream is) {
10581039
return createEncryptingStream(provider, is, EMPTY_MAP);
@@ -1071,7 +1052,6 @@ public <K extends MasterKey<K>> CryptoInputStream<K> createEncryptingStream(
10711052
* Returns the equivalent to calling {@link #createEncryptingStream(CryptoMaterialsManager,
10721053
* InputStream, Map)} with an empty {@code encryptionContext}.
10731054
*/
1074-
@Deprecated
10751055
public CryptoInputStream<?> createEncryptingStream(
10761056
final CryptoMaterialsManager materialsManager, final InputStream is) {
10771057
return createEncryptingStream(materialsManager, is, EMPTY_MAP);
@@ -1094,7 +1074,6 @@ public CryptoInputStream<?> createEncryptingStream(
10941074
* @see #decryptData(MasterKeyProvider, byte[])
10951075
* @see javax.crypto.CipherOutputStream
10961076
*/
1097-
@Deprecated
10981077
public <K extends MasterKey<K>> CryptoOutputStream<K> createUnsignedMessageDecryptingStream(
10991078
final MasterKeyProvider<K> provider, final OutputStream os) {
11001079
final MessageCryptoHandler cryptoHandler =
@@ -1150,7 +1129,6 @@ public <K extends MasterKey<K>> CryptoOutputStream<K> createUnsignedMessageDecry
11501129
* @see #decryptData(MasterKeyProvider, byte[])
11511130
* @see javax.crypto.CipherInputStream
11521131
*/
1153-
@Deprecated
11541132
public <K extends MasterKey<K>> CryptoInputStream<K> createUnsignedMessageDecryptingStream(
11551133
final MasterKeyProvider<K> provider, final InputStream is) {
11561134
final MessageCryptoHandler cryptoHandler =
@@ -1206,7 +1184,6 @@ public <K extends MasterKey<K>> CryptoInputStream<K> createUnsignedMessageDecryp
12061184
* @see #decryptData(CryptoMaterialsManager, byte[])
12071185
* @see javax.crypto.CipherOutputStream
12081186
*/
1209-
@Deprecated
12101187
public CryptoOutputStream<?> createUnsignedMessageDecryptingStream(
12111188
final CryptoMaterialsManager materialsManager, final OutputStream os) {
12121189
final MessageCryptoHandler cryptoHandler =
@@ -1264,7 +1241,6 @@ public CryptoOutputStream<?> createUnsignedMessageDecryptingStream(
12641241
* @see #encryptData(CryptoMaterialsManager, byte[], Map)
12651242
* @see javax.crypto.CipherInputStream
12661243
*/
1267-
@Deprecated
12681244
public CryptoInputStream<?> createUnsignedMessageDecryptingStream(
12691245
final CryptoMaterialsManager materialsManager, final InputStream is) {
12701246
final MessageCryptoHandler cryptoHandler =
@@ -1330,7 +1306,6 @@ public CryptoInputStream<?> createUnsignedMessageDecryptingStream(
13301306
* @see #createUnsignedMessageDecryptingStream(MasterKeyProvider, OutputStream)
13311307
* @see javax.crypto.CipherOutputStream
13321308
*/
1333-
@Deprecated
13341309
public <K extends MasterKey<K>> CryptoOutputStream<K> createDecryptingStream(
13351310
final MasterKeyProvider<K> provider, final OutputStream os) {
13361311
final MessageCryptoHandler cryptoHandler =
@@ -1408,7 +1383,6 @@ public <K extends MasterKey<K>> CryptoOutputStream<K> createDecryptingStream(
14081383
* @see #createUnsignedMessageDecryptingStream(MasterKeyProvider, InputStream)
14091384
* @see javax.crypto.CipherInputStream
14101385
*/
1411-
@Deprecated
14121386
public <K extends MasterKey<K>> CryptoInputStream<K> createDecryptingStream(
14131387
final MasterKeyProvider<K> provider, final InputStream is) {
14141388
final MessageCryptoHandler cryptoHandler =
@@ -1486,7 +1460,6 @@ public <K extends MasterKey<K>> CryptoInputStream<K> createDecryptingStream(
14861460
* @see #createUnsignedMessageDecryptingStream(CryptoMaterialsManager, OutputStream)
14871461
* @see javax.crypto.CipherOutputStream
14881462
*/
1489-
@Deprecated
14901463
public CryptoOutputStream<?> createDecryptingStream(
14911464
final CryptoMaterialsManager materialsManager, final OutputStream os) {
14921465
final MessageCryptoHandler cryptoHandler =
@@ -1568,7 +1541,6 @@ public CryptoOutputStream<?> createDecryptingStream(
15681541
* @see #createUnsignedMessageDecryptingStream(CryptoMaterialsManager, InputStream)
15691542
* @see javax.crypto.CipherInputStream
15701543
*/
1571-
@Deprecated
15721544
public CryptoInputStream<?> createDecryptingStream(
15731545
final CryptoMaterialsManager materialsManager, final InputStream is) {
15741546
final MessageCryptoHandler cryptoHandler =

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ public class CryptoResult<T, K extends MasterKey<K>> {
4949
/**
5050
* The actual result of the cryptographic operation. This is not a defensive copy and callers
5151
* should not modify it.
52-
*
53-
* @return
5452
*/
5553
public T getResult() {
5654
return result_;
@@ -60,16 +58,12 @@ public T getResult() {
6058
* Returns all relevant {@link MasterKey}s. In the case of encryption, returns all {@code
6159
* MasterKey}s used to protect the ciphertext. In the case of decryption, returns just the {@code
6260
* MasterKey} used to decrypt the ciphertext.
63-
*
64-
* @return
6561
*/
66-
@Deprecated
6762
public List<K> getMasterKeys() {
6863
return masterKeys_;
6964
}
7065

7166
/** Convenience method for retrieving the keyIds in the results from {@link #getMasterKeys()}. */
72-
@Deprecated
7367
public List<String> getMasterKeyIds() {
7468
final List<String> result = new ArrayList<>(masterKeys_.size());
7569
for (final MasterKey<K> mk : masterKeys_) {

src/main/java/com/amazonaws/encryptionsdk/model/EncryptionMaterials.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public PrivateKey getTrailingSignatureKey() {
8484
}
8585

8686
/** Contains a list of all MasterKeys that could decrypt this message. */
87-
@Deprecated
8887
public List<MasterKey> getMasterKeys() {
8988
return masterKeys;
9089
}
@@ -181,7 +180,6 @@ public Builder setTrailingSignatureKey(PrivateKey trailingSignatureKey) {
181180
return this;
182181
}
183182

184-
@Deprecated
185183
public List<MasterKey> getMasterKeys() {
186184
return masterKeys;
187185
}

src/main/java/com/amazonaws/encryptionsdk/model/EncryptionMaterialsHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ public List<String> getRequiredEncryptionContextKeys() {
9393
}
9494
}
9595

96-
@Deprecated
9796
public List<MasterKey> getMasterKeys() {
9897
if (materials != null) {
9998
return materials.getMasterKeys();

0 commit comments

Comments
 (0)