Module org.cryptomator.cryptolib
Package org.cryptomator.cryptolib.common
Class DecryptingReadableByteChannel
java.lang.Object
org.cryptomator.cryptolib.common.DecryptingReadableByteChannel
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,ReadableByteChannel
-
Constructor Summary
ConstructorsConstructorDescriptionDecryptingReadableByteChannel(ReadableByteChannel src, Cryptor cryptor, boolean authenticate) Creates a DecryptingReadableByteChannel that decrypts a whole ciphertext file beginning at its first byte.DecryptingReadableByteChannel(ReadableByteChannel src, Cryptor cryptor, boolean authenticate, FileHeader header, long firstChunk) Creates a DecryptingReadableByteChannel with a previously read header, allowing to start decryption at any chunk. -
Method Summary
-
Constructor Details
-
DecryptingReadableByteChannel
public DecryptingReadableByteChannel(ReadableByteChannel src, Cryptor cryptor, boolean authenticate) Creates a DecryptingReadableByteChannel that decrypts a whole ciphertext file beginning at its first byte.- Parameters:
src- A ciphertext channel positioned at the begin of the file headercryptor- The cryptor to useauthenticate- Set tofalseto skip ciphertext authentication (may not be supported)
-
DecryptingReadableByteChannel
public DecryptingReadableByteChannel(ReadableByteChannel src, Cryptor cryptor, boolean authenticate, FileHeader header, long firstChunk) Creates a DecryptingReadableByteChannel with a previously read header, allowing to start decryption at any chunk.- Parameters:
src- A ciphertext channel positioned at the beginning of the givenfirstChunkcryptor- The cryptor to useauthenticate- Set tofalseto skip ciphertext authentication (may not be supported)header- The file's headerfirstChunk- The index of the chunk at which thesrcchannel is positioned
-
-
Method Details
-
isOpen
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException
-
read
- Specified by:
readin interfaceReadableByteChannel- Throws:
IOException
-