Class CryptoAPIEncryptor
java.lang.Object
org.docx4j.org.apache.poi.poifs.crypt.Encryptor
org.docx4j.org.apache.poi.poifs.crypt.cryptoapi.CryptoAPIEncryptor
-
Field Summary
Fields inherited from class org.docx4j.org.apache.poi.poifs.crypt.Encryptor
DEFAULT_POIFS_ENTRY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionvoidconfirmPassword(String password) voidconfirmPassword(String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt) protected voidEncrypt the Document-/SummaryInformation and other optionally streams.protected intinitCipherForBlock(Cipher cipher, int block) Initializes a cipher object for a given block index for encryptionMethods inherited from class org.docx4j.org.apache.poi.poifs.crypt.Encryptor
getDataStream, getDataStream, getDataStream, getInstance, getSecretKey, setSecretKey
-
Constructor Details
-
CryptoAPIEncryptor
-
-
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
-
initCipherForBlock
Initializes a cipher object for a given block index for encryption- Parameters:
cipher- may be null, otherwise the given instance is reset to the new block indexblock- the block index, e.g. the persist/slide id (hslf)- Returns:
- a new cipher object, if cipher was null, otherwise the reinitialized cipher
- Throws:
GeneralSecurityException
-
getDataStream
Encrypt the Document-/SummaryInformation and other optionally streams. Opposed to other crypto modes, cryptoapi is record based and can't be used to stream-encrypt a whole file- Specified by:
getDataStreamin classEncryptor- Parameters:
dir- the node to write to- Returns:
- encrypted stream
- Throws:
IOExceptionGeneralSecurityException- See Also:
-
getKeySizeInBytes
protected int getKeySizeInBytes() -
createEncryptionInfoEntry
- Throws:
IOException
-