Code example for SecureRandom

Methods: nextInt

0
			this.random = SecureRandom.getInstance(PRNG_ALGORITHM, PRNG_PROVIDER);
		} catch (GeneralSecurityException e) {
			throw new IllegalStateException(e);
		} 
		LOGGER.info("Seeding PRNG"); 
		random.nextInt(); // force seeding
		 
		// update the PRNG every hour, starting in an hour 
		pool.scheduleAtFixedRate(new UpdateTask(random, LOGGER), 1, 1, TimeUnit.HOURS);
	} 
	 
	@Override 
	public SecureRandom get() {
		return random;
	} 
}