Class BlockingSecureRandom
- java.lang.Object
-
- io.heraldprox.herald.sensor.datatype.random.RandomSource
-
- io.heraldprox.herald.sensor.datatype.random.BlockingSecureRandom
-
- Direct Known Subclasses:
BlockingSecureRandomNIST
public class BlockingSecureRandom extends RandomSource
Secure random number generator that is blocking after about 4.5 hours on idle devices due to lack of entropy. Uses a new instance for every call.
-
-
Field Summary
-
Fields inherited from class io.heraldprox.herald.sensor.datatype.random.RandomSource
entropy
-
-
Constructor Summary
Constructors Constructor Description BlockingSecureRandom()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Random
getSecureRandom()
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
-
getSecureRandom
@NonNull protected java.util.Random getSecureRandom()
-
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.
-
-