Class XAdESSignatureFacet

java.lang.Object
org.apache.poi.poifs.crypt.dsig.facets.SignatureFacet
org.apache.poi.poifs.crypt.dsig.facets.XAdESSignatureFacet
All Implemented Interfaces:
SignatureConfig.SignatureConfigurable

public class XAdESSignatureFacet extends SignatureFacet
XAdES Signature Facet. Implements XAdES v1.4.1 which is compatible with XAdES v1.3.2. The implemented XAdES format is XAdES-BES/EPES. It's up to another part of the signature service to upgrade the XAdES-BES to a XAdES-X-L. This implementation has been tested against an implementation that participated multiple ETSI XAdES plugtests.
Author:
Frank Cornelis
See Also:
  • Constructor Details

    • XAdESSignatureFacet

      public XAdESSignatureFacet()
  • Method Details

    • preSign

      public void preSign(Document document, List<Reference> references, List<XMLObject> objects) throws XMLSignatureException
      Description copied from class: SignatureFacet
      This method is being invoked by the XML signature service engine during pre-sign phase. Via this method a signature facet implementation can add signature facets to an XML signature.
      Overrides:
      preSign in class SignatureFacet
      Parameters:
      document - the signature document to be used for imports
      references - list of reference definitions
      objects - objects to be signed/included in the signature document
      Throws:
      XMLSignatureException
    • setDigestAlgAndValue

      protected static void setDigestAlgAndValue(org.etsi.uri.x01903.v13.DigestAlgAndValueType digestAlgAndValue, byte[] data, HashAlgorithm digestAlgo)
      Gives back the JAXB DigestAlgAndValue data structure.
      Parameters:
      digestAlgAndValue - the parent for the new digest element
      data - the data to be digested
      digestAlgo - the digest algorithm
    • setCertID

      protected static void setCertID(org.etsi.uri.x01903.v13.CertIDType certId, SignatureConfig signatureConfig, boolean issuerNameNoReverseOrder, X509Certificate certificate)
      Gives back the JAXB CertID data structure.
    • addMimeType

      public void addMimeType(String dsReferenceUri, String mimetype)
      Adds a mime-type for the given ds:Reference (referred via its @URI). This information is added via the xades:DataObjectFormat element.
      Parameters:
      dsReferenceUri -
      mimetype -
    • insertXChild

      protected static void insertXChild(org.apache.xmlbeans.XmlObject root, org.apache.xmlbeans.XmlObject child)