Code example for SecureRandom

Methods: nextLong

0
	 * Generates a nonce (a random number used once). 
	 *  
	 * @return the nonce 
	 */ 
	public static long generateNonce() { 
		long nonce = RANDOM.nextLong();
		knownNonces.add(nonce);
		return nonce;
	} 
	 
	public static void removeNonce(long nonce) {
		knownNonces.remove(nonce);
	} 
	 
	public static boolean isNonceKnown(long nonce) {
		return knownNonces.contains(nonce);
	} 
	 
	/** 
	 * Verifies that the data was signed with the given signature, and returns the list of verified purchases. The data 
Stop searching for code, let great code find you!  Add Codota to your java IDE