Oracle Communications Services Gatekeeper Java API Reference
6.1

E65002-01

oracle.ocsg.oauth2.util
Class OAuthUtil

java.lang.Object
  extended byoracle.ocsg.oauth2.util.OAuthUtil
All Implemented Interfaces:
java.io.Serializable

public class OAuthUtil
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
OAuthUtil()
           
 
Method Summary
static java.lang.String bytes2Hex(byte[] bts)
          Convert byte array to string.
static byte[] digestPassword(java.lang.String password)
           
static java.lang.String generateUUID()
          Generate UUID.
static java.lang.String join(java.util.Collection s, java.lang.String delimiter)
          Join collection of String.
static java.lang.String mapToString(java.util.Map map)
          encode a map into query string
static java.lang.String sha1(java.lang.String source)
          Generate SHA-256 hash of a given string.
static java.lang.String sha256(java.lang.String source)
          Generate SHA-256 hash of a given string.
static java.util.Map string2Map(java.lang.String str)
          parse a query string into map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OAuthUtil

public OAuthUtil()
Method Detail

bytes2Hex

public static java.lang.String bytes2Hex(byte[] bts)
Convert byte array to string.

Parameters:
bts - byte array.
Returns:
hex encoded string.

digestPassword

public static byte[] digestPassword(java.lang.String password)
                             throws java.lang.Exception
Throws:
java.lang.Exception

generateUUID

public static java.lang.String generateUUID()
Generate UUID.

Returns:
UUID in string

join

public static java.lang.String join(java.util.Collection s,
                                    java.lang.String delimiter)
Join collection of String.

Parameters:
s - the strings.
delimiter - delimiter
Returns:
the joined string.

mapToString

public static java.lang.String mapToString(java.util.Map map)
encode a map into query string

Parameters:
map - the map
Returns:
string in http querystring format, e.g. a=1&b=2

sha1

public static java.lang.String sha1(java.lang.String source)
Generate SHA-256 hash of a given string.

Parameters:
source - given string.
Returns:
SHA-256 hash.

sha256

public static java.lang.String sha256(java.lang.String source)
                               throws java.security.NoSuchAlgorithmException
Generate SHA-256 hash of a given string.

Parameters:
source - given string.
Returns:
SHA-256 hash.
Throws:
java.security.NoSuchAlgorithmException

string2Map

public static java.util.Map string2Map(java.lang.String str)
parse a query string into map.

Parameters:
str - string in http querystring format, e.g. a=1&b=2
Returns:
a map

Oracle Communications Services Gatekeeper Java API Reference
6.1

E65002-01

Copyright © 2008, 2016, Oracle and/or its affiliates. All rights reserved.