@Immutable public final class VerySecureRandom extends Object
/dev/random may require waiting for the result as it uses
so-called entropy pool, where random data may not be available at the moment.
/dev/urandom returns as many bytes as user requested and thus it
is less random than /dev/random.| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_RE_SEED_INTERVAL |
| Modifier and Type | Method and Description |
|---|---|
static SecureRandom |
getInstance() |
static int |
getReSeedInterval()
Get the interval of
getInstance() calls after which the random
should be re-seeded. |
static void |
setReSeedInterval(int nReseedInterval)
Set the interval of
getInstance() calls after which the random
should be re-seeded. |
public static final int DEFAULT_RE_SEED_INTERVAL
public static void setReSeedInterval(@Nonnegative int nReseedInterval)
getInstance() calls after which the random
should be re-seeded.nReseedInterval - The re-seed interval. Must be ≥ 0. The value of 0 means: don't
re-seed. The default value is 20.@Nonnegative public static int getReSeedInterval()
getInstance() calls after which the random
should be re-seeded.@Nonnull public static SecureRandom getInstance()
SecureRandom instance that does the hard work. Never
null.Copyright © 2014–2019 Philip Helger. All rights reserved.