Class 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 Detail

      • NonceHerder

        public NonceHerder()
    • 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, use checkNonce(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)