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

java.lang.Object
  extended by org.jcp.xml.dsig.internal.dom.DOMStructure
      extended by org.jcp.xml.dsig.internal.dom.DOMXMLSignature
All Implemented Interfaces:
XMLSignature, XMLStructure

public final class DOMXMLSignature
extends DOMStructure
implements XMLSignature

Disabled: no SafeJ information.

DOM-based implementation of XMLSignature.


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(org.w3c.dom.Element sigElem, XMLCryptoContext context, Provider provider)
          Creates a DOMXMLSignature from XML.
DOMXMLSignature(SignedInfo si, KeyInfo ki, List objs, String id, String signatureValueId)
          Creates a DOMXMLSignature from the specified components.
 
Method Summary
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 String getId()
          Returns the optional Id of this XMLSignature.
 KeyInfo getKeyInfo()
          Returns the key info of this XMLSignature.
 KeySelectorResult getKeySelectorResult()
          Returns the result of the KeySelector, if specified, after this XMLSignature has been signed or validated.
 List getObjects()
          Returns an unmodifiable list of XMLObjects contained in this XMLSignature.
 XMLSignature.SignatureValue getSignatureValue()
          Returns the signature value of this XMLSignature.
 SignedInfo getSignedInfo()
          Returns the signed info of this XMLSignature.
 void marshal(org.w3c.dom.Node parent, org.w3c.dom.Node nextSibling, String dsPrefix, DOMCryptoContext context)
           
 void marshal(org.w3c.dom.Node parent, String dsPrefix, DOMCryptoContext context)
           
 void sign(XMLSignContext signContext)
          Signs this XMLSignature.
 boolean validate(XMLValidateContext vc)
          Validates the signature according to the core validation processing rules.
 
Methods inherited from class org.jcp.xml.dsig.internal.dom.DOMStructure
isFeatureSupported
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, 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 objs,
                       String id,
                       String signatureValueId)
Class is disabled.

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(org.w3c.dom.Element sigElem,
                       XMLCryptoContext context,
                       Provider provider)
                throws MarshalException
Class is disabled.

Creates a DOMXMLSignature from XML.

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

getId

public String getId()
Class is disabled.

Description copied from interface: XMLSignature
Returns the optional Id of this XMLSignature.

Specified by:
getId in interface XMLSignature
Returns:
the Id (may be null if not specified)

getKeyInfo

public KeyInfo getKeyInfo()
Class is disabled.

Description copied from interface: XMLSignature
Returns the key info of this XMLSignature.

Specified by:
getKeyInfo in interface XMLSignature
Returns:
the key info (may be null if not specified)

getSignedInfo

public SignedInfo getSignedInfo()
Class is disabled.

Description copied from interface: XMLSignature
Returns the signed info of this XMLSignature.

Specified by:
getSignedInfo in interface XMLSignature
Returns:
the signed info (never null)

getObjects

public List getObjects()
Class is disabled.

Description copied from interface: XMLSignature
Returns an unmodifiable list of XMLObjects contained in this XMLSignature.

Specified by:
getObjects in interface XMLSignature
Returns:
an unmodifiable list of XMLObjects (may be empty but never null)

getSignatureValue

public XMLSignature.SignatureValue getSignatureValue()
Class is disabled.

Description copied from interface: XMLSignature
Returns the signature value of this XMLSignature.

Specified by:
getSignatureValue in interface XMLSignature
Returns:
the signature value

getKeySelectorResult

public KeySelectorResult getKeySelectorResult()
Class is disabled.

Description copied from interface: XMLSignature
Returns the result of the KeySelector, if specified, after this XMLSignature has been signed or validated.

Specified by:
getKeySelectorResult in interface XMLSignature
Returns:
the key selector result, or null if a key selector has not been specified or this XMLSignature has not been signed or validated

marshal

public void marshal(org.w3c.dom.Node parent,
                    String dsPrefix,
                    DOMCryptoContext context)
             throws MarshalException
Class is disabled.

Specified by:
marshal in class DOMStructure
Throws:
MarshalException

marshal

public void marshal(org.w3c.dom.Node parent,
                    org.w3c.dom.Node nextSibling,
                    String dsPrefix,
                    DOMCryptoContext context)
             throws MarshalException
Class is disabled.

Throws:
MarshalException

validate

public boolean validate(XMLValidateContext vc)
                 throws XMLSignatureException
Class is disabled.

Description copied from interface: XMLSignature
Validates the signature according to the core validation processing rules. This method validates the signature using the existing state, it does not unmarshal and reinitialize the contents of the XMLSignature using the location information specified in the context.

This method only validates the signature the first time it is invoked. On subsequent invocations, it returns a cached result.

Specified by:
validate in interface XMLSignature
Parameters:
vc - the validating context
Returns:
true if the signature passed core validation, otherwise false
Throws:
XMLSignatureException - if an unexpected error occurs during validation that prevented the validation operation from completing

sign

public void sign(XMLSignContext signContext)
          throws MarshalException,
                 XMLSignatureException
Class is disabled.

Description copied from interface: XMLSignature
Signs this XMLSignature.

If this method throws an exception, this XMLSignature and the signContext parameter will be left in the state that it was in prior to the invocation.

Specified by:
sign in interface XMLSignature
Parameters:
signContext - the signing context
Throws:
MarshalException - if an exception occurs while marshalling
XMLSignatureException - if an unexpected exception occurs while generating the signature

equals

public boolean equals(Object o)
Enabled. assumes no non-deterministic equals methods in libraries

Description copied from class: Object
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).

Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.

Overrides:
equals in class Object
Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.hashCode(), HashMap