Class BinaryRC4Decryptor
java.lang.Object
org.docx4j.org.apache.poi.poifs.crypt.Decryptor
org.docx4j.org.apache.poi.poifs.crypt.binaryrc4.BinaryRC4Decryptor
-
Field Summary
Fields inherited from class org.docx4j.org.apache.poi.poifs.crypt.Decryptor
builder, DEFAULT_PASSWORD, DEFAULT_POIFS_ENTRY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionprotected static SecretKeygenerateSecretKey(String password, EncryptionVerifier ver) Return a stream with decrypted data.longReturns the length of the encrypted data that can be safely read withDecryptor.getDataStream(org.docx4j.org.apache.poi.poifs.filesystem.DirectoryNode).protected static CipherinitCipherForBlock(Cipher cipher, int block, EncryptionInfoBuilder builder, SecretKey skey, int encryptMode) booleanverifyPassword(String password) Methods inherited from class org.docx4j.org.apache.poi.poifs.crypt.Decryptor
getBlockSizeInBytes, getDataStream, getDataStream, getDataStream, getInstance, getIntegrityHmacKey, getIntegrityHmacValue, getKeySizeInBytes, getSecretKey, getVerifier, setIntegrityHmacKey, setIntegrityHmacValue, setSecretKey, setVerifier
-
Constructor Details
-
BinaryRC4Decryptor
-
-
Method Details
-
verifyPassword
- Specified by:
verifyPasswordin classDecryptor
-
initCipherForBlock
protected static Cipher initCipherForBlock(Cipher cipher, int block, EncryptionInfoBuilder builder, SecretKey skey, int encryptMode) throws GeneralSecurityException - Throws:
GeneralSecurityException
-
generateSecretKey
-
getDataStream
Description copied from class:DecryptorReturn a stream with decrypted data.Use
Decryptor.getLength()to get the size of that data that can be safely read from the stream. Just reading to the end of the input stream is not sufficient because there are normally padding bytes that must be discarded- Specified by:
getDataStreamin classDecryptor- Parameters:
dir- the node to read from- Returns:
- decrypted stream
- Throws:
IOExceptionGeneralSecurityException
-
getLength
public long getLength()Description copied from class:DecryptorReturns the length of the encrypted data that can be safely read withDecryptor.getDataStream(org.docx4j.org.apache.poi.poifs.filesystem.DirectoryNode). Just reading to the end of the input stream is not sufficient because there are normally padding bytes that must be discardedThe length variable is initialized in
Decryptor.getDataStream(org.docx4j.org.apache.poi.poifs.filesystem.DirectoryNode), an attempt to call getLength() prior to getDataStream() will result in IllegalStateException.
-