@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) |
<M extends FsModel> |
decorate(FsController<M> controller)
The implementation in the class
ZipRaesDriver returns the
expression
new ZipRaesKeyController<M>(controller, this). |
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. |
ZipDriverEntry |
newEntry(String path,
Entry.Type type,
Entry template,
BitField<FsOutputOption> mknod)
Returns a new
ZipDriverEntry, requesting that the data gets
DEFLATED if no template is provided. |
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, newController, newInputShop, newOutputShop, newOutputShop, process, resourceUri, superNewController, zipCryptoParametersassertEncodable, getCharset, toString, toZipOrTarEntryNamegetClosedIcon, getInputSocket, getOpenIcon, isFederated, newController, 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)
public <M extends FsModel> FsController<M> decorate(FsController<M> controller)
The implementation in the class ZipRaesDriver returns the
expression
new ZipRaesKeyController<M>(controller, this).
Overridde this method in order to return just the given
controller if you are overriding
raesParameters(FsModel) and do not want to use
a locatable key manager to resolve passwords for RAES encryption.
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 ZipDriverEntry newEntry(String path, Entry.Type type, @CheckForNull Entry template, BitField<FsOutputOption> mknod) throws CharConversionException
ZipDriverEntry, requesting that the data gets
DEFLATED if no template is provided.
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–2015 Schlichtherle IT Services. All rights reserved.