|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.identity.saml2.common.SAML2SDKUtils
public class SAML2SDKUtils
The SAML2SDKUtils contains utility methods for SAML 2.0
implementation.
| Constructor Summary | |
|---|---|
protected |
SAML2SDKUtils()
Protected contstructor. |
| Method Summary | |
|---|---|
static Boolean |
booleanValueOf(String value)
Returns the boolean value as a Boolean object. |
static String |
byteArrayToHexString(byte[] byteArray)
Converts byte array to Hex String. |
static String |
byteArrayToString(byte[] bytes)
Converts byte array to String. |
static boolean |
checkStatement(Element element,
String statementname)
Verifies if an element is a type of a specific statement. |
static String |
createSOAPMessageString(String xmlString)
Creates SOAPMessage with the input XML String
as message body. |
static String |
fillInBasicAuthInfo(BaseConfigType config,
String locationURL)
Fills in basic auth user and password inside the location URL if configuration is done properly |
static String |
generateID()
Generates ID. |
static String |
generateMessageHandle()
Generates message handle used in an Artifact. |
static List |
getDiscoveryBootStrapCredentials(HttpServletRequest request)
Gets the Discovery bootstrap credentials. |
static ResourceOffering |
getDiscoveryBootStrapResourceOffering(HttpServletRequest request)
Gets the Discovery bootstrap resource offering in an attribute statement. |
static Object |
getObjectInstance(String iName)
Returns default object instance for a given interface. |
static Object |
getObjectInstance(String iName,
byte[] typecode,
int endpointIndex,
String sourceID,
String messageHandle)
Returns new object instance with given parameters. |
static Object |
getObjectInstance(String iName,
Element value)
Returns new object instance taking Element parameter in constructor. |
static Object |
getObjectInstance(String iName,
String value)
Returns new object instance taking String parameter in constructor. |
static byte[] |
hexStringToByteArray(String hexString)
Converts Hex String to Byte Array. |
static byte[] |
intToTwoBytes(int i)
Converts integer to byte array. |
static String |
removeDeployUri(String uri)
Removes deployment URI from the pass down string. |
static Boolean |
StringToBoolean(String str)
Converts a value of XML boolean type to Boolean object. |
static byte[] |
stringToByteArray(String input)
Converts String to Byte Array. |
static int |
twoBytesToInt(byte[] bytes)
Converts two bytes to an integer. |
| Field Detail |
|---|
public static com.sun.identity.shared.debug.Debug debug
public static final String BUNDLE_NAME
public static ResourceBundle bundle
protected static final String SAML2ID_PREFIX
public static SecureRandom random
public static final String ACTION
public static final String ADVICE
public static final String ASSERTION
public static final String ASSERTION_ID_REF
public static final String ASSERTION_ID_REQUEST
public static final String ATTRIBUTE
public static final String ATTRIBUTE_STATEMENT
public static final String AUDIENCE_RESTRICTION
public static final String AUTHN_CONTEXT
public static final String AUTHN_STATEMENT
public static final String AUTHZ_DECISION_STATEMENT
public static final String BASEID
public static final String CONDITION
public static final String CONDITIONS
public static final String ENCRYPTED_ASSERTION
public static final String ENCRYPTED_ATTRIBUTE
public static final String ENCRYPTED_ELEMENT
public static final String ENCRYPTEDID
public static final String EVIDENCE
public static final String ISSUER
public static final String KEYINFO_CONFIRMATION_DATA
public static final String NAMEID
public static final String ONE_TIME_USE
public static final String PROXY_RESTRICTION
public static final String STATEMENT
public static final String SUBJECT_CONFIRMATION_DATA
public static final String SUBJECT_CONFIRMATION
public static final String SUBJECT
public static final String SUBJECT_LOCALITY
public static final String ARTIFACT
public static final String ARTIFACT_RESOLVE
public static final String ARTIFACT_RESPONSE
public static final String ATTRIBUTE_QUERY
public static final String AUTHN_QUERY
public static final String AUTHN_REQUEST
public static final String ECP_RELAY_STATE
public static final String ECP_REQUEST
public static final String ECP_RESPONSE
public static final String EXTENSIONS
public static final String GET_COMPLETE
public static final String IDPENTRY
public static final String IDPLIST
public static final String LOGOUT_REQUEST
public static final String LOGOUT_RESPONSE
public static final String MANAGE_NAMEID_REQUEST
public static final String MANAGE_NAMEID_RESPONSE
public static final String NAMEID_POLICY
public static final String NEW_ENCRYPTEDID
public static final String NEWID
public static final String REQUESTED_AUTHN_CONTEXT
public static final String REQUESTERID
public static final String RESPONSE
public static final String SCOPING
public static final String SESSION_INDEX
public static final String STATUS_CODE
public static final String STATUS_DETAIL
public static final String STATUS
public static final String STATUS_MESSAGE
public static final String STATUS_RESPONSE
public static final String NAMEIDMAPPING_REQ
public static final String NAMEIDMAPPING_RES
| Constructor Detail |
|---|
protected SAML2SDKUtils()
| Method Detail |
|---|
public static Object getObjectInstance(String iName)
iName - name of the interface.
public static Object getObjectInstance(String iName,
String value)
iName - name of the interface.value - String value to be used as parameter in constructor.
public static Object getObjectInstance(String iName,
Element value)
iName - name of the interface.value - Element value to be used as parameter in constructor.
public static Object getObjectInstance(String iName,
byte[] typecode,
int endpointIndex,
String sourceID,
String messageHandle)
iName - name of the interface.typecode - type code.endpointIndex - end point index.sourceID - source ID.messageHandle - message handler.
public static boolean checkStatement(Element element,
String statementname)
element - a DOM Element which needs to be verified.statementname - A specific name of a statement, for example,
AuthnStatement, AuthzStatement or AttributeStatement
true if the element is of the specific type;
false otherwise.public static String byteArrayToString(byte[] bytes)
bytes - Byte Array to be converted.
public static byte[] intToTwoBytes(int i)
throws SAML2Exception
i - an integer value between 0 and 65535.
SAML2Exception - if the input is not between 0 and 65535.
public static int twoBytesToInt(byte[] bytes)
throws SAML2Exception
bytes - byte array whose length is 2.
SAML2Exception - if the input is null or the length is not 2.public static String generateMessageHandle()
Artifact.
public static byte[] stringToByteArray(String input)
input - String to be converted.
public static String byteArrayToHexString(byte[] byteArray)
Hex String.
byteArray - Byte Array to be converted.
public static byte[] hexStringToByteArray(String hexString)
Hex String to Byte Array.
hexString - Hex String to be converted.
public static String generateID()
public static ResourceOffering getDiscoveryBootStrapResourceOffering(HttpServletRequest request)
request - HttpServletRequest associated with a user
session.
ResourceOffering Discovery Resource Offering,
null if there is any failure or if there is not onepublic static List getDiscoveryBootStrapCredentials(HttpServletRequest request)
request - HttpServletRequest associated with a user
session.
List of SecurityAssertions,
null if there is any failure or if there is not one
public static String createSOAPMessageString(String xmlString)
throws SAML2Exception
SOAPMessage with the input XML String
as message body.
xmlString - XML string to be put into SOAPMessage body.
SOAPMessage.
javax.xml.soap.SOAPException - if it cannot create the
SOAPMessage.
SAML2Exception
public static String fillInBasicAuthInfo(BaseConfigType config,
String locationURL)
config - Either an SPSSOConfigElement object , an
IDPSSOConfigElement object or PEPConfigElement.locationURL - The original location URL which is to be
inserted with user:password@ before the
hostname part and after //
public static Boolean StringToBoolean(String str)
throws SAML2Exception
str - a value of XML boolean type
SAML2Exception - if there is a syntax errorpublic static String removeDeployUri(String uri)
uri - the URI string which the deployment uri is to be removed
return string without deployment uripublic static Boolean booleanValueOf(String value)
Boolean object.
value - boolean value true or false.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||