TrueZIP 6.8.3

de.schlichtherle.crypto.io.raes
Class Type0RaesReadOnlyFile

java.lang.Object
  extended by de.schlichtherle.io.rof.AbstractReadOnlyFile
      extended by de.schlichtherle.io.rof.FilterReadOnlyFile
          extended by de.schlichtherle.crypto.io.CipherReadOnlyFile
              extended by de.schlichtherle.crypto.io.raes.RaesReadOnlyFile
                  extended by de.schlichtherle.crypto.io.raes.Type0RaesReadOnlyFile
All Implemented Interfaces:
ReadOnlyFile

 class Type0RaesReadOnlyFile
extends RaesReadOnlyFile

Reads a type 0 RAES file.

Since:
TrueZIP 6.0
Author:
Christian Schlichtherle

Field Summary
private  byte[] footer
          The footer of the data envelope containing the authentication codes.
private  int keyStrength
          The key strength.
private  CipherParameters macParam
          The parameters required to init the Message Authentication Code (MAC).
private static long MIN_KEY_RETRY_DELAY
          The minimum delay between subsequent attempts to authenticate a key in milliseconds.
 
Fields inherited from class de.schlichtherle.io.rof.FilterReadOnlyFile
rof
 
Constructor Summary
Type0RaesReadOnlyFile(ReadOnlyFile rof, Type0RaesParameters parameters)
           
 
Method Summary
 void authenticate()
          Authenticates all encrypted data in the read only file.
private static long enforceSuspensionPenalty(long last)
           
 int getKeySizeBits()
          Returns the key size in bits which is actually used to decrypt the data of this RAES file.
 
Methods inherited from class de.schlichtherle.crypto.io.raes.RaesReadOnlyFile
getInstance, getInstance, readUByte, readUInt, readUShort
 
Methods inherited from class de.schlichtherle.crypto.io.CipherReadOnlyFile
close, computeMac, getFilePointer, init, length, read, read, seek
 
Methods inherited from class de.schlichtherle.io.rof.AbstractReadOnlyFile
read, readFully, readFully, skipBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_KEY_RETRY_DELAY

private static final long MIN_KEY_RETRY_DELAY
The minimum delay between subsequent attempts to authenticate a key in milliseconds.

See Also:
Constant Field Values

keyStrength

private final int keyStrength
The key strength.


macParam

private final CipherParameters macParam
The parameters required to init the Message Authentication Code (MAC).


footer

private final byte[] footer
The footer of the data envelope containing the authentication codes.

Constructor Detail

Type0RaesReadOnlyFile

Type0RaesReadOnlyFile(ReadOnlyFile rof,
                      Type0RaesParameters parameters)
                throws NullPointerException,
                       FileNotFoundException,
                       RaesException,
                       RaesKeyException,
                       IOException
Throws:
NullPointerException
FileNotFoundException
RaesException
RaesKeyException
IOException
Method Detail

enforceSuspensionPenalty

private static long enforceSuspensionPenalty(long last)

getKeySizeBits

public int getKeySizeBits()
Description copied from class: RaesReadOnlyFile
Returns the key size in bits which is actually used to decrypt the data of this RAES file.

Specified by:
getKeySizeBits in class RaesReadOnlyFile

authenticate

public void authenticate()
                  throws RaesAuthenticationException,
                         IOException
Description copied from class: RaesReadOnlyFile
Authenticates all encrypted data in the read only file. It is safe to call this method multiple times to detect if the file has been tampered with meanwhile.

This is the second, optional step of authentication. The first, mandatory step is to computeMac the cipher key and cipher text length only and has already been successfully completed in the constructor.

Specified by:
authenticate in class RaesReadOnlyFile
Throws:
RaesAuthenticationException - If the computed MAC does not match the MAC declared in the RAES file.
IOException - On any I/O related issue.

TrueZIP 6.8.3

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