Package com.itextpdf.signatures
Class LtvVerifier
- java.lang.Object
-
- com.itextpdf.signatures.CertificateVerifier
-
- com.itextpdf.signatures.RootStoreVerifier
-
- com.itextpdf.signatures.LtvVerifier
-
@Deprecated public class LtvVerifier extends RootStoreVerifier
Deprecated.starting from 8.0.5.SignatureValidatorshould be used instead.Verifies the signatures in an LTV document.
-
-
Field Summary
Fields Modifier and Type Field Description protected PdfAcroFormacroFormDeprecated.The fields in the revision that is being verified.private static IBouncyCastleFactoryBOUNCY_CASTLE_FACTORYDeprecated.protected PdfDocumentdocumentDeprecated.A document object for the revision that is being verified.protected PdfDictionarydssDeprecated.The document security store for the revision that is being verifiedprotected booleanlatestRevisionDeprecated.Indicates if we're working with the latest revision.protected static org.slf4j.LoggerLOGGERDeprecated.The Logger instanceprotected IMetaInfometaInfoDeprecated.The meta infoprotected LtvVerification.CertificateOptionoptionDeprecated.Option to specify level of verification; signing certificate only or the entire chain.protected PdfPKCS7pkcs7Deprecated.The PdfPKCS7 object for the signature.protected java.lang.StringsecurityProviderCodeDeprecated.Security provider to use, use null for defaultprivate SignatureUtilsgnUtilDeprecated.protected java.lang.StringsignatureNameDeprecated.The signature that covers the revision.protected java.util.DatesignDateDeprecated.The date the revision was signed, ornullfor the highest revision.protected booleanverifyRootCertificateDeprecated.Verify root.-
Fields inherited from class com.itextpdf.signatures.RootStoreVerifier
rootStore
-
Fields inherited from class com.itextpdf.signatures.CertificateVerifier
onlineCheckingAllowed, verifier
-
-
Constructor Summary
Constructors Constructor Description LtvVerifier(PdfDocument document)Deprecated.Creates a VerificationData object for a PdfReaderLtvVerifier(PdfDocument document, java.lang.String securityProviderCode)Deprecated.CreateLtvVerifierclass instance from thePdfDocumentand security provider code.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected PdfPKCS7coversWholeDocument()Deprecated.Checks if the signature covers the whole document and throws an exception if the document was alteredjava.util.List<java.security.cert.X509CRL>getCRLsFromDSS()Deprecated.Gets a list of X509CRL objects from a Document Security Store.java.util.List<IBasicOCSPResp>getOCSPResponsesFromDSS()Deprecated.Gets OCSP responses from the Document Security Store.protected voidinitLtvVerifier(PdfDocument document)Deprecated.InitializeLtvVerifierobject by using provided document.voidsetCertificateOption(LtvVerification.CertificateOption option)Deprecated.Sets the certificate option.voidsetEventCountingMetaInfo(IMetaInfo metaInfo)Deprecated.Sets theIMetaInfothat will be used duringPdfDocumentcreation.voidsetVerifier(CertificateVerifier verifier)Deprecated.Sets an extra verifier.voidsetVerifyRootCertificate(boolean verifyRootCertificate)Deprecated.Set the verifyRootCertificate to false if you can't verify the root certificate.voidswitchToPreviousRevision()Deprecated.Switches to the previous revision.java.util.List<VerificationOK>verify(java.security.cert.X509Certificate signCert, java.security.cert.X509Certificate issuerCert, java.util.Date signDate)Deprecated.Verifies certificates against a list of CRLs and OCSP responses.java.util.List<VerificationOK>verify(java.util.List<VerificationOK> result)Deprecated.Verifies all the document-level timestamps and all the signatures in the document.voidverifyChain(java.security.cert.Certificate[] chain)Deprecated.Checks the certificates in a certificate chain: are they valid on a specific date, and do they chain up correctly?java.util.List<VerificationOK>verifySignature()Deprecated.Verifies a document level timestamp.-
Methods inherited from class com.itextpdf.signatures.RootStoreVerifier
setRootStore
-
Methods inherited from class com.itextpdf.signatures.CertificateVerifier
setOnlineCheckingAllowed
-
-
-
-
Field Detail
-
BOUNCY_CASTLE_FACTORY
private static final IBouncyCastleFactory BOUNCY_CASTLE_FACTORY
Deprecated.
-
LOGGER
protected static final org.slf4j.Logger LOGGER
Deprecated.The Logger instance
-
option
protected LtvVerification.CertificateOption option
Deprecated.Option to specify level of verification; signing certificate only or the entire chain.
-
verifyRootCertificate
protected boolean verifyRootCertificate
Deprecated.Verify root.
-
document
protected PdfDocument document
Deprecated.A document object for the revision that is being verified.
-
acroForm
protected PdfAcroForm acroForm
Deprecated.The fields in the revision that is being verified.
-
signDate
protected java.util.Date signDate
Deprecated.The date the revision was signed, ornullfor the highest revision.
-
signatureName
protected java.lang.String signatureName
Deprecated.The signature that covers the revision.
-
pkcs7
protected PdfPKCS7 pkcs7
Deprecated.The PdfPKCS7 object for the signature.
-
latestRevision
protected boolean latestRevision
Deprecated.Indicates if we're working with the latest revision.
-
dss
protected PdfDictionary dss
Deprecated.The document security store for the revision that is being verified
-
securityProviderCode
protected java.lang.String securityProviderCode
Deprecated.Security provider to use, use null for default
-
metaInfo
protected IMetaInfo metaInfo
Deprecated.The meta info
-
sgnUtil
private SignatureUtil sgnUtil
Deprecated.
-
-
Constructor Detail
-
LtvVerifier
public LtvVerifier(PdfDocument document) throws java.security.GeneralSecurityException
Deprecated.Creates a VerificationData object for a PdfReader- Parameters:
document- The document we want to verify.- Throws:
java.security.GeneralSecurityException- if some problem with signature or security are occurred
-
LtvVerifier
public LtvVerifier(PdfDocument document, java.lang.String securityProviderCode) throws java.security.GeneralSecurityException
Deprecated.CreateLtvVerifierclass instance from thePdfDocumentand security provider code.- Parameters:
document-PdfDocumentwhich will be verifiedsecurityProviderCode- security provider code to read signatures- Throws:
java.security.GeneralSecurityException- if some problem with signature or security are occurred
-
-
Method Detail
-
setVerifier
public void setVerifier(CertificateVerifier verifier)
Deprecated.Sets an extra verifier.- Parameters:
verifier- the verifier to set
-
setCertificateOption
public void setCertificateOption(LtvVerification.CertificateOption option)
Deprecated.Sets the certificate option.- Parameters:
option- Either CertificateOption.SIGNING_CERTIFICATE (default) or CertificateOption.WHOLE_CHAIN
-
setVerifyRootCertificate
public void setVerifyRootCertificate(boolean verifyRootCertificate)
Deprecated.Set the verifyRootCertificate to false if you can't verify the root certificate.- Parameters:
verifyRootCertificate- false if you can't verify the root certificate, otherwise true
-
setEventCountingMetaInfo
public void setEventCountingMetaInfo(IMetaInfo metaInfo)
Deprecated.Sets theIMetaInfothat will be used duringPdfDocumentcreation.- Parameters:
metaInfo- meta info to set
-
verify
public java.util.List<VerificationOK> verify(java.util.List<VerificationOK> result) throws java.io.IOException, java.security.GeneralSecurityException
Deprecated.Verifies all the document-level timestamps and all the signatures in the document.- Parameters:
result- a list ofVerificationOKobjects- Returns:
- a list of all
VerificationOKobjects after verification - Throws:
java.io.IOException- signals that an I/O exception has occurredjava.security.GeneralSecurityException- if some problems with signature or security occurred
-
verifySignature
public java.util.List<VerificationOK> verifySignature() throws java.security.GeneralSecurityException, java.io.IOException
Deprecated.Verifies a document level timestamp.- Returns:
- a list of
VerificationOKobjects - Throws:
java.security.GeneralSecurityException- if some problems with signature or security occurredjava.io.IOException- signals that an I/O exception has occurred
-
verifyChain
public void verifyChain(java.security.cert.Certificate[] chain) throws java.security.GeneralSecurityExceptionDeprecated.Checks the certificates in a certificate chain: are they valid on a specific date, and do they chain up correctly?- Parameters:
chain- the certificate chain- Throws:
java.security.GeneralSecurityException- when requested cryptographic algorithm or security provider is not available, if the certificate is invalid on a specific date and if the certificates chained up incorrectly
-
verify
public java.util.List<VerificationOK> verify(java.security.cert.X509Certificate signCert, java.security.cert.X509Certificate issuerCert, java.util.Date signDate) throws java.security.GeneralSecurityException
Deprecated.Verifies certificates against a list of CRLs and OCSP responses.- Overrides:
verifyin classRootStoreVerifier- Parameters:
signCert- the signing certificateissuerCert- the issuer's certificatesignDate- the date the certificate needs to be valid- Returns:
- a list of
VerificationOKobjects. The list will be empty if the certificate couldn't be verified. - Throws:
java.security.GeneralSecurityException- if some problems with signature or security occurred- See Also:
RootStoreVerifier.verify(java.security.cert.X509Certificate, java.security.cert.X509Certificate, java.util.Date)
-
switchToPreviousRevision
public void switchToPreviousRevision() throws java.io.IOException, java.security.GeneralSecurityExceptionDeprecated.Switches to the previous revision.- Throws:
java.io.IOException- signals that an I/O exception has occurredjava.security.GeneralSecurityException- if some problems with signature or security occurred
-
getCRLsFromDSS
public java.util.List<java.security.cert.X509CRL> getCRLsFromDSS() throws java.security.GeneralSecurityExceptionDeprecated.Gets a list of X509CRL objects from a Document Security Store.- Returns:
- a list of CRLs
- Throws:
java.security.GeneralSecurityException- when requested cryptographic algorithm or security provider is not available
-
getOCSPResponsesFromDSS
public java.util.List<IBasicOCSPResp> getOCSPResponsesFromDSS() throws java.security.GeneralSecurityException
Deprecated.Gets OCSP responses from the Document Security Store.- Returns:
- a list of IBasicOCSPResp objects
- Throws:
java.security.GeneralSecurityException- if OCSP response failed
-
initLtvVerifier
protected void initLtvVerifier(PdfDocument document) throws java.security.GeneralSecurityException
Deprecated.InitializeLtvVerifierobject by using provided document. This method reads all the existing signatures and mathematically validates the last one.- Parameters:
document-PdfDocumentinstance to be verified- Throws:
java.security.GeneralSecurityException- if some problems with signature or security are occurred
-
coversWholeDocument
protected PdfPKCS7 coversWholeDocument() throws java.security.GeneralSecurityException
Deprecated.Checks if the signature covers the whole document and throws an exception if the document was altered- Returns:
- a PdfPKCS7 object
- Throws:
java.security.GeneralSecurityException- if some problems with signature or security occurred
-
-