Class AesCipherInputStream

    • Field Detail

      • 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 Detail

      • AesCipherInputStream

        public AesCipherInputStream​(ZipEntryInputStream zipEntryInputStream,
                                    LocalFileHeader localFileHeader,
                                    char[] password,
                                    int bufferSize,
                                    boolean useUtf8ForPassword)
                             throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class CipherInputStream<AESDecrypter>
        Throws:
        java.io.IOException
      • copyBytesFromBuffer

        private void copyBytesFromBuffer​(byte[] b,
                                         int off)
      • endOfEntryReached

        protected void endOfEntryReached​(java.io.InputStream inputStream,
                                         int numberOfBytesPushedBack)
                                  throws java.io.IOException
        Overrides:
        endOfEntryReached in class CipherInputStream<AESDecrypter>
        Throws:
        java.io.IOException
      • verifyContent

        private void verifyContent​(byte[] storedMac,
                                   int numberOfBytesPushedBack)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • readStoredMac

        protected byte[] readStoredMac​(java.io.InputStream inputStream)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • getSalt

        private byte[] getSalt​(LocalFileHeader localFileHeader)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • getPasswordVerifier

        private byte[] getPasswordVerifier()
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • incrementAesByteBlockPointer

        private void incrementAesByteBlockPointer​(int incrementBy)
      • decrementRemainingAesBytesLength

        private void decrementRemainingAesBytesLength​(int decrementBy)