public class RBGNonce extends java.lang.Object implements Nonce
Instances of this class are thread safe.
| Modifier and Type | Field and Description |
|---|---|
private int |
length
Length of generated nonces.
|
private org.bouncycastle.crypto.prng.drbg.SP80090DRBG |
rbg
Random bit generator.
|
| Constructor and Description |
|---|
RBGNonce()
Creates a new instance that produces 16-bytes (128-bits) of random data.
|
RBGNonce(int length)
Creates a new instance that produces length bytes of random data.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
generate()
Generates a nonce value.
|
int |
getLength() |
private final int length
private final org.bouncycastle.crypto.prng.drbg.SP80090DRBG rbg
public RBGNonce()
public RBGNonce(int length)
length - Number of bytes in generated nonce values.public byte[] generate()
throws LimitException
Noncegenerate in interface NonceLimitException - When a limit imposed by the nonce generation strategy, if any, is exceeded.