Package org.apache.james.mime4j.storage
Class CipherStorageProvider
- java.lang.Object
-
- org.apache.james.mime4j.storage.AbstractStorageProvider
-
- org.apache.james.mime4j.storage.CipherStorageProvider
-
- All Implemented Interfaces:
StorageProvider
public class CipherStorageProvider extends AbstractStorageProvider
AStorageProviderthat transparently scrambles and unscrambles the data stored by anotherStorageProvider.Example usage:
StorageProvider mistrusted = new TempFileStorageProvider(); StorageProvider enciphered = new CipherStorageProvider(mistrusted); StorageProvider provider = new ThresholdStorageProvider(enciphered); DefaultStorageProvider.setInstance(provider);
-
-
Constructor Summary
Constructors Constructor Description CipherStorageProvider(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StorageOutputStreamcreateStorageOutputStream()Creates aStorageOutputStreamwhere data to be stored can be written to.-
Methods inherited from class org.apache.james.mime4j.storage.AbstractStorageProvider
store
-
-
-
-
Constructor Detail
-
CipherStorageProvider
public CipherStorageProvider(StorageProvider backend)
Creates a newCipherStorageProviderfor the given back-end using the Blowfish cipher algorithm.- Parameters:
backend- back-end storage strategy to encrypt.
-
CipherStorageProvider
public CipherStorageProvider(StorageProvider backend, String algorithm)
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 Detail
-
createStorageOutputStream
public StorageOutputStream createStorageOutputStream() throws IOException
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.
-
-