Top Fields Constructors Methods
org.apache.poi.poifs.crypt.standard

public Class StandardDecryptor

extends Decryptor
Class Inheritance
Static Imports
org.apache.poi.poifs.crypt.CryptoFunctions.hashPassword

Field Summary

Modifier and TypeField and Description
private long
Inherited from org.apache.poi.poifs.crypt.Decryptor:
DEFAULT_PASSWORDDEFAULT_POIFS_ENTRYencryptionInfo

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
public StandardDecryptor
protected static byte[]
fillAndXor(byte[] hash, byte fillByte)

protected static SecretKey
generateSecretKey(String password, EncryptionVerifier ver, int keySize)

private Cipher
public InputStream
getDataStream(DirectoryNode
the node to read from
dir
)

Implements abstract org.apache.poi.poifs.crypt.Decryptor.getDataStream.

Return a stream with decrypted data.

public long

Returns:

the length of the stream returned by getDataStream(DirectoryNode)
getLength
()

Implements abstract org.apache.poi.poifs.crypt.Decryptor.getLength.

Returns the length of the encrypted data that can be safely read with getDataStream(org.apache.poi.poifs.filesystem.DirectoryNode).

public boolean
Inherited from org.apache.poi.poifs.crypt.Decryptor:
getBlockSizeInBytesgetDataStreamgetDataStreamgetEncryptionInfogetGenericPropertiesgetInstancegetIntegrityHmacKeygetIntegrityHmacValuegetKeySizeInBytesgetSecretKeygetVerifierinitCipherForBlocksetChunkSizesetEncryptionInfosetIntegrityHmacKeysetIntegrityHmacValuesetSecretKeysetVerifier

Field Detail

_lengthback to summary
private long _length

Constructor Detail

StandardDecryptorback to summary
protected StandardDecryptor()
StandardDecryptorback to summary
protected StandardDecryptor(StandardDecryptor other)

Method Detail

copyback to summary
public StandardDecryptor copy()

Implements abstract org.apache.poi.poifs.crypt.Decryptor.copy.

Annotations
@Override
fillAndXorback to summary
protected static byte[] fillAndXor(byte[] hash, byte fillByte)
generateSecretKeyback to summary
protected static SecretKey generateSecretKey(String password, EncryptionVerifier ver, int keySize)
getCipherback to summary
private Cipher getCipher(SecretKey key)
getDataStreamback to summary
public InputStream getDataStream(DirectoryNode dir) throws IOException

Implements abstract org.apache.poi.poifs.crypt.Decryptor.getDataStream.

Doc from org.apache.poi.poifs.crypt.Decryptor.getDataStream.

Return a stream with decrypted data.

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

Parameters
dir:DirectoryNode

the node to read from

Returns:InputStream

decrypted stream

Annotations
@Override
@SuppressWarnings:resource, squid:S2095
getLengthback to summary
public long getLength()

Implements abstract org.apache.poi.poifs.crypt.Decryptor.getLength.

Doc from org.apache.poi.poifs.crypt.Decryptor.getLength.

Returns the length of the encrypted data that can be safely read with getDataStream(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.apache.poi.poifs.filesystem.DirectoryNode), an attempt to call getLength() prior to getDataStream() will result in IllegalStateException.

Returns:long

the length of the stream returned by getDataStream(DirectoryNode)

Annotations
@Override
verifyPasswordback to summary
public boolean verifyPassword(String password)

Implements abstract org.apache.poi.poifs.crypt.Decryptor.verifyPassword.

Annotations
@Override