public class ApprovalSignaturePdfBox extends PdfSignatureDetailsPdfBox implements ApprovalSignature
Modifier and Type | Method and Description |
---|---|
iaik.x509.X509Certificate[] |
getCertificateChain(CadesSignature cadesSignature)
Get the signer's certificate chain.
|
CadesSignature |
getCMSSignature()
Extracts the CMS signature included in the PDF signature dictionary.
|
boolean |
getCrlRevocationStatus()
Checks whether the signer's certificate is contained in the crl that is included in the
signature's revocation information.
|
byte[] |
getEncodedCmsSignature()
Get the original encoding of the CMS signature as included in the PDF signature dictionary.
|
iaik.x509.ocsp.CertStatus |
getOcspRevocationStatus()
Parses the OCSP responses included in the signature's revocation information.
|
RevocationInfoArchival |
getRevocationInformation()
Extract revocation information if included.
|
SignatureTimeStamp[] |
getSignatureTimeStamps()
Extract all included signature timestamps.
|
iaik.tsp.TimeStampToken |
getSignatureTimeStampToken()
Extract signature timestamp token if included.
|
iaik.x509.X509Certificate |
getSignerCertificate()
Returns the signer certificate.
|
java.util.Calendar |
getSigningTime()
Get the time of signature creation.
|
void |
verifySignatureTimestampImprint()
Verify signature timestamp if included.
|
void |
verifySignatureTimestampImprint(iaik.x509.X509Certificate tsa_certificate)
Verify signature timestamp if included.
|
void |
verifySignatureTimestamps()
Verify all included signature timestamps.
|
iaik.x509.X509Certificate |
verifySignatureValue()
Verify the signature value.
|
getName, getRevision, getRevision, getRevision, getSignatureDictionaryDate, getSubfilter, isModified
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, getRevision, getRevision, getRevision, getSignatureDictionaryDate, getSubfilter, isModified
public CadesSignature getCMSSignature() throws PdfSignatureException, java.io.IOException
ApprovalSignature
getCMSSignature
in interface ApprovalSignature
PdfSignatureException
- if the CMS signature can't be extracted or parsedjava.io.IOException
- if the CMS signature bytes can't be readpublic byte[] getEncodedCmsSignature() throws java.io.IOException
ApprovalSignature
getEncodedCmsSignature
in interface ApprovalSignature
java.io.IOException
- if the signature can't be extracted from the PDF documentpublic java.util.Calendar getSigningTime()
PdfSignatureDetails
getSigningTime
in interface PdfSignatureDetails
public RevocationInfoArchival getRevocationInformation() throws PdfSignatureException, CmsCadesException
ApprovalSignature
getRevocationInformation
in interface ApprovalSignature
PdfSignatureException
- if the CMS signature can't be extracted or parsedCmsCadesException
- if the revocation attribute can't be parsed or the revocation type is unknownpublic iaik.x509.ocsp.CertStatus getOcspRevocationStatus() throws PdfSignatureException, CmsCadesException
ApprovalSignature
getOcspRevocationStatus
in interface ApprovalSignature
PdfSignatureException
- if the CMS signature can't be extracted or parsedCmsCadesException
- if no revocation infos are included or can't be readpublic boolean getCrlRevocationStatus() throws PdfSignatureException, CmsCadesException
ApprovalSignature
getCrlRevocationStatus
in interface ApprovalSignature
PdfSignatureException
- if the CMS signature can't be extracted or parsedCmsCadesException
- if no revocation infos are included or can't be readpublic iaik.x509.X509Certificate getSignerCertificate() throws PdfSignatureException, CmsCadesException
ApprovalSignature
getSignerCertificate
in interface ApprovalSignature
PdfSignatureException
- if the CMS signature can't be extracted or parsedCmsCadesException
- if requested certificate is not containedpublic iaik.x509.X509Certificate[] getCertificateChain(CadesSignature cadesSignature) throws PdfSignatureException, CmsCadesException
ApprovalSignature
getCertificateChain
in interface ApprovalSignature
PdfSignatureException
- if the CMS signature can't be extracted or parsedCmsCadesException
- if requested certificate chain is not containedpublic iaik.x509.X509Certificate verifySignatureValue() throws PdfSignatureException, CmsCadesException, iaik.cms.CMSSignatureException
ApprovalSignature
verifySignatureValue
in interface ApprovalSignature
PdfSignatureException
- if the CMS signature can't be extracted or parsedCmsCadesException
- if no signature could be foundiaik.cms.CMSSignatureException
- if the signature turns out to be incorrectpublic iaik.tsp.TimeStampToken getSignatureTimeStampToken() throws PdfSignatureException, CmsCadesException
ApprovalSignature
getSignatureTimeStampToken
in interface ApprovalSignature
PdfSignatureException
- if the CMS signature can't be extracted or parsedCmsCadesException
- if timestamp token can't be parsedpublic SignatureTimeStamp[] getSignatureTimeStamps() throws PdfSignatureException, CmsCadesException
ApprovalSignature
getSignatureTimeStamps
in interface ApprovalSignature
PdfSignatureException
- if the CMS signature can't be extracted or parsedCmsCadesException
- if timestamp token can't be parsedpublic void verifySignatureTimestampImprint() throws PdfSignatureException, CmsCadesException, iaik.tsp.TspVerificationException
ApprovalSignature
verifySignatureTimestampImprint
in interface ApprovalSignature
PdfSignatureException
- if the CMS signature can't be extracted or parsedCmsCadesException
- if tsa certificate is not included to verify timestamp, if timestamp can't be
extractediaik.tsp.TspVerificationException
- if signature of timestamp token is invalid or an parsing error occurspublic void verifySignatureTimestamps() throws PdfSignatureException, CmsCadesException, iaik.tsp.TspVerificationException
ApprovalSignature
verifySignatureTimestamps
in interface ApprovalSignature
PdfSignatureException
- if the CMS signature can't be extracted or parsedCmsCadesException
- if no tsa certificate is included to verify the timestamp or if a timestamp can't be
extractediaik.tsp.TspVerificationException
- if signature of timestamp token is invalid or an parsing error occurspublic void verifySignatureTimestampImprint(iaik.x509.X509Certificate tsa_certificate) throws PdfSignatureException, CmsCadesException, iaik.tsp.TspVerificationException
ApprovalSignature
ApprovalSignature.getSignatureTimeStamps()
and its verify method.
Verifies the signature value and whether the message imprint equals the expected signature. No
certificate path validation is done.
To verify the signature the given TSA certificate is used. If the given TSA certificate is null
and this timestamp contains the corresponding TSA certificate, the included TSA certificate is
used.verifySignatureTimestampImprint
in interface ApprovalSignature
tsa_certificate
- the certificate of the timestamp authorityPdfSignatureException
- if the CMS signature can't be extracted or parsedCmsCadesException
- if timestamp can't be extractediaik.tsp.TspVerificationException
- if signature of timestamp token is invalid or an parsing error occurs