@NotThreadSafe public abstract class RaesReadOnlyChannel extends net.java.truecommons.io.ReadOnlyChannel
SeekableByteChannelfor random read-only access to the plain text data of a RAES encrypted file, where RAES means Random Access Encryption Specification. 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
For this step the entire cipher text is authenticated, which is comparably
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
Most applications should always call
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 channel implements its own virtual file pointer.
|Constructor and Description|
|Modifier and Type||Method and Description|
Authenticates all encrypted data in this read only file.
Creates a new RAES read-only channel.
Returns the key strength which is actually used to decrypt the data of the RAES file.
close, isOpen, position, position, read, size, toString
public abstract void authenticate() throws RaesAuthenticationException, IOException
This is the second, optional step of authentication. The first, mandatory step is to compute the cipher key and cipher text length only and must already have been successfully completed in the constructor.
@CreatesObligation public static RaesReadOnlyChannel create(RaesParameters param, net.java.truecommons.io.Source source) throws RaesParametersException, RaesException, EOFException, IOException
RaesParametersrequired to access the RAES type actually found in the file. If the 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
RaesParametersProviderinterface, then it gets queried to find the required RAES parameters. This algorithm gets recursively applied.
source- the source for reading the RAES file from.
RaesParametersException- If no RAES parameter can be found which match the type of RAES file in the given channel.
RaesException- If the file is not RAES compatible.
EOFException- on unexpected end-of-file.
IOException- on any I/O error.
public abstract net.java.truecommons.key.spec.common.AesKeyStrength getKeyStrength()
Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.