public class SignatureValidity extends Object
Constructor and Description |
---|
SignatureValidity() |
Modifier and Type | Method and Description |
---|---|
void |
drawSmallIcon(Component c,
Graphics2D g2d)
Draws a small icon that reflects the validity state of the signature.
|
Throwable |
getException()
Returns any exception when reading the signature.
|
String |
getExceptionMessage()
Returns a message associated with an exception when reading the signature.
|
Icon |
getLargeIcon()
Returns an Icon that will draw the status of the signature with the same rules as drawSmallIcon().
|
Icon |
getSmallIcon() |
List<String> |
getValidationMessages()
This method returns a list of messages related to the validity of the certificates, timestamp, key usage, and byte range.
|
String |
getValidityText()
Returns a textual description of the state of the signature.
|
boolean |
isAllValid()
Checks if the signature is completely valid.
|
boolean |
isContentAppended()
Gets a flag that indicates if there has been any content appended to this PDF.
|
boolean |
isDocReconstructed()
Gets the value of the document reconstructed flag.
|
boolean |
isDocumentTimestamp()
Return a flag indicating whether this signature is a document timestamp.
|
boolean |
isNotValid()
This method checks if the signature is considered NOT VALID.
|
boolean |
isTested()
Returns a flag indicating if this signature has been tested.
|
boolean |
isTrustedChain()
Gets the value of the trusted chain flag.
|
boolean |
isTSTrustedChain()
Returns whether the TSA certificate chain is trusted.
|
boolean |
isTSValid()
If there is a time stamp token, returns whether it is valid.
|
boolean |
isTSValidCertificate()
If there is a time stamp token, returns whether its certificate is valid.
|
boolean |
isValidByteRange()
Gets the value of the byte range flag.
|
boolean |
isValidCertificateChain()
Returns the status of the certificate chain validity.
|
boolean |
isValidExpiration()
Gets the value of the valid expiration flag.
|
boolean |
isValidKeyUsage()
Returns whether the key usage is valid.
|
boolean |
isValidPadesCertificate()
Returns true if this is a PAdES signature and the certificate is valid OR if this is not a PAdES signature.
|
boolean |
isValidRevocationList()
Returns the status of the revocation list validity.
|
boolean |
isValidSignatureHash()
Returns a flag indicating whether the stored signature hash matches the calculated signature hash.
|
boolean |
isValidSignatureObject()
Gets a flag that indicates whether the signature object was readable.
|
boolean |
isValidTimestamp()
Returns a flag indicating whether the signature has a valid timestamp.
|
boolean |
isValidWithWarning()
Returns true if the signature is considered valid but has warnings associated with it.
|
void |
setContentAppended(boolean contentAppended)
Sets the content appended flag.
|
void |
setDocReconstructed(boolean docReconstructed)
Sets the value of the document reconstructed flag.
|
void |
setDocumentTimestamp(boolean documentTimestamp)
Set the document timestamp flag.
|
void |
setException(Throwable t,
String msg)
Sets the exception when reading the signature.
|
void |
setTested(boolean tested)
Sets flag indicating that this signature has been tested.
|
void |
setTrustedChain(boolean trustedChain)
Sets the value of the trusted chain flag.
|
void |
setTSTrustedChain(boolean tsTrustedChain)
Sets the flag to indicate if the TSA certificate chain is trusted.
|
void |
setTSValid(boolean valid)
Sets the flag to indicate that if a time stamp is present, if it is valid
|
void |
setTSValidCertificate(boolean valid)
Sets the flag to indicate that if a time stamp is present that its certificate is valid.
|
void |
setValidByteRange(boolean validByteRange)
Sets the value of the byte range flag.
|
void |
setValidCertificateChain(boolean validCertificateChain)
Sets the status of the certificate chain validity.
|
void |
setValidExpiration(boolean validExpiration)
Sets the value of the expiration flag.
|
void |
setValidKeyUsage(boolean validKeyUsage)
Sets the flag to indicate that the key usage is valid.
|
void |
setValidPadesCertificate(boolean validPadesCertificate)
Set the flag to indicate if the PAdES certificate is valid.
|
void |
setValidRevocationList(boolean validRevocationList)
Sets the status of the revocation list validity.
|
void |
setValidSignatureHash(boolean validSignatureHash)
Sets the flag that indicates that the stored signature hash matches the calculated signature hash.
|
void |
setValidSignatureObject(boolean validSignatureObject)
Sets the value of the valid signature object flag.
|
void |
setValidTimestamp(boolean validTimestamp)
Sets the valid timestamp flag.
|
public boolean isValidCertificateChain()
public void setValidCertificateChain(boolean validCertificateChain)
validCertificateChain
- The status of the certificate chain validity.public boolean isValidRevocationList()
public void setValidRevocationList(boolean validRevocationList)
validRevocationList
- The status of the revocation list validity.public boolean isValidSignatureHash()
public void setValidSignatureHash(boolean validSignatureHash)
validSignatureHash
- Whether the signature hashes match.public boolean isDocumentTimestamp()
public void setDocumentTimestamp(boolean documentTimestamp)
documentTimestamp
- The new value of the document timestamp flag.public boolean isValidTimestamp()
public void setValidTimestamp(boolean validTimestamp)
validTimestamp
- The new value of the valid timestamp flag.public boolean isAllValid()
public boolean isValidWithWarning()
public boolean isNotValid()
public boolean isValidExpiration()
public void setValidExpiration(boolean validExpiration)
validExpiration
- The new value of the expiration flag.public boolean isTrustedChain()
public void setTrustedChain(boolean trustedChain)
trustedChain
- The new value of the trusted chain flag.public boolean isValidByteRange()
public void setValidByteRange(boolean validByteRange)
validByteRange
- The new value of the byte range flag.public boolean isDocReconstructed()
public void setDocReconstructed(boolean docReconstructed)
docReconstructed
- The new value of the document reconstructed flag.public void drawSmallIcon(Component c, Graphics2D g2d)
c
- The component used to obtain relevant properties.g2d
- The graphics object on which to draw the icon.public Icon getLargeIcon()
public Icon getSmallIcon()
public String getValidityText()
public List<String> getValidationMessages()
public boolean isValidSignatureObject()
public void setValidSignatureObject(boolean validSignatureObject)
validSignatureObject
- The new value of the valid signature object flag.public String getExceptionMessage()
public Throwable getException()
public void setException(Throwable t, String msg)
t
- The exception.msg
- Any message associated with the exception.public boolean isTested()
public void setTested(boolean tested)
tested
- The new value of the tested flag.public boolean isContentAppended()
public void setContentAppended(boolean contentAppended)
contentAppended
- The new value of the content appended flag.public void setTSValid(boolean valid)
valid
- Validity of the timestamp.public boolean isTSValid()
public void setTSValidCertificate(boolean valid)
valid
- Validity of the timestamp certificate.public boolean isTSValidCertificate()
public void setValidKeyUsage(boolean validKeyUsage)
validKeyUsage
- Validity of the key usage.public boolean isValidKeyUsage()
public void setTSTrustedChain(boolean tsTrustedChain)
tsTrustedChain
- Trusted status of the TSA certificate chain.public boolean isTSTrustedChain()
public void setValidPadesCertificate(boolean validPadesCertificate)
validPadesCertificate
- true if the PAdES certificate is valid.public boolean isValidPadesCertificate()