org.apache.poi.poifs.crypt.dsig.facets
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:
- XAdES
Method Summary |
void |
addMimeType(java.lang.String dsReferenceUri,
java.lang.String mimetype)
Adds a mime-type for the given ds:Reference (referred via its @URI). |
protected static void |
insertXChild(org.apache.xmlbeans.XmlObject root,
org.apache.xmlbeans.XmlObject child)
|
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. |
protected static void |
setCertID(org.etsi.uri.x01903.v13.CertIDType certId,
SignatureConfig signatureConfig,
boolean issuerNameNoReverseOrder,
java.security.cert.X509Certificate certificate)
Gives back the JAXB CertID data structure. |
protected static void |
setDigestAlgAndValue(org.etsi.uri.x01903.v13.DigestAlgAndValueType digestAlgAndValue,
byte[] data,
HashAlgorithm digestAlgo)
Gives back the JAXB DigestAlgAndValue data structure. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XAdESSignatureFacet
public XAdESSignatureFacet()
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
- 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 importsreferences
- list of reference definitionsobjects
- objects to be signed/included in the signature document
- Throws:
javax.xml.crypto.dsig.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 elementdata
- the data to be digesteddigestAlgo
- the digest algorithm
setCertID
protected static void setCertID(org.etsi.uri.x01903.v13.CertIDType certId,
SignatureConfig signatureConfig,
boolean issuerNameNoReverseOrder,
java.security.cert.X509Certificate certificate)
- Gives back the JAXB CertID data structure.
addMimeType
public void addMimeType(java.lang.String dsReferenceUri,
java.lang.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)
Copyright 2015 The Apache Software Foundation or
its licensors, as applicable.