Skip to content

Commit eec790b

Browse files
committed
chore: deprecate getMasterKeyIds()
1 parent 800bd01 commit eec790b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public List<K> getMasterKeys() {
6969
}
7070

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

src/main/java/com/amazonaws/encryptionsdk/internal/DecryptionHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,9 @@ public CiphertextHeaders getHeaders() {
890890

891891
@Override
892892
public List<K> getMasterKeys() {
893-
return Collections.singletonList(dataKey_.getMasterKey());
893+
return dataKey_.getMasterKey() == null
894+
? Collections.emptyList()
895+
: Collections.singletonList(dataKey_.getMasterKey());
894896
}
895897

896898
@Override

0 commit comments

Comments
 (0)