Class Encryptor
java.lang.Object
org.docx4j.org.apache.poi.poifs.crypt.Encryptor
- All Implemented Interfaces:
GenericRecord
- Direct Known Subclasses:
AgileEncryptor,BinaryRC4Encryptor,CryptoAPIEncryptor,StandardEncryptor,XOREncryptor
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidconfirmPassword(String password) abstract voidconfirmPassword(String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt) abstract Encryptorcopy()getDataStream(OutputStream stream, int initialOffset) abstract OutputStreamReturn an output stream for encrypted data.static EncryptorgetInstance(EncryptionInfo info) voidsetChunkSize(int chunkSize) Sets the chunk size of the data stream.voidsetEncryptionInfo(EncryptionInfo encryptionInfo) voidsetSecretKey(SecretKey secretKey) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.docx4j.org.apache.poi.common.usermodel.GenericRecord
getGenericChildren, getGenericRecordType
-
Field Details
-
DEFAULT_POIFS_ENTRY
- See Also:
-
-
Constructor Details
-
Encryptor
protected Encryptor() -
Encryptor
-
-
Method Details
-
getDataStream
public abstract OutputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException Return an output stream for encrypted data.- Parameters:
dir- the node to write to- Returns:
- encrypted stream
- Throws:
IOExceptionGeneralSecurityException
-
confirmPassword
public abstract void confirmPassword(String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt) -
confirmPassword
-
getInstance
-
getDataStream
- Throws:
IOExceptionGeneralSecurityException
-
getDataStream
public ChunkedCipherOutputStream getDataStream(OutputStream stream, int initialOffset) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-
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
-
copy
-
getGenericProperties
- Specified by:
getGenericPropertiesin interfaceGenericRecord
-