Skip navigation links

Oracle Fusion Middleware SAML 2.0 Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10676-05


oracle.security.xmlsec.saml2.util
Class SAML2Utils

java.lang.Object
  extended by oracle.security.xmlsec.saml2.util.SAML2Utils


public class SAML2Utils
extends java.lang.Object

For internal use only


Constructor Summary
SAML2Utils()
           

 

Method Summary
static void appendChildElementWithNode(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String namespaceURI, java.lang.String localName, org.w3c.dom.Node node)
          This method creates a new element with the given local name and namespace URI containing the given text.
static void appendChildElementWithText(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String namespaceURI, java.lang.String localName, java.lang.String text)
          This method creates a new element with the given local name and namespace URI containing the given text.
static java.lang.String collectTextFromChild(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String namespaceURI, java.lang.String localName)
          This methods obtains the first child element of the given context element with the given local name and namespace URI.
static java.util.List collectTextFromChildren(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String namespaceURI, java.lang.String localName)
          This methods obtains all the child elements of the given context element with the given local name and namespace URI.
static oracle.security.xmlsec.dsig.XSSignature createSignature(oracle.security.xmlsec.util.XMLElement tbs, java.lang.String tbsID, java.lang.String signatureMethod, java.lang.String c14nMethod, java.lang.String digestMethod)
          Creates a ds:Signature element in the given element's document, with the given element as the target of the signature, but does not append the ds:Signature element to any node in the document.
static oracle.security.xmlsec.util.XMLElement getChildElement(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String nsURI, java.lang.String localName)
          Returns the first instance of a child element with the given namespace URI and local name found within the given context element, or null if no such element exists.
static java.util.List getChildElements(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String nsURI, java.lang.String localName)
          Returns a list containing all the child elements with the given namespace URI and local name found within the given context element.
static java.util.List getChildren(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String nsURI, java.lang.String localName)
          Returns a list containing all the child elements with the given namespace URI and local name found within the given context 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 void insertChild(oracle.security.xmlsec.util.XMLElement contextElement, oracle.security.xmlsec.util.XMLElement element, java.lang.String nsURI, java.lang.String[] tagList)
          The element is inserted as a child element of the given context element in the correct position relative to the given child element types.
static void insertChildElementWithNode(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String namespaceURI, java.lang.String localName, java.lang.String[] namespaceURIs, java.lang.String[] localNames, org.w3c.dom.Node node, boolean replaceExisting)
          This method creates a new element with the given local name and namespace URI containing the given text.
static void 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)
          This method creates a new element with the given local name and namespace URI containing the given text.
static void setChildElement(oracle.security.xmlsec.util.XMLElement contextElement, oracle.security.xmlsec.util.XMLElement element, java.lang.String[] nsURIs, java.lang.String[] localNames)
          Inserts the given element as a child element to the given context element in the proper position, removing any existing child element with the same local name and namespace URI as the element to be inserted.

 

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

 

Constructor Detail

SAML2Utils

public SAML2Utils()

Method Detail

collectTextFromChild

public static java.lang.String collectTextFromChild(oracle.security.xmlsec.util.XMLElement contextElement,
                                                    java.lang.String namespaceURI,
                                                    java.lang.String localName)
This methods obtains the first child element of the given context element with the given local name and namespace URI. This method then collects all of the child element's child text nodes and returns them as a single String.

This method will return null if the child element is not found or the child element has no child text nodes.

Parameters:
contextElement - The context element.
namespaceURI - The child element's namespaceURI.
localName - The child element's local name.
Returns:
The concatenation of all the child element's child text nodes, or null if the child element is not found.

collectTextFromChildren

public static java.util.List collectTextFromChildren(oracle.security.xmlsec.util.XMLElement contextElement,
                                                     java.lang.String namespaceURI,
                                                     java.lang.String localName)
This methods obtains all the child elements of the given context element with the given local name and namespace URI. For each child element, this method collects all of the child element's child text nodes and concatenates them into a single String. This method returns a list of String objects, one for each child element.

This method will return null if no child elements are found with the given local name and namespace URI.

Parameters:
contextElement - The context element.
namespaceURI - The child elements' namespaceURI.
localName - The child elements' local name.
Returns:
A list of String objects, where each String represents the concatenation of all of a child element's child text nodes.

insertChildElementWithText

public static void 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
This method creates a new element with the given local name and namespace URI containing the given text. The element is inserted as a child element of the given context element in the correct position relative to the given child element types.
Parameters:
contextElement - The contex element.
namespaceURI - The namespace URI of the element to be inserted.
localName - The local name of the element to be inserted.
namespaceURIs - The ordered set of namespace URIs for valid child elements for the given context element.
localNames - The ordered set of local names for valid child elements for the given context element.
text - The text to be inserted into the child element.
replaceExisting - If true, existing child elements with the given local name and namespace URI will be removed from the context element before the new child element is inserted.
Throws:
org.w3c.dom.DOMException

insertChildElementWithNode

public static void insertChildElementWithNode(oracle.security.xmlsec.util.XMLElement contextElement,
                                              java.lang.String namespaceURI,
                                              java.lang.String localName,
                                              java.lang.String[] namespaceURIs,
                                              java.lang.String[] localNames,
                                              org.w3c.dom.Node node,
                                              boolean replaceExisting)
                                       throws org.w3c.dom.DOMException
