Class KeyStoreMaterialsProvider
java.lang.Object
com.amazonaws.services.dynamodbv2.datamodeling.encryption.providers.KeyStoreMaterialsProvider
- All Implemented Interfaces:
EncryptionMaterialsProvider
- Author:
- Greg Rubin
-
Constructor Summary
ConstructorDescriptionKeyStoreMaterialsProvider
(KeyStore keyStore, String encryptionAlias, String signingAlias, KeyStore.ProtectionParameter encryptionProtection, KeyStore.ProtectionParameter signingProtection, Map<String, String> description) KeyStoreMaterialsProvider
(KeyStore keyStore, String encryptionAlias, String signingAlias, Map<String, String> description) -
Method Summary
Modifier and TypeMethodDescriptiongetDecryptionMaterials
(EncryptionContext context) Retrieves encryption materials matching the specified description from some source.getEncryptionMaterials
(EncryptionContext context) Returns EncryptionMaterials which the caller can use for encryption.void
refresh()
Reloads the keys from the underlying keystore by callingKeyStore.getEntry(String, ProtectionParameter)
again for each of them.
-
Constructor Details
-
KeyStoreMaterialsProvider
public KeyStoreMaterialsProvider(KeyStore keyStore, String encryptionAlias, String signingAlias, Map<String, String> description) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableEntryException -
KeyStoreMaterialsProvider
public KeyStoreMaterialsProvider(KeyStore keyStore, String encryptionAlias, String signingAlias, KeyStore.ProtectionParameter encryptionProtection, KeyStore.ProtectionParameter signingProtection, Map<String, String> description) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableEntryException
-
-
Method Details
-
getDecryptionMaterials
Description copied from interface:EncryptionMaterialsProvider
Retrieves encryption materials matching the specified description from some source.- Specified by:
getDecryptionMaterials
in interfaceEncryptionMaterialsProvider
- Parameters:
context
- Information to assist in selecting a the proper return value. The implementation is free to determine the minimum necessary for successful processing.- Returns:
- The encryption materials that match the description, or null if no matching encryption materials found.
-
getEncryptionMaterials
Description copied from interface:EncryptionMaterialsProvider
Returns EncryptionMaterials which the caller can use for encryption. Each implementation of EncryptionMaterialsProvider can choose its own strategy for loading encryption material. For example, an implementation might load encryption material from an existing key management system, or load new encryption material when keys are rotated.- Specified by:
getEncryptionMaterials
in interfaceEncryptionMaterialsProvider
- Parameters:
context
- Information to assist in selecting a the proper return value. The implementation is free to determine the minimum necessary for successful processing.- Returns:
- EncryptionMaterials which the caller can use to encrypt or decrypt data.
-
refresh
public void refresh()Reloads the keys from the underlying keystore by callingKeyStore.getEntry(String, ProtectionParameter)
again for each of them.- Specified by:
refresh
in interfaceEncryptionMaterialsProvider
-