public class StandardDecryptor extends Decryptor
builder, DEFAULT_PASSWORD, DEFAULT_POIFS_ENTRY| Modifier | Constructor and Description |
|---|---|
protected |
StandardDecryptor(EncryptionInfoBuilder builder) |
| Modifier and Type | Method and Description |
|---|---|
protected static byte[] |
fillAndXor(byte[] hash,
byte fillByte) |
protected static SecretKey |
generateSecretKey(String password,
EncryptionVerifier ver,
int keySize) |
InputStream |
getDataStream(DirectoryNode dir)
Return a stream with decrypted data.
|
long |
getLength()
Returns the length of the encrypted data that can be safely read with
Decryptor.getDataStream(org.docx4j.org.apache.poi.poifs.filesystem.DirectoryNode). |
boolean |
verifyPassword(String password) |
getBlockSizeInBytes, getDataStream, getDataStream, getDataStream, getInstance, getIntegrityHmacKey, getIntegrityHmacValue, getKeySizeInBytes, getSecretKey, getVerifier, setIntegrityHmacKey, setIntegrityHmacValue, setSecretKey, setVerifierprotected StandardDecryptor(EncryptionInfoBuilder builder)
public boolean verifyPassword(String password)
verifyPassword in class Decryptorprotected static SecretKey generateSecretKey(String password, EncryptionVerifier ver, int keySize)
protected static byte[] fillAndXor(byte[] hash,
byte fillByte)
public InputStream getDataStream(DirectoryNode dir) throws IOException
Decryptor
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
getDataStream in class Decryptordir - the node to read fromIOExceptionpublic long getLength()
DecryptorDecryptor.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 discarded
The 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.
getLength in class DecryptorgetDataStream(DirectoryNode)Copyright © 2007-2020. All Rights Reserved.