org.apache.jcp.xml.dsig.internal.dom
Class DOMXMLSignature

java.lang.Object
  extended by org.apache.jcp.xml.dsig.internal.dom.BaseStructure
      extended by org.apache.jcp.xml.dsig.internal.dom.DOMStructure
          extended by 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
 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
DOMXMLSignature(Element sigElem, XMLCryptoContext context, Provider provider)
          Creates a DOMXMLSignature from XML.
DOMXMLSignature(SignedInfo si, KeyInfo ki, List<? extends XMLObject> objs, String id, String signatureValueId)
          Creates a DOMXMLSignature from the specified components.
 
Method Summary
 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 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 a DOMXMLSignature from the specified components.

Parameters:
si - the SignedInfo
ki - the KeyInfo, or null if not specified
objs - a list of XMLObjects or null if not specified. The list is copied to protect against subsequent modification.
id - an optional id (specify null to omit)
signatureValueId - an optional id (specify null to omit)
Throws:
NullPointerException - if si is null

DOMXMLSignature

public DOMXMLSignature(Element sigElem,
                       XMLCryptoContext context,
                       Provider provider)
                throws MarshalException
Creates a DOMXMLSignature from XML.

Parameters:
sigElem - Signature element
Throws:
MarshalException - if XMLSignature cannot be unmarshalled
Method Detail

getId

public String getId()
Specified by:
getId in interface XMLSignature

getKeyInfo

public KeyInfo getKeyInfo()
Specified by:
getKeyInfo in interface XMLSignature

getSignedInfo

public SignedInfo getSignedInfo()
Specified by:
getSignedInfo in interface XMLSignature

getObjects

public List<XMLObject> getObjects()
Specified by:
getObjects in interface XMLSignature

getSignatureValue

public XMLSignature.SignatureValue getSignatureValue()
Specified by:
getSignatureValue in interface XMLSignature

getKeySelectorResult

public KeySelectorResult getKeySelectorResult()
Specified by:
getKeySelectorResult in interface XMLSignature

marshal

public void marshal(XmlWriter xwriter,
                    String dsPrefix,
                    XMLCryptoContext context)
             throws MarshalException
Specified by:
marshal in class DOMStructure
Throws:
MarshalException

validate

public boolean validate(XMLValidateContext vc)
                 throws XMLSignatureException
Specified by:
validate in interface XMLSignature
Throws:
XMLSignatureException

sign

public void sign(XMLSignContext signContext)
          throws MarshalException,
                 XMLSignatureException
Specified by:
sign in interface XMLSignature
Throws:
MarshalException
XMLSignatureException

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2000–2014 The Apache Software Foundation. All rights reserved.