de.schlichtherle.io.archive.zip.raes
Class ParanoidZipRaesDriver
java.lang.Object
de.schlichtherle.io.archive.spi.AbstractArchiveDriver
de.schlichtherle.io.archive.zip.ZipDriver
de.schlichtherle.io.archive.zip.JarDriver
de.schlichtherle.io.archive.zip.raes.AbstractZipRaesDriver
de.schlichtherle.io.archive.zip.raes.ParanoidZipRaesDriver
- All Implemented Interfaces:
- ArchiveDriver, Serializable
- Direct Known Subclasses:
- ParanoidZip32RaesDriver
public class ParanoidZipRaesDriver
- extends AbstractZipRaesDriver
A paranoid archive driver which builds RAES encrypted ZIP files.
This driver always checks the cipher text of input archive files
using the RAES Message Authentication Code (MAC), which makes it slower than
the 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 output
streams to one, so that writing unencrypted temporary files is inhibited.
Instances of this class are immutable.
- Since:
- TrueZIP 6.0
- Author:
- Christian Schlichtherle
- See Also:
SafeZipRaesDriver,
Serialized Form
|
Constructor Summary |
ParanoidZipRaesDriver()
Equivalent to this(null, null, false, false, DEFAULT_LEVEL). |
ParanoidZipRaesDriver(Icon openIcon,
Icon closedIcon,
boolean preambled,
boolean postambled,
int level)
Constructs a new paranoid ZIP.RAES driver. |
ParanoidZipRaesDriver(int level)
Equivalent to this(null, null, false, false, level). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
ParanoidZipRaesDriver
public ParanoidZipRaesDriver()
- Equivalent to
this(null, null, false, false, DEFAULT_LEVEL).
ParanoidZipRaesDriver
public ParanoidZipRaesDriver(int level)
- Equivalent to
this(null, null, false, false, level).
ParanoidZipRaesDriver
public ParanoidZipRaesDriver(Icon openIcon,
Icon closedIcon,
boolean preambled,
boolean postambled,
int level)
- Constructs a new paranoid ZIP.RAES driver.
createOutputArchive
public OutputArchive createOutputArchive(Archive archive,
OutputStream out,
InputArchive source)
throws IOException
- This implementation calls
AbstractZipRaesDriver.getRaesParameters(de.schlichtherle.io.archive.Archive), with which it
initializes a new RaesOutputStream, and finally passes the
resulting stream to
ZipDriver.createZipOutputArchive(Archive, OutputStream, ZipInputArchive).
Note that this limits the number of concurrent output entry streams
to one in order to inhibit writing unencrypted temporary files for
buffering the written entries.
- Specified by:
createOutputArchive in interface ArchiveDriver- Overrides:
createOutputArchive in class AbstractZipRaesDriver
- Parameters:
archive - The abstract archive representation which TrueZIP's
internal ArchiveController is processing
- never null.out - The OutputStream to write the archive entries to
- never null.source - The source InputArchive if
archive is going to get updated.
If not null, this is guaranteed to be a product
of this driver's ArchiveDriver.createInputArchive(de.schlichtherle.io.archive.Archive, de.schlichtherle.io.rof.ReadOnlyFile) method.
This may be used to copy some meta data which is specific to
the type of archive this driver supports.
For example, this could be used to copy the comment of a ZIP
file.
- Returns:
- A new output archive instance.
- Throws:
TransientIOException - If calling this method for the same
archive file again may finally succeed.
This exception is associated with another IOException
as its cause which is unwrapped and interpreted as below.
FileNotFoundException - If the output archive is inaccessible
for any reason.
IOException - On any other I/O or data format related issue
when writing the output archive.- See Also:
OutputArchive
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.