Package net.lingala.zip4j.io.inputstream
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 int
private int
private int
private int
private int
private int
private int
private byte[]
-
Constructor Summary
ConstructorsConstructorDescriptionAesCipherInputStream
(ZipEntryInputStream zipEntryInputStream, LocalFileHeader localFileHeader, char[] password, int bufferSize, boolean useUtf8ForPassword) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
copyBytesFromBuffer
(byte[] b, int off) private void
decrementRemainingAesBytesLength
(int decrementBy) protected void
endOfEntryReached
(InputStream inputStream, int numberOfBytesPushedBack) private byte[]
private byte[]
getSalt
(LocalFileHeader localFileHeader) private void
incrementAesByteBlockPointer
(int incrementBy) protected AESDecrypter
initializeDecrypter
(LocalFileHeader localFileHeader, char[] password, boolean useUtf8ForPassword) int
read()
int
read
(byte[] b) int
read
(byte[] b, int off, int len) protected byte[]
readStoredMac
(InputStream inputStream) private void
verifyContent
(byte[] storedMac, int numberOfBytesPushedBack) Methods inherited from class net.lingala.zip4j.io.inputstream.CipherInputStream
close, getDecrypter, getLastReadRawDataCache, getLocalFileHeader, getNumberOfBytesReadForThisEntry, readRaw
Methods inherited from class java.io.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:
initializeDecrypter
in classCipherInputStream<AESDecrypter>
- Throws:
IOException
-
read
- Overrides:
read
in classCipherInputStream<AESDecrypter>
- Throws:
IOException
-
read
- Overrides:
read
in classCipherInputStream<AESDecrypter>
- Throws:
IOException
-
read
- Overrides:
read
in classCipherInputStream<AESDecrypter>
- Throws:
IOException
-
copyBytesFromBuffer
private void copyBytesFromBuffer(byte[] b, int off) -
endOfEntryReached
protected void endOfEntryReached(InputStream inputStream, int numberOfBytesPushedBack) throws IOException - Overrides:
endOfEntryReached
in 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)
-