@Immutable public abstract class ZipRaesDriver extends JarDriver
Sub-classes must be thread-safe and should be immutable!
JAR_CHARSET| Constructor and Description |
|---|
ZipRaesDriver(IOPoolProvider ioPoolProvider,
KeyManagerProvider keyManagerProvider)
Constructs a new RAES encrypted ZIP file driver.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
check(ZipInputShop input,
ZipDriverEntry entry) |
protected abstract long |
getAuthenticationTrigger()
Returns the value of the property
authenticationTrigger. |
protected KeyManagerProvider |
getKeyManagerProvider()
Returns the provider for key managers for accessing protected resources
(encryption).
|
OptionOutputSocket |
getOutputSocket(FsController<?> controller,
FsEntryName name,
BitField<FsOutputOption> options,
Entry template)
|
boolean |
getPreambled()
Since TrueZIP 7.3, the implementation in the class
ZipRaesDriver
returns true for future use. |
FsController<?> |
newController(FsModel model,
FsController<?> parent)
The implementation in the class
ZipRaesDriver returns the
expression
new ZipRaesController(superNewController(model, parent), this). |
ZipDriverEntry |
newEntry(String path,
Entry.Type type,
Entry template,
BitField<FsOutputOption> mknod)
Returns a new
ZipDriverEntry, enforcing that the data gets
DEFLATED when written, even if copying data from a
STORED source entry. |
InputShop<ZipDriverEntry> |
newInputShop(FsModel model,
InputSocket<?> input)
The implementation in
ZipRaesDriver calls
raesParameters(de.schlichtherle.truezip.fs.FsModel), with which it initializes a new
RaesReadOnlyFile. |
protected OutputShop<ZipDriverEntry> |
newOutputShop(FsModel model,
OptionOutputSocket output,
ZipInputShop source) |
protected RaesParameters |
raesParameters(FsModel model)
Returns the RAES parameters for the given file system model.
|
getKeyProviderSyncStrategy, getLevel, getMethod, getOverheadSize, getPool, getPostambled, getRedundantContentSupport, getRedundantMetaDataSupport, mountPointUri, newInputShop, newOutputShop, newOutputShop, process, resourceUri, superNewController, zipCryptoParametersassertEncodable, getCharset, toString, toZipOrTarEntryNamegetClosedIcon, getInputSocket, getOpenIcon, isFederated, newEntrygetPriorityclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetCharsetpublic ZipRaesDriver(IOPoolProvider ioPoolProvider, KeyManagerProvider keyManagerProvider)
ioPoolProvider - the provider for the I/O buffer pool.keyManagerProvider - the key manager provider for accessing
protected resources (cryptography).protected final boolean check(ZipInputShop input, ZipDriverEntry entry)
protected abstract long getAuthenticationTrigger()
authenticationTrigger.
If the cipher text length of an input RAES file is smaller than or equal to this value, then the Hash-based Message Authentication Code (HMAC) for the entire cipher text is computed and verified in order to authenticate the input RAES file.
Otherwise, if the cipher text length of an input RAES file is greater than this value, then initially only the cipher key and the cipher text length get authenticated. In addition, whenever an entry is subsequently accessed, then it's CRC-32 value is checked.
Consequently, if the value of this property is set to a negative value,
then the entire cipher text gets never authenticated (CRC-32
checking only), and if set to Long.MAX_VALUE, then the entire
cipher text gets always authenticated (no CRC-32 checking).
authenticationTrigger.protected final KeyManagerProvider getKeyManagerProvider()
The implementation in ZipRaesDriver simply returns the value of
the field keyManagerProvider.
getKeyManagerProvider in class ZipDriverpublic final OptionOutputSocket getOutputSocket(FsController<?> controller, FsEntryName name, BitField<FsOutputOption> options, @CheckForNull Entry template)
getOutputSocket in class ZipDriverpublic final boolean getPreambled()
Since TrueZIP 7.3, the implementation in the class ZipRaesDriver
returns true for future use.
getPreambled in interface ZipFileParameters<ZipDriverEntry>getPreambled in class ZipDrivertruepublic FsController<?> newController(FsModel model, FsController<?> parent)
The implementation in the class ZipRaesDriver returns the
expression
new ZipRaesController(superNewController(model, parent), this).
This method should be overridden in order to call only
ZipDriver.superNewController(de.schlichtherle.truezip.fs.FsModel, de.schlichtherle.truezip.fs.FsController<?>) if and only if you are overriding
raesParameters(de.schlichtherle.truezip.fs.FsModel), too,
and do not want to use the built-in key manager to resolve passwords
for RAES encryption.
newController in class ZipDriverpublic ZipDriverEntry newEntry(String path, Entry.Type type, Entry template, BitField<FsOutputOption> mknod) throws CharConversionException
ZipDriverEntry, enforcing that the data gets
DEFLATED when written, even if copying data from a
STORED source entry.
This feature strengthens the security level of the authentication
process and inhibits the use of an unencrypted temporary I/O entry
(usually a temporary file) in case the output is not copied from a file
system entry as its input.
Furthermore, the method ZipEntry.clearEncryption() is
called in order to prevent adding a redundant encryption layer for the
individual ZIP entry because this would confuse users, increase the size
of the resulting archive file and unecessarily heat the CPU.
newEntry in class ZipDriverCharConversionExceptionpublic final InputShop<ZipDriverEntry> newInputShop(FsModel model, InputSocket<?> input) throws IOException
The implementation in ZipRaesDriver calls
raesParameters(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 ZipDriverIOExceptionprotected OutputShop<ZipDriverEntry> newOutputShop(FsModel model, OptionOutputSocket output, ZipInputShop source) throws IOException
newOutputShop in class ZipDriverIOExceptionprotected RaesParameters raesParameters(FsModel model)
The implementation in the class ZipRaesDriver returns
new KeyManagerRaesParameters(getKeyManagerProvider().get(AesCipherParameters.class), mountPointUri(model)).
model - the file system model.Copyright © 2005-2012 Schlichtherle IT Services. All Rights Reserved.