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

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AgileEncryptionVerifier.AgileCertificateEntry`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `AgileEncryptionVerifier(AgileEncryptionVerifier other)`
    `` | `AgileEncryptionVerifier(CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode)`
    `protected` | `AgileEncryptionVerifier(com.microsoft.schemas.office.x2006.encryption.EncryptionDocument ed)`
    `` | `AgileEncryptionVerifier(java.lang.String descriptor)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCertificate(java.security.cert.X509Certificate x509)`
    `AgileEncryptionVerifier` | `copy()`
    `int` | `getBlockSize()` The blockSize (in bytes) of the verifier data.
    `java.util.List<AgileEncryptionVerifier.AgileCertificateEntry>` | `getCertificates()`
    `int` | `getKeySize()` The keysize (in bits) of the verifier data.
    `protected void` | `setBlockSize(int blockSize)` Sets the blockSize (in bytes) of the verifier
    `protected void` | `setCipherAlgorithm(CipherAlgorithm cipherAlgorithm)`
    `protected void` | `setEncryptedKey(byte[] encryptedKey)`
    `protected void` | `setEncryptedVerifier(byte[] encryptedVerifier)`
    `protected void` | `setEncryptedVerifierHash(byte[] encryptedVerifierHash)`
    `protected void` | `setKeySize(int keyBits)` Sets the keysize (in bits) of the verifier
    `protected void` | `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(java.lang.String descriptor)

    - #### AgileEncryptionVerifier

          protected AgileEncryptionVerifier(com.microsoft.schemas.office.x2006.encryption.EncryptionDocument ed)

    - #### AgileEncryptionVerifier

          public AgileEncryptionVerifier(CipherAlgorithm cipherAlgorithm,
                                         HashAlgorithm hashAlgorithm,
                                         int keyBits,
                                         int blockSize,
                                         ChainingMode chainingMode)

    - #### AgileEncryptionVerifier

          public AgileEncryptionVerifier(AgileEncryptionVerifier other)

  - ### Method Detail

    - #### setSalt

          protected void setSalt(byte[] salt)

      Overrides:
        `setSalt` in class `EncryptionVerifier`

    - #### setEncryptedVerifier

          protected void setEncryptedVerifier(byte[] encryptedVerifier)

      Overrides:
        `setEncryptedVerifier` in class `EncryptionVerifier`

    - #### setEncryptedVerifierHash

          protected void setEncryptedVerifierHash(byte[] encryptedVerifierHash)

      Overrides:
        `setEncryptedVerifierHash` in class `EncryptionVerifier`

    - #### setEncryptedKey

          protected void setEncryptedKey(byte[] encryptedKey)

      Overrides:
        `setEncryptedKey` in class `EncryptionVerifier`

    - #### addCertificate

          public void addCertificate(java.security.cert.X509Certificate x509)

    - #### getCertificates

          public java.util.List<AgileEncryptionVerifier.AgileCertificateEntry> getCertificates()

    - #### copy

          public AgileEncryptionVerifier copy()

      Specified by:
        `copy` in interface `Duplicatable`
      Specified by:
        `copy` in class `EncryptionVerifier`
      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

          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

          protected final void setCipherAlgorithm(CipherAlgorithm cipherAlgorithm)

      Overrides:
        `setCipherAlgorithm` in class `EncryptionVerifier`

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.