Top Description Fields Constructors Methods
org.apache.poi.poifs.crypt

public abstract Class EncryptionHeader

extends Object
implements GenericRecord, Duplicatable
Class Inheritance
All Implemented Interfaces
org.apache.poi.common.Duplicatable, org.apache.poi.common.usermodel.GenericRecord
Known Direct Subclasses
org.apache.poi.poifs.crypt.agile.AgileEncryptionHeader, org.apache.poi.poifs.crypt.binaryrc4.BinaryRC4EncryptionHeader, org.apache.poi.poifs.crypt.standard.StandardEncryptionHeader, org.apache.poi.poifs.crypt.xor.XOREncryptionHeader
Imports
java.util.Collections, .LinkedHashMap, .Map, java.util.function.Supplier, org.apache.poi.EncryptedDocumentException, org.apache.poi.common.Duplicatable, org.apache.poi.common.usermodel.GenericRecord

Reads and processes OOXML Encryption Headers The constants are largely based on ZIP constants.

Field Summary

Modifier and TypeField and Description
private int
private ChainingMode
private CipherAlgorithm
private String
private int
private HashAlgorithm
private int
private byte[]
private CipherProvider
private int

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
public abstract EncryptionHeader
public int
public ChainingMode
public CipherAlgorithm
public CipherProvider
public String
public int
public Map<String, Supplier<?>>
public HashAlgorithm
public byte[]
public int
public int
public void
setBlockSize(int blockSize)

protected void
public void
public void
public void
setCspName(String cspName)

public void
setFlags(int flags)

public void
public void
setKeySalt(byte[] salt)

public void
setKeySize(int keyBits)

Sets the keySize (in bits).

public void
setSizeExtra(int sizeExtra)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

blockSizeback to summary
private int blockSize
chainingModeback to summary
private ChainingMode chainingMode
cipherAlgorithmback to summary
private CipherAlgorithm cipherAlgorithm
cspNameback to summary
private String cspName
flagsback to summary
private int flags
hashAlgorithmback to summary
private HashAlgorithm hashAlgorithm
keyBitsback to summary
private int keyBits
keySaltback to summary
private byte[] keySalt
providerTypeback to summary
private CipherProvider providerType
sizeExtraback to summary
private int sizeExtra

Constructor Detail

EncryptionHeaderback to summary
protected EncryptionHeader()
EncryptionHeaderback to summary
protected EncryptionHeader(EncryptionHeader other)

Method Detail

copyback to summary
public abstract EncryptionHeader copy()

Redeclares org.apache.poi.common.Duplicatable.copy.

Returns:EncryptionHeader

Doc from org.apache.poi.common.Duplicatable.copy.

a deep copy of the implementing class / instance

Annotations
@Override
getBlockSizeback to summary
public int getBlockSize()
getChainingModeback to summary
public ChainingMode getChainingMode()
getCipherAlgorithmback to summary
public CipherAlgorithm getCipherAlgorithm()
getCipherProviderback to summary
public CipherProvider getCipherProvider()
getCspNameback to summary
public String getCspName()
getFlagsback to summary
public int getFlags()
getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

Implements org.apache.poi.common.usermodel.GenericRecord.getGenericProperties.

Annotations
@Override
getHashAlgorithmback to summary
public HashAlgorithm getHashAlgorithm()
getKeySaltback to summary
public byte[] getKeySalt()
getKeySizeback to summary
public int getKeySize()
getSizeExtraback to summary
public int getSizeExtra()
setBlockSizeback to summary
public void setBlockSize(int blockSize)
setChainingModeback to summary
protected void setChainingMode(ChainingMode chainingMode)
setCipherAlgorithmback to summary
public void setCipherAlgorithm(CipherAlgorithm cipherAlgorithm)
setCipherProviderback to summary
public void setCipherProvider(CipherProvider providerType)
setCspNameback to summary
public void setCspName(String cspName)
setFlagsback to summary
public void setFlags(int flags)
setHashAlgorithmback to summary
public void setHashAlgorithm(HashAlgorithm hashAlgorithm)
setKeySaltback to summary
public void setKeySalt(byte[] salt)
setKeySizeback to summary
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

setSizeExtraback to summary
public void setSizeExtra(int sizeExtra)