org.apache.poi.poifs.crypt
Class Encryptor
java.lang.Object
org.apache.poi.poifs.crypt.Encryptor
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- BinaryRC4Encryptor, CryptoAPIEncryptor, StandardEncryptor, XOREncryptor
public abstract class Encryptor
- extends java.lang.Object
- implements java.lang.Cloneable
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_POIFS_ENTRY
protected static final java.lang.String DEFAULT_POIFS_ENTRY
- See Also:
- Constant Field Values
Encryptor
public Encryptor()
getDataStream
public abstract java.io.OutputStream getDataStream(DirectoryNode dir)
throws java.io.IOException,
java.security.GeneralSecurityException
- Return a output stream for encrypted data.
- Parameters:
dir
- the node to write to
- Returns:
- encrypted stream
- Throws:
java.io.IOException
java.security.GeneralSecurityException
confirmPassword
public abstract void confirmPassword(java.lang.String password,
byte[] keySpec,
byte[] keySalt,
byte[] verifier,
byte[] verifierSalt,
byte[] integritySalt)
confirmPassword
public abstract void confirmPassword(java.lang.String password)
getInstance
public static Encryptor getInstance(EncryptionInfo info)
getDataStream
public java.io.OutputStream getDataStream(NPOIFSFileSystem fs)
throws java.io.IOException,
java.security.GeneralSecurityException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
getDataStream
public java.io.OutputStream getDataStream(OPOIFSFileSystem fs)
throws java.io.IOException,
java.security.GeneralSecurityException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
getDataStream
public java.io.OutputStream getDataStream(POIFSFileSystem fs)
throws java.io.IOException,
java.security.GeneralSecurityException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
getDataStream
public ChunkedCipherOutputStream getDataStream(java.io.OutputStream stream,
int initialOffset)
throws java.io.IOException,
java.security.GeneralSecurityException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
getSecretKey
public javax.crypto.SecretKey getSecretKey()
setSecretKey
public void setSecretKey(javax.crypto.SecretKey secretKey)
getEncryptionInfo
public EncryptionInfo getEncryptionInfo()
setEncryptionInfo
public void setEncryptionInfo(EncryptionInfo encryptionInfo)
setChunkSize
public void setChunkSize(int chunkSize)
- Sets the chunk size of the data stream.
Needs to be set before the data stream is requested.
When not set, the implementation uses method specific default values
- Parameters:
chunkSize
- the chunk size, i.e. the block size with the same encryption key
clone
public Encryptor clone()
throws java.lang.CloneNotSupportedException
- Overrides:
clone
in class java.lang.Object
- Throws:
java.lang.CloneNotSupportedException