This method creates a new element with the given local name and namespace URI containing the given text. The element is inserted as a child element of the given context element in the correct position relative to the given child element types.
Parameters:
contextElement - The contex element.
namespaceURI - The namespace URI of the element to be inserted.
localName - The local name of the element to be inserted.
namespaceURIs - The ordered set of namespace URIs for valid child elements for the given context element.
localNames - The ordered set of local names for valid child elements for the given context element.
node - The Node to be inserted.
replaceExisting - If true, existing child elements with the given local name and namespace URI will be removed from the context element before the new child element is inserted.
Throws:
org.w3c.dom.DOMException

appendChildElementWithText

public static void appendChildElementWithText(oracle.security.xmlsec.util.XMLElement contextElement,
                                              java.lang.String namespaceURI,
                                              java.lang.String localName,
                                              java.lang.String text)
                                       throws org.w3c.dom.DOMException
This method creates a new element with the given local name and namespace URI containing the given text. The element is appended as a child element of the given context element.
Parameters:
contextElement - The contex element.
namespaceURI - The namespace URI of the element to be inserted.
localName - The local name of the element to be inserted.
text - The text to be inserted into the child element.
Throws:
org.w3c.dom.DOMException

appendChildElementWithNode

public static void appendChildElementWithNode(oracle.security.xmlsec.util.XMLElement contextElement,
                                              java.lang.String namespaceURI,
                                              java.lang.String localName,
                                              org.w3c.dom.Node node)
                                       throws org.w3c.dom.DOMException
This method creates a new element with the given local name and namespace URI containing the given text. The element is appended as a child element of the given context element.
Parameters:
contextElement - The contex element.
namespaceURI - The namespace URI of the element to be inserted.
localName - The local name of the element to be inserted.
node - The Node to be inserted.
Throws:
org.w3c.dom.DOMException

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)
Inserts the given element as a child element to the given context element in the proper position, removing any existing child element with the same local name and namespace URI as the element to be inserted.
Parameters:
contextElement - The context element.
element - The element to be inserted.
nsURIs - The ordered set of namespace URIs for valid child elements for the given context element.
localNames - The ordered set of local names for valid child elements for the given context element.

getChildElement

public static oracle.security.xmlsec.util.XMLElement getChildElement(oracle.security.xmlsec.util.XMLElement contextElement,
                                                                     java.lang.String nsURI,
                                                                     java.lang.String localName)
Returns the first instance of a child element with the given namespace URI and local name found within the given context element, or null if no such element exists.
Parameters:
contextElement - The context element.
nsURI - The child element's namespace URI.
localName - The child element's local name.

getChildElements

public static java.util.List getChildElements(oracle.security.xmlsec.util.XMLElement contextElement,
                                              java.lang.String nsURI,
                                              java.lang.String localName)
Returns a list containing all the child elements with the given namespace URI and local name found within the given context element.
Parameters:
contextElement - The context element.
nsURI - The child elements' namespace URI.
localName - The child elements' local name.

getChildren

public static java.util.List getChildren(oracle.security.xmlsec.util.XMLElement contextElement,
                                         java.lang.String nsURI,
                                         java.lang.String localName)
Returns a list containing all the child elements with the given namespace URI and local name found within the given context element.

This method will not call SAML2Utils.getInstance.

Parameters:
contextElement - The context element.
nsURI - The child elements' namespace URI.
localName - The child elements' local name.

insertChild

public static void insertChild(oracle.security.xmlsec.util.XMLElement contextElement,
                               oracle.security.xmlsec.util.XMLElement element,
                               java.lang.String nsURI,
                               java.lang.String[] tagList)
The element is inserted as a child element of the given context element in the correct position relative to the given child element types.
Parameters:
contextElement - The context element.
element - The element to insert.
nsURI - The namespace URI for valid child elements for the given context element.
tagList - The ordered set of local names for valid child elements for the given context element.

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. Note: saml:Attribute supporting multiple attribute profiles will return incorrect results.
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.

createSignature

public static oracle.security.xmlsec.dsig.XSSignature createSignature(oracle.security.xmlsec.util.XMLElement tbs,
                                                                      java.lang.String tbsID,
                                                                      java.lang.String signatureMethod,
                                                                      java.lang.String c14nMethod,
                                                                      java.lang.String digestMethod)
Creates a ds:Signature element in the given element's document, with the given element as the target of the signature, but does not append the ds:Signature element to any node in the document.
Parameters:
tbs - The element to be signed.
tbsID - The value of the attribute of type xs:ID of the element to be signed. Optional - may be null, in which case an XPath Filter Transform is added to the ds:Signature to locate the target element with the assumption that the target element is the parent of the ds:Signature element.
signatureMethod - The URI of the signature algorithm to be used.
c14nMethod - The URI of the XML canonicalization algorithm to be used.
digestMethod - The URI of the reference digest algorithm to be used.
Returns:
A new XSSignature object.

Skip navigation links

Oracle Fusion Middleware SAML 2.0 Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10676-05


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