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
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:
-
Field Summary
Fields inherited from class org.apache.poi.poifs.crypt.dsig.facets.SignatureFacet
MS_DIGSIG_NS, OO_DIGSIG_NS, signatureConfig, XADES_132_NS, XADES_141_NS, XML_DIGSIG_NS, XML_NS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMimeType
(String dsReferenceUri, 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
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, 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 org.apache.poi.poifs.crypt.dsig.facets.SignatureFacet
getSignatureFactory, newReference, newReference, newTransform, newTransform, postSign, setSignatureConfig
-
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 classSignatureFacet
- Parameters:
document
- the signature document to be used for importsreferences
- list of reference definitionsobjects
- 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 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, X509Certificate certificate) Gives back the JAXB CertID data structure. -
addMimeType
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)
-