Class AgileEncryptor
java.lang.Object
org.docx4j.org.apache.poi.poifs.crypt.Encryptor
org.docx4j.org.apache.poi.poifs.crypt.agile.AgileEncryptor
- All Implemented Interfaces:
GenericRecord
-
Field Summary
Fields inherited from class org.docx4j.org.apache.poi.poifs.crypt.Encryptor
DEFAULT_POIFS_ENTRY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfirmPassword(String password) voidconfirmPassword(String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt) copy()protected EncryptionDocumentReturn an output stream for encrypted data.protected voidprotected voidupdateIntegrityHMAC(File tmpFile, int oleStreamSize) Generate an HMAC, as specified in [RFC2104], of the encrypted form of the data (message), which the DataIntegrity element will verify by using the Salt generated in step 2 as the key.Methods inherited from class org.docx4j.org.apache.poi.poifs.crypt.Encryptor
getDataStream, getDataStream, getEncryptionInfo, getGenericProperties, getInstance, getSecretKey, setChunkSize, setEncryptionInfo, setSecretKeyMethods 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
-
Constructor Details
-
AgileEncryptor
protected AgileEncryptor() -
AgileEncryptor
-
-
Method Details
-
confirmPassword
- Specified by:
confirmPasswordin classEncryptor
-
confirmPassword
public void confirmPassword(String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt) - Specified by:
confirmPasswordin classEncryptor
-
getDataStream
Description copied from class:EncryptorReturn an output stream for encrypted data.- Specified by:
getDataStreamin classEncryptor- Parameters:
dir- the node to write to- Returns:
- encrypted stream
- Throws:
IOExceptionGeneralSecurityException
-
updateIntegrityHMAC
protected void updateIntegrityHMAC(File tmpFile, int oleStreamSize) throws GeneralSecurityException, IOException Generate an HMAC, as specified in [RFC2104], of the encrypted form of the data (message), which the DataIntegrity element will verify by using the Salt generated in step 2 as the key. Note that the entire EncryptedPackage stream (1), including the StreamSize field, MUST be used as the message. Encrypt the HMAC as in step 3 by using a blockKey byte array consisting of the following bytes: 0xa0, 0x67, 0x7f, 0x02, 0xb2, 0x2c, 0x84, and 0x33.- Throws:
GeneralSecurityExceptionIOException
-
createEncryptionDocument
-
marshallEncryptionDocument
protected void marshallEncryptionDocument(EncryptionDocument ed, LittleEndianByteArrayOutputStream os) -
copy
-