@Immutable public class ParanoidZipRaesDriver extends ZipRaesDriver
SafeZipRaesDriver
for archive files larger than 512 KB and
may pause the client application on the first access to the archive file
for a while if the file is large.
Note that the CRC-32 value of the plain text ZIP file is never checked
because this is made redundant by the MAC verification.
In addition, this driver limits the number of concurrent entry sink streams to one, so that writing unencrypted temporary files is inhibited.
Subclasses must be thread-safe and should be immutable!
SafeZipRaesDriver
JAR_CHARSET
Constructor and Description |
---|
ParanoidZipRaesDriver() |
Modifier and Type | Method and Description |
---|---|
long |
getAuthenticationTrigger()
Returns the value of the property
authenticationTrigger . |
protected ZipOutputService<JarDriverEntry> |
newOutput(FsModel model,
FsOutputSocketSink sink,
net.java.truecommons.cio.InputService<JarDriverEntry> input)
Creates a new input service for writing archive entries for the given
model to the target archive file referenced by sink . |
check, decorate, getPreambled, newEntry, newZipInput, raesParameters, sink
getCharset, newEntry, newEntry
fileSystemUri, getKeyManagerMap, getLevel, getMethod, getOverheadSize, getPool, getPostambled, getRedundantContentSupport, getRedundantMetaDataSupport, mountPointUri, newInput, rdc, zipCryptoParameters
checkEncodable, isArchiveDriver, newController, newEntry, newInput, newOutput, normalize, source, toString
public final long getAuthenticationTrigger()
ZipRaesDriver
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).
getAuthenticationTrigger
in class ZipRaesDriver
authenticationTrigger
.protected final ZipOutputService<JarDriverEntry> newOutput(FsModel model, FsOutputSocketSink sink, @CheckForNull @WillNotClose net.java.truecommons.cio.InputService<JarDriverEntry> input) throws IOException
model
to the target archive file referenced by sink
.
The implementation in the class ParanoidZipRaesDriver
returns a
new ZipOutputService
.
This restricts the number of concurrent sink entry streams to one in
order to inhibit writing unencrypted temporary files for buffering the
written entries.
newOutput
in class ZipRaesDriver
model
- the file system model.sink
- the sink for writing the target archive file.input
- the nullable InputService
for the target archive
file.
If not null
, then the target archive file is going to
get updated.
This parameter is guaranteed to be the product of this driver's
factory method
FsArchiveDriver.newInput(FsModel, BitField, FsController, FsNodeName)
.IOException
- on any I/O error.FsArchiveDriver.newOutput(FsModel, BitField, FsController, FsNodeName, InputService)
Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.