public class SAML2Utils
extends java.lang.Object
Constructor and Description |
---|
SAML2Utils() |
Modifier and Type | Method and Description |
---|---|
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)
Internal use only:
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 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.
|
public static java.lang.String collectTextFromChild(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String namespaceURI, java.lang.String localName)
This method will return null
if the child element is not found
or the child element has no child text nodes.
contextElement
- The context element.namespaceURI
- The child element's namespaceURI.localName
- The child element's local name.null
if the child element is not found.public static java.util.List collectTextFromChildren(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String namespaceURI, java.lang.String localName)
This method will return null
if no child elements are found
with the given local name and namespace URI.
contextElement
- The context element.namespaceURI
- The child elements' namespaceURI.localName
- The child elements' local name.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
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.org.w3c.dom.DOMException
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
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.org.w3c.dom.DOMException
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
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.org.w3c.dom.DOMException
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
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.org.w3c.dom.DOMException
public static void setChildElement(oracle.security.xmlsec.util.XMLElement contextElement, oracle.security.xmlsec.util.XMLElement element, java.lang.String[] nsURIs, java.lang.String[] localNames)
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.public static oracle.security.xmlsec.util.XMLElement getChildElement(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String nsURI, java.lang.String localName)
null
if no
such element exists.contextElement
- The context element.nsURI
- The child element's namespace URI.localName
- The child element's local name.public static java.util.List getChildElements(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String nsURI, java.lang.String localName)
contextElement
- The context element.nsURI
- The child elements' namespace URI.localName
- The child elements' local name.public static java.util.List getChildren(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String nsURI, java.lang.String localName)
This method will not call SAML2Utils.getInstance.
contextElement
- The context element.nsURI
- The child elements' namespace URI.localName
- The child elements' local name.public static void insertChild(oracle.security.xmlsec.util.XMLElement contextElement, oracle.security.xmlsec.util.XMLElement element, java.lang.String nsURI, java.lang.String[] tagList)
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.public static oracle.security.xmlsec.util.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 XSSignature createSignature(oracle.security.xmlsec.util.XMLElement tbs, java.lang.String tbsID, java.lang.String signatureMethod, java.lang.String c14nMethod, java.lang.String digestMethod)
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.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.XSSignature
object.