Code example for SecureRandom

Methods: nextLong

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