Class Util
java.lang.Object
org.wso2.carbon.hostobjects.sso.internal.util.Util
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.opensaml.xml.XMLObjectbuildXMLObject(QName objectQName) static StringcreateID()Generates a unique Id for Authentication Requestsstatic StringDecoding and deflating the encoded AuthReqstatic voidThis method is used to initialize the OpenSAML2 library.static StringCompressing and Encoding the responsestatic StringgetDomainName(org.opensaml.xml.XMLObject samlObject) static org.wso2.carbon.user.core.service.RealmServicestatic 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.
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
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
- Throws:
Exception
-
createID
Generates a unique Id for Authentication Requests- Returns:
- generated unique ID
-
unmarshall
Constructing the XMLObject Object from a String- Parameters:
authReqStr-- Returns:
- Corresponding XMLObject which is a SAML2 object
- Throws:
Exception
-
marshall
Serializing a SAML2 object into a String- Parameters:
xmlObject- object that needs to serialized.- Returns:
- serialized object
- Throws:
Exception
-
encode
Compressing and Encoding the response- Parameters:
xmlString- String to be encoded- Returns:
- compressed and encoded String
- Throws:
Exception
-
decode
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
-
setRealmService
public static void setRealmService(org.wso2.carbon.user.core.service.RealmService realmService) -
getRealmService
public static org.wso2.carbon.user.core.service.RealmService getRealmService()
-