1313
1414package com .amazonaws .encryptionsdk .kms ;
1515
16+ import javax .crypto .SecretKey ;
17+ import javax .crypto .spec .SecretKeySpec ;
1618import java .nio .ByteBuffer ;
1719import java .nio .charset .StandardCharsets ;
1820import java .util .ArrayList ;
1921import java .util .Collection ;
2022import java .util .List ;
2123import java .util .Map ;
2224
23- import javax .crypto .SecretKey ;
24- import javax .crypto .spec .SecretKeySpec ;
25-
2625import com .amazonaws .AmazonServiceException ;
2726import com .amazonaws .auth .AWSCredentials ;
2827import com .amazonaws .auth .AWSCredentialsProvider ;
@@ -52,10 +51,20 @@ public final class KmsMasterKey extends MasterKey<KmsMasterKey> implements KmsMe
5251 private final String id_ ;
5352 private final List <String > grantTokens_ = new ArrayList <>();
5453
54+ /**
55+ *
56+ * @deprecated Use a {@link KmsMasterKeyProvider} to obtain {@link KmsMasterKey}s.
57+ */
58+ @ Deprecated
5559 public static KmsMasterKey getInstance (final AWSCredentials creds , final String keyId ) {
5660 return new KmsMasterKeyProvider (creds , keyId ).getMasterKey (keyId );
5761 }
5862
63+ /**
64+ *
65+ * @deprecated Use a {@link KmsMasterKeyProvider} to obtain {@link KmsMasterKey}s.
66+ */
67+ @ Deprecated
5968 public static KmsMasterKey getInstance (final AWSCredentialsProvider creds , final String keyId ) {
6069 return new KmsMasterKeyProvider (creds , keyId ).getMasterKey (keyId );
6170 }
@@ -65,12 +74,6 @@ static KmsMasterKey getInstance(final AWSKMS kms, final String id,
6574 return new KmsMasterKey (kms , id , provider );
6675 }
6776
68- private KmsMasterKey (final AWSKMS kms , final String id ) {
69- kms_ = kms ;
70- id_ = id ;
71- sourceProvider_ = this ;
72- }
73-
7477 private KmsMasterKey (final AWSKMS kms , final String id , final MasterKeyProvider <KmsMasterKey > provider ) {
7578 kms_ = kms ;
7679 id_ = id ;
0 commit comments