Class DefaultXMLSignatureContext
java.lang.Object
se.swedenconnect.sigval.xml.xmlstruct.impl.DefaultXMLSignatureContext
- All Implemented Interfaces:
XMLSigConstants
,XMLSignatureContext
public class DefaultXMLSignatureContext
extends Object
implements XMLSignatureContext, XMLSigConstants
Provides signature context data related to XML document signatures.
This class is instantiated for a specific XML document and a new instance must be created for each processed XML document.
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Field Summary
Fields inherited from interface se.swedenconnect.sigval.xml.xmlstruct.XMLSigConstants
XADES_NAMESPACE, XML_SVT_NS, XMLDSIG_NS, XMLDSIG_V2_TRANSFORM
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List
<X509Certificate> getAllSignatureCertificates
(org.apache.xml.security.keys.KeyInfo keyInfo) Extracts all certificates from the supplied KeyInfo.getSignatureData
(Element sigNode) Parse and extract signature data from the signatureMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface se.swedenconnect.sigval.xml.xmlstruct.XMLSignatureContext
getDocument, getDocumentBytes
-
Constructor Details
-
DefaultXMLSignatureContext
Constructor- Parameters:
document
- the XML document from which signature context data is collected- Throws:
IOException
- on errors parsing data
-
-
Method Details
-
getSignatureData
Parse and extract signature data from the signature- Specified by:
getSignatureData
in interfaceXMLSignatureContext
- Parameters:
sigNode
- The signature element- Returns:
- signature data
- Throws:
IOException
- on error parsing the signature and extracting the necessary information
-
getAllSignatureCertificates
protected List<X509Certificate> getAllSignatureCertificates(org.apache.xml.security.keys.KeyInfo keyInfo) Extracts all certificates from the supplied KeyInfo.- Parameters:
keyInfo
- the KeyInfo- Returns:
- a list of certificates
-