Oracle Security Developer Tools XKMS Java API Reference
10g (10.1.4.0.1)

B28176-01


oracle.security.xmlsec.xkms
Class Message

java.lang.Object
  extended byoracle.security.xmlsec.util.XMLNode
      extended byoracle.security.xmlsec.util.XMLElement
          extended byoracle.security.xmlsec.xkms.Message

Direct Known Subclasses:
Request, Result

public abstract class Message
extends oracle.security.xmlsec.util.XMLElement

Abstract base class for XKMS messages. Represents the xkms:MessageAbstractType element.


Field Summary

 

Fields inherited from class oracle.security.xmlsec.util.XMLNode
node, systemId

 

Constructor Summary
protected Message(org.w3c.dom.Document owner, java.lang.String tagName)
          Creates a new Message instance.
protected Message(org.w3c.dom.Document owner, java.lang.String tagName, java.lang.String systemId)
          Creates a new Message instance.
protected Message(org.w3c.dom.Element element)
          Creates a new Message instance.

 

Method Summary
 void addMessageExtension(org.w3c.dom.Element msgExtension)
          Creates a new xkms:MessageExtension element in this message's owner document, and appends it to the message element.
 void clearSignature()
          Removes any dsig:Signature element(s) from this XKMS message.
 java.lang.String getId()
          Returns the value of the Id attribute for this message, or null if none is set.
 org.w3c.dom.NodeList getMessageExtensions()
          Returns the xkms:MessageExtension for this message, or null if none is present.
 byte[] getNonce()
          Returns the Nonce attribute for this message, or null if nonce is set.
 OpaqueClientData getOpaqueClientData()
          Returns the xkms:OpaqueClientData for this message, or null if none is present.
 java.lang.String getService()
          Returns the value of the Service attribute for this message, or null if none is set.
 oracle.security.xmlsec.dsig.XSSignature getSignature()
          Returns the dsig:Signature for this message, or null if none is present.
protected  void insertChild(org.w3c.dom.Element e, java.lang.String[] tag, java.lang.String[] ns)
          Inserts a child element after any occurrences of the given elements.
protected  void insertChild(oracle.security.xmlsec.util.XMLElement e, java.lang.String[] tag, java.lang.String[] ns)
          Inserts a child element after any occurrences of the given elements.
protected  void removeChildren(java.lang.String tag, java.lang.String ns)
          Removes any child elements with the given tag name.
 void setId(java.lang.String id)
          Sets the Id attribute for this message.
 void setNonce(byte[] nonce)
          Sets the Nonce attribute for this message.
 void setOpaqueClientData(OpaqueClientData opdata)
          Creates a new xkms:OpaqueClientData element in this message's owner document, and appends it to the message element.
 void setService(java.lang.String service)
          Sets the Service attribute for this message.
 oracle.security.xmlsec.dsig.XSSignature setSignature(java.lang.String signatureMethod, java.lang.String c14nMethod, java.lang.String digestMethod)
          Creates a new dsig:Signature element in this message's owner document, and appends it to the message element.

 

Methods inherited from class oracle.security.xmlsec.util.XMLElement
addNSPrefixAttr, addNSPrefixAttr, addNSPrefixAttrDefault, addNSPrefixAttrDefault, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getChildElementsByTagName, getChildElementsByTagName, getChildElementsByTagNameNS, getChildElementsByTagNameNS, getDefaultNSPrefix, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setDefaultNSPrefix

 

Methods inherited from class oracle.security.xmlsec.util.XMLNode
appendChild, appendChild, appendTo, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNode, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSystemId, hasAttributes, hasChildNodes, insertBefore, insertBefore, isSupported, normalize, removeChild, removeChild, replaceChild, replaceChild, setNodeValue, setPrefix, setSystemId, toBytesXML, toStringXML

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

Message

protected Message(org.w3c.dom.Element element)
           throws org.w3c.dom.DOMException
Creates a new Message instance.
Parameters:
element - An Element node in the XML document.
Throws:
org.w3c.dom.DOMException

Message

protected Message(org.w3c.dom.Document owner,
                  java.lang.String tagName)
           throws org.w3c.dom.DOMException
Creates a new Message instance.
Parameters:
owner - The owner document of the new Message.
tagName - The name of the element to be created; e.g. "LocateRequest" if this Message is to be a X-KISS LocateRequest mesage.
Throws:
org.w3c.dom.DOMException

Message

protected Message(org.w3c.dom.Document owner,
                  java.lang.String tagName,
                  java.lang.String systemId)
           throws org.w3c.dom.DOMException
Creates a new Message instance.
Parameters:
owner - The owner document of the new Message..
tagName - The name of the element to be created; e.g. "LocateRequest" if this Message is to be a X-KISS LocateRequest mesage.
systemId - The URI string system ID for the Message.
Throws:
org.w3c.dom.DOMException

Method Detail

setId

public void setId(java.lang.String id)
           throws org.w3c.dom.DOMException
Sets the Id attribute for this message.
Parameters:
id - A unique XKMS message identifier.
Throws:
org.w3c.dom.DOMException

getId

public java.lang.String getId()
Returns the value of the Id attribute for this message, or null if none is set.
Returns:
A unique XKMS message identifier.

setService

public void setService(java.lang.String service)
                throws org.w3c.dom.DOMException
Sets the Service attribute for this message.
Parameters:
service - The URI of the service to which the message is addressed.
Throws:
org.w3c.dom.DOMException

