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

B28177-01


oracle.security.xmlsec.wss.util
Class WSSUtils

java.lang.Object
  extended byoracle.security.xmlsec.wss.util.WSSUtils


public class WSSUtils
extends java.lang.Object

A set of utility methods.


Constructor Summary
WSSUtils()
           

 

Method Summary
static void addWsuIdToElement(java.lang.String id, org.w3c.dom.Element element)
          Adds a wsu:Id attribute to the given element.
static java.lang.String collectTextFromChild(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String namespaceURI, java.lang.String localName)
          Return the textual content for the text node.
static WSSecurityToken createSecurityToken(org.w3c.dom.Element element)
          Deprecated. Use WSSTokenUtils.createSecurityToken(Element)
static byte[] decodeBinary(java.lang.String encoded, java.lang.String encodingType)
          Decode the previously encoded bytes.
static java.lang.String encodeBinary(byte[] value, java.lang.String encodingType)
          Encode the bytes.
static oracle.security.xmlsec.util.XMLElement getChildElement(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String nsURI, java.lang.String localName)
          Get the child element.
static java.util.List getChildElements(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String nsURI, java.lang.String localName)
          Get the child element.
static oracle.security.xmlsec.util.XMLElement getInstance(org.w3c.dom.Element element, java.lang.String tag, java.lang.String ns)
          Creates a new instance of the implementation class for the given tag name, and uses it to wrap the Element.
static java.lang.String getTypeAttribute(org.w3c.dom.Element element, java.lang.String attrName)
          Get the Type attribute.
static org.w3c.dom.Element insertChildElementWithText(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String namespaceURI, java.lang.String localName, java.lang.String[] namespaceURIs, java.lang.String[] localNames, java.lang.String text, boolean replaceExisting)
          Convert the content string into a text org.w3c.dom.Node and append to the specified org.w3c.dom.Element.
static void prependChild(oracle.security.xmlsec.util.XMLNode parent, org.w3c.dom.Node newChild)
          Prepend the supplied node.
static void setChildElement(oracle.security.xmlsec.util.XMLElement contextElement, oracle.security.xmlsec.util.XMLElement element, java.lang.String[] nsURIs, java.lang.String[] localNames)
          Set the specified element as the child.
static void setTypeAttribute(org.w3c.dom.Element element, java.lang.String attrName, java.lang.String attrVal)
          Set the Type attribute.

 

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

 

Constructor Detail

WSSUtils

public WSSUtils()

Method Detail

encodeBinary

public static java.lang.String encodeBinary(byte[] value,
                                            java.lang.String encodingType)
Encode the bytes.
Parameters:
value - The bytes to encode.
encodingType - The URI of the encoding algorithm to use.
Returns:
The encoded content string.

decodeBinary

public static byte[] decodeBinary(java.lang.String encoded,
                                  java.lang.String encodingType)
Decode the previously encoded bytes.
Parameters:
encoded - The bytes to decode.
encodingType - The URI of the encoding algorithm used.
Returns:
The decoded content bytes.

setTypeAttribute

public static void setTypeAttribute(org.w3c.dom.Element element,
                                    java.lang.String attrName,
                                    java.lang.String attrVal)
Set the Type attribute.
Parameters:
element - The parent element of the attribute.
attrName - The name of the attribute.
attrVal - The attribute value.

getTypeAttribute

public static java.lang.String getTypeAttribute(org.w3c.dom.Element element,
                                                java.lang.String attrName)
Get the Type attribute.
Parameters:
element - The parent element of the attribute.
attrName - The name of the attribute.
Returns:
The attribute value string.

insertChildElementWithText

public static org.w3c.dom.Element insertChildElementWithText(oracle.security.xmlsec.util.XMLElement contextElement,
                                                             java.lang.String namespaceURI,
                                                             java.lang.String localName,
                                                             java.lang.String[] namespaceURIs,
                                                             java.lang.String[] localNames,
                                                             java.lang.String text,
                                                             boolean replaceExisting)
                                                      throws org.w3c.dom.DOMException
Convert the content string into a text org.w3c.dom.Node and append to the specified org.w3c.dom.Element.
Parameters:
contextElement - The parent element of the text node to be inserted.
namespaceURI - The namespace of the parent element.
localName -
namespaceURIs - The namespace list corresponding to the list of local names.
localNames - The local name list after which the text node will be inserted.
text - The content string.
replaceExisting - If true, any existing text Node will be replaced.
Returns:
The inserted text org.w3c.dom.Node .
Throws:
org.w3c.dom.DOMException

collectTextFromChild

public static java.lang.String collectTextFromChild(oracle.security.xmlsec.util.XMLElement contextElement,
                                                    java.lang.String namespaceURI,
                                                    java.lang.String localName)
Return the textual content for the text node.
Parameters:
contextElement - The element whose children will be searched for text Nodes.
namespaceURI - The namespace of the child Node.
localName - The tag name of the child Node.
Returns:
The textual content string.

setChildElement

public static void setChildElement(oracle.security.xmlsec.util.XMLElement contextElement,
                                   oracle.security.xmlsec.util.XMLElement element,
                                   java.lang.String[] nsURIs,
                                   java.lang.String[] localNames)
Set the specified element as the child.
Parameters:
contextElement - The parent element.
element - The element that will be added as the child.
nsURIs - The namespace URI list.
localNames - The local name list.

getChildElement

public static oracle.security.xmlsec.util.XMLElement getChildElement(oracle.security.xmlsec.util.XMLElement contextElement,
                                                                     java.lang.String nsURI,
                                                                     java.lang.String localName)
Get the child element.
Parameters:
contextElement - The element whose sub-tree will be searched.
nsURI - The namespace of the child.
localName - The local name of the child.
Returns:
The element.

getChildElements

public static java.util.List getChildElements(oracle.security.xmlsec.util.XMLElement contextElement,
                                              java.lang.String nsURI,
                                              java.lang.String localName)
Get the child element.
Parameters:
contextElement - The element whose sub-tree will be searched.
nsURI - The namespace of the child.
localName - The local name of the child.
Returns:
A list of elements.

getInstance

public static oracle.security.xmlsec.util.XMLElement getInstance(org.w3c.dom.Element element,
                                                                 java.lang.String tag,
                                                                 java.lang.String ns)
Creates a new instance of the implementation class for the given tag name, and uses it to wrap the Element. The namespace is taken from the given Element.
Parameters:
element - The element to be wrapped.
tag - The tag name to look for; if null, the tag will be taken from the element (or its xsi:type attribute).
ns - The namespace in which tag is defined; if null, the namespace will be taken from the element.
Returns:
An instance of a subclass of XMLElement, or null if a corresponding implementation class cannot be identified or instantiated.

prependChild

public static void prependChild(oracle.security.xmlsec.util.XMLNode parent,
                                org.w3c.dom.Node newChild)
Prepend the supplied node.
Parameters:
parent - The parent node.
newChild - The node to prepend.

createSecurityToken

public static WSSecurityToken createSecurityToken(org.w3c.dom.Element element)
                                           throws WSSException
Deprecated. Use WSSTokenUtils.createSecurityToken(Element)
Create a WSSecurityToken from the given org.w3c.dom.Element.
Parameters:
element - A security token that conforms to a supported security token schema.
Returns:
The created security token.
Throws:
WSSException

addWsuIdToElement

public static void addWsuIdToElement(java.lang.String id,
                                     org.w3c.dom.Element element)
Adds a wsu:Id attribute to the given element. If a wsu:Id attribute is already present on the element, its value is changed.
Parameters:
id -
element -

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

B28177-01


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