Package com.atlassian.crowd.plugin.saml
Class Util
java.lang.Object
com.atlassian.crowd.plugin.saml.Util
This utility class is used across the various servlets that make up the
SAML-based Single Sign-On Reference Tool. It includes various helper methods
that are used for the SAML transactions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.dom4j.Document
createDom4jDoc
(String xmlString) static String
createID()
Create a randomly generated string conforming to the xsd:ID datatype.static String
getDateAndTime
(Date date) Gets the current date and time in the format specified by xsd:dateTime in UTC form, as described in SAML 2.0 core 1.2.2 This will also apply to Version 1.1static String
htmlEncode
(String s) Returns HTML encoded version of the specified String s.static org.dom4j.Element
static Element
toW3cDom
(org.dom4j.Element element)
-
Method Details
-
toW3cDom
public static Element toW3cDom(org.dom4j.Element element) throws ParserConfigurationException, IOException, SAXException -
toDom4j
-
createDom4jDoc
- Throws:
SAMLException
-
createID
Create a randomly generated string conforming to the xsd:ID datatype. containing 160 bits of non-cryptographically strong pseudo-randomness, as suggested by SAML 2.0 core 1.2.3. This will also apply to version 1.1- Returns:
- the randomly generated string
-
getDateAndTime
Gets the current date and time in the format specified by xsd:dateTime in UTC form, as described in SAML 2.0 core 1.2.2 This will also apply to Version 1.1- Parameters:
date
- date of SAML timestamp.- Returns:
- the date and time as a String
-
htmlEncode
Returns HTML encoded version of the specified String s.- Parameters:
s
- String to be HTML encoded- Returns:
- HTML encoded String
-