Class CipherStorageProvider
java.lang.Object
org.apache.james.mime4j.storage.AbstractStorageProvider
org.apache.james.mime4j.storage.CipherStorageProvider
- All Implemented Interfaces:
StorageProvider
A
StorageProvider that transparently scrambles and unscrambles the
data stored by another StorageProvider.
Example usage:
StorageProvider mistrusted = new TempFileStorageProvider(); StorageProvider enciphered = new CipherStorageProvider(mistrusted); StorageProvider provider = new ThresholdStorageProvider(enciphered); DefaultStorageProvider.setInstance(provider);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final StorageProviderprivate final KeyGenerator -
Constructor Summary
ConstructorsConstructorDescriptionCipherStorageProvider(StorageProvider backend) Creates a newCipherStorageProviderfor the given back-end using the Blowfish cipher algorithm.CipherStorageProvider(StorageProvider backend, String algorithm) Creates a newCipherStorageProviderfor the given back-end and cipher algorithm. -
Method Summary
Modifier and TypeMethodDescriptionCreates aStorageOutputStreamwhere data to be stored can be written to.private SecretKeySpecMethods inherited from class AbstractStorageProvider
store
-
Field Details
-
backend
-
algorithm
-
keygen
-
-
Constructor Details
-
CipherStorageProvider
Creates a newCipherStorageProviderfor the given back-end using the Blowfish cipher algorithm.- Parameters:
backend- back-end storage strategy to encrypt.
-
CipherStorageProvider
Creates a newCipherStorageProviderfor the given back-end and cipher algorithm.- Parameters:
backend- back-end storage strategy to encrypt.algorithm- the name of the symmetric block cipher algorithm such as "Blowfish", "AES" or "RC2".
-
-
Method Details
-
createStorageOutputStream
Description copied from interface:StorageProviderCreates aStorageOutputStreamwhere data to be stored can be written to. Subsequently the user can calltoStorage()on that object to get aStorageinstance that holds the data that has been written.- Returns:
- a
StorageOutputStreamwhere data can be written to. - Throws:
IOException- if an I/O error occurs.
-
getSecretKeySpec
-