public class WrappedMaterialsProvider extends java.lang.Object implements EncryptionMaterialsProvider
getEncryptionMaterials(EncryptionContext). Practically, this means each record in DynamoDB will
be encrypted under a unique record key. A wrapped/encrypted copy of this record key is stored in
the MaterialsDescription field of that record and is unwrapped/decrypted upon reading that
record.
This is generally a more secure way of encrypting data than with the SymmetricStaticProvider.
WrappedRawMaterials| Constructor and Description |
|---|
WrappedMaterialsProvider(java.security.Key wrappingKey,
java.security.Key unwrappingKey,
java.security.KeyPair signingPair) |
WrappedMaterialsProvider(java.security.Key wrappingKey,
java.security.Key unwrappingKey,
java.security.KeyPair signingPair,
java.util.Map<java.lang.String,java.lang.String> description) |
WrappedMaterialsProvider(java.security.Key wrappingKey,
java.security.Key unwrappingKey,
javax.crypto.SecretKey macKey) |
WrappedMaterialsProvider(java.security.Key wrappingKey,
java.security.Key unwrappingKey,
javax.crypto.SecretKey macKey,
java.util.Map<java.lang.String,java.lang.String> description) |
| Modifier and Type | Method and Description |
|---|---|
DecryptionMaterials |
getDecryptionMaterials(EncryptionContext context)
Retrieves encryption materials matching the specified description from some source.
|
EncryptionMaterials |
getEncryptionMaterials(EncryptionContext context)
Returns EncryptionMaterials which the caller can use for encryption.
|
void |
refresh()
Forces this encryption materials provider to refresh its encryption material.
|
public WrappedMaterialsProvider(java.security.Key wrappingKey,
java.security.Key unwrappingKey,
java.security.KeyPair signingPair)
wrappingKey - The key used to wrap/encrypt the symmetric record key. (May be the same as
the unwrappingKey.)unwrappingKey - The key used to unwrap/decrypt the symmetric record key. (May be the same
as the wrappingKey.) If null, then this provider may only be used for
decryption, but not encryption.signingPair - the keypair used to sign/verify the data stored in Dynamo. If only the
public key is provided, then this provider may only be used for decryption, but not
encryption.public WrappedMaterialsProvider(java.security.Key wrappingKey,
java.security.Key unwrappingKey,
java.security.KeyPair signingPair,
java.util.Map<java.lang.String,java.lang.String> description)
wrappingKey - The key used to wrap/encrypt the symmetric record key. (May be the same as
the unwrappingKey.)unwrappingKey - The key used to unwrap/decrypt the symmetric record key. (May be the same
as the wrappingKey.) If null, then this provider may only be used for
decryption, but not encryption.signingPair - the keypair used to sign/verify the data stored in Dynamo. If only the
public key is provided, then this provider may only be used for decryption, but not
encryption.description - description the value to be returned by CryptographicMaterials.getMaterialDescription() for any CryptographicMaterials
returned by this object.public WrappedMaterialsProvider(java.security.Key wrappingKey,
java.security.Key unwrappingKey,
javax.crypto.SecretKey macKey)
wrappingKey - The key used to wrap/encrypt the symmetric record key. (May be the same as
the unwrappingKey.)unwrappingKey - The key used to unwrap/decrypt the symmetric record key. (May be the same
as the wrappingKey.) If null, then this provider may only be used for
decryption, but not encryption.macKey - the key used to sign/verify the data stored in Dynamo.public WrappedMaterialsProvider(java.security.Key wrappingKey,
java.security.Key unwrappingKey,
javax.crypto.SecretKey macKey,
java.util.Map<java.lang.String,java.lang.String> description)
wrappingKey - The key used to wrap/encrypt the symmetric record key. (May be the same as
the unwrappingKey.)unwrappingKey - The key used to unwrap/decrypt the symmetric record key. (May be the same
as the wrappingKey.) If null, then this provider may only be used for
decryption, but not encryption.macKey - the key used to sign/verify the data stored in Dynamo.description - description the value to be returned by CryptographicMaterials.getMaterialDescription() for any CryptographicMaterials
returned by this object.public DecryptionMaterials getDecryptionMaterials(EncryptionContext context)
EncryptionMaterialsProvidergetDecryptionMaterials in interface EncryptionMaterialsProvidercontext - Information to assist in selecting a the proper return value. The implementation
is free to determine the minimum necessary for successful processing.public EncryptionMaterials getEncryptionMaterials(EncryptionContext context)
EncryptionMaterialsProvidergetEncryptionMaterials in interface EncryptionMaterialsProvidercontext - Information to assist in selecting a the proper return value. The implementation
is free to determine the minimum necessary for successful processing.public void refresh()
EncryptionMaterialsProviderrefresh in interface EncryptionMaterialsProvider