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:
Cloneable
Used when checking if a key is valid for a document
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAgileEncryptionVerifier(com.microsoft.schemas.office.x2006.encryption.EncryptionDocument ed) AgileEncryptionVerifier(String descriptor) AgileEncryptionVerifier(CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode) -
Method Summary
Modifier and TypeMethodDescriptionvoidclone()intThe blockSize (in bytes) of the verifier data.intThe keysize (in bits) of the verifier data.protected voidsetBlockSize(int blockSize) Sets the blockSize (in bytes) of the verifierprotected final voidsetCipherAlgorithm(CipherAlgorithm cipherAlgorithm) protected voidsetEncryptedKey(byte[] encryptedKey) protected voidsetEncryptedVerifier(byte[] encryptedVerifier) protected voidsetEncryptedVerifierHash(byte[] encryptedVerifierHash) protected voidsetKeySize(int keyBits) Sets the keysize (in bits) of the verifierprotected voidsetSalt(byte[] salt) Methods inherited from class org.apache.poi.poifs.crypt.EncryptionVerifier
getChainingMode, getCipherAlgorithm, getEncryptedKey, getEncryptedVerifier, getEncryptedVerifierHash, getHashAlgorithm, getSalt, getSpinCount, setChainingMode, setHashAlgorithm, setSpinCount
-
Constructor Details
-
AgileEncryptionVerifier
-
AgileEncryptionVerifier
protected AgileEncryptionVerifier(com.microsoft.schemas.office.x2006.encryption.EncryptionDocument ed) -
AgileEncryptionVerifier
public AgileEncryptionVerifier(CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode)
-
-
Method Details
-
setSalt
protected void setSalt(byte[] salt) - Overrides:
setSaltin classEncryptionVerifier
-
setEncryptedVerifier
protected void setEncryptedVerifier(byte[] encryptedVerifier) - Overrides:
setEncryptedVerifierin classEncryptionVerifier
-
setEncryptedVerifierHash
protected void setEncryptedVerifierHash(byte[] encryptedVerifierHash) - Overrides:
setEncryptedVerifierHashin classEncryptionVerifier
-
setEncryptedKey
protected void setEncryptedKey(byte[] encryptedKey) - Overrides:
setEncryptedKeyin classEncryptionVerifier
-
addCertificate
-
getCertificates
-
clone
- Overrides:
clonein classEncryptionVerifier- Throws:
CloneNotSupportedException
-
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
protected void setKeySize(int keyBits) Sets the keysize (in bits) of the verifier- Parameters:
keyBits- the keysize (in bits)
-
setBlockSize
protected void setBlockSize(int blockSize) Sets the blockSize (in bytes) of the verifier- Parameters:
blockSize- the blockSize (in bytes)
-
setCipherAlgorithm
- Overrides:
setCipherAlgorithmin classEncryptionVerifier
-