Package org.oa4mp.delegation.server
Class NonceHerder
- java.lang.Object
-
- org.oa4mp.delegation.server.NonceHerder
-
public class NonceHerder extends Object
A class to manage nonces (with an in-memory store) and create new ones.Created by Jeff Gaynor
on 9/24/13 at 1:18 PM
-
-
Constructor Summary
Constructors Constructor Description NonceHerder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkNonce(String nonce)
Checks if a non-trivial nonce is here and if so, throws an exception.static String
createNonce()
Creates a default nonce that is 32 bytes long.static String
createNonce(int length)
static HashSet<String>
getNonces()
static boolean
hasNonce(String nonce)
Checks if this herder knows about this nonce.static void
putNonce(String nonce)
static void
removeNonce(String nonce)
-
-
-
Method Detail
-
removeNonce
public static void removeNonce(String nonce)
-
hasNonce
public static boolean hasNonce(String nonce)
Checks if this herder knows about this nonce. It returns a boolean. To test for nonces, usecheckNonce(String)
- Parameters:
nonce
-- Returns:
-
checkNonce
public static void checkNonce(String nonce)
Checks if a non-trivial nonce is here and if so, throws an exception. If not, the new nonce is added.- Parameters:
nonce
-
-
putNonce
public static void putNonce(String nonce)
-
createNonce
public static String createNonce()
Creates a default nonce that is 32 bytes long.- Returns:
-
createNonce
public static String createNonce(int length)
-
-