public class CipherStorageProvider extends AbstractStorageProvider
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);
Constructor and Description |
---|
CipherStorageProvider(StorageProvider backend)
Creates a new
CipherStorageProvider for the given back-end
using the Blowfish cipher algorithm. |
CipherStorageProvider(StorageProvider backend,
String algorithm)
Creates a new
CipherStorageProvider for the given back-end
and cipher algorithm. |
Modifier and Type | Method and Description |
---|---|
StorageOutputStream |
createStorageOutputStream()
Creates a
StorageOutputStream where data to be stored can be
written to. |
store
public CipherStorageProvider(StorageProvider backend)
CipherStorageProvider
for the given back-end
using the Blowfish cipher algorithm.backend
- back-end storage strategy to encrypt.public CipherStorageProvider(StorageProvider backend, String algorithm)
CipherStorageProvider
for the given back-end
and cipher algorithm.backend
- back-end storage strategy to encrypt.algorithm
- the name of the symmetric block cipher algorithm such as
"Blowfish", "AES" or "RC2".public StorageOutputStream createStorageOutputStream() throws IOException
StorageProvider
StorageOutputStream
where data to be stored can be
written to. Subsequently the user can call
toStorage()
on that object to get
a Storage
instance that holds the data that has been written.StorageOutputStream
where data can be written to.IOException
- if an I/O error occurs.Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.