Package org.apache.poi.poifs.crypt.agile
Class AgileEncryptionVerifier
- java.lang.Object
-
- org.apache.poi.poifs.crypt.EncryptionVerifier
-
- org.apache.poi.poifs.crypt.agile.AgileEncryptionVerifier
-
- All Implemented Interfaces:
Duplicatable
,GenericRecord
public class AgileEncryptionVerifier extends EncryptionVerifier
Used when checking if a key is valid for a document
-
-
Constructor Summary
Constructors Modifier Constructor Description AgileEncryptionVerifier(String descriptor)
AgileEncryptionVerifier(AgileEncryptionVerifier other)
protected
AgileEncryptionVerifier(EncryptionDocument ed)
AgileEncryptionVerifier(CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AgileEncryptionVerifier
copy()
int
getBlockSize()
The blockSize (in bytes) of the verifier data.int
getKeySize()
The keysize (in bits) of the verifier data.void
setBlockSize(int blockSize)
Sets the blockSize (in bytes) of the verifiervoid
setCipherAlgorithm(CipherAlgorithm cipherAlgorithm)
void
setEncryptedKey(byte[] encryptedKey)
void
setEncryptedVerifier(byte[] encryptedVerifier)
void
setEncryptedVerifierHash(byte[] encryptedVerifierHash)
void
setKeySize(int keyBits)
Sets the keysize (in bits) of the verifiervoid
setSalt(byte[] salt)
-
Methods inherited from class org.apache.poi.poifs.crypt.EncryptionVerifier
getChainingMode, getCipherAlgorithm, getEncryptedKey, getEncryptedVerifier, getEncryptedVerifierHash, getGenericProperties, getHashAlgorithm, getSalt, getSpinCount, setChainingMode, setHashAlgorithm, setSpinCount
-
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
-
AgileEncryptionVerifier
public AgileEncryptionVerifier(String descriptor)
-
AgileEncryptionVerifier
protected AgileEncryptionVerifier(EncryptionDocument ed)
-
AgileEncryptionVerifier
public AgileEncryptionVerifier(CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode)
-
AgileEncryptionVerifier
public AgileEncryptionVerifier(AgileEncryptionVerifier other)
-
-
Method Detail
-
setSalt
public void setSalt(byte[] salt)
- Overrides:
setSalt
in classEncryptionVerifier
-
setEncryptedVerifier
public void setEncryptedVerifier(byte[] encryptedVerifier)
- Overrides:
setEncryptedVerifier
in classEncryptionVerifier
-
setEncryptedVerifierHash
public void setEncryptedVerifierHash(byte[] encryptedVerifierHash)
- Overrides:
setEncryptedVerifierHash
in classEncryptionVerifier
-
setEncryptedKey
public void setEncryptedKey(byte[] encryptedKey)
- Overrides:
setEncryptedKey
in classEncryptionVerifier
-
copy
public AgileEncryptionVerifier copy()
- Specified by:
copy
in interfaceDuplicatable
- Specified by:
copy
in classEncryptionVerifier
- Returns:
- a deep copy of the implementing class / instance
-
getKeySize
public int getKeySize()
The keysize (in bits) of the verifier data. This usually equals the keysize of the header, but only on a few exceptions, like files generated by Office for Mac, can be different.- Returns:
- the keysize (in bits) of the verifier.
-
getBlockSize
public int getBlockSize()
The blockSize (in bytes) of the verifier data. This usually equals the blocksize of the header.- Returns:
- the blockSize (in bytes) of the verifier,
-
setKeySize
public void setKeySize(int keyBits)
Sets the keysize (in bits) of the verifier- Parameters:
keyBits
- the keysize (in bits)
-
setBlockSize
public void setBlockSize(int blockSize)
Sets the blockSize (in bytes) of the verifier- Parameters:
blockSize
- the blockSize (in bytes)
-
setCipherAlgorithm
public final void setCipherAlgorithm(CipherAlgorithm cipherAlgorithm)
- Overrides:
setCipherAlgorithm
in classEncryptionVerifier
-
-