TrueZIP Driver ZIP.RAES (TZP) 7.1

de.schlichtherle.truezip.crypto.raes
Class Type0RaesOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by de.schlichtherle.truezip.io.DecoratingOutputStream
          extended by de.schlichtherle.truezip.crypto.CipherOutputStream
              extended by de.schlichtherle.truezip.crypto.raes.RaesOutputStream
                  extended by de.schlichtherle.truezip.crypto.raes.Type0RaesOutputStream
All Implemented Interfaces:
Closeable, Flushable

@NotThreadSafe
@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class)
 class Type0RaesOutputStream
extends RaesOutputStream

Writes a type 0 RAES file.

Author:
Christian Schlichtherle

Field Summary
private  boolean closed
          Whether this stream has been closed or not.
private  LEDataOutputStream dos
          The low level data output stream.
(package private) static int ITERATION_COUNT
          The iteration count for the derived keys of the cipher, KLAC and MAC.
private  Type0RaesParameters.KeyStrength keyStrength
          The key strength.
private  Mac klac
          The cipher Key and cipher text Length Authentication Code (KLAC).
private  Mac mac
          The Message Authentication Code (MAC).
private static SecureRandom shaker
           
private  long start
          The offset where the encrypted application data starts.
 
Fields inherited from class de.schlichtherle.truezip.crypto.CipherOutputStream
cipher
 
Fields inherited from class de.schlichtherle.truezip.io.DecoratingOutputStream
delegate
 
Constructor Summary
Type0RaesOutputStream(OutputStream out, Type0RaesParameters param)
           
 
Method Summary
 void close()
          Closes this output stream and releases any resources associated with it.
 Type0RaesParameters.KeyStrength getKeyStrength()
          Returns the key strength which is actually used to encrypt the data of the RAES file.
 
Methods inherited from class de.schlichtherle.truezip.crypto.raes.RaesOutputStream
getInstance, klac
 
Methods inherited from class de.schlichtherle.truezip.crypto.CipherOutputStream
finish, write, write
 
Methods inherited from class de.schlichtherle.truezip.io.DecoratingOutputStream
flush, toString, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

shaker

private static final SecureRandom shaker

ITERATION_COUNT

static final int ITERATION_COUNT
The iteration count for the derived keys of the cipher, KLAC and MAC.

See Also:
Constant Field Values

keyStrength

private final Type0RaesParameters.KeyStrength keyStrength
The key strength.


mac

private Mac mac
The Message Authentication Code (MAC).


klac

private Mac klac
The cipher Key and cipher text Length Authentication Code (KLAC).


dos

private LEDataOutputStream dos
The low level data output stream. Used for writing the header and footer.


start

private long start
The offset where the encrypted application data starts.


closed

private boolean closed
Whether this stream has been closed or not.

Constructor Detail

Type0RaesOutputStream

Type0RaesOutputStream(OutputStream out,
                      Type0RaesParameters param)
                throws IOException
Throws:
IOException
Method Detail

getKeyStrength

public Type0RaesParameters.KeyStrength getKeyStrength()
Description copied from class: RaesOutputStream
Returns the key strength which is actually used to encrypt the data of the RAES file.

Specified by:
getKeyStrength in class RaesOutputStream

close

public void close()
           throws IOException
Description copied from class: CipherOutputStream
Closes this output stream and releases any resources associated with it. This method calls CipherOutputStream.finish() and then closes and nullifies the underlying output stream DecoratingOutputStream.delegate and the cipher CipherOutputStream.cipher.

Specified by:
close in interface Closeable
Overrides:
close in class CipherOutputStream
Throws:
IOException - If an I/O error occurs.

TrueZIP Driver ZIP.RAES (TZP) 7.1

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