TrueZIP 6.8.2

de.schlichtherle.io.archive.zip.raes
Class ParanoidZipRaesDriver

java.lang.Object
  extended by de.schlichtherle.io.archive.spi.AbstractArchiveDriver
      extended by de.schlichtherle.io.archive.zip.ZipDriver
          extended by de.schlichtherle.io.archive.zip.JarDriver
              extended by de.schlichtherle.io.archive.zip.raes.AbstractZipRaesDriver
                  extended by 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
Version:
$Id: ParanoidZipRaesDriver.java 06f3ba684701 2010/11/04 01:15:55 christian $
Author:
Christian Schlichtherle
See Also:
SafeZipRaesDriver, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class de.schlichtherle.io.archive.spi.AbstractArchiveDriver
AbstractArchiveDriver.InconsistentCharsetSupportError
 
Field Summary
private static long serialVersionUID
           
 
Fields inherited from class de.schlichtherle.io.archive.zip.JarDriver
DEFAULT_CHARSET
 
Fields inherited from class de.schlichtherle.io.archive.zip.ZipDriver
DEFAULT_LEVEL
 
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).
 
Method Summary
 OutputArchive createOutputArchive(Archive archive, OutputStream out, InputArchive source)
          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).
 
Methods inherited from class de.schlichtherle.io.archive.zip.raes.AbstractZipRaesDriver
createArchiveEntry, createInputArchive, getAuthenticationTrigger, getRaesParameters
 
Methods inherited from class de.schlichtherle.io.archive.zip.JarDriver
createZipEntry, createZipEntry, createZipInputArchive
 
Methods inherited from class de.schlichtherle.io.archive.zip.ZipDriver
createZip32InputArchive, createZip32OutputArchive, createZipOutputArchive, getLevel, getPostambled, getPreambled
 
Methods inherited from class de.schlichtherle.io.archive.spi.AbstractArchiveDriver
ensureEncodable, getCharset, getClosedIcon, getEncoding, getOpenIcon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.schlichtherle.io.archive.spi.ArchiveDriver
equals, hashCode
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

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.

Method Detail

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

TrueZIP 6.8.2

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.