Class XMLDocumentAnalyzer

java.lang.Object
eu.europa.esig.dss.spi.validation.analyzer.DefaultDocumentAnalyzer
eu.europa.esig.dss.xades.validation.XMLDocumentAnalyzer
All Implemented Interfaces:
eu.europa.esig.dss.spi.validation.analyzer.DocumentAnalyzer

public class XMLDocumentAnalyzer extends eu.europa.esig.dss.spi.validation.analyzer.DefaultDocumentAnalyzer
Validator of XML Signed document
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Document
    The root element of the document to validate
    protected List<XAdESPath>
    This variable contains the list of XAdESPaths adapted to the specific signature schema.

    Fields inherited from class eu.europa.esig.dss.spi.validation.analyzer.DefaultDocumentAnalyzer

    certificateVerifier, containerContents, detachedContents, detachedEvidenceRecordDocuments, document, manifestFile, signingCertificateSource
  • Constructor Summary

    Constructors
    Constructor
    Description
    XMLDocumentAnalyzer(eu.europa.esig.dss.model.DSSDocument dssDocument)
    The default constructor for XMLDocumentValidator.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addXAdESPathsHolder(XAdESPath xadesPathsHolder)
    This adds a XAdESPaths.
    protected List<eu.europa.esig.dss.spi.signature.AdvancedSignature>
     
    void
    Removes all elements from the list of query holders.
    List<eu.europa.esig.dss.model.DSSDocument>
    getOriginalDocuments(eu.europa.esig.dss.spi.signature.AdvancedSignature advancedSignature)
     
    Returns the root element of the validating document
    eu.europa.esig.dss.spi.policy.SignaturePolicyValidatorLoader
     
    This getter returns the XAdESPaths
    boolean
    isSupported(eu.europa.esig.dss.model.DSSDocument dssDocument)
     
    void
    setDisableXSWProtection(boolean disableXSWProtection)
    NOT RECOMMENDED : This parameter allows disabling protection against XML Signature wrapping attacks (XSW).

    Methods inherited from class eu.europa.esig.dss.spi.validation.analyzer.DefaultDocumentAnalyzer

    addReference, appendCounterSignatures, appendExternalEvidenceRecords, appendExternalEvidenceRecords, buildDetachedEvidenceRecords, buildDetachedTimestamps, buildEvidenceRecord, coversSignature, createValidationContext, fromDocument, getAllEvidenceRecords, getAllSignatures, getDetachedEvidenceRecords, getDetachedTimestamps, getDocument, getEvidenceRecord, getEvidenceRecordScopes, getOriginalDocuments, getSignatureById, getSignaturePolicyProvider, getSignatures, getTimestampedReferences, getTimestampReaders, getTokenIdentifierProvider, getValidationData, getValidationData, getValidationTime, instantiateValidationDataContainer, isTimestampCoveredByEvidenceRecord, prepareDetachedEvidenceRecordValidationContext, prepareDetachedTimestampValidationContext, prepareSignatureForVerification, prepareSignatureValidationContext, prepareValidationContext, processSignaturesValidation, setCertificateVerifier, setContainerContents, setDetachedContents, setDetachedEvidenceRecordDocuments, setDetachedEvidenceRecords, setManifestFile, setSignaturePolicyProvider, setSigningCertificateSource, setTokenIdentifierProvider, setValidationContextExecutor, setValidationTime, validate, validateContext, validateSignaturePolicy

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • xadesPathsHolders

      protected List<XAdESPath> xadesPathsHolders
      This variable contains the list of XAdESPaths adapted to the specific signature schema.
    • rootElement

      protected Document rootElement
      The root element of the document to validate
  • Constructor Details

    • XMLDocumentAnalyzer

      public XMLDocumentAnalyzer(eu.europa.esig.dss.model.DSSDocument dssDocument)
      The default constructor for XMLDocumentValidator. The created instance is initialised with default XAdESPaths .
      Parameters:
      dssDocument - The instance of DSSDocument to validate
  • Method Details

    • isSupported

      public boolean isSupported(eu.europa.esig.dss.model.DSSDocument dssDocument)
    • setDisableXSWProtection

      public void setDisableXSWProtection(boolean disableXSWProtection)
      NOT RECOMMENDED : This parameter allows disabling protection against XML Signature wrapping attacks (XSW). It disables the research by XPath expression for defined Type attributes.
      Parameters:
      disableXSWProtection - true to disable the protection
    • buildSignatures

      protected List<eu.europa.esig.dss.spi.signature.AdvancedSignature> buildSignatures()
      Overrides:
      buildSignatures in class eu.europa.esig.dss.spi.validation.analyzer.DefaultDocumentAnalyzer
    • getOriginalDocuments

      public List<eu.europa.esig.dss.model.DSSDocument> getOriginalDocuments(eu.europa.esig.dss.spi.signature.AdvancedSignature advancedSignature)
    • getXAdESPathsHolder

      public List<XAdESPath> getXAdESPathsHolder()
      This getter returns the XAdESPaths
      Returns:
      a list of XAdESPath
    • addXAdESPathsHolder

      public void addXAdESPathsHolder(XAdESPath xadesPathsHolder)
      This adds a XAdESPaths. This is useful when the signature follows a particular schema.
      Parameters:
      xadesPathsHolder - XAdESPath
    • clearQueryHolders

      public void clearQueryHolders()
      Removes all elements from the list of query holders. The list will be empty after this call returns.
    • getRootElement

      public Document getRootElement()
      Returns the root element of the validating document
      Returns:
      Document
    • getSignaturePolicyValidatorLoader

      public eu.europa.esig.dss.spi.policy.SignaturePolicyValidatorLoader getSignaturePolicyValidatorLoader()
      Overrides:
      getSignaturePolicyValidatorLoader in class eu.europa.esig.dss.spi.validation.analyzer.DefaultDocumentAnalyzer