TrueZIP Driver TZP (ZIP.RAES) 7.0-rc1

de.schlichtherle.truezip.fs.archive.zip.raes
Class ZipRaesDriver

java.lang.Object
  extended by de.schlichtherle.truezip.fs.FsDriver
      extended by de.schlichtherle.truezip.fs.archive.FsArchiveDriver<E>
          extended by de.schlichtherle.truezip.fs.archive.FsCharsetArchiveDriver<ZipArchiveEntry>
              extended by de.schlichtherle.truezip.fs.archive.zip.ZipDriver
                  extended by de.schlichtherle.truezip.fs.archive.zip.JarDriver
                      extended by de.schlichtherle.truezip.fs.archive.zip.raes.ZipRaesDriver
All Implemented Interfaces:
EntryFactory<ZipArchiveEntry>, ZipEntryFactory<ZipArchiveEntry>
Direct Known Subclasses:
ParanoidZipRaesDriver, SafeZipRaesDriver

@Immutable
@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class)
public abstract class ZipRaesDriver
extends JarDriver

An abstract archive driver which builds RAES encrypted ZIP files and optionally authenticates the cipher data of the input archive files presented to it.

Author:
Christian Schlichtherle

Nested Class Summary
static class ZipRaesDriver.KeyProviderSyncStrategy
          Defines strategies for updating a key provider once a RAES encrypted ZIP file has been successfully synchronized.
 
Field Summary
private  KeyManagerService service
           
 
Fields inherited from class de.schlichtherle.truezip.fs.archive.zip.JarDriver
JAR_CHARSET
 
Constructor Summary
ZipRaesDriver(IOPoolService ioPoolService, KeyManagerService keyManagerService)
          Constructs a new RAES encrypted ZIP file driver.
 
Method Summary
abstract  long getAuthenticationTrigger()
          Constructs a new abstract ZIP.RAES driver which uses the given byte size to trigger verification of the Message Authentication Code (MAC).
(package private)  KeyManagerService getKeyManagerService()
           
 ZipRaesDriver.KeyProviderSyncStrategy getKeyProviderSyncStrategy()
          Returns the key provider sync strategy, which is ZipRaesDriver.KeyProviderSyncStrategy.RESET_CANCELLED_KEY.
(package private)  RaesParameters getRaesParameters(FsModel model)
          Returns the RaesParameters for the given file system model.
 FsController<?> newController(FsMountPoint mountPoint, FsController<?> parent)
           
 JarArchiveEntry newEntry(String path, Entry.Type type, Entry template)
          Creates a new JarArchiveEntry, enforcing that the data gets DEFLATED when written, even if copying data from a STORED source entry.
 ZipInputShop newInputShop(FsConcurrentModel model, InputSocket<?> target)
           The implementation in ZipRaesDriver calls getRaesParameters(de.schlichtherle.truezip.fs.FsModel), with which it initializes a new RaesReadOnlyFile.
 OutputShop<ZipArchiveEntry> newOutputShop(FsConcurrentModel model, OutputSocket<?> target, InputShop<ZipArchiveEntry> source)
           The implementation in the class ZipRaesDriver calls getRaesParameters(de.schlichtherle.truezip.fs.FsModel) for authentication.
 
Methods inherited from class de.schlichtherle.truezip.fs.archive.zip.JarDriver
newEntry, newEntry
 
Methods inherited from class de.schlichtherle.truezip.fs.archive.zip.ZipDriver
getLevel, getMethod, getPool, getPostambled, getPreambled, newZipInputShop, newZipOutputShop
 
Methods inherited from class de.schlichtherle.truezip.fs.archive.FsCharsetArchiveDriver
assertEncodable, getCharset, toZipOrTarEntryName
 
Methods inherited from class de.schlichtherle.truezip.fs.archive.FsArchiveDriver
getClosedIcon, getOpenIcon, isFederated
 
Methods inherited from class de.schlichtherle.truezip.fs.FsDriver
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

service

private final KeyManagerService service
Constructor Detail

ZipRaesDriver

public ZipRaesDriver(IOPoolService ioPoolService,
                     KeyManagerService keyManagerService)
Constructs a new RAES encrypted ZIP file driver.

Parameters:
ioPoolService - the I/O pool service to use for temporary data.
keyManagerService - the key manager service.
Method Detail

getKeyProviderSyncStrategy

public ZipRaesDriver.KeyProviderSyncStrategy getKeyProviderSyncStrategy()
Returns the key provider sync strategy, which is ZipRaesDriver.KeyProviderSyncStrategy.RESET_CANCELLED_KEY.

Returns:
The key provider sync strategy.

getAuthenticationTrigger

public abstract long getAuthenticationTrigger()
Constructs a new abstract ZIP.RAES driver which uses the given byte size to trigger verification of the Message Authentication Code (MAC). Note that the given parameter only affects the authentication of the cipher text in input archives - the cipher key and file length are always authenticated with RAES. Returns the value of the property authenticationTrigger. If the size of an input file is smaller than or equal to this value, the Message Authentication Code (MAC) for the entire cipher text is computed and verified in order to authenticate the file. Otherwise, only the cipher key and the file length get authenticated.

Consequently, if the value of this property is set to a negative value, the cipher text gets never verified, and if set to Long.MAX_VALUE, the cipher text gets always authenticated.

Returns:
The value of the property authenticationTrigger.

newController

public final FsController<?> newController(FsMountPoint mountPoint,
                                           FsController<?> parent)
Overrides:
newController in class FsArchiveDriver<ZipArchiveEntry>

newEntry

public final JarArchiveEntry newEntry(String path,
                                      Entry.Type type,
                                      @CheckForNull
                                      Entry template)
                               throws CharConversionException
Creates a new JarArchiveEntry, enforcing that the data gets DEFLATED when written, even if copying data from a STORED source entry. This feature strengthens the security of the authentication process.

Specified by:
newEntry in interface EntryFactory<ZipArchiveEntry>
Overrides:
newEntry in class JarDriver
Throws:
CharConversionException

newInputShop

public final ZipInputShop newInputShop(FsConcurrentModel model,
                                       InputSocket<?> target)
                                throws IOException

The implementation in ZipRaesDriver calls getRaesParameters(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.

Overrides:
newInputShop in class ZipDriver
Throws:
IOException

newOutputShop

public OutputShop<ZipArchiveEntry> newOutputShop(FsConcurrentModel model,
                                                 OutputSocket<?> target,
                                                 @CheckForNull
                                                 InputShop<ZipArchiveEntry> source)
                                          throws IOException

The implementation in the class ZipRaesDriver calls getRaesParameters(de.schlichtherle.truezip.fs.FsModel) for authentication.

Overrides:
newOutputShop in class ZipDriver
Throws:
IOException

getKeyManagerService

final KeyManagerService getKeyManagerService()

getRaesParameters

final RaesParameters getRaesParameters(FsModel model)
Returns the RaesParameters for the given file system model.

Parameters:
model - the file system model.
Returns:
The RaesParameters for the given file system model.

TrueZIP Driver TZP (ZIP.RAES) 7.0-rc1

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