Package edu.uiuc.ncsa.security.core.util
Class Identifiers
- java.lang.Object
-
- edu.uiuc.ncsa.security.core.util.Identifiers
-
public class Identifiers extends Object
Utilities for Identifiers, such as creating various URIs that can be fed to theIdentifier
class. the classic form iscaput:/ranom_hex_string/timestamp_milliseconds
Created by Jeff Gaynor
on 4/10/12 at 11:56 AM
-
-
Field Summary
Fields Modifier and Type Field Description static int
byteCount
static int
COUNT
static int
DEFAULT_BYTE_COUNT
static int
LIFETIME_INDEX
static String
LIFETIME_TAG
static int
TIMESTAMP_INDEX
static String
TIMESTAMP_TAG
static int
TOKEN_TYPE_INDEX
static String
TOKEN_TYPE_TAG
static String
VERSION_1_0_TAG
static String
VERSION_2_0_TAG
static int
VERSION_INDEX
static String
VERSION_TAG
-
Constructor Summary
Constructors Constructor Description Identifiers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getByteCount()
static String
getHexString()
static Map<String,String>
getParameters(URI uri)
Take a URI and turn the query string in to a set of parameters.protected static SecureRandom
getRandom()
static void
main(String[] args)
Just a demo of this classstatic void
setByteCount(int newByteCount)
static URI
uniqueIdentifier(String caput, String tail)
This creates an identifier of the formstatic URI
uniqueIdentifier(String caput, String component, String version, long lifetime)
Creates a new token of the form
-
-
-
Field Detail
-
TOKEN_TYPE_INDEX
public static final int TOKEN_TYPE_INDEX
- See Also:
- Constant Field Values
-
TIMESTAMP_INDEX
public static final int TIMESTAMP_INDEX
- See Also:
- Constant Field Values
-
VERSION_INDEX
public static final int VERSION_INDEX
- See Also:
- Constant Field Values
-
LIFETIME_INDEX
public static final int LIFETIME_INDEX
- See Also:
- Constant Field Values
-
COUNT
public static final int COUNT
- See Also:
- Constant Field Values
-
TOKEN_TYPE_TAG
public static final String TOKEN_TYPE_TAG
- See Also:
- Constant Field Values
-
TIMESTAMP_TAG
public static final String TIMESTAMP_TAG
- See Also:
- Constant Field Values
-
VERSION_TAG
public static final String VERSION_TAG
- See Also:
- Constant Field Values
-
LIFETIME_TAG
public static final String LIFETIME_TAG
- See Also:
- Constant Field Values
-
VERSION_2_0_TAG
public static final String VERSION_2_0_TAG
- See Also:
- Constant Field Values
-
VERSION_1_0_TAG
public static final String VERSION_1_0_TAG
- See Also:
- Constant Field Values
-
DEFAULT_BYTE_COUNT
public static int DEFAULT_BYTE_COUNT
-
byteCount
public static int byteCount
-
-
Method Detail
-
getByteCount
public static int getByteCount()
-
setByteCount
public static void setByteCount(int newByteCount)
-
getRandom
protected static SecureRandom getRandom()
-
getHexString
public static String getHexString()
-
uniqueIdentifier
public static URI uniqueIdentifier(String caput, String tail)
This creates an identifier of the formcaput + / + hex_string + / + tail
If tail has a trailing / it will be removed.- Parameters:
caput
-tail
-- Returns:
-
uniqueIdentifier
public static URI uniqueIdentifier(String caput, String component, String version, long lifetime)
Creates a new token of the formcaput/id?param1=¶m2=...
E.g.https://foo.bar/oauth2/5c6c24e951a5a965f5303b7207b2a90b?type=accessToken&ts=1681817646409&version=v2.0&lifetime=1000000
- Parameters:
caput
-component
-version
-lifetime
-- Returns:
-
getParameters
public static Map<String,String> getParameters(URI uri)
Take a URI and turn the query string in to a set of parameters. These are returned as strings so they may need some further processing.- Parameters:
uri
-- Returns:
-
main
public static void main(String[] args)
Just a demo of this class- Parameters:
args
-
-
-