@Immutable @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public abstract class ZipRaesDriver extends JarDriver
| Modifier and Type | Field and Description |
|---|---|
private KeyManagerProvider |
keyManagerProvider
The key manager provider for accessing protected resources (cryptography).
|
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,
ZipArchiveEntry 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). |
ZipArchiveEntry |
newEntry(String path,
Entry.Type type,
Entry template,
BitField<FsOutputOption> mknod)
Returns a new
JarArchiveEntry, enforcing that the data gets
DEFLATED when written, even if copying data from a
STORED source entry. |
InputShop<ZipArchiveEntry> |
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<ZipArchiveEntry> |
newOutputShop(FsModel model,
OptionOutputSocket output,
ZipInputShop source) |
protected RaesParameters |
raesParameters(FsModel model)
Returns the RAES parameters for the given file system model
or
null if not available. |
getKeyProviderSyncStrategy, getLevel, getMethod, getOverheadSize, getPool, getPostambled, getRedundantContentSupport, getRedundantMetaDataSupport, mountPointUri, newInputShop, newOutputShop, newOutputShop, process, resourceUri, superNewController, zipCryptoParametersassertEncodable, getCharset, toString, toZipOrTarEntryNamegetClosedIcon, getInputSocket, getOpenIcon, isFederated, newEntry, newInputStream, newOutputStream, newReadOnlyFilegetPriorityclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetCharsetprivate final KeyManagerProvider keyManagerProvider
public ZipRaesDriver(IOPoolProvider ioPoolProvider, KeyManagerProvider keyManagerProvider)
ioPoolProvider - the I/O entry pool provider for allocating
temporary I/O entries (buffers).keyManagerProvider - the key manager provider for accessing
protected resources (cryptography).protected final boolean check(ZipInputShop input, ZipArchiveEntry 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<ZipArchiveEntry>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 ZipArchiveEntry newEntry(String path, Entry.Type type, 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 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 output option preference FsOutputOption.ENCRYPT
is cleared in order to prevent adding a redundant encryption layer for
the individual ZIP entry.
This would not have any effect on the security level, but increase the
size of the resulting archive file and heat the CPU.
newEntry in class ZipDriverCharConversionExceptionpublic final InputShop<ZipArchiveEntry> 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<ZipArchiveEntry> newOutputShop(FsModel model, OptionOutputSocket output, @CheckForNull ZipInputShop source) throws IOException
newOutputShop in class ZipDriverIOException@CheckForNull protected RaesParameters raesParameters(FsModel model)
null if not available.
The implementation in the class ZipRaesDriver returns
new KeyManagerRaesParameters(getKeyManager(), mountPointUri(model)).
model - the file system model.null if not available.Copyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.