APIdia Launch Partner
Top Description Fields Constructors Methods
javax.xml.crypto.dsig.dom

public Class DOMSignContext

extends DOMCryptoContext
implements XMLSignContext
Class Inheritance
All Implemented Interfaces
javax.xml.crypto.dsig.XMLSignContext, javax.xml.crypto.XMLCryptoContext
Imports
javax.xml.crypto.KeySelector, javax.xml.crypto.dom.DOMCryptoContext, javax.xml.crypto.dsig.XMLSignContext, .XMLSignature, java.security.Key, .PrivateKey, .Provider, .SecureRandom, .Signature, org.w3c.dom.Node

A DOM-specific XMLSignContext. This class contains additional methods to specify the location in a DOM tree where an XMLSignature object is to be marshalled when generating the signature.

Note that DOMSignContext instances can contain information and state specific to the XML signature structure it is used with. The results are unpredictable if a DOMSignContext is used with different signature structures (for example, you should not use the same DOMSignContext instance to sign two different XMLSignature objects).

Implementation Note

The JDK implementation supports the following properties that can be set using the setProperty method.

Authors
Sean Mullan, JSR 105 Expert Group
Since
1.6

Field Summary

Modifier and TypeField and Description
private Node
private Node

Constructor Summary

AccessConstructor and Description
public
DOMSignContext(Key
the signing key
signingKey
,
Node
the parent node
parent
)

Creates a DOMSignContext with the specified signing key and parent node.

public
DOMSignContext(Key
the signing key
signingKey
,
Node
the parent node
parent
,
Node
the next sibling node
nextSibling
)

Creates a DOMSignContext with the specified signing key, parent and next sibling nodes.

public
DOMSignContext(KeySelector
the key selector
ks
,
Node
the parent node
parent
)

Creates a DOMSignContext with the specified key selector and parent node.

public
DOMSignContext(KeySelector
the key selector
ks
,
Node
the parent node
parent
,
Node
the next sibling node
nextSibling
)

Creates a DOMSignContext with the specified key selector, parent and next sibling nodes.

Method Summary

Modifier and TypeMethod and Description
public Node

Returns:

the nextSibling node, or null if not specified.
getNextSibling
()

Returns the nextSibling node.

public Node

Returns:

the parent node (never null)
getParent
()

Returns the parent node.

public void
setNextSibling(Node
the next sibling node. The marshalled XMLSignature will be inserted immediately before this node. Specify null to remove the current setting.
nextSibling
)

Sets the next sibling node.

public void
setParent(Node
the parent node. The marshalled XMLSignature will be added as a child element of this node.
parent
)

Sets the parent node.

Inherited from javax.xml.crypto.dom.DOMCryptoContext:
getgetBaseURIgetDefaultNamespacePrefixgetElementByIdgetKeySelectorgetNamespacePrefixgetPropertygetURIDereferenceriteratorputputNamespacePrefixsetBaseURIsetDefaultNamespacePrefixsetIdAttributeNSsetKeySelectorsetPropertysetURIDereferencer

Field Detail

nextSiblingback to summary
private Node nextSibling
parentback to summary
private Node parent

Constructor Detail

DOMSignContextback to summary
public DOMSignContext(Key signingKey, Node parent)

Creates a DOMSignContext with the specified signing key and parent node. The signing key is stored in a singleton KeySelector that is returned by the getKeySelector method. The marshalled XMLSignature will be added as the last child element of the specified parent node unless a next sibling node is specified by invoking the setNextSibling method.

Parameters
signingKey:Key

the signing key

parent:Node

the parent node

Exceptions
NullPointerException:
if signingKey or parent is null
DOMSignContextback to summary
public DOMSignContext(Key signingKey, Node parent, Node nextSibling)

Creates a DOMSignContext with the specified signing key, parent and next sibling nodes. The signing key is stored in a singleton KeySelector that is returned by the getKeySelector method. The marshalled XMLSignature will be inserted as a child element of the specified parent node and immediately before the specified next sibling node.

Parameters
signingKey:Key

the signing key

parent:Node

the parent node

nextSibling:Node

the next sibling node

Exceptions
NullPointerException:
if signingKey, parent or nextSibling is null
DOMSignContextback to summary
public DOMSignContext(KeySelector ks, Node parent)

Creates a DOMSignContext with the specified key selector and parent node. The marshalled XMLSignature will be added as the last child element of the specified parent node unless a next sibling node is specified by invoking the setNextSibling method.

Parameters
ks:KeySelector

the key selector

parent:Node

the parent node

Exceptions
NullPointerException:
if ks or parent is null
DOMSignContextback to summary
public DOMSignContext(KeySelector ks, Node parent, Node nextSibling)

Creates a DOMSignContext with the specified key selector, parent and next sibling nodes. The marshalled XMLSignature will be inserted as a child element of the specified parent node and immediately before the specified next sibling node.

Parameters
ks:KeySelector

the key selector

parent:Node

the parent node

nextSibling:Node

the next sibling node

Exceptions
NullPointerException:
if ks, parent or nextSibling is null

Method Detail

getNextSiblingback to summary
public Node getNextSibling()

Returns the nextSibling node.

Returns:Node

the nextSibling node, or null if not specified.

See Also
setNextSibling(Node)
getParentback to summary
public Node getParent()

Returns the parent node.

Returns:Node

the parent node (never null)

See Also
setParent(Node)
setNextSiblingback to summary
public void setNextSibling(Node nextSibling)

Sets the next sibling node.

Parameters
nextSibling:Node

the next sibling node. The marshalled XMLSignature will be inserted immediately before this node. Specify null to remove the current setting.

See Also
getNextSibling
setParentback to summary
public void setParent(Node parent)

Sets the parent node.

Parameters
parent:Node

the parent node. The marshalled XMLSignature will be added as a child element of this node.

Exceptions
NullPointerException:
if parent is null
See Also
getParent