Package org.apache.poi.poifs.crypt
Class EncryptionHeader
java.lang.Object
org.apache.poi.poifs.crypt.EncryptionHeader
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
AgileEncryptionHeader
,BinaryRC4EncryptionHeader
,StandardEncryptionHeader
,XOREncryptionHeader
Reads and processes OOXML Encryption Headers
The constants are largely based on ZIP constants.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
int
int
getFlags()
byte[]
int
int
protected void
setBlockSize
(int blockSize) protected void
setChainingMode
(ChainingMode chainingMode) protected void
setCipherAlgorithm
(CipherAlgorithm cipherAlgorithm) protected void
setCipherProvider
(CipherProvider providerType) protected void
setCspName
(String cspName) protected void
setFlags
(int flags) protected void
setHashAlgorithm
(HashAlgorithm hashAlgorithm) protected void
setKeySalt
(byte[] salt) protected void
setKeySize
(int keyBits) Sets the keySize (in bits).protected void
setSizeExtra
(int sizeExtra)
-
Field Details
-
ALGORITHM_RC4
public static final int ALGORITHM_RC4 -
ALGORITHM_AES_128
public static final int ALGORITHM_AES_128 -
ALGORITHM_AES_192
public static final int ALGORITHM_AES_192 -
ALGORITHM_AES_256
public static final int ALGORITHM_AES_256 -
HASH_NONE
public static final int HASH_NONE -
HASH_SHA1
public static final int HASH_SHA1 -
HASH_SHA256
public static final int HASH_SHA256 -
HASH_SHA384
public static final int HASH_SHA384 -
HASH_SHA512
public static final int HASH_SHA512 -
PROVIDER_RC4
public static final int PROVIDER_RC4 -
PROVIDER_AES
public static final int PROVIDER_AES -
MODE_ECB
public static final int MODE_ECB -
MODE_CBC
public static final int MODE_CBC -
MODE_CFB
public static final int MODE_CFB
-
-
Constructor Details
-
EncryptionHeader
protected EncryptionHeader()
-
-
Method Details
-
getChainingMode
-
setChainingMode
-
getFlags
public int getFlags() -
setFlags
protected void setFlags(int flags) -
getSizeExtra
public int getSizeExtra() -
setSizeExtra
protected void setSizeExtra(int sizeExtra) -
getCipherAlgorithm
-
setCipherAlgorithm
-
getHashAlgorithm
-
setHashAlgorithm
-
getKeySize
public int getKeySize() -
setKeySize
protected void setKeySize(int keyBits) Sets the keySize (in bits). Before calling this method, make sure to set the cipherAlgorithm, as the amount of keyBits gets validated against the list of allowed keyBits of the corresponding cipherAlgorithm- Parameters:
keyBits
-
-
getBlockSize
public int getBlockSize() -
setBlockSize
protected void setBlockSize(int blockSize) -
getKeySalt
public byte[] getKeySalt() -
setKeySalt
protected void setKeySalt(byte[] salt) -
getCipherProvider
-
setCipherProvider
-
getCspName
-
setCspName
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-