public final class KmsMasterKey extends MasterKey<KmsMasterKey> implements KmsMethods
AwsCrypto.| Modifier and Type | Method and Description |
|---|---|
void |
addGrantToken(String grantToken)
Adds
grantToken to the list of grantTokens sent to KMS when this class calls it. |
DataKey<KmsMasterKey> |
decryptDataKey(CryptoAlgorithm algorithm,
Collection<? extends EncryptedDataKey> encryptedDataKeys,
Map<String,String> encryptionContext)
Iterates through
encryptedDataKeys and returns the first one which can be
successfully decrypted. |
DataKey<KmsMasterKey> |
encryptDataKey(CryptoAlgorithm algorithm,
Map<String,String> encryptionContext,
DataKey<?> dataKey)
Returns a new copy of the provided
dataKey which is protected by this
MasterKey for use with algorithm and associated with the provided
encryptionContext. |
DataKey<KmsMasterKey> |
generateDataKey(CryptoAlgorithm algorithm,
Map<String,String> encryptionContext)
|
List<String> |
getGrantTokens()
Returns the grantTokens which this object sends to KMS when calling it.
|
static KmsMasterKey |
getInstance(com.amazonaws.auth.AWSCredentialsProvider creds,
String keyId)
Deprecated.
Use a
KmsMasterKeyProvider to obtain KmsMasterKeys. |
static KmsMasterKey |
getInstance(com.amazonaws.auth.AWSCredentials creds,
String keyId)
Deprecated.
Use a
KmsMasterKeyProvider to obtain KmsMasterKeys. |
String |
getKeyId() |
String |
getProviderId() |
void |
setGrantTokens(List<String> grantTokens)
Sets the
grantTokens which should be submitted to KMS when calling it. |
canProvide, equals, getDefaultProviderId, getMasterKey, getMasterKeysForEncryption, hashCode, toStringbuildCannotDecryptDksException, buildCannotDecryptDksException, buildCannotDecryptDksException, getMasterKey@Deprecated public static KmsMasterKey getInstance(com.amazonaws.auth.AWSCredentials creds, String keyId)
KmsMasterKeyProvider to obtain KmsMasterKeys.@Deprecated public static KmsMasterKey getInstance(com.amazonaws.auth.AWSCredentialsProvider creds, String keyId)
KmsMasterKeyProvider to obtain KmsMasterKeys.public String getProviderId()
getProviderId in class MasterKey<KmsMasterKey>public String getKeyId()
getKeyId in class MasterKey<KmsMasterKey>public DataKey<KmsMasterKey> generateDataKey(CryptoAlgorithm algorithm, Map<String,String> encryptionContext)
MasterKeyDataKey which is protected by this MasterKey for use with
algorithm and associated with the provided encryptionContext.generateDataKey in class MasterKey<KmsMasterKey>public void setGrantTokens(List<String> grantTokens)
KmsMethodsgrantTokens which should be submitted to KMS when calling it.setGrantTokens in interface KmsMethodspublic List<String> getGrantTokens()
KmsMethodsgetGrantTokens in interface KmsMethodspublic void addGrantToken(String grantToken)
KmsMethodsgrantToken to the list of grantTokens sent to KMS when this class calls it.addGrantToken in interface KmsMethodspublic DataKey<KmsMasterKey> encryptDataKey(CryptoAlgorithm algorithm, Map<String,String> encryptionContext, DataKey<?> dataKey)
MasterKeydataKey which is protected by this
MasterKey for use with algorithm and associated with the provided
encryptionContext.encryptDataKey in class MasterKey<KmsMasterKey>public DataKey<KmsMasterKey> decryptDataKey(CryptoAlgorithm algorithm, Collection<? extends EncryptedDataKey> encryptedDataKeys, Map<String,String> encryptionContext) throws UnsupportedProviderException, AwsCryptoException
MasterKeyProviderencryptedDataKeys and returns the first one which can be
successfully decrypted.decryptDataKey in class MasterKeyProvider<KmsMasterKey>nullUnsupportedProviderException - if the encryptedDataKey is associated with an unsupported providerCannotUnwrapDataKeyException - if the encryptedDataKey cannot be decryptedAwsCryptoExceptionCopyright © 2018. All rights reserved.