Class AgileDecryptor.AgileCipherInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.docx4j.org.apache.poi.util.LittleEndianInputStream
org.docx4j.org.apache.poi.poifs.crypt.ChunkedCipherInputStream
org.docx4j.org.apache.poi.poifs.crypt.agile.AgileDecryptor.AgileCipherInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable,LittleEndianInput
- Enclosing class:
- AgileDecryptor
2.3.4.15 Data Encryption (Agile Encryption)
The EncryptedPackage stream (1) MUST be encrypted in 4096-byte segments to facilitate nearly
random access while allowing CBC modes to be used in the encryption process.
The initialization vector for the encryption process MUST be obtained by using the zero-based
segment number as a blockKey and the binary form of the KeyData.saltValue as specified in
section 2.3.4.12. The block number MUST be represented as a 32-bit unsigned integer.
Data blocks MUST then be encrypted by using the initialization vector and the intermediate key
obtained by decrypting the encryptedKeyValue from a KeyEncryptor contained within the
KeyEncryptors sequence as specified in section 2.3.4.10. The final data block MUST be padded to
the next integral multiple of the KeyData.blockSize value. Any padding bytes can be used. Note
that the StreamSize field of the EncryptedPackage field specifies the number of bytes of
unencrypted data as specified in section 2.3.4.4.
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.docx4j.org.apache.poi.poifs.crypt.ChunkedCipherInputStream
available, mark, markSupported, read, read, reset, skipMethods inherited from class org.docx4j.org.apache.poi.util.LittleEndianInputStream
readByte, readDouble, readFully, readFully, readInt, readLong, readShort, readUByte, readUInt, readUShortMethods inherited from class java.io.FilterInputStream
close, readMethods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
AgileCipherInputStream
public AgileCipherInputStream(DocumentInputStream stream, long size) throws GeneralSecurityException - Throws:
GeneralSecurityException
-
-
Method Details
-
initCipherForBlock
- Specified by:
initCipherForBlockin classChunkedCipherInputStream- Throws:
GeneralSecurityException
-