public abstract class Decryptor extends Object
| Modifier and Type | Field and Description |
|---|---|
protected EncryptionInfoBuilder |
builder |
static String |
DEFAULT_PASSWORD |
static String |
DEFAULT_POIFS_ENTRY |
| Modifier | Constructor and Description |
|---|---|
protected |
Decryptor(EncryptionInfoBuilder builder) |
public static final String DEFAULT_PASSWORD
public static final String DEFAULT_POIFS_ENTRY
protected final EncryptionInfoBuilder builder
protected Decryptor(EncryptionInfoBuilder builder)
public abstract InputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException
Use 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
dir - the node to read fromIOExceptionGeneralSecurityExceptionpublic abstract boolean verifyPassword(String password) throws GeneralSecurityException
GeneralSecurityExceptionpublic abstract long getLength()
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 getDataStream(org.docx4j.org.apache.poi.poifs.filesystem.DirectoryNode),
an attempt to call getLength() prior to getDataStream() will result in IllegalStateException.
IllegalStateException - if getDataStream(org.docx4j.org.apache.poi.poifs.filesystem.DirectoryNode)
was not calledpublic static Decryptor getInstance(EncryptionInfo info)
public InputStream getDataStream(NPOIFSFileSystem fs) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionpublic InputStream getDataStream(OPOIFSFileSystem fs) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionpublic InputStream getDataStream(POIFSFileSystem fs) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionpublic byte[] getVerifier()
public SecretKey getSecretKey()
public byte[] getIntegrityHmacKey()
public byte[] getIntegrityHmacValue()
protected void setSecretKey(SecretKey secretKey)
protected void setVerifier(byte[] verifier)
protected void setIntegrityHmacKey(byte[] integrityHmacKey)
protected void setIntegrityHmacValue(byte[] integrityHmacValue)
protected int getBlockSizeInBytes()
protected int getKeySizeInBytes()
Copyright © 2007-2020. All Rights Reserved.