Class TLStructureVerifier

java.lang.Object
eu.europa.esig.dss.xades.tsl.TLStructureVerifier

public class TLStructureVerifier extends Object
This class verifies conformity of a TL to the defined TLVersion. NOTE: The class currently handles validation of only V5 and V6 Trusted List versions.
  • Constructor Details

    • TLStructureVerifier

      public TLStructureVerifier()
      Default constructor. Accepts TL V5 and TL V6
  • Method Details

    • setAcceptedTLVersions

      public TLStructureVerifier setAcceptedTLVersions(List<Integer> acceptedTLVersions)
      Sets a list of acceptable TL version. When defined, an error message will be produces for Trusted Lists with a different version.
      Parameters:
      acceptedTLVersions - a list of Integers, containing acceptable TL versions
      Returns:
      this TLStructureVerifier
    • setSigningMode

      public TLStructureVerifier setSigningMode(boolean signingMode)
      Sets whether the current operation is the XML Trusted List signing. If enabled, verifies that no ds:Signature element is present within the XML Trusted List. Otherwise, verifies presence and validity of the ds:Signature element. Default : FALSE (verifies that the signature is not present)
      Parameters:
      signingMode - whether the validation is performed for the XML Trusted List signing
      Returns:
      this TLStructureVerifier
    • validate

      public List<String> validate(DSSDocument dssDocument, Integer tlVersion)
      This method validates the Trusted List's conformity to the specified TLVersion
      Parameters:
      dssDocument - DSSDocument XML Trusted List to be validated
      tlVersion - Integer the version of the Trusted List to validate document against
      Returns:
      a list of Strings indicating errors occurred during the conformity evaluation
    • validate

      public List<String> validate(Document document, Integer tlVersion)
      This method validates the Trusted List's conformity to the specified TLVersion
      Parameters:
      document - Document XML Trusted List to be validated
      tlVersion - Integer the version of the Trusted List to validate document against
      Returns:
      a list of Strings indicating errors occurred during the conformity evaluation
    • validateTrustedListV5

      protected List<String> validateTrustedListV5(Document document)
      This method validates the Trusted List XML document against the TL V5 definition
      Parameters:
      document - Document containing a Trusted List to be validated
      Returns:
      a list of Strings
    • validateTrustedListV6

      protected List<String> validateTrustedListV6(Document document)
      This method validates the Trusted List XML document against the TL V6 definition
      Parameters:
      document - Document containing a Trusted List to be validated
      Returns:
      a list of Strings