Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
21 changes: 12 additions & 9 deletions src/main/java/com/amazonaws/encryptionsdk/kms/KmsMasterKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@

package com.amazonaws.encryptionsdk.kms;

import javax.crypto.SecretKey;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these new imports used anywhere?

import javax.crypto.spec.SecretKeySpec;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;

import com.amazonaws.AmazonServiceException;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSCredentialsProvider;
Expand Down Expand Up @@ -52,10 +51,20 @@ public final class KmsMasterKey extends MasterKey<KmsMasterKey> implements KmsMe
private final String id_;
private final List<String> grantTokens_ = new ArrayList<>();

/**
*
* @deprecated Use a {@link KmsMasterKeyProvider} to obtain {@link KmsMasterKey}s.
*/
@Deprecated
public static KmsMasterKey getInstance(final AWSCredentials creds, final String keyId) {
return new KmsMasterKeyProvider(creds, keyId).getMasterKey(keyId);
}

/**
*
* @deprecated Use a {@link KmsMasterKeyProvider} to obtain {@link KmsMasterKey}s.
*/
@Deprecated
public static KmsMasterKey getInstance(final AWSCredentialsProvider creds, final String keyId) {
return new KmsMasterKeyProvider(creds, keyId).getMasterKey(keyId);
}
Expand All @@ -65,12 +74,6 @@ static KmsMasterKey getInstance(final AWSKMS kms, final String id,
return new KmsMasterKey(kms, id, provider);
}

private KmsMasterKey(final AWSKMS kms, final String id) {
kms_ = kms;
id_ = id;
sourceProvider_ = this;
}

private KmsMasterKey(final AWSKMS kms, final String id, final MasterKeyProvider<KmsMasterKey> provider) {
kms_ = kms;
id_ = id;
Expand Down
Loading