Class SymmetricStaticProvider
- java.lang.Object
-
- com.amazonaws.services.dynamodbv2.datamodeling.encryption.providers.SymmetricStaticProvider
-
- All Implemented Interfaces:
EncryptionMaterialsProvider
public class SymmetricStaticProvider extends Object implements EncryptionMaterialsProvider
A provider which always returns the same provided symmetric encryption/decryption key and the same signing/verification key(s).- Author:
- Greg Rubin
-
-
Constructor Summary
Constructors Constructor Description SymmetricStaticProvider(SecretKey encryptionKey, KeyPair signingPair)
SymmetricStaticProvider(SecretKey encryptionKey, KeyPair signingPair, Map<String,String> description)
SymmetricStaticProvider(SecretKey encryptionKey, SecretKey macKey)
SymmetricStaticProvider(SecretKey encryptionKey, SecretKey macKey, Map<String,String> description)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DecryptionMaterials
getDecryptionMaterials(EncryptionContext context)
Returns theencryptionKey
provided to the constructor if and only ifmaterialDescription
is a super-set (may be equal) to thedescription
provided to the constructor.EncryptionMaterials
getEncryptionMaterials(EncryptionContext context)
Returns theencryptionKey
provided to the constructor.void
refresh()
Does nothing.
-
-
-
Constructor Detail
-
SymmetricStaticProvider
public SymmetricStaticProvider(SecretKey encryptionKey, KeyPair signingPair)
- Parameters:
encryptionKey
- the value to be returned bygetEncryptionMaterials(EncryptionContext)
andgetDecryptionMaterials(EncryptionContext)
signingPair
- the keypair used to sign/verify the data stored in Dynamo. If only the public key is provided, then this provider may be used for decryption, but not encryption.
-
SymmetricStaticProvider
public SymmetricStaticProvider(SecretKey encryptionKey, KeyPair signingPair, Map<String,String> description)
- Parameters:
encryptionKey
- the value to be returned bygetEncryptionMaterials(EncryptionContext)
andgetDecryptionMaterials(EncryptionContext)
signingPair
- the keypair used to sign/verify the data stored in Dynamo. If only the public key is provided, then this provider may be used for decryption, but not encryption.description
- the value to be returned byCryptographicMaterials.getMaterialDescription()
for anyCryptographicMaterials
returned by this object.
-
SymmetricStaticProvider
public SymmetricStaticProvider(SecretKey encryptionKey, SecretKey macKey)
- Parameters:
encryptionKey
- the value to be returned bygetEncryptionMaterials(EncryptionContext)
andgetDecryptionMaterials(EncryptionContext)
macKey
- the key used to sign/verify the data stored in Dynamo.
-
SymmetricStaticProvider
public SymmetricStaticProvider(SecretKey encryptionKey, SecretKey macKey, Map<String,String> description)
- Parameters:
encryptionKey
- the value to be returned bygetEncryptionMaterials(EncryptionContext)
andgetDecryptionMaterials(EncryptionContext)
macKey
- the key used to sign/verify the data stored in Dynamo.description
- the value to be returned byCryptographicMaterials.getMaterialDescription()
for anyCryptographicMaterials
returned by this object.
-
-
Method Detail
-
getDecryptionMaterials
public DecryptionMaterials getDecryptionMaterials(EncryptionContext context)
Returns theencryptionKey
provided to the constructor if and only ifmaterialDescription
is a super-set (may be equal) to thedescription
provided to the constructor.- 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
public EncryptionMaterials getEncryptionMaterials(EncryptionContext context)
Returns theencryptionKey
provided to the constructor.- 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()
Does nothing.- Specified by:
refresh
in interfaceEncryptionMaterialsProvider
-
-