Package org.apache.poi.poifs.crypt
Class Encryptor
java.lang.Object
org.apache.poi.poifs.crypt.Encryptor
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
AgileEncryptor
,BinaryRC4Encryptor
,CryptoAPIEncryptor
,StandardEncryptor
,XOREncryptor
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
abstract void
confirmPassword
(String password) abstract void
confirmPassword
(String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt) getDataStream
(OutputStream stream, int initialOffset) abstract OutputStream
Return a output stream for encrypted data.static Encryptor
getInstance
(EncryptionInfo info) void
setChunkSize
(int chunkSize) Sets the chunk size of the data stream.void
setEncryptionInfo
(EncryptionInfo encryptionInfo) void
setSecretKey
(SecretKey secretKey)
-
Field Details
-
DEFAULT_POIFS_ENTRY
- See Also:
-
-
Constructor Details
-
Encryptor
public Encryptor()
-
-
Method Details
-
getDataStream
public abstract OutputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException Return a output stream for encrypted data.- Parameters:
dir
- the node to write to- Returns:
- encrypted stream
- Throws:
IOException
GeneralSecurityException
-
confirmPassword
public abstract void confirmPassword(String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt) -
confirmPassword
-
getInstance
-
getDataStream
- Throws:
IOException
GeneralSecurityException
-
getDataStream
public ChunkedCipherOutputStream getDataStream(OutputStream stream, int initialOffset) throws IOException, GeneralSecurityException - Throws:
IOException
GeneralSecurityException
-
getSecretKey
-
setSecretKey
-
getEncryptionInfo
-
setEncryptionInfo
-
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
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-