public class

DigitalSignatureInfo

extends Object
java.lang.Object
   ↳ com.pspdfkit.signatures.DigitalSignatureInfo

Class Overview

A digital signature stored inside a PDF document. This can be retrieved by calling getSignatureInfo(). As a convenience to check the signing status of a document, you can retrieve the DocumentSignatureInfo by calling getDocumentSignatureInfoAsync().

Summary

Nested Classes
class DigitalSignatureInfo.BuildData Build data dictionary of a software that created the digital signature. 
class DigitalSignatureInfo.Reference Signature reference dictionary. 
enum DigitalSignatureInfo.ReferenceTransformMethod List of possible transformation methods of a DigitalSignatureInfo.Reference
Constants
String BUILD_DATA_APP_KEY Key of a DigitalSignatureInfo.BuildData entry for the PDF/SigQ Conformance Checker that was used to create the signature.
String BUILD_DATA_FILTER_KEY Key of a DigitalSignatureInfo.BuildData entry for the filter (i.e.
String BUILD_DATA_PUB_SEC_KEY Key of a DigitalSignatureInfo.BuildData entry for the PubSec software that created the signature.
String BUILD_DATA_SIGQ_KEY Key of a DigitalSignatureInfo.BuildData entry for the PDF/SigQ Specification and Conformance Checker that was used to create the signature.
Public Methods
Map<StringDigitalSignatureInfo.BuildData> getBuildProperties()
Returns map of build properties.
List<Long> getByteRange()
Returns range of bytes this signature covers.
byte[] getContents()
Returns actual byte content of this signature in PDF file.
Calendar getCreationDate()
Returns date of creation of this signature in UTC timezone.
PdfDocument getDocument()
Returns the document with which the signature info is associated.
String getFilter()
Returns name of the filter used for signing.
String getName()
Returns name of the signer of this signature.
String getReason()
Returns reason for signing if the signer attached it.
List<DigitalSignatureInfo.Reference> getReferences()
String getSubFilter()
Returns name of the subfilter used for signing.
boolean isSigned()
Returns if form field is actually signed.
String toString()
DigitalSignatureValidationResult validate()
Checks the actual validity of the signature and returns DigitalSignatureValidationResult.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String BUILD_DATA_APP_KEY

Key of a DigitalSignatureInfo.BuildData entry for the PDF/SigQ Conformance Checker that was used to create the signature.

Constant Value: "App"

public static final String BUILD_DATA_FILTER_KEY

Key of a DigitalSignatureInfo.BuildData entry for the filter (i.e. signature handler) that created the signature.

Constant Value: "Filter"

public static final String BUILD_DATA_PUB_SEC_KEY

Key of a DigitalSignatureInfo.BuildData entry for the PubSec software that created the signature.

Constant Value: "PubSec"

public static final String BUILD_DATA_SIGQ_KEY

Key of a DigitalSignatureInfo.BuildData entry for the PDF/SigQ Specification and Conformance Checker that was used to create the signature.

Constant Value: "SigQ"

Public Methods

public Map<StringDigitalSignatureInfo.BuildData> getBuildProperties ()

Returns map of build properties. Keys will be one of BUILD_DATA_APP_KEY, BUILD_DATA_FILTER_KEY, BUILD_DATA_PUB_SEC_KEY, BUILD_DATA_SIGQ_KEY.

Returns
  • map of build properties of this signature.

public List<Long> getByteRange ()

Returns range of bytes this signature covers. Signatures cover two parts of a document: The part before the signature and the part after the signature. This method will return four elements because of that: [offset_of_part_before_signature, length_of_part_before_signature, offset_of_part_after_signature, length_of_part_after_signature].

To fully verify the integrity of the document, the both parts and contents of this signature should span full size of the document.

Returns
  • a list representing the byte range.

public byte[] getContents ()

Returns actual byte content of this signature in PDF file.

Returns
  • content of the signature or null if there's actually no signature attached to signature field.

public Calendar getCreationDate ()

Returns date of creation of this signature in UTC timezone. May be null if no creation date is stored in the signature.

Returns
  • Creation date in UTC timezone, or null.

public PdfDocument getDocument ()

Returns the document with which the signature info is associated.

Returns

public String getFilter ()

Returns name of the filter used for signing.

Returns
  • signing filter, can be null.

public String getName ()

Returns name of the signer of this signature. May be null no name is stored in the signature.

Returns
  • Name of the signer, or null.

public String getReason ()

Returns reason for signing if the signer attached it.

Returns
  • reason for signing, can be null.

public List<DigitalSignatureInfo.Reference> getReferences ()

public String getSubFilter ()

Returns name of the subfilter used for signing.

Returns
  • signing subfilter, can be null.

public boolean isSigned ()

Returns if form field is actually signed. Note that this DOES NOT check if the signature is actually valid. Signature validity must be checked with validate() call.

Returns
  • true if this digital signature actually has contents.

public String toString ()

public DigitalSignatureValidationResult validate ()

Checks the actual validity of the signature and returns DigitalSignatureValidationResult. This check will use certificates from SignatureManager for validating certificate of this signature and will also check for integrity issues. Note that validation may take a bit of time and shouldn't be run on the main thread.

Returns