|
TrueZIP 6.8.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.io.rof.AbstractReadOnlyFile
de.schlichtherle.io.rof.FilterReadOnlyFile
de.schlichtherle.crypto.io.CipherReadOnlyFile
de.schlichtherle.crypto.io.raes.RaesReadOnlyFile
public abstract class RaesReadOnlyFile
This class implements a ReadOnlyFile
in order to provide transparent random read only access to the plain text
data which has been encrypted and stored in a file according to the
Random Access Encryption Specification (RAES).
To accomodate the transparent random read access feature, RAES specifies a multistep authentication process:
The first step is mandatory and implemented in the constructor of the concrete implementation of this abstract class. For this step only the cipher key and the file length is authenticated, which is fast to process (O(1)).
The second step is optional and must be initiated by the client by calling
authenticate().
For this step the entire cipher text is authenticated, which is comparably
slow (O(n)).
Please note that this step does not require the cipher text to be
decrypted first, which features comparably fast processing.
So it is up to the application which level of security it needs to
provide:
Most applications should always call authenticate() in
order to guard against integrity attacks.
However, some applications may provide additional (faster) methods for
authentication of the pay load, in which case the authentication
provided by this class may be safely skipped.
Note that this class implements its own virtual file pointer.
Thus, if you would like to access the underlying ReadOnlyFile
again after you have finished working with an instance of this class,
you should synchronize their file pointers using the pattern as described
in the base class FilterReadOnlyFile.
RaesOutputStream| Field Summary |
|---|
| Fields inherited from class de.schlichtherle.io.rof.FilterReadOnlyFile |
|---|
rof |
| Constructor Summary | |
|---|---|
RaesReadOnlyFile(ReadOnlyFile rof)
|
|
| Method Summary | |
|---|---|
abstract void |
authenticate()
Authenticates all encrypted data in the read only file. |
private static RaesParameters |
findParameters(Class type,
RaesParameters parameters)
|
static RaesReadOnlyFile |
getInstance(File file,
RaesParameters parameters)
Creates a new instance of RaesReadOnlyFile. |
static RaesReadOnlyFile |
getInstance(ReadOnlyFile rof,
RaesParameters parameters)
Creates a new instance of RaesReadOnlyFile. |
abstract int |
getKeySizeBits()
Returns the key size in bits which is actually used to decrypt the data of this RAES file. |
(package private) static short |
readUByte(byte[] b,
int off)
|
(package private) static long |
readUInt(byte[] b,
int off)
|
(package private) static int |
readUShort(byte[] b,
int off)
|
| 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 |
| Constructor Detail |
|---|
RaesReadOnlyFile(ReadOnlyFile rof)
| Method Detail |
|---|
static short readUByte(byte[] b,
int off)
static int readUShort(byte[] b,
int off)
static long readUInt(byte[] b,
int off)
public static RaesReadOnlyFile getInstance(File file,
RaesParameters parameters)
throws FileNotFoundException,
RaesParametersException,
RaesException,
IOException
RaesReadOnlyFile.
file - The file to read.parameters - The RaesParameters required to access the
RAES type actually found in the file.
If the run time class of this parameter does not match the
required parameter interface according to the RAES type found
in the file, but is an instance of the
RaesParametersAgent interface, it is used to find
the required RAES parameters.
This is applied recursively.
NullPointerException - If any of the parameters is null.
FileNotFoundException - If the file cannot get opened for reading.
RaesParametersException - If no suitable RAES parameters have been
provided or something is wrong with the parameters.
RaesException - If the file is not RAES compatible.
IOException - On any other I/O related issue.
public static RaesReadOnlyFile getInstance(ReadOnlyFile rof,
RaesParameters parameters)
throws FileNotFoundException,
RaesParametersException,
RaesException,
IOException
RaesReadOnlyFile.
rof - The read only file to read.parameters - The RaesParameters required to access the
RAES type actually found in the file.
If the run time class of this parameter does not match the
required parameter interface according to the RAES type found
in the file, but is an instance of the
RaesParametersAgent interface, it is used to find
the required RAES parameters.
This is applied recursively.
NullPointerException - If any of the parameters is null.
FileNotFoundException - If the file cannot get opened for reading.
RaesParametersException - If no suitable RAES parameters have been
provided or something is wrong with the parameters.
RaesException - If the file is not RAES compatible.
IOException - On any other I/O related issue.
private static RaesParameters findParameters(Class type,
RaesParameters parameters)
throws RaesParametersException
RaesParametersExceptionpublic abstract int getKeySizeBits()
public abstract void authenticate()
throws RaesAuthenticationException,
IOException
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.
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 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||