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

public Class StandardEncryptor

extends Encryptor
Class Inheritance
Static Imports
org.apache.poi.poifs.crypt.DataSpaceMapUtils.createEncryptionEntry, org.apache.poi.poifs.crypt.standard.StandardDecryptor.generateSecretKey

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class

Field Summary

Modifier and TypeField and Description
private static final Logger
Inherited from org.apache.poi.poifs.crypt.Encryptor:
DEFAULT_POIFS_ENTRY

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
public void
public void
confirmPassword(String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt)

Implements abstract org.apache.poi.poifs.crypt.Encryptor.confirmPassword.

Fills the fields of verifier and header with the calculated hashes based on the password and a random salt see [MS-OFFCRYPTO] - 2.3.4.7 ECMA-376 Document Encryption Key Generation

public StandardEncryptor
protected void
private Cipher
getCipher(SecretKey key, String padding)

public OutputStream
getDataStream(final DirectoryNode
the node to write to
dir
)

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

Return an output stream for encrypted data.

protected int
Inherited from org.apache.poi.poifs.crypt.Encryptor:
getDataStreamgetDataStreamgetEncryptionInfogetGenericPropertiesgetInstancegetSecretKeysetChunkSizesetEncryptionInfosetSecretKey

Field Detail

LOGback to summary
private static final Logger LOG

Constructor Detail

StandardEncryptorback to summary
protected StandardEncryptor()
StandardEncryptorback to summary
protected StandardEncryptor(StandardEncryptor other)

Method Detail

confirmPasswordback to summary
public void confirmPassword(String password)

Implements abstract org.apache.poi.poifs.crypt.Encryptor.confirmPassword.

Annotations
@Override
confirmPasswordback to summary
public void confirmPassword(String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt)

Implements abstract org.apache.poi.poifs.crypt.Encryptor.confirmPassword.

Fills the fields of verifier and header with the calculated hashes based on the password and a random salt see [MS-OFFCRYPTO] - 2.3.4.7 ECMA-376 Document Encryption Key Generation

Annotations
@Override
copyback to summary
public StandardEncryptor copy()

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

Annotations
@Override
createEncryptionInfoEntryback to summary
protected void createEncryptionInfoEntry(DirectoryNode dir) throws IOException
getCipherback to summary
private Cipher getCipher(SecretKey key, String padding)
getDataStreamback to summary
public OutputStream getDataStream(final DirectoryNode dir) throws IOException, GeneralSecurityException

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

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

Return an output stream for encrypted data.

Parameters
dir:DirectoryNode

the node to write to

Returns:OutputStream

encrypted stream

Annotations
@Override
getKeySizeInBytesback to summary
protected int getKeySizeInBytes()
org.apache.poi.poifs.crypt.standard back to summary

protected Class StandardEncryptor.StandardCipherOutputStream

extends FilterOutputStream
implements POIFSWriterListener
Class Inheritance
All Implemented Interfaces
org.apache.poi.poifs.filesystem.POIFSWriterListener

Field Summary

Modifier and TypeField and Description
protected long
protected final boolean
protected final DirectoryNode
protected final File
Inherited from java.io.FilterOutputStream:
out

Constructor Summary

AccessConstructor and Description
private
StandardCipherOutputStream(DirectoryNode dir, File fileOut, boolean deleteFile)

protected

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.FilterOutputStream.close.

Implements java.io.Closeable.close.

Closes this output stream and releases any system resources associated with the stream.

public void
processPOIFSWriterEvent(POIFSWriterEvent
the POIFSWriterEvent
event
)

Implements org.apache.poi.poifs.filesystem.POIFSWriterListener.processPOIFSWriterEvent.

Process a POIFSWriterEvent that this listener had registered for

public void
write(byte[]
the data.
b
,
int
the start offset in the data.
off
,
int
the number of bytes to write.
len
)

Overrides java.io.FilterOutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.

public void
write(int
the byte.
b
)

Overrides java.io.FilterOutputStream.write.

Writes the specified byte to this output stream.

pack-priv void
Inherited from java.io.FilterOutputStream:
flushwrite

Field Detail

countBytesback to summary
protected long countBytes
deleteFileback to summary
protected final boolean deleteFile
dirback to summary
protected final DirectoryNode dir
fileOutback to summary
protected final File fileOut

Constructor Detail

StandardCipherOutputStreamback to summary
private StandardCipherOutputStream(DirectoryNode dir, File fileOut, boolean deleteFile) throws IOException
Annotations
@SuppressWarnings:resource, squid:S2095
StandardCipherOutputStreamback to summary
protected StandardCipherOutputStream(DirectoryNode dir) throws IOException

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.FilterOutputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.FilterOutputStream.close.

Closes this output stream and releases any system resources associated with the stream.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
processPOIFSWriterEventback to summary
public void processPOIFSWriterEvent(POIFSWriterEvent event)

Implements org.apache.poi.poifs.filesystem.POIFSWriterListener.processPOIFSWriterEvent.

Doc from org.apache.poi.poifs.filesystem.POIFSWriterListener.processPOIFSWriterEvent.

Process a POIFSWriterEvent that this listener had registered for

Parameters
event:POIFSWriterEvent

the POIFSWriterEvent

Annotations
@Override
writeback to summary
public void write(byte[] b, int off, int len) throws IOException

Overrides java.io.FilterOutputStream.write.

Doc from java.io.FilterOutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.

Parameters
b:byte[]

the data.

off:int

the start offset in the data.

len:int

the number of bytes to write.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
writeback to summary
public void write(int b) throws IOException

Overrides java.io.FilterOutputStream.write.

Doc from java.io.FilterOutputStream.write.

Writes the specified byte to this output stream.

The write method of FilterOutputStream calls the write method of its underlying output stream, that is, it performs out.write(b).

Implements the abstract write method of OutputStream.

Parameters
b:int

the byte.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
writeToPOIFSback to summary
pack-priv void writeToPOIFS() throws IOException