Class BlockingSecureRandomSingleton
- java.lang.Object
-
- io.heraldprox.herald.sensor.datatype.random.RandomSource
-
- io.heraldprox.herald.sensor.datatype.random.BlockingSecureRandomSingleton
-
public class BlockingSecureRandomSingleton extends RandomSource
Secure random number generator that is blocking after about 7.5 hours on idle devices due to lack of entropy. Uses a singleton instance for all calls.
-
-
Field Summary
-
Fields inherited from class io.heraldprox.herald.sensor.datatype.random.RandomSource
entropy
-
-
Constructor Summary
Constructors Constructor Description BlockingSecureRandomSingleton()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Random
getSecureRandomSingleton()
void
nextBytes(byte[] bytes)
Get random bytes from the random source.-
Methods inherited from class io.heraldprox.herald.sensor.datatype.random.RandomSource
addEntropy, addEntropy, addEntropy, hash, nextInt, nextLong, useEntropy, useEntropy
-
-
-
-
Method Detail
-
getSecureRandomSingleton
@NonNull protected java.util.Random getSecureRandomSingleton()
-
nextBytes
public void nextBytes(@NonNull byte[] bytes)
Description copied from class:RandomSource
Get random bytes from the random source.- Specified by:
nextBytes
in classRandomSource
- Parameters:
bytes
- Fill byte array with random data.
-
-