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
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 class
private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private final StorageProvider
private final KeyGenerator
-
Constructor Summary
ConstructorsConstructorDescriptionCipherStorageProvider
(StorageProvider backend) Creates a newCipherStorageProvider
for the given back-end using the Blowfish cipher algorithm.CipherStorageProvider
(StorageProvider backend, String algorithm) Creates a newCipherStorageProvider
for the given back-end and cipher algorithm. -
Method Summary
Modifier and TypeMethodDescriptionCreates aStorageOutputStream
where data to be stored can be written to.private SecretKeySpec
Methods inherited from class org.apache.james.mime4j.storage.AbstractStorageProvider
store
-
Field Details
-
backend
-
algorithm
-
keygen
-
-
Constructor Details
-
CipherStorageProvider
Creates a newCipherStorageProvider
for the given back-end using the Blowfish cipher algorithm.- Parameters:
backend
- back-end storage strategy to encrypt.
-
CipherStorageProvider
Creates a newCipherStorageProvider
for 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:StorageProvider
Creates aStorageOutputStream
where data to be stored can be written to. Subsequently the user can calltoStorage()
on that object to get aStorage
instance that holds the data that has been written.- Returns:
- a
StorageOutputStream
where data can be written to. - Throws:
IOException
- if an I/O error occurs.
-
getSecretKeySpec
-