Class EncryptionInfo
java.lang.Object
org.docx4j.org.apache.poi.poifs.crypt.EncryptionInfo
public class EncryptionInfo
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description static BitFieldflagAESA value that MUST be 1 if the protected content is an ECMA-376 document ECMA-376.static BitFieldflagCryptoAPIA flag that specifies whether CryptoAPI RC4 or ECMA-376 encryption ECMA-376 is used.static BitFieldflagDocPropsA value that MUST be 0 if document properties are encrypted.static BitFieldflagExternalA value that MUST be 1 if extensible encryption is used. -
Constructor Summary
Constructors Constructor Description EncryptionInfo(EncryptionMode encryptionMode)Prepares for encryption, using the given Encryption Mode, and all other parameters as default.EncryptionInfo(EncryptionMode encryptionMode, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode)Constructs an EncryptionInfo from scratchEncryptionInfo(DirectoryNode dir)Opens for decryptionEncryptionInfo(DirectoryNode dir, EncryptionMode encryptionMode)Deprecated.UseEncryptionInfo(EncryptionMode)(dir parameter no longer required)EncryptionInfo(DirectoryNode dir, EncryptionMode encryptionMode, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode)EncryptionInfo(NPOIFSFileSystem fs)Opens for decryptionEncryptionInfo(NPOIFSFileSystem fs, EncryptionMode encryptionMode)Deprecated.UseEncryptionInfo(EncryptionMode)(fs parameter no longer required)EncryptionInfo(NPOIFSFileSystem fs, EncryptionMode encryptionMode, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode)EncryptionInfo(OPOIFSFileSystem fs)Opens for decryptionEncryptionInfo(POIFSFileSystem fs)Opens for decryptionEncryptionInfo(POIFSFileSystem fs, EncryptionMode encryptionMode)Deprecated.UseEncryptionInfo(EncryptionMode)(fs parameter no longer required)EncryptionInfo(POIFSFileSystem fs, EncryptionMode encryptionMode, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode)EncryptionInfo(LittleEndianInput dis, boolean isCryptoAPI) -
Method Summary
Modifier and Type Method Description protected static EncryptionInfoBuildergetBuilder(EncryptionMode encryptionMode)DecryptorgetDecryptor()intgetEncryptionFlags()EncryptorgetEncryptor()EncryptionHeadergetHeader()EncryptionVerifiergetVerifier()intgetVersionMajor()intgetVersionMinor()
-
Field Details
-
flagCryptoAPI
A flag that specifies whether CryptoAPI RC4 or ECMA-376 encryption ECMA-376 is used. It MUST be 1 unless flagExternal is 1. If flagExternal is 1, it MUST be 0. -
flagDocProps
A value that MUST be 0 if document properties are encrypted. The encryption of document properties is specified in section 2.3.5.4. -
flagExternal
A value that MUST be 1 if extensible encryption is used. If this value is 1, the value of every other field in this structure MUST be 0. -
flagAES
A value that MUST be 1 if the protected content is an ECMA-376 document ECMA-376. If the fAES bit is 1, the fCryptoAPI bit MUST also be 1.
-
-
Constructor Details
-
EncryptionInfo
Opens for decryption- Throws:
java.io.IOException
-
EncryptionInfo
Opens for decryption- Throws:
java.io.IOException
-
EncryptionInfo
Opens for decryption- Throws:
java.io.IOException
-
EncryptionInfo
Opens for decryption- Throws:
java.io.IOException
-
EncryptionInfo
- Throws:
java.io.IOException
-
EncryptionInfo
Deprecated.UseEncryptionInfo(EncryptionMode)(fs parameter no longer required) -
EncryptionInfo
Deprecated.UseEncryptionInfo(EncryptionMode)(fs parameter no longer required) -
EncryptionInfo
Deprecated.UseEncryptionInfo(EncryptionMode)(dir parameter no longer required) -
EncryptionInfo
@Deprecated public EncryptionInfo(POIFSFileSystem fs, EncryptionMode encryptionMode, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode) -
EncryptionInfo
@Deprecated public EncryptionInfo(NPOIFSFileSystem fs, EncryptionMode encryptionMode, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode) -
EncryptionInfo
@Deprecated public EncryptionInfo(DirectoryNode dir, EncryptionMode encryptionMode, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode) -
EncryptionInfo
Prepares for encryption, using the given Encryption Mode, and all other parameters as default. -
EncryptionInfo
public EncryptionInfo(EncryptionMode encryptionMode, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode)Constructs an EncryptionInfo from scratch- Parameters:
encryptionMode- seeEncryptionModefor values,EncryptionMode.cryptoAPIis for internal use only, as it's record basedcipherAlgorithm-hashAlgorithm-keyBits-blockSize-chainingMode-- Throws:
EncryptedDocumentException- if the given parameters mismatch, e.g. only certain combinations of keyBits, blockSize are allowed for a givenCipherAlgorithm
-
-
Method Details
-
getBuilder
protected static EncryptionInfoBuilder getBuilder(EncryptionMode encryptionMode) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException- Throws:
java.lang.ClassNotFoundExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationException
-
getVersionMajor
public int getVersionMajor() -
getVersionMinor
public int getVersionMinor() -
getEncryptionFlags
public int getEncryptionFlags() -
getHeader
-
getVerifier
-
getDecryptor
-
getEncryptor
-