Module org.apache.santuario.xmlsec
Class DOMXMLSignature
- java.lang.Object
-
- org.apache.jcp.xml.dsig.internal.dom.DOMStructure
-
- org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignature
-
- All Implemented Interfaces:
XMLSignature,XMLStructure
public final class DOMXMLSignature extends DOMStructure implements XMLSignature
DOM-based implementation of XMLSignature.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classDOMXMLSignature.DOMSignatureValue-
Nested classes/interfaces inherited from interface javax.xml.crypto.dsig.XMLSignature
XMLSignature.SignatureValue
-
-
Field Summary
-
Fields inherited from interface javax.xml.crypto.dsig.XMLSignature
XMLNS
-
-
Constructor Summary
Constructors Constructor Description DOMXMLSignature(SignedInfo si, KeyInfo ki, List<? extends XMLObject> objs, String id, String signatureValueId)Creates aDOMXMLSignaturefrom the specified components.DOMXMLSignature(Element sigElem, XMLCryptoContext context, Provider provider)Creates aDOMXMLSignaturefrom XML.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetId()KeyInfogetKeyInfo()KeySelectorResultgetKeySelectorResult()List<XMLObject>getObjects()XMLSignature.SignatureValuegetSignatureValue()SignedInfogetSignedInfo()inthashCode()voidmarshal(Node parent, String dsPrefix, DOMCryptoContext context)voidmarshal(Node parent, Node nextSibling, String dsPrefix, DOMCryptoContext context)voidsign(XMLSignContext signContext)booleanvalidate(XMLValidateContext vc)-
Methods inherited from class org.apache.jcp.xml.dsig.internal.dom.DOMStructure
equalsContent, isFeatureSupported
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.xml.crypto.XMLStructure
isFeatureSupported
-
-
-
-
Constructor Detail
-
DOMXMLSignature
public DOMXMLSignature(SignedInfo si, KeyInfo ki, List<? extends XMLObject> objs, String id, String signatureValueId)
Creates aDOMXMLSignaturefrom the specified components.- Parameters:
si- theSignedInfoki- theKeyInfo, ornullif not specifiedobjs- a list ofXMLObjects ornullif not specified. The list is copied to protect against subsequent modification.id- an optional id (specifynullto omit)signatureValueId- an optional id (specifynullto omit)- Throws:
NullPointerException- ifsiisnull
-
DOMXMLSignature
public DOMXMLSignature(Element sigElem, XMLCryptoContext context, Provider provider) throws MarshalException
Creates aDOMXMLSignaturefrom XML.- Parameters:
sigElem- Signature element- Throws:
MarshalException- if XMLSignature cannot be unmarshalled
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceXMLSignature
-
getKeyInfo
public KeyInfo getKeyInfo()
- Specified by:
getKeyInfoin interfaceXMLSignature
-
getSignedInfo
public SignedInfo getSignedInfo()
- Specified by:
getSignedInfoin interfaceXMLSignature
-
getObjects
public List<XMLObject> getObjects()
- Specified by:
getObjectsin interfaceXMLSignature
-
getSignatureValue
public XMLSignature.SignatureValue getSignatureValue()
- Specified by:
getSignatureValuein interfaceXMLSignature
-
getKeySelectorResult
public KeySelectorResult getKeySelectorResult()
- Specified by:
getKeySelectorResultin interfaceXMLSignature
-
marshal
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context) throws MarshalException
- Specified by:
marshalin classDOMStructure- Throws:
MarshalException
-
marshal
public void marshal(Node parent, Node nextSibling, String dsPrefix, DOMCryptoContext context) throws MarshalException
- Throws:
MarshalException
-
validate
public boolean validate(XMLValidateContext vc) throws XMLSignatureException
- Specified by:
validatein interfaceXMLSignature- Throws:
XMLSignatureException
-
sign
public void sign(XMLSignContext signContext) throws MarshalException, XMLSignatureException
- Specified by:
signin interfaceXMLSignature- Throws:
MarshalExceptionXMLSignatureException
-
-