|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vodafone360.people.service.utils.AuthUtils
public class AuthUtils
Set of functions that are used for generating 'auth' parameter required for cresting requests and is usually based on a valid session created on sign-up/login.
Constructor Summary | |
---|---|
AuthUtils()
|
Method Summary | |
---|---|
static java.lang.String |
calculateAuth(java.lang.String functionName,
java.util.Hashtable<java.lang.String,java.lang.Object> parameters,
java.lang.String timeStamp,
AuthSessionHolder session)
Calculates the AUTH parameter using a list of NameValues. |
private static java.lang.String |
createSigningString(java.lang.String inputString,
java.lang.Object inputObject)
Calculates a signing string from a name/value pair |
private static java.lang.String |
createSignOfByteAray(byte[] bytes)
Calculates the sign value from a byte array |
private static java.lang.String |
createSignOfHastable(java.util.Hashtable<java.lang.String,java.lang.Object> hashTable)
Calculates the sign value from a Hash table |
private static java.lang.String |
createSignOfVector(java.util.Vector<java.lang.Object> vector)
Calculates the sign value from a Vector |
static java.lang.String |
getMd5Hash(java.lang.String input)
Generates a MD5 hash of the input. |
private static java.util.List<java.lang.String> |
getSortedListOfKeys(java.util.Hashtable<java.lang.String,java.lang.Object> map)
Returns a list of keys from the map in alphabetical order |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AuthUtils()
Method Detail |
---|
public static java.lang.String getMd5Hash(java.lang.String input)
input
- - String from which MD5 will be created
java.lang.NullPointerException
- when input is NULL
java.lang.NullPointerException
- MD5 algorithm could not be foundpublic static java.lang.String calculateAuth(java.lang.String functionName, java.util.Hashtable<java.lang.String,java.lang.Object> parameters, java.lang.String timeStamp, AuthSessionHolder session)
functionName
- - String representation of function, using the
"class/funcName" convention e.g.
"auth/getsessionbycredentials". Typically empty.parameters
- - List of name/value pairstimeStamp
- - String containing absolute time stamps, generated by
calls to getCurrentTimeInSeconds()session
- - Valid session object or NULL
java.lang.NullPointerException
- when functionName is NULL
java.lang.NullPointerException
- when parameters is NULL
java.lang.NullPointerException
- when timeStamp is NULLprivate static java.lang.String createSigningString(java.lang.String inputString, java.lang.Object inputObject)
inputString
- - String name.inputObject
- - Object value can be Hashtable, Vector, byte[] or
String.
java.lang.NullPointerException
- when inputString is NULL
java.lang.NullPointerException
- when inputObject is NULLprivate static java.lang.String createSignOfHastable(java.util.Hashtable<java.lang.String,java.lang.Object> hashTable)
hashTable
- - Given Hash table
java.lang.NullPointerException
- when hashTable is NULLprivate static java.lang.String createSignOfVector(java.util.Vector<java.lang.Object> vector)
hashTable
- - Given Vector
java.lang.NullPointerException
- when vector is NULLprivate static java.lang.String createSignOfByteAray(byte[] bytes)
bytes
- - Given byte array
java.lang.NullPointerException
- when bytes is NULLprivate static java.util.List<java.lang.String> getSortedListOfKeys(java.util.Hashtable<java.lang.String,java.lang.Object> map)
map
- The map to sort
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc