Class Util
- java.lang.Object
-
- org.wso2.carbon.hostobjects.sso.internal.util.Util
-
public class Util extends Object
-
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.opensaml.xml.XMLObjectbuildXMLObject(QName objectQName)static StringcreateID()Generates a unique Id for Authentication Requestsstatic Stringdecode(String encodedStr)Decoding and deflating the encoded AuthReqstatic voiddoBootstrap()This method is used to initialize the OpenSAML2 library.static Stringencode(String xmlString)Compressing and Encoding the responsestatic StringgetDomainName(org.opensaml.xml.XMLObject samlObject)static org.wso2.carbon.user.core.service.RealmServicegetRealmService()static Stringmarshall(org.opensaml.xml.XMLObject xmlObject)Serializing a SAML2 object into a Stringstatic voidsetRealmService(org.wso2.carbon.user.core.service.RealmService realmService)static org.opensaml.xml.XMLObjectunmarshall(String authReqStr)Constructing the XMLObject Object from a Stringstatic booleanvalidateSignature(org.opensaml.saml2.core.Response resp, String keyStoreName, String keyStorePassword, String alias, int tenantId, String tenantDomain)This method validates the signature of the SAML Response.
-
-
-
Method Detail
-
doBootstrap
public static void doBootstrap()
This method is used to initialize the OpenSAML2 library. It calls the bootstrap method, if it is not initialized yet.
-
buildXMLObject
public static org.opensaml.xml.XMLObject buildXMLObject(QName objectQName) throws Exception
- Throws:
Exception
-
createID
public static String createID()
Generates a unique Id for Authentication Requests- Returns:
- generated unique ID
-
unmarshall
public static org.opensaml.xml.XMLObject unmarshall(String authReqStr) throws Exception
Constructing the XMLObject Object from a String- Parameters:
authReqStr-- Returns:
- Corresponding XMLObject which is a SAML2 object
- Throws:
Exception
-
marshall
public static String marshall(org.opensaml.xml.XMLObject xmlObject) throws Exception
Serializing a SAML2 object into a String- Parameters:
xmlObject- object that needs to serialized.- Returns:
- serialized object
- Throws:
Exception
-
encode
public static String encode(String xmlString) throws Exception
Compressing and Encoding the response- Parameters:
xmlString- String to be encoded- Returns:
- compressed and encoded String
- Throws:
Exception
-
decode
public static String decode(String encodedStr) throws Exception
Decoding and deflating the encoded AuthReq- Parameters:
encodedStr- encoded AuthReq- Returns:
- decoded AuthReq
- Throws:
Exception
-
validateSignature
public static boolean validateSignature(org.opensaml.saml2.core.Response resp, String keyStoreName, String keyStorePassword, String alias, int tenantId, String tenantDomain)This method validates the signature of the SAML Response.- Parameters:
resp- SAML Response- Returns:
- true, if signature is valid.
-
getDomainName
public static String getDomainName(org.opensaml.xml.XMLObject samlObject)
-
setRealmService
public static void setRealmService(org.wso2.carbon.user.core.service.RealmService realmService)
-
getRealmService
public static org.wso2.carbon.user.core.service.RealmService getRealmService()
-
-