- java.lang.Object
-
- com.pervasive.datarush.encryption.EncryptionManager
-
public final class EncryptionManager extends Object
A manager of EncryptionProvider's. Within a JVM, there is a single, staticcurrentEncryptorthat is used when performing encryption of sensitive information. ThecurrentEncryptormay be globally set by setting thecurrentEncryptorId. Within a JVM, there can be multipleprovidersthat 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.- See Also:
EncryptionProvider
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EncryptionProvidergetCurrentEncryptor()Returns the encryptor to use when encrypting.StringgetCurrentEncryptorId()Gets the id of theEncryptionProviderto use when encrypting.static EncryptionManagergetInstance()Returns the single instance of this class.EncryptionProvidergetProvider(String id)Returns the provider whoseproviderIDmatches that given.voidsetCurrentEncryptorId(String id)Sets the id of theEncryptionProviderto use when encrypting.
-
-
-
Method Detail
-
getInstance
public static EncryptionManager getInstance()
Returns the single instance of this class.- Returns:
- the single instance of this class
-
getProvider
public EncryptionProvider getProvider(String id)
Returns the provider whoseproviderIDmatches that given.- Parameters:
id- the providerID- Returns:
- the matching provider
- Throws:
IllegalArgumentException- if no provider was found that matches the given ID
-
setCurrentEncryptorId
public void setCurrentEncryptorId(String id)
Sets the id of theEncryptionProviderto use when encrypting. By default this is set toDefaultEncryptionProvider.ID.- Parameters:
id- the encryptor id- Throws:
IllegalArgumentException- if the given provider is not registered
-
getCurrentEncryptorId
public String getCurrentEncryptorId()
Gets the id of theEncryptionProviderto use when encrypting. By default this is set toDefaultEncryptionProvider.ID.- Returns:
- the encryptor id
-
getCurrentEncryptor
public EncryptionProvider getCurrentEncryptor()
Returns the encryptor to use when encrypting. By default this is aDefaultEncryptionProvider.- Returns:
- the encryptor to use when encrypting.
-
-