@Immutable
public abstract class ZipRaesDriver
extends net.java.truevfs.comp.zipdriver.JarDriver
Sub-classes must be thread-safe and should be immutable!
| Constructor and Description |
|---|
ZipRaesDriver() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
check(net.java.truevfs.comp.zipdriver.JarDriverEntry local,
net.java.truevfs.comp.zipdriver.ZipInputService<net.java.truevfs.comp.zipdriver.JarDriverEntry> input) |
net.java.truevfs.kernel.spec.FsController |
decorate(net.java.truevfs.kernel.spec.FsController controller) |
protected abstract long |
getAuthenticationTrigger()
Returns the value of the property
authenticationTrigger. |
boolean |
getPreambled() |
net.java.truevfs.comp.zipdriver.JarDriverEntry |
newEntry(net.java.truecommons.shed.BitField<net.java.truevfs.kernel.spec.FsAccessOption> options,
java.lang.String name,
net.java.truecommons.cio.Entry.Type type,
net.java.truecommons.cio.Entry template)
Returns a new
JarDriverEntry, requesting that the data gets
DEFLATED if no template is provided. |
protected net.java.truecommons.cio.OutputService<net.java.truevfs.comp.zipdriver.JarDriverEntry> |
newOutput(net.java.truevfs.kernel.spec.FsModel model,
net.java.truevfs.kernel.spec.FsOutputSocketSink sink,
net.java.truecommons.cio.InputService<net.java.truevfs.comp.zipdriver.JarDriverEntry> input) |
protected net.java.truevfs.comp.zipdriver.ZipInputService<net.java.truevfs.comp.zipdriver.JarDriverEntry> |
newZipInput(net.java.truevfs.kernel.spec.FsModel model,
net.java.truevfs.kernel.spec.FsInputSocketSource source) |
protected RaesParameters |
raesParameters(net.java.truevfs.kernel.spec.FsModel model)
Returns the RAES parameters for the given file system model.
|
protected net.java.truevfs.kernel.spec.FsOutputSocketSink |
sink(net.java.truecommons.shed.BitField<net.java.truevfs.kernel.spec.FsAccessOption> options,
net.java.truevfs.kernel.spec.FsController controller,
net.java.truevfs.kernel.spec.FsNodeName name)
Sets
FsAccessOption.STORE in options before
forwarding the call to controller. |
getCharset, newEntry, newEntryfileSystemUri, getKeyManagerMap, getLevel, getMethod, getOverheadSize, getPool, getPostambled, getRedundantContentSupport, getRedundantMetaDataSupport, mountPointUri, newInput, rdc, zipCryptoParameterspublic final boolean getPreambled()
The implementation in the class ZipRaesDriver returns
true for future use.
getPreambled in interface net.java.truevfs.comp.zip.ZipFileParameters<net.java.truevfs.comp.zipdriver.JarDriverEntry>getPreambled in class net.java.truevfs.comp.zipdriver.AbstractZipDriver<net.java.truevfs.comp.zipdriver.JarDriverEntry>trueprotected RaesParameters raesParameters(net.java.truevfs.kernel.spec.FsModel model)
The implementation in the class ZipRaesDriver returns
new KeyManagerRaesParameters(getKeyManagerMap().getKeyManager(AesPbeParameters.class), mountPointUri(model)).
model - the file system model.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 getKeyManager 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.public final boolean check(net.java.truevfs.comp.zipdriver.JarDriverEntry local,
net.java.truevfs.comp.zipdriver.ZipInputService<net.java.truevfs.comp.zipdriver.JarDriverEntry> input)
check in class net.java.truevfs.comp.zipdriver.AbstractZipDriver<net.java.truevfs.comp.zipdriver.JarDriverEntry>public net.java.truevfs.kernel.spec.FsController decorate(net.java.truevfs.kernel.spec.FsController controller)
The implementation in the class ZipRaesDriver decorates the given controller with a package private
controller which keeps track of the AES PBE parameters, e.g. the encryption passwords.
This method should be overridden in order to return just controller if and only if you are overriding
raesParameters(FsModel), too, and do not want to use a locatable key manager to resolve
passwords for RAES encryption.
decorate in class net.java.truevfs.comp.zipdriver.AbstractZipDriver<net.java.truevfs.comp.zipdriver.JarDriverEntry>protected net.java.truevfs.comp.zipdriver.ZipInputService<net.java.truevfs.comp.zipdriver.JarDriverEntry> newZipInput(net.java.truevfs.kernel.spec.FsModel model,
net.java.truevfs.kernel.spec.FsInputSocketSource source)
throws java.io.IOException
newZipInput in class net.java.truevfs.comp.zipdriver.AbstractZipDriver<net.java.truevfs.comp.zipdriver.JarDriverEntry>java.io.IOExceptionprotected net.java.truecommons.cio.OutputService<net.java.truevfs.comp.zipdriver.JarDriverEntry> newOutput(net.java.truevfs.kernel.spec.FsModel model,
net.java.truevfs.kernel.spec.FsOutputSocketSink sink,
@CheckForNull @WillNotClose
net.java.truecommons.cio.InputService<net.java.truevfs.comp.zipdriver.JarDriverEntry> input)
throws java.io.IOException
newOutput in class net.java.truevfs.comp.zipdriver.AbstractZipDriver<net.java.truevfs.comp.zipdriver.JarDriverEntry>java.io.IOExceptionprotected final net.java.truevfs.kernel.spec.FsOutputSocketSink sink(net.java.truecommons.shed.BitField<net.java.truevfs.kernel.spec.FsAccessOption> options,
net.java.truevfs.kernel.spec.FsController controller,
net.java.truevfs.kernel.spec.FsNodeName name)
FsAccessOption.STORE in options before
forwarding the call to controller.sink in class net.java.truevfs.comp.zipdriver.AbstractZipDriver<net.java.truevfs.comp.zipdriver.JarDriverEntry>public net.java.truevfs.comp.zipdriver.JarDriverEntry newEntry(net.java.truecommons.shed.BitField<net.java.truevfs.kernel.spec.FsAccessOption> options,
java.lang.String name,
net.java.truecommons.cio.Entry.Type type,
@CheckForNull
net.java.truecommons.cio.Entry template)
JarDriverEntry, 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 sink 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 net.java.truevfs.comp.zipdriver.AbstractZipDriver<net.java.truevfs.comp.zipdriver.JarDriverEntry>