Package org.apache.poi.poifs.crypt
Class EncryptionHeader
- java.lang.Object
-
- org.apache.poi.poifs.crypt.EncryptionHeader
-
- All Implemented Interfaces:
Duplicatable
,GenericRecord
- Direct Known Subclasses:
AgileEncryptionHeader
,BinaryRC4EncryptionHeader
,StandardEncryptionHeader
,XOREncryptionHeader
public abstract class EncryptionHeader extends Object implements GenericRecord, Duplicatable
Reads and processes OOXML Encryption Headers The constants are largely based on ZIP constants.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EncryptionHeader()
protected
EncryptionHeader(EncryptionHeader other)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract EncryptionHeader
copy()
int
getBlockSize()
ChainingMode
getChainingMode()
CipherAlgorithm
getCipherAlgorithm()
CipherProvider
getCipherProvider()
String
getCspName()
int
getFlags()
Map<String,Supplier<?>>
getGenericProperties()
HashAlgorithm
getHashAlgorithm()
byte[]
getKeySalt()
int
getKeySize()
int
getSizeExtra()
void
setBlockSize(int blockSize)
protected void
setChainingMode(ChainingMode chainingMode)
void
setCipherAlgorithm(CipherAlgorithm cipherAlgorithm)
void
setCipherProvider(CipherProvider providerType)
void
setCspName(String cspName)
void
setFlags(int flags)
void
setHashAlgorithm(HashAlgorithm hashAlgorithm)
void
setKeySalt(byte[] salt)
void
setKeySize(int keyBits)
Sets the keySize (in bits).void
setSizeExtra(int sizeExtra)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericChildren, getGenericRecordType
-
-
-
-
Constructor Detail
-
EncryptionHeader
protected EncryptionHeader()
-
EncryptionHeader
protected EncryptionHeader(EncryptionHeader other)
-
-
Method Detail
-
getChainingMode
public ChainingMode getChainingMode()
-
setChainingMode
protected void setChainingMode(ChainingMode chainingMode)
-
getFlags
public int getFlags()
-
setFlags
public void setFlags(int flags)
-
getSizeExtra
public int getSizeExtra()
-
setSizeExtra
public void setSizeExtra(int sizeExtra)
-
getCipherAlgorithm
public CipherAlgorithm getCipherAlgorithm()
-
setCipherAlgorithm
public void setCipherAlgorithm(CipherAlgorithm cipherAlgorithm)
-
getHashAlgorithm
public HashAlgorithm getHashAlgorithm()
-
setHashAlgorithm
public void setHashAlgorithm(HashAlgorithm hashAlgorithm)
-
getKeySize
public int getKeySize()
-
setKeySize
public 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
-
getBlockSize
public int getBlockSize()
-
setBlockSize
public void setBlockSize(int blockSize)
-
getKeySalt
public byte[] getKeySalt()
-
setKeySalt
public void setKeySalt(byte[] salt)
-
getCipherProvider
public CipherProvider getCipherProvider()
-
setCipherProvider
public void setCipherProvider(CipherProvider providerType)
-
getCspName
public String getCspName()
-
setCspName
public void setCspName(String cspName)
-
copy
public abstract EncryptionHeader copy()
- Specified by:
copy
in interfaceDuplicatable
- Returns:
- a deep copy of the implementing class / instance
-
getGenericProperties
public Map<String,Supplier<?>> getGenericProperties()
- Specified by:
getGenericProperties
in interfaceGenericRecord
-
-