Package org.faceless.pdf2.viewer2
Class SignatureProvider.SignatureState
- java.lang.Object
-
- org.faceless.pdf2.viewer2.SignatureProvider.SignatureState
-
- Direct Known Subclasses:
KeyStoreSignatureProvider.X509SignatureState
- Enclosing class:
- SignatureProvider
public class SignatureProvider.SignatureState extends Object
A SignatureState contains information about aFormSignatureonce it's been verified. This is used to display information about the signatures in the dialog displayed byshowVerifyDialog(), and to determine which Icon to display on any visual representation of the Signature in the PDF (seeSignatureProvider.getIcon(org.faceless.pdf2.viewer2.DocumentPanel, org.faceless.pdf2.FormSignature)). Subclasses of SignatureState may extend this class to store additional information if necessary.
-
-
Constructor Summary
Constructors Constructor Description SignatureState(FormSignature sig)Create a new SignatureState
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExceptiongetException()Return the Exception that occurred when trying to verify the signature or certificate, ornullif none was thrown.ImageIcongetIcon()Return anIconthat visually represents the state of the signature.StringgetReason()Return the descriptive text describing this stateFormSignaturegetSignature()Return the signature itselfSignatureProvidergetSignatureProvider()Return theSignatureProviderthat verified the Signature and created this SignatureState object.BooleangetValidity()Return the validity of the Signature.voidinitialize(Boolean validity, String reason, boolean alteredsince, Exception exception)Initialize the SignatureState.booleanisAlteredSince()Return true of the PDF has been altered since the signature was applied.
-
-
-
Constructor Detail
-
SignatureState
public SignatureState(FormSignature sig)
Create a new SignatureState- Parameters:
sig- the signature
-
-
Method Detail
-
initialize
public void initialize(Boolean validity, String reason, boolean alteredsince, Exception exception)
Initialize the SignatureState. This method is called immediately after the constructor- Parameters:
validity-Boolean.TRUE,Boolean.FALSEor null to indicate the signature is valid, invalid or hasn't be validatedreason- the reason for signingalteredsince- whether the PDF has been altered since the signature was appliedexception- the exception encountered during validation, or null if it succeeded- Since:
- 2.28.7 - prior to that these properties were set in the constructor
-
getValidity
public Boolean getValidity()
Return the validity of the Signature.Boolean.TRUEfor valid,Boolean.FALSEfor invalid ornullfor unknown validity.
-
getReason
public String getReason()
Return the descriptive text describing this state
-
isAlteredSince
public boolean isAlteredSince()
Return true of the PDF has been altered since the signature was applied. Only useful ifgetValidity()returns True.
-
getException
public Exception getException()
Return the Exception that occurred when trying to verify the signature or certificate, ornullif none was thrown.
-
getSignature
public FormSignature getSignature()
Return the signature itself
-
getSignatureProvider
public SignatureProvider getSignatureProvider()
Return theSignatureProviderthat verified the Signature and created this SignatureState object.
-
getIcon
public ImageIcon getIcon()
Return anIconthat visually represents the state of the signature. This will be displayed in theDocumentPaneland in the dialog displayed byshowVerifyDialog()
-
-