public class WSSUtils
extends java.lang.Object
| Constructor and Description | 
|---|
WSSUtils()  | 
| Modifier and Type | Method and Description | 
|---|---|
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(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 XMLElement | 
getChildElement(XMLElement contextElement, java.lang.String nsURI, java.lang.String localName)
Get the child element. 
 | 
static java.util.List | 
getChildElements(XMLElement contextElement, java.lang.String nsURI, java.lang.String localName)
Get the child element. 
 | 
static 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(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(XMLNode parent, org.w3c.dom.Node newChild)
Prepend the supplied node. 
 | 
static org.w3c.dom.Element | 
prependChild2(XMLNode parent, org.w3c.dom.Node newChild)
Prepend the supplied node. 
 | 
static java.lang.Object | 
resolveReference(ObjectReference ref, javax.xml.soap.SOAPMessage msg, java.util.Map STRToST)
Find out what the reference is pointing to by performing all transforms, except the canonicalization ones. 
 | 
static java.util.List | 
resolveReferences(XSSignature sig, javax.xml.soap.SOAPMessage msg, java.util.Map STRToST)
Calls @link #resolveReference(ObjectReference, SOAPMessage, Map) for each references in a signature and puts them into a list 
 | 
static void | 
setChildElement(XMLElement contextElement, 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. 
 | 
public static java.lang.String encodeBinary(byte[] value,
                                            java.lang.String encodingType)
value - The bytes to encode.encodingType - The URI of the encoding algorithm to use.
public static byte[] decodeBinary(java.lang.String encoded,
                                  java.lang.String encodingType)
encoded - The bytes to decode.encodingType - The URI of the encoding algorithm used.
public static void setTypeAttribute(org.w3c.dom.Element element,
                                    java.lang.String attrName,
                                    java.lang.String attrVal)
element - The parent element of the attribute.attrName - The name of the attribute.attrVal - The attribute value.
public static java.lang.String getTypeAttribute(org.w3c.dom.Element element,
                                                java.lang.String attrName)
element - The parent element of the attribute.attrName - The name of the attribute.public static org.w3c.dom.Element insertChildElementWithText(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
org.w3c.dom.Node and append to the specified org.w3c.dom.Element.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.org.w3c.dom.Node .org.w3c.dom.DOMExceptionpublic static java.lang.String collectTextFromChild(XMLElement contextElement, java.lang.String namespaceURI, java.lang.String localName)
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.public static void setChildElement(XMLElement contextElement, XMLElement element, java.lang.String[] nsURIs, java.lang.String[] localNames)
contextElement - The parent element.element - The element that will be added as the child.nsURIs - The namespace URI list.localNames - The local name list.public static XMLElement getChildElement(XMLElement contextElement, java.lang.String nsURI, java.lang.String localName)
contextElement - The element whose sub-tree will be searched.nsURI - The namespace of the child.localName - The local name of the child.public static java.util.List getChildElements(XMLElement contextElement, java.lang.String nsURI, java.lang.String localName)
contextElement - The element whose sub-tree will be searched.nsURI - The namespace of the child.localName - The local name of the child.public static XMLElement getInstance(org.w3c.dom.Element element, java.lang.String tag, java.lang.String ns)
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.XMLElement, or null if a corresponding implementation class cannot be identified or instantiated.public static void prependChild(XMLNode parent, org.w3c.dom.Node newChild)
parent - The parent node.newChild - The node to prepend.public static org.w3c.dom.Element prependChild2(XMLNode parent, org.w3c.dom.Node newChild)
parent - The parent node.newChild - The node to prepend.public static WSSecurityToken createSecurityToken(org.w3c.dom.Element element) throws WSSException
WSSecurityToken from the given org.w3c.dom.Element.element - A security token that conforms to a supported security token schema.WSSException
public static void addWsuIdToElement(java.lang.String id,
                                     org.w3c.dom.Element element)
id -element -public static java.lang.Object resolveReference(ObjectReference ref, javax.xml.soap.SOAPMessage msg, java.util.Map STRToST) throws ReferenceException, oracle.security.crypto.core.AlgorithmIdentifierException, TransformationException
Transforms
ref - the reference to be resolvedmsg - the soap messages - only used for resolving cid: referencesSTRToST - if a non null Map is passed in and if there is an STRTransform this reference's list of transforms, then the STRToST will be filled up a mapping of WSSecurityTokenReference objects to corresponding WSSecurityToken objects. The WSSecurityToken objects are obtained by following the KeyRetrieversReferenceException - if a reference cannot be resolved, of if the transform has invalid syntax, or if there isoracle.security.crypto.core.AlgorithmIdentifierException - if there is a unrecognized transformTransformationExceptionpublic static java.util.List resolveReferences(XSSignature sig, javax.xml.soap.SOAPMessage msg, java.util.Map STRToST) throws ReferenceException, oracle.security.crypto.core.AlgorithmIdentifierException, TransformationException
sig -msg -STRToST -ReferenceExceptionoracle.security.crypto.core.AlgorithmIdentifierExceptionTransformationException