13
13
14
14
package com .amazonaws .encryptionsdk .kms ;
15
15
16
+ import javax .crypto .SecretKey ;
17
+ import javax .crypto .spec .SecretKeySpec ;
16
18
import java .nio .ByteBuffer ;
17
19
import java .nio .charset .StandardCharsets ;
18
20
import java .util .ArrayList ;
19
21
import java .util .Collection ;
20
22
import java .util .List ;
21
23
import java .util .Map ;
22
24
23
- import javax .crypto .SecretKey ;
24
- import javax .crypto .spec .SecretKeySpec ;
25
-
26
25
import com .amazonaws .AmazonServiceException ;
27
26
import com .amazonaws .auth .AWSCredentials ;
28
27
import com .amazonaws .auth .AWSCredentialsProvider ;
@@ -52,10 +51,20 @@ public final class KmsMasterKey extends MasterKey<KmsMasterKey> implements KmsMe
52
51
private final String id_ ;
53
52
private final List <String > grantTokens_ = new ArrayList <>();
54
53
54
+ /**
55
+ *
56
+ * @deprecated Use a {@link KmsMasterKeyProvider} to obtain {@link KmsMasterKey}s.
57
+ */
58
+ @ Deprecated
55
59
public static KmsMasterKey getInstance (final AWSCredentials creds , final String keyId ) {
56
60
return new KmsMasterKeyProvider (creds , keyId ).getMasterKey (keyId );
57
61
}
58
62
63
+ /**
64
+ *
65
+ * @deprecated Use a {@link KmsMasterKeyProvider} to obtain {@link KmsMasterKey}s.
66
+ */
67
+ @ Deprecated
59
68
public static KmsMasterKey getInstance (final AWSCredentialsProvider creds , final String keyId ) {
60
69
return new KmsMasterKeyProvider (creds , keyId ).getMasterKey (keyId );
61
70
}
@@ -65,12 +74,6 @@ static KmsMasterKey getInstance(final AWSKMS kms, final String id,
65
74
return new KmsMasterKey (kms , id , provider );
66
75
}
67
76
68
- private KmsMasterKey (final AWSKMS kms , final String id ) {
69
- kms_ = kms ;
70
- id_ = id ;
71
- sourceProvider_ = this ;
72
- }
73
-
74
77
private KmsMasterKey (final AWSKMS kms , final String id , final MasterKeyProvider <KmsMasterKey > provider ) {
75
78
kms_ = kms ;
76
79
id_ = id ;
0 commit comments