getService

public java.lang.String getService()
Returns the value of the Service attribute for this message, or null if none is set.
Returns:
The URI of the service to which the message is addressed.

setNonce

public void setNonce(byte[] nonce)
              throws org.w3c.dom.DOMException
Sets the Nonce attribute for this message.

The nonce bytes will be Base-64 encoded prior to setting the attribute value.

Parameters:
nonce - The nonce bytes.
Throws:
org.w3c.dom.DOMException

getNonce

public byte[] getNonce()
Returns the Nonce attribute for this message, or null if nonce is set.

The Base-64 encoded nonce bytes will be decoded.

Returns:
The nonce bytes.

setSignature

public oracle.security.xmlsec.dsig.XSSignature setSignature(java.lang.String signatureMethod,
                                                            java.lang.String c14nMethod,
                                                            java.lang.String digestMethod)
                                                     throws org.w3c.dom.DOMException
Creates a new dsig:Signature element in this message's owner document, and appends it to the message element. The created dsig:Signature includes a dsig:Reference to the enclosing document, and uses a Enveloped Signature transform to select this message element and its children.

If the Id attribute of the XKMS Message is not set prior to calling this method, a XPath Filter Transform is added to the dsig:Reference (which points to the enclosing document i.e. URI="") to select this message element and its children for signing.

It may be necessary to add a verification key or retrieval data to the signature using the XSSignature.createKeyInfo and XSSignature.setKeyInfo methods.

Once the signature and the message are complete, use one of the XSSignature.sign methods to compute the signature value.

Parameters:
signatureMethod - The URI identifying the signature algorithm to be used to sign the SignedInfo structure.
c14nMethod - The URI identifying the canonicalization method to be applied to both the SignedInfo structure and the Reference target.
digestMethod - The URI identifying the digest algorithm to be used for the dsig:Reference to this message element.
Returns:
A reference to a XSSignature instance enclosing this message's newly created dsig:Signature child element.
Throws:
org.w3c.dom.DOMException

getSignature

public oracle.security.xmlsec.dsig.XSSignature getSignature()
Returns the dsig:Signature for this message, or null if none is present.
Returns:
A XSSignature instance enclosing this message's dsig:Signature element.

addMessageExtension

public void addMessageExtension(org.w3c.dom.Element msgExtension)
                         throws org.w3c.dom.DOMException
Creates a new xkms:MessageExtension element in this message's owner document, and appends it to the message element.
Parameters:
msgExtension - The element to be wrapped in a xkms:MessageExtension element.
Returns:
A reference to a xkms:MessageExtension instance enclosing this message's newly created xkms:MessageExtension child element.
Throws:
org.w3c.dom.DOMException

getMessageExtensions

public org.w3c.dom.NodeList getMessageExtensions()
Returns the xkms:MessageExtension for this message, or null if none is present.
Returns:
A NodeList instance enclosing this message's xkms:MessageExtension elements or null.

setOpaqueClientData

public void setOpaqueClientData(OpaqueClientData opdata)
                         throws org.w3c.dom.DOMException
Creates a new xkms:OpaqueClientData element in this message's owner document, and appends it to the message element.

Once the signature and the message are complete, use one of the XSSignature.sign methods to compute the signature value.

Parameters:
opdata - The xkms:OpaqueClientData element.
Returns:
A reference to a xkms:OpaqueClientData instance enclosing this message's newly created xkms:OpaqueClientData child element.
Throws:
org.w3c.dom.DOMException

getOpaqueClientData

public OpaqueClientData getOpaqueClientData()
Returns the xkms:OpaqueClientData for this message, or null if none is present.
Returns:
A OpaqueClientData instance enclosing this message's xkms:OpaqueData elements or null.

clearSignature

public void clearSignature()
Removes any dsig:Signature element(s) from this XKMS message. This method should be invoked by subclasses in any method that modifies the data over which the signature is to be calculated.

insertChild

protected void insertChild(oracle.security.xmlsec.util.XMLElement e,
                           java.lang.String[] tag,
                           java.lang.String[] ns)
                    throws org.w3c.dom.DOMException
Inserts a child element after any occurrences of the given elements.
Parameters:
e - The child element to insert.
tag - An array of element tag names after any occurrence of which the child element is to be inserted. The tags must be presented in the order in which they appear in the parent element's schema.
ns - An array of namespace URIs corresponding to the tag names in the tag array.
Throws:
org.w3c.dom.DOMException

insertChild

protected void insertChild(org.w3c.dom.Element e,
                           java.lang.String[] tag,
                           java.lang.String[] ns)
                    throws org.w3c.dom.DOMException
Inserts a child element after any occurrences of the given elements.
Parameters:
e - The child element to insert.
tag - An array of element tag names after any occurrence of which the child element is to be inserted. The tags must be presented in the order in which they appear in the parent element's schema.
ns - An array of namespace URIs corresponding to the tag names in the tag array.
Throws:
org.w3c.dom.DOMException

removeChildren

protected void removeChildren(java.lang.String tag,
                              java.lang.String ns)
Removes any child elements with the given tag name.
Parameters:
tag - The tag name of the child element(s) to remove.
ns - The namespace URI of the element(s) to remove.

Oracle Security Developer Tools XKMS Java API Reference
10g (10.1.4.0.1)

B28176-01


Copyright © 2005 ,2006 , Oracle. All rights reserved.