Class ExtensionBuilder

java.lang.Object
eu.europa.esig.dss.xades.signature.XAdESBuilder
eu.europa.esig.dss.xades.signature.ExtensionBuilder
Direct Known Subclasses:
CounterSignatureBuilder, SignaturePolicyStoreBuilder, XAdESLevelBaselineT

public abstract class ExtensionBuilder extends XAdESBuilder
Builds XAdES signature extension
  • Field Details

    • xadesSignature

      protected XAdESSignature xadesSignature
      This object allows to access DOM signature representation using XPATH
    • currentSignatureDom

      protected Element currentSignatureDom
      This field represents the current signature being extended.
    • qualifyingPropertiesDom

      protected Element qualifyingPropertiesDom
      This field represents the signature qualifying properties
    • unsignedPropertiesDom

      protected Element unsignedPropertiesDom
      This field represents the unsigned properties
    • unsignedSignaturePropertiesDom

      protected Element unsignedSignaturePropertiesDom
      This field contains unsigned signature properties
    • documentValidator

      protected XMLDocumentValidator documentValidator
      The used document validator
  • Constructor Details

    • ExtensionBuilder

      protected ExtensionBuilder()
      Empty constructor
    • ExtensionBuilder

      protected ExtensionBuilder(CertificateVerifier certificateVerifier)
      Default constructor
      Parameters:
      certificateVerifier - CertificateVerifier
  • Method Details

    • initializeSignatureBuilder

      protected XAdESSignature initializeSignatureBuilder(XAdESSignature signature)
      Initializes all variables to be used for signature extension
      Parameters:
      signature - XAdESSignature
      Returns:
      XAdESSignature
    • ensureUnsignedProperties

      protected void ensureUnsignedProperties()
      Returns or creates (if it does not exist) the UnsignedPropertiesType DOM object.
    • ensureUnsignedSignatureProperties

      protected void ensureUnsignedSignatureProperties()
      Returns or creates (if it does not exist) the UnsignedSignaturePropertiesType DOM object.
    • ensureSignedDataObjectProperties

      protected void ensureSignedDataObjectProperties()
      Returns or create (if it does not exist) the SignedDataObjectProperties DOM object.
    • assertSignatureValid

      protected void assertSignatureValid(AdvancedSignature signature)
      Verifies if the signature is valid. Throws an exception if the signature is invalid.
      Parameters:
      signature - AdvancedSignature to check
    • indentIfPrettyPrint

      protected Element indentIfPrettyPrint(Element nodeToIndent, Element oldNode)
      Indents the nodeToIndent if pretty-print is enabled
      Parameters:
      nodeToIndent - Element to be indented
      oldNode - Element the old node
      Returns:
      Element
    • alignNodes

      protected void alignNodes()
      Description copied from class: XAdESBuilder
      This method is used to align children indents
      Specified by:
      alignNodes in class XAdESBuilder
    • removeNodes

      protected String removeNodes(NodeList nodeListToRemove)
      Removes the given nodeListToRemove from its parent
      Parameters:
      nodeListToRemove - NodeList to remove
      Returns:
      String of the next TEXT sibling of the first removed node with indent
    • removeNode

      protected String removeNode(Node nodeToRemove)
      Removes the given nodeToRemove from its parent
      Parameters:
      nodeToRemove - Node to remove
      Returns:
      String of the next TEXT sibling of the removed node (can be NULL if the TEXT sibling does not exist)
    • getXmldsigNamespace

      protected DSSNamespace getXmldsigNamespace()
      This method returns the current used XMLDSig namespace. Try to determine from the signature, from the parameters or the default value
      Overrides:
      getXmldsigNamespace in class XAdESBuilder
      Returns:
      DSSNamespace
    • getXadesNamespace

      protected DSSNamespace getXadesNamespace()
      This method returns the current used XAdES namespace. Try to determine from the signature, from the parameters or the default value
      Overrides:
      getXadesNamespace in class XAdESBuilder
      Returns:
      DSSNamespace