@Immutable @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public abstract class ZipRaesDriver extends JarDriver
| Modifier and Type | Class and Description |
|---|---|
static class |
ZipRaesDriver.KeyProviderSyncStrategy
Defines strategies for updating a key provider once a RAES encrypted
ZIP file has been successfully synchronized.
|
| Modifier and Type | Field and Description |
|---|---|
private KeyManagerProvider |
keyManagerProvider |
JAR_CHARSET| Constructor and Description |
|---|
ZipRaesDriver(IOPoolProvider ioPoolProvider,
KeyManagerProvider keyManagerProvider)
Constructs a new RAES encrypted ZIP file driver.
|
| Modifier and Type | Method and Description |
|---|---|
abstract long |
getAuthenticationTrigger()
Constructs a new abstract ZIP.RAES driver which
uses the given byte
size to trigger verification of the Message Authentication Code (MAC).
|
(package private) KeyManager<AesCipherParameters> |
getKeyManager() |
ZipRaesDriver.KeyProviderSyncStrategy |
getKeyProviderSyncStrategy()
Returns the key provider sync strategy,
which is
ZipRaesDriver.KeyProviderSyncStrategy.RESET_CANCELLED_KEY. |
(package private) RaesParameters |
getRaesParameters(FsModel model)
Returns the
RaesParameters for the given file system model. |
FsController<?> |
newController(FsModel model,
FsController<?> parent) |
JarArchiveEntry |
newEntry(String path,
Entry.Type type,
Entry template,
BitField<FsOutputOption> mknod)
Creates a new
JarArchiveEntry, enforcing that the data gets
DEFLATED when written, even if copying data from a
STORED source entry. |
ZipInputShop |
newInputShop(FsModel model,
InputSocket<?> target)
The implementation in
ZipRaesDriver calls
getRaesParameters(de.schlichtherle.truezip.fs.FsModel), with which it initializes a new
RaesReadOnlyFile. |
OutputShop<ZipArchiveEntry> |
newOutputShop(FsModel model,
OutputSocket<?> target,
InputShop<ZipArchiveEntry> source)
The implementation in the class
ZipRaesDriver calls
getRaesParameters(de.schlichtherle.truezip.fs.FsModel) for authentication. |
protected URI |
toMountPointResource(FsModel model)
Returns a URI which represents the mount point of the given model as a
resource URI for looking up a
KeyProvider. |
getLevel, getMethod, getOutputSocket, getPool, getPostambled, getPreambled, newZipInputShop, newZipOutputShopassertEncodable, getCharset, toString, toZipOrTarEntryNamegetClosedIcon, getInputSocket, getOpenIcon, isFederated, newEntry, newInputStream, newOutputStream, newReadOnlyFilegetPriorityprivate final KeyManagerProvider keyManagerProvider
public ZipRaesDriver(IOPoolProvider ioPoolProvider, KeyManagerProvider keyManagerProvider)
ioPoolProvider - the I/O pool service to use for temporary data.keyManagerProvider - the key manager service.public ZipRaesDriver.KeyProviderSyncStrategy getKeyProviderSyncStrategy()
ZipRaesDriver.KeyProviderSyncStrategy.RESET_CANCELLED_KEY.public abstract long getAuthenticationTrigger()
authenticationTrigger.
If the size of an input file is smaller than or equal to this value,
the Message Authentication Code (MAC) for the entire
cipher text is computed and verified in order to authenticate
the file.
Otherwise, only the cipher key and the file length
get authenticated.
Consequently, if the value of this property is set to a negative value,
the cipher text gets never verified, and if set to
Long.MAX_VALUE, the cipher text gets always
authenticated.
authenticationTrigger.public final FsController<?> newController(FsModel model, FsController<?> parent)
newController in class FsArchiveDriver<ZipArchiveEntry>public final JarArchiveEntry newEntry(String path, Entry.Type type, @CheckForNull Entry template, BitField<FsOutputOption> mknod) throws CharConversionException
JarArchiveEntry, enforcing that the data gets
DEFLATED when written, even if copying data from a
STORED source entry.
This feature strengthens the security of the authentication process.newEntry in class JarDriverCharConversionExceptionpublic final ZipInputShop newInputShop(FsModel model, InputSocket<?> target) throws IOException
The implementation in ZipRaesDriver calls
getRaesParameters(de.schlichtherle.truezip.fs.FsModel), with which it initializes a new
RaesReadOnlyFile.
Next, if the gross file length of the archive is smaller than or equal
to the authentication trigger, the MAC authentication on the cipher
text is performed.
Finally, the RaesReadOnlyFile is passed on to the super
class implementation.
newInputShop in class ZipDriverIOExceptionpublic OutputShop<ZipArchiveEntry> newOutputShop(FsModel model, OutputSocket<?> target, @CheckForNull InputShop<ZipArchiveEntry> source) throws IOException
The implementation in the class ZipRaesDriver calls
getRaesParameters(de.schlichtherle.truezip.fs.FsModel) for authentication.
newOutputShop in class ZipDriverIOExceptionfinal RaesParameters getRaesParameters(FsModel model)
RaesParameters for the given file system model.model - the file system model.RaesParameters for the given file system model.final KeyManager<AesCipherParameters> getKeyManager()
protected URI toMountPointResource(FsModel model)
KeyProvider.
Note that this URI needs to be matched exactly when setting a password
programmatically!
The implementation in the class ZipRaesDriver returns the
expression model.getMountPoint().toHierarchicalUri()
in order to improve the readability of the URI in comparison to the
expression model.getMountPoint().toUri().
model - the file system model.Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.