Class DOMXMLSignature
- java.lang.Object
-
- org.apache.jcp.xml.dsig.internal.dom.BaseStructure
-
- 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.- Author:
- Sean Mullan, Joyce Leung
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
DOMXMLSignature.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 aDOMXMLSignature
from the specified components.DOMXMLSignature(Element sigElem, XMLCryptoContext context, Provider provider)
Creates aDOMXMLSignature
from XML.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getId()
KeyInfo
getKeyInfo()
KeySelectorResult
getKeySelectorResult()
List<XMLObject>
getObjects()
XMLSignature.SignatureValue
getSignatureValue()
SignedInfo
getSignedInfo()
int
hashCode()
void
marshal(XmlWriter xwriter, String dsPrefix, XMLCryptoContext context)
void
marshal(Node parent, Node nextSibling, String dsPrefix, DOMCryptoContext context)
void
sign(XMLSignContext signContext)
boolean
validate(XMLValidateContext vc)
-
Methods inherited from class org.apache.jcp.xml.dsig.internal.dom.BaseStructure
isFeatureSupported, textOfNode
-
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 aDOMXMLSignature
from the specified components.- Parameters:
si
- theSignedInfo
ki
- theKeyInfo
, ornull
if not specifiedobjs
- a list ofXMLObject
s ornull
if not specified. The list is copied to protect against subsequent modification.id
- an optional id (specifynull
to omit)signatureValueId
- an optional id (specifynull
to omit)- Throws:
NullPointerException
- ifsi
isnull
-
DOMXMLSignature
public DOMXMLSignature(Element sigElem, XMLCryptoContext context, Provider provider) throws MarshalException
Creates aDOMXMLSignature
from XML.- Parameters:
sigElem
- Signature element- Throws:
MarshalException
- if XMLSignature cannot be unmarshalled
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getId
in interfaceXMLSignature
-
getKeyInfo
public KeyInfo getKeyInfo()
- Specified by:
getKeyInfo
in interfaceXMLSignature
-
getSignedInfo
public SignedInfo getSignedInfo()
- Specified by:
getSignedInfo
in interfaceXMLSignature
-
getObjects
public List<XMLObject> getObjects()
- Specified by:
getObjects
in interfaceXMLSignature
-
getSignatureValue
public XMLSignature.SignatureValue getSignatureValue()
- Specified by:
getSignatureValue
in interfaceXMLSignature
-
getKeySelectorResult
public KeySelectorResult getKeySelectorResult()
- Specified by:
getKeySelectorResult
in interfaceXMLSignature
-
marshal
public void marshal(Node parent, Node nextSibling, String dsPrefix, DOMCryptoContext context) throws MarshalException
- Throws:
MarshalException
-
marshal
public void marshal(XmlWriter xwriter, String dsPrefix, XMLCryptoContext context) throws MarshalException
- Specified by:
marshal
in classDOMStructure
- Throws:
MarshalException
-
validate
public boolean validate(XMLValidateContext vc) throws XMLSignatureException
- Specified by:
validate
in interfaceXMLSignature
- Throws:
XMLSignatureException
-
sign
public void sign(XMLSignContext signContext) throws MarshalException, XMLSignatureException
- Specified by:
sign
in interfaceXMLSignature
- Throws:
MarshalException
XMLSignatureException
-
-