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:
org.apache.poi.common.Duplicatable,GenericRecord
Used when checking if a key is valid for a document
-
Constructor Summary
ConstructorsConstructorDescriptionAgileEncryptionVerifier(String descriptor) AgileEncryptionVerifier(CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode) -
Method Summary
Modifier and TypeMethodDescriptioncopy()intThe blockSize (in bytes) of the verifier data.intThe keysize (in bits) of the verifier data.voidsetBlockSize(int blockSize) Sets the blockSize (in bytes) of the verifierfinal voidsetCipherAlgorithm(CipherAlgorithm cipherAlgorithm) voidsetEncryptedKey(byte[] encryptedKey) voidsetEncryptedVerifier(byte[] encryptedVerifier) voidsetEncryptedVerifierHash(byte[] encryptedVerifierHash) voidsetKeySize(int keyBits) Sets the keysize (in bits) of the verifiervoidsetSalt(byte[] salt) Methods inherited from class org.apache.poi.poifs.crypt.EncryptionVerifier
getChainingMode, getCipherAlgorithm, getEncryptedKey, getEncryptedVerifier, getEncryptedVerifierHash, getGenericProperties, getHashAlgorithm, getSalt, getSpinCount, setChainingMode, setHashAlgorithm, setSpinCountMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericChildren, getGenericRecordType
-
Constructor Details
-
AgileEncryptionVerifier
-
AgileEncryptionVerifier
public AgileEncryptionVerifier(CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode) -
AgileEncryptionVerifier
-
-
Method Details
-
setSalt
public void setSalt(byte[] salt) - Overrides:
setSaltin classEncryptionVerifier
-
setEncryptedVerifier
public void setEncryptedVerifier(byte[] encryptedVerifier) - Overrides:
setEncryptedVerifierin classEncryptionVerifier
-
setEncryptedVerifierHash
public void setEncryptedVerifierHash(byte[] encryptedVerifierHash) - Overrides:
setEncryptedVerifierHashin classEncryptionVerifier
-
setEncryptedKey
public void setEncryptedKey(byte[] encryptedKey) - Overrides:
setEncryptedKeyin classEncryptionVerifier
-
copy
- Specified by:
copyin interfaceorg.apache.poi.common.Duplicatable- Specified by:
copyin classEncryptionVerifier
-
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
- Overrides:
setCipherAlgorithmin classEncryptionVerifier
-