public final class AwsKmsMrkAwareMasterKey extends MasterKey<AwsKmsMrkAwareMasterKey> implements KmsMethods
AwsCrypto
. This
key may be a multi region key, in which case this component is able to recognize different
regional replicas of this multi region key as the same.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<AwsKmsMrkAwareMasterKey> |
decryptDataKey(CryptoAlgorithm algorithm,
Collection<? extends EncryptedDataKey> encryptedDataKeys,
Map<String,String> encryptionContext)
Will attempt to decrypt if awsKmsArnMatchForDecrypt returns true in
AwsKmsMrkAwareMasterKey#filterEncryptedDataKeys(String, AwsKmsCmkArnInfo, EncryptedDataKey) . |
DataKey<AwsKmsMrkAwareMasterKey> |
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<AwsKmsMrkAwareMasterKey> |
generateDataKey(CryptoAlgorithm algorithm,
Map<String,String> encryptionContext)
This is identical behavior to
|
List<String> |
getGrantTokens()
Returns the grantTokens which this object sends to KMS when calling it.
|
String |
getKeyId() |
String |
getProviderId() |
void |
setGrantTokens(List<String> grantTokens)
Clears and sets all grant tokens on this instance.
|
canProvide, equals, getDefaultProviderId, getMasterKey, getMasterKeysForEncryption, hashCode, toString
buildCannotDecryptDksException, buildCannotDecryptDksException, buildCannotDecryptDksException, getMasterKey
public String getProviderId()
getProviderId
in class MasterKey<AwsKmsMrkAwareMasterKey>
public String getKeyId()
getKeyId
in class MasterKey<AwsKmsMrkAwareMasterKey>
public void setGrantTokens(List<String> grantTokens)
setGrantTokens
in interface KmsMethods
public List<String> getGrantTokens()
KmsMethods
getGrantTokens
in interface KmsMethods
public void addGrantToken(String grantToken)
KmsMethods
grantToken
to the list of grantTokens sent to KMS when this class calls it.addGrantToken
in interface KmsMethods
public DataKey<AwsKmsMrkAwareMasterKey> generateDataKey(CryptoAlgorithm algorithm, Map<String,String> encryptionContext)
generateDataKey
in class MasterKey<AwsKmsMrkAwareMasterKey>
KmsMasterKey.generateDataKey(CryptoAlgorithm, Map)
public DataKey<AwsKmsMrkAwareMasterKey> encryptDataKey(CryptoAlgorithm algorithm, Map<String,String> encryptionContext, DataKey<?> dataKey)
MasterKey
dataKey
which is protected by this MasterKey
for use with algorithm
and associated with the provided encryptionContext
.encryptDataKey
in class MasterKey<AwsKmsMrkAwareMasterKey>
KmsMasterKey.encryptDataKey(CryptoAlgorithm, Map, DataKey)
public DataKey<AwsKmsMrkAwareMasterKey> decryptDataKey(CryptoAlgorithm algorithm, Collection<? extends EncryptedDataKey> encryptedDataKeys, Map<String,String> encryptionContext) throws AwsCryptoException
AwsKmsMrkAwareMasterKey#filterEncryptedDataKeys(String, AwsKmsCmkArnInfo, EncryptedDataKey)
.
An extension of KmsMasterKey.decryptDataKey(CryptoAlgorithm, Collection, Map)
but with
an awareness of the properties of multi-Region keys.decryptDataKey
in class MasterKeyProvider<AwsKmsMrkAwareMasterKey>
null
UnsupportedProviderException
- if the encryptedDataKey
is associated with an
unsupported providerCannotUnwrapDataKeyException
- if the encryptedDataKey
cannot be decryptedAwsCryptoException
Copyright © 2023. All rights reserved.