org.apache.poi.poifs.crypt.dsig.facets

## Class SignatureFacet

- java.lang.Object
- - org.apache.poi.poifs.crypt.dsig.facets.SignatureFacet

- All Implemented Interfaces:
    SignatureConfig.SignatureConfigurable
  Direct Known Subclasses:
    EnvelopedSignatureFacet, KeyInfoSignatureFacet, Office2010SignatureFacet, OOXMLSignatureFacet, XAdESSignatureFacet, XAdESXLSignatureFacet

      public abstract class SignatureFacet
      extends java.lang.Object
      implements SignatureConfig.SignatureConfigurable

  JSR105 Signature Facet base class.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `MS_DIGSIG_NS`
    `static java.lang.String` | `OO_DIGSIG_NS`
    `protected SignatureConfig` | `signatureConfig`
    `static java.lang.String` | `XADES_132_NS`
    `static java.lang.String` | `XADES_141_NS`
    `static java.lang.String` | `XML_DIGSIG_NS`
    `static java.lang.String` | `XML_NS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SignatureFacet()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected javax.xml.crypto.dsig.XMLSignatureFactory` | `getSignatureFactory()`
    `protected javax.xml.crypto.dsig.Reference` | `newReference(java.lang.String uri, java.util.List<javax.xml.crypto.dsig.Transform> transforms, java.lang.String type, java.lang.String id, byte[] digestValue)`
    `static javax.xml.crypto.dsig.Reference` | `newReference(java.lang.String uri, java.util.List<javax.xml.crypto.dsig.Transform> transforms, java.lang.String type, java.lang.String id, byte[] digestValue, SignatureConfig signatureConfig)`
    `protected javax.xml.crypto.dsig.Transform` | `newTransform(java.lang.String canonicalizationMethod)`
    `protected javax.xml.crypto.dsig.Transform` | `newTransform(java.lang.String canonicalizationMethod, javax.xml.crypto.dsig.spec.TransformParameterSpec paramSpec)`
    `void` | `postSign(org.w3c.dom.Document document)` This method is being invoked by the XML signature service engine during the post-sign phase.
    `void` | `preSign(org.w3c.dom.Document document, java.util.List<javax.xml.crypto.dsig.Reference> references, java.util.List<javax.xml.crypto.dsig.XMLObject> objects)` This method is being invoked by the XML signature service engine during pre-sign phase.
    `void` | `setSignatureConfig(SignatureConfig signatureConfig)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### XML_NS

          public static final java.lang.String XML_NS

      See Also:
        Constant Field Values

    - #### XML_DIGSIG_NS

          public static final java.lang.String XML_DIGSIG_NS

      See Also:
        Constant Field Values

    - #### OO_DIGSIG_NS

          public static final java.lang.String OO_DIGSIG_NS

      See Also:
        Constant Field Values

    - #### MS_DIGSIG_NS

          public static final java.lang.String MS_DIGSIG_NS

      See Also:
        Constant Field Values

    - #### XADES_132_NS

          public static final java.lang.String XADES_132_NS

      See Also:
        Constant Field Values

    - #### XADES_141_NS

          public static final java.lang.String XADES_141_NS

      See Also:
        Constant Field Values

    - #### signatureConfig

          protected SignatureConfig signatureConfig

  - ### Constructor Detail

    - #### SignatureFacet

          public SignatureFacet()

  - ### Method Detail

    - #### setSignatureConfig

          public void setSignatureConfig(SignatureConfig signatureConfig)

      Specified by:
        `setSignatureConfig` in interface `SignatureConfig.SignatureConfigurable`

    - #### preSign

          public void preSign(org.w3c.dom.Document document,
                              java.util.List<javax.xml.crypto.dsig.Reference> references,
                              java.util.List<javax.xml.crypto.dsig.XMLObject> objects)
                       throws javax.xml.crypto.dsig.XMLSignatureException

      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.
      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:
        `javax.xml.crypto.dsig.XMLSignatureException`

    - #### postSign

          public void postSign(org.w3c.dom.Document document)
                        throws javax.xml.crypto.MarshalException

      This method is being invoked by the XML signature service engine during the post-sign phase. Via this method a signature facet can extend the XML signatures with for example key information.
      Parameters:
        `document` - the signature document to be modified
      Throws:
        `javax.xml.crypto.MarshalException`

    - #### getSignatureFactory

          protected javax.xml.crypto.dsig.XMLSignatureFactory getSignatureFactory()

    - #### newTransform

          protected javax.xml.crypto.dsig.Transform newTransform(java.lang.String canonicalizationMethod)
                                                          throws javax.xml.crypto.dsig.XMLSignatureException

      Throws:
        `javax.xml.crypto.dsig.XMLSignatureException`

    - #### newTransform

          protected javax.xml.crypto.dsig.Transform newTransform(java.lang.String canonicalizationMethod,
                                                                 javax.xml.crypto.dsig.spec.TransformParameterSpec paramSpec)
                                                          throws javax.xml.crypto.dsig.XMLSignatureException

      Throws:
        `javax.xml.crypto.dsig.XMLSignatureException`

    - #### newReference

          protected javax.xml.crypto.dsig.Reference newReference(java.lang.String uri,
                                                                 java.util.List<javax.xml.crypto.dsig.Transform> transforms,
                                                                 java.lang.String type,
                                                                 java.lang.String id,
                                                                 byte[] digestValue)
                                                          throws javax.xml.crypto.dsig.XMLSignatureException

      Throws:
        `javax.xml.crypto.dsig.XMLSignatureException`

    - #### newReference

          public static javax.xml.crypto.dsig.Reference newReference(java.lang.String uri,
                                                                     java.util.List<javax.xml.crypto.dsig.Transform> transforms,
                                                                     java.lang.String type,
                                                                     java.lang.String id,
                                                                     byte[] digestValue,
                                                                     SignatureConfig signatureConfig)
                                                              throws javax.xml.crypto.dsig.XMLSignatureException

      Throws:
        `javax.xml.crypto.dsig.XMLSignatureException`

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.