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 aFormSignature
once 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 Exception
getException()
Return the Exception that occurred when trying to verify the signature or certificate, ornull
if none was thrown.ImageIcon
getIcon()
Return anIcon
that visually represents the state of the signature.String
getReason()
Return the descriptive text describing this stateFormSignature
getSignature()
Return the signature itselfSignatureProvider
getSignatureProvider()
Return theSignatureProvider
that verified the Signature and created this SignatureState object.Boolean
getValidity()
Return the validity of the Signature.void
initialize(Boolean validity, String reason, boolean alteredsince, Exception exception)
Initialize the SignatureState.boolean
isAlteredSince()
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.FALSE
or 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.TRUE
for valid,Boolean.FALSE
for invalid ornull
for 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, ornull
if none was thrown.
-
getSignature
public FormSignature getSignature()
Return the signature itself
-
getSignatureProvider
public SignatureProvider getSignatureProvider()
Return theSignatureProvider
that verified the Signature and created this SignatureState object.
-
getIcon
public ImageIcon getIcon()
Return anIcon
that visually represents the state of the signature. This will be displayed in theDocumentPanel
and in the dialog displayed byshowVerifyDialog()
-
-