com.pdfunit.validators

## Class SignatureFieldValidator

- java.lang.Object
- - com.pdfunit.validators.AbstractValidator
  - - com.pdfunit.validators.SignatureFieldValidator

-     @DoNotObfuscate
      public final class SignatureFieldValidator
      extends com.pdfunit.validators.AbstractValidator

  This validator provides methods for testing signatures.
  Since:
    2016.05
  Author:
    Carsten Siedentop, January 2016

- - ### Field Summary

    - ### Fields inherited from class com.pdfunit.validators.AbstractValidator

      `testDocument`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `SignatureFieldValidator(DocumentValidator documentValidator)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `SignatureFieldValidator` | `coveringWholeDocument()` Verifiying that the current signature covers the whole document.
    `SignatureFieldValidator` | `hasSignatureField(java.lang.String expectedFieldName)` This method checks that a signature field with the given name exists.
    `SignatureFieldValidator` | `signedBy(java.lang.String expectedName)` This method validates that the name of the current signature is the same as the expected name.
    `SignatureFieldValidator` | `signedOn(java.util.Calendar expectedSigningDate)` This method verifies that the signing date of the signature of the current field is the same as the given parameter.
    `SignatureFieldValidator` | `withoutSignature()` This method does what the name suggests.
    `SignatureFieldValidator` | `withReason(java.lang.String expectedReason)` This method verifies that the reason of the current signature is equals to the expected value.
    `SignatureFieldValidator` | `withSignature()`

    - ### Methods inherited from class com.pdfunit.validators.AbstractValidator

      `closeDocument, equals, getDocument, hashCode`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SignatureFieldValidator

          protected SignatureFieldValidator(DocumentValidator documentValidator)

  - ### Method Detail

    - #### coveringWholeDocument

          public SignatureFieldValidator coveringWholeDocument()

      Verifiying that the current signature covers the whole document.

    - #### hasSignatureField

          @Guarded
          public SignatureFieldValidator hasSignatureField(java.lang.String expectedFieldName)

      This method checks that a signature field with the given name exists. When no signature field with the expected name exists, an exception is thrown.

      This method creates always a valid instance of IFieldSignature, it never returns null.

    - #### withSignature

          public SignatureFieldValidator withSignature()

    - #### signedBy

          @Guarded
          public SignatureFieldValidator signedBy(java.lang.String expectedName)

      This method validates that the name of the current signature is the same as the expected name.

    - #### signedOn

          @Guarded
          public SignatureFieldValidator signedOn(java.util.Calendar expectedSigningDate)

      This method verifies that the signing date of the signature of the current field is the same as the given parameter.

    - #### withoutSignature

          @Guarded
          public SignatureFieldValidator withoutSignature()

      This method does what the name suggests.

    - #### withReason

          @Guarded
          public SignatureFieldValidator withReason(java.lang.String expectedReason)

      This method verifies that the reason of the current signature is equals to the expected value.

Copyright (C) PDFUnit.com. See here for license.