Class AesCipherInputStream
java.lang.Object
java.io.InputStream
net.lingala.zip4j.io.inputstream.CipherInputStream<AESDecrypter>
net.lingala.zip4j.io.inputstream.AesCipherInputStream
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]private intprivate intprivate intprivate intprivate intprivate intprivate intprivate byte[] -
Constructor Summary
ConstructorsConstructorDescriptionAesCipherInputStream(ZipEntryInputStream zipEntryInputStream, LocalFileHeader localFileHeader, char[] password, int bufferSize, boolean useUtf8ForPassword) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcopyBytesFromBuffer(byte[] b, int off) private voiddecrementRemainingAesBytesLength(int decrementBy) protected voidendOfEntryReached(InputStream inputStream, int numberOfBytesPushedBack) private byte[]private byte[]getSalt(LocalFileHeader localFileHeader) private voidincrementAesByteBlockPointer(int incrementBy) protected AESDecrypterinitializeDecrypter(LocalFileHeader localFileHeader, char[] password, boolean useUtf8ForPassword) intread()intread(byte[] b) intread(byte[] b, int off, int len) protected byte[]readStoredMac(InputStream inputStream) private voidverifyContent(byte[] storedMac, int numberOfBytesPushedBack) Methods inherited from class CipherInputStream
close, getDecrypter, getLastReadRawDataCache, getLocalFileHeader, getNumberOfBytesReadForThisEntry, readRawMethods inherited from class InputStream
available, mark, markSupported, reset, skip
-
Field Details
-
singleByteBuffer
private byte[] singleByteBuffer -
aes16ByteBlock
private byte[] aes16ByteBlock -
aes16ByteBlockPointer
private int aes16ByteBlockPointer -
remainingAes16ByteBlockLength
private int remainingAes16ByteBlockLength -
lengthToRead
private int lengthToRead -
offsetWithAesBlock
private int offsetWithAesBlock -
bytesCopiedInThisIteration
private int bytesCopiedInThisIteration -
lengthToCopyInThisIteration
private int lengthToCopyInThisIteration -
aes16ByteBlockReadLength
private int aes16ByteBlockReadLength
-
-
Constructor Details
-
AesCipherInputStream
public AesCipherInputStream(ZipEntryInputStream zipEntryInputStream, LocalFileHeader localFileHeader, char[] password, int bufferSize, boolean useUtf8ForPassword) throws IOException - Throws:
IOException
-
-
Method Details
-
initializeDecrypter
protected AESDecrypter initializeDecrypter(LocalFileHeader localFileHeader, char[] password, boolean useUtf8ForPassword) throws IOException - Specified by:
initializeDecrypterin classCipherInputStream<AESDecrypter>- Throws:
IOException
-
read
- Overrides:
readin classCipherInputStream<AESDecrypter>- Throws:
IOException
-
read
- Overrides:
readin classCipherInputStream<AESDecrypter>- Throws:
IOException
-
read
- Overrides:
readin classCipherInputStream<AESDecrypter>- Throws:
IOException
-
copyBytesFromBuffer
private void copyBytesFromBuffer(byte[] b, int off) -
endOfEntryReached
protected void endOfEntryReached(InputStream inputStream, int numberOfBytesPushedBack) throws IOException - Overrides:
endOfEntryReachedin classCipherInputStream<AESDecrypter>- Throws:
IOException
-
verifyContent
- Throws:
IOException
-
readStoredMac
- Throws:
IOException
-
getSalt
- Throws:
IOException
-
getPasswordVerifier
- Throws:
IOException
-
incrementAesByteBlockPointer
private void incrementAesByteBlockPointer(int incrementBy) -
decrementRemainingAesBytesLength
private void decrementRemainingAesBytesLength(int decrementBy)
-