public class LtvVerifier extends RootStoreVerifier
| Modifier and Type | Field and Description |
|---|---|
protected PdfAcroForm |
acroForm
The fields in the revision that is being verified.
|
protected com.itextpdf.kernel.pdf.PdfDocument |
document
A document object for the revision that is being verified.
|
protected com.itextpdf.kernel.pdf.PdfDictionary |
dss
The document security store for the revision that is being verified
|
protected boolean |
latestRevision
Indicates if we're working with the latest revision.
|
protected static org.slf4j.Logger |
LOGGER
The Logger instance
|
protected com.itextpdf.kernel.counter.event.IMetaInfo |
metaInfo
The meta info
|
protected LtvVerification.CertificateOption |
option
Option to specify level of verification; signing certificate only or the entire chain.
|
protected PdfPKCS7 |
pkcs7
The PdfPKCS7 object for the signature.
|
protected String |
securityProviderCode
Security provider to use, use null for default
|
protected String |
signatureName
The signature that covers the revision.
|
protected Date |
signDate
The date the revision was signed, or
null for the highest revision. |
protected boolean |
verifyRootCertificate
Verify root.
|
rootStoreonlineCheckingAllowed, verifier| Constructor and Description |
|---|
LtvVerifier(com.itextpdf.kernel.pdf.PdfDocument document)
Creates a VerificationData object for a PdfReader
|
LtvVerifier(com.itextpdf.kernel.pdf.PdfDocument document,
String securityProviderCode) |
| Modifier and Type | Method and Description |
|---|---|
protected PdfPKCS7 |
coversWholeDocument()
Checks if the signature covers the whole document
and throws an exception if the document was altered
|
List<X509CRL> |
getCRLsFromDSS()
Gets a list of X509CRL objects from a Document Security Store.
|
List<org.bouncycastle.cert.ocsp.BasicOCSPResp> |
getOCSPResponsesFromDSS()
Gets OCSP responses from the Document Security Store.
|
protected void |
initLtvVerifier(com.itextpdf.kernel.pdf.PdfDocument document) |
void |
setCertificateOption(LtvVerification.CertificateOption option)
Sets the certificate option.
|
void |
setEventCountingMetaInfo(com.itextpdf.kernel.counter.event.IMetaInfo metaInfo)
Sets the
IMetaInfo that will be used during PdfDocument creation. |
void |
setVerifier(CertificateVerifier verifier)
Sets an extra verifier.
|
void |
setVerifyRootCertificate(boolean verifyRootCertificate)
Set the verifyRootCertificate to false if you can't verify the root certificate.
|
void |
switchToPreviousRevision()
Switches to the previous revision.
|
List<VerificationOK> |
verify(List<VerificationOK> result)
Verifies all the document-level timestamps and all the signatures in the document.
|
List<VerificationOK> |
verify(X509Certificate signCert,
X509Certificate issuerCert,
Date signDate)
Verifies certificates against a list of CRLs and OCSP responses.
|
void |
verifyChain(Certificate[] chain)
Checks the certificates in a certificate chain:
are they valid on a specific date, and
do they chain up correctly?
|
List<VerificationOK> |
verifySignature()
Verifies a document level timestamp.
|
setRootStoresetOnlineCheckingAllowedprotected static final org.slf4j.Logger LOGGER
protected LtvVerification.CertificateOption option
protected boolean verifyRootCertificate
protected com.itextpdf.kernel.pdf.PdfDocument document
protected PdfAcroForm acroForm
protected Date signDate
null for the highest revision.protected String signatureName
protected PdfPKCS7 pkcs7
protected boolean latestRevision
protected com.itextpdf.kernel.pdf.PdfDictionary dss
protected String securityProviderCode
protected com.itextpdf.kernel.counter.event.IMetaInfo metaInfo
public LtvVerifier(com.itextpdf.kernel.pdf.PdfDocument document)
throws GeneralSecurityException
document - The document we want to verify.GeneralSecurityExceptionpublic LtvVerifier(com.itextpdf.kernel.pdf.PdfDocument document,
String securityProviderCode)
throws GeneralSecurityException
GeneralSecurityExceptionpublic void setVerifier(CertificateVerifier verifier)
verifier - the verifier to setpublic void setCertificateOption(LtvVerification.CertificateOption option)
option - Either CertificateOption.SIGNING_CERTIFICATE (default) or CertificateOption.WHOLE_CHAINpublic void setVerifyRootCertificate(boolean verifyRootCertificate)
public void setEventCountingMetaInfo(com.itextpdf.kernel.counter.event.IMetaInfo metaInfo)
IMetaInfo that will be used during PdfDocument creation.metaInfo - meta info to setpublic List<VerificationOK> verify(List<VerificationOK> result) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionpublic List<VerificationOK> verifySignature() throws GeneralSecurityException, IOException
GeneralSecurityExceptionIOExceptionpublic void verifyChain(Certificate[] chain) throws GeneralSecurityException
chain - the certificate chainGeneralSecurityExceptionpublic List<VerificationOK> verify(X509Certificate signCert, X509Certificate issuerCert, Date signDate) throws GeneralSecurityException, IOException
verify in class RootStoreVerifiersignCert - the signing certificateissuerCert - the issuer's certificatesignDate - the date the certificate needs to be validVerificationOK objects.
The list will be empty if the certificate couldn't be verified.GeneralSecurityExceptionIOExceptionRootStoreVerifier.verify(java.security.cert.X509Certificate, java.security.cert.X509Certificate, java.util.Date)public void switchToPreviousRevision()
throws IOException,
GeneralSecurityException
IOExceptionGeneralSecurityExceptionpublic List<X509CRL> getCRLsFromDSS() throws GeneralSecurityException, IOException
GeneralSecurityExceptionIOExceptionpublic List<org.bouncycastle.cert.ocsp.BasicOCSPResp> getOCSPResponsesFromDSS() throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionprotected void initLtvVerifier(com.itextpdf.kernel.pdf.PdfDocument document)
throws GeneralSecurityException
GeneralSecurityExceptionprotected PdfPKCS7 coversWholeDocument() throws GeneralSecurityException
GeneralSecurityExceptionCopyright © 1998–2018 iText Group NV. All rights reserved.