Class LtvVerifier


  • @Deprecated
    public class LtvVerifier
    extends RootStoreVerifier
    Deprecated.
    starting from 8.0.5. SignatureValidator should be used instead.
    Verifies the signatures in an LTV document.
    • 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
      • 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, or null for 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
    • 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.
        Create LtvVerifier class instance from the PdfDocument and security provider code.
        Parameters:
        document - PdfDocument which will be verified
        securityProviderCode - 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 the IMetaInfo that will be used during PdfDocument creation.
        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 of VerificationOK objects
        Returns:
        a list of all VerificationOK objects after verification
        Throws:
        java.io.IOException - signals that an I/O exception has occurred
        java.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 VerificationOK objects
        Throws:
        java.security.GeneralSecurityException - if some problems with signature or security occurred
        java.io.IOException - signals that an I/O exception has occurred
      • verifyChain

        public void verifyChain​(java.security.cert.Certificate[] chain)
                         throws java.security.GeneralSecurityException
        Deprecated.
        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:
        verify in class RootStoreVerifier
        Parameters:
        signCert - the signing certificate
        issuerCert - the issuer's certificate
        signDate - the date the certificate needs to be valid
        Returns:
        a list of VerificationOK objects. 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.GeneralSecurityException
        Deprecated.
        Switches to the previous revision.
        Throws:
        java.io.IOException - signals that an I/O exception has occurred
        java.security.GeneralSecurityException - if some problems with signature or security occurred
      • getCRLsFromDSS

        public java.util.List<java.security.cert.X509CRL> getCRLsFromDSS()
                                                                  throws java.security.GeneralSecurityException
        Deprecated.
        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.
        Initialize LtvVerifier object by using provided document. This method reads all the existing signatures and mathematically validates the last one.
        Parameters:
        document - PdfDocument instance 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