Code example for SecureRandom

Methods: nextLong

0
        } 
    } 
 
    /** Generates a nonce (a random number used once). */ 
    public static long generateNonce() { 
        long nonce = RANDOM.nextLong();
        sKnownNonces.add(nonce);
        return nonce;
    } 
 
    public static void removeNonce(long nonce) {
        sKnownNonces.remove(nonce);
    } 
 
    public static boolean isNonceKnown(long nonce) {
        return sKnownNonces.contains(nonce);
    } 
 
    /** 
     * Verifies that the data was signed with the given signature, and returns 
     * the list of verified purchases. The data is in JSON format and contains