public String generate ( long maxAge ) { // Sweep expired nonces if enough time has passed sweepExpiredNonces ( ) ; // Generate and store nonce, along with expiration timestamp String nonce = new BigInteger ( 130 , random ) . toString ( 32 ) ; nonces . put ( nonce , System . currentTimeMillis ( ) + maxAge ) ; return nonce ; }
Generates a cryptographically - secure nonce value . The nonce is intended to be used to prevent replay attacks .