TrueZIP Driver ZIP.RAES (TZP) 7.1

de.schlichtherle.truezip.crypto.raes
Class RaesOutputStream

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
All Implemented Interfaces:
Closeable, Flushable
Direct Known Subclasses:
Type0RaesOutputStream

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

An OutputStream to produce a file with data ecnrypted according to the Random Access Encryption Specification (RAES).

Author:
Christian Schlichtherle
See Also:
RaesReadOnlyFile

Field Summary
 
Fields inherited from class de.schlichtherle.truezip.crypto.CipherOutputStream
cipher
 
Fields inherited from class de.schlichtherle.truezip.io.DecoratingOutputStream
delegate
 
Constructor Summary
RaesOutputStream(OutputStream out, BufferedBlockCipher cipher)
           
 
Method Summary
static RaesOutputStream getInstance(OutputStream out, RaesParameters parameters)
          Returns a new instance of an RaesOutputStream.
abstract  Type0RaesParameters.KeyStrength getKeyStrength()
          Returns the key strength which is actually used to encrypt the data of the RAES file.
(package private) static void klac(Mac klac, long length, byte[] buf)
          Update the given KLAC with the given file length in little endian order and finalize it, writing the result to buf.
 
Methods inherited from class de.schlichtherle.truezip.crypto.CipherOutputStream
close, 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
 

Constructor Detail

RaesOutputStream

RaesOutputStream(@CheckForNull
                 OutputStream out,
                 @CheckForNull
                 BufferedBlockCipher cipher)
Method Detail

klac

static void klac(Mac klac,
                 long length,
                 byte[] buf)
Update the given KLAC with the given file length in little endian order and finalize it, writing the result to buf. The KLAC must already have been initialized and updated with the password bytes as retrieved according to PKCS #12. The result is stored in buf, which must match the given KLAC's output size.


getInstance

public static RaesOutputStream getInstance(OutputStream out,
                                           @CheckForNull
                                           RaesParameters parameters)
                                    throws IOException
Returns a new instance of an RaesOutputStream.

Parameters:
out - The underlying output stream to use for the encrypted data.
parameters - The RaesParameters used to determine and configure the type of RAES file created. If the run time class of this parameter matches multiple parameter interfaces, it is at the discretion of this implementation which one is picked and hence which type of RAES file is created. If you need more control over this, pass in an instance which's run time class just implements the RaesParametersProvider interface. Instances of this interface are queried to find RAES parameters which match a known RAES type. This algorithm is recursively applied.
Returns:
A new instance of an RaesOutputStream.
Throws:
NullPointerException - If DecoratingOutputStream.delegate is null.
RaesParametersException - If parameters is null or no suitable RAES parameters can be found.
IOException - On any other I/O related issue.

getKeyStrength

public abstract Type0RaesParameters.KeyStrength getKeyStrength()
Returns the key strength which is actually used to encrypt the data of the RAES file.


TrueZIP Driver ZIP.RAES (TZP) 7.1

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