Customizing the Digital Signature Validation Status
With the Digital Signatures license component, the validation status UI is available, but it’s not enabled by default. You can easily turn it on by specifying the desired option on the
PSPDFKit.ViewState.showSignatureValidationStatus property. The available options are:
PSPDFKit.ShowSignatureValidationStatusMode.NEVER(default) — Don’t show the digital signature validation UI at any time, even if there are digital signatures on the document.
PSPDFKit.ShowSignatureValidationStatusMode.IF_SIGNED— Show the digital signature validation UI whenever the document is digitally signed.
PSPDFKit.ShowSignatureValidationStatusMode.HAS_WARNINGS— Only show the digital signature validation UI if there are warnings for the document’s digital signatures.
PSPDFKit.ShowSignatureValidationStatusMode.HAS_ERRORS— Only show the digital signature validation UI if there are invalid signatures in the document.
The signature validation UI consists of a colored bar shown under the main toolbar and, if they exist, under the annotation toolbars. The bar will have the background color corresponding to the current document’s validation status: red for “error,” yellow for “warning,” and green for “OK.” These colors are adapted for the default supported themes, light and dark. The status bar will show an informative text about the validation status of the document.
The diagram below shows the decision tree that leads to each possible validation status text and color. The bar will be shown or hidden in each case depending upon the value of
The validation status bar will pop up either when the document is loaded (or reloaded), or when
PSPDFKit.ViewState.showSignatureValidationStatus is updated, depending on its value. The bar can be closed at any time by pressing the Close button at the end of the bar. The validation status displayed is automatically updated whenever the document changes, e.g. if an annotation is added, the bar will reflect that modifications were made to the document since it was signed.