public final class EncryptionManager extends Object
currentEncryptor
that is used when performing
encryption of sensitive information. The currentEncryptor
may be globally set by setting the currentEncryptorId
.
Within a JVM, there can be multiple providers
that are used
when performing decryption.
This model allows for the encryption strategy to evolve over time
while always being able to read files written by previous EncryptionProvider's.EncryptionProvider
Modifier and Type | Method and Description |
---|---|
EncryptionProvider |
getCurrentEncryptor()
Returns the encryptor to use when encrypting.
|
String |
getCurrentEncryptorId()
Gets the id of the
EncryptionProvider to use when encrypting. |
static EncryptionManager |
getInstance()
Returns the single instance of this class.
|
EncryptionProvider |
getProvider(String id)
Returns the provider whose
providerID matches
that given. |
void |
setCurrentEncryptorId(String id)
Sets the id of the
EncryptionProvider to use when encrypting. |
public static EncryptionManager getInstance()
public EncryptionProvider getProvider(String id)
providerID
matches
that given.id
- the providerIDIllegalArgumentException
- if no provider was found that matches the given IDpublic void setCurrentEncryptorId(String id)
EncryptionProvider
to use when encrypting.
By default this is set to DefaultEncryptionProvider.ID
.id
- the encryptor idIllegalArgumentException
- if the given provider is not registeredpublic String getCurrentEncryptorId()
EncryptionProvider
to use when encrypting.
By default this is set to DefaultEncryptionProvider.ID
.public EncryptionProvider getCurrentEncryptor()
DefaultEncryptionProvider
.Copyright © 2016 Actian Corporation. All rights reserved.