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 theIdentifierclass. the classic form iscaput:/ranom_hex_string/timestamp_millisecondsCreated by Jeff Gaynor
on 4/10/12 at 11:56 AM
-
-
Field Summary
Fields Modifier and Type Field Description static intbyteCountstatic intCOUNTstatic intDEFAULT_BYTE_COUNTstatic intLIFETIME_INDEXstatic StringLIFETIME_TAGstatic intTIMESTAMP_INDEXstatic StringTIMESTAMP_TAGstatic intTOKEN_TYPE_INDEXstatic StringTOKEN_TYPE_TAGstatic StringVERSION_1_0_TAGstatic StringVERSION_2_0_TAGstatic intVERSION_INDEXstatic StringVERSION_TAG
-
Constructor Summary
Constructors Constructor Description Identifiers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetByteCount()static StringgetHexString()static Map<String,String>getParameters(URI uri)Take a URI and turn the query string in to a set of parameters.protected static SecureRandomgetRandom()static voidmain(String[] args)Just a demo of this classstatic voidsetByteCount(int newByteCount)static URIuniqueIdentifier(String caput, String tail)This creates an identifier of the formstatic URIuniqueIdentifier(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 + / + tailIf 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-
-
-