Class RBGNonce
java.lang.Object
org.cryptacular.generator.sp80038a.RBGNonce
- All Implemented Interfaces:
Nonce
Nonce generation strategy that produces a random value according to NIST
SP-800-38a, appendix C, method 2 (random number generator), suitable for use with any block cipher mode described
in that standard except OFB.
Instances of this class are thread safe.
- Author:
- Middleware Services
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
RBGNonce
public RBGNonce()Creates a new instance that produces 16-bytes (128-bits) of random data. -
RBGNonce
public RBGNonce(int length) Creates a new instance that produces length bytes of random data.- Parameters:
length
- Number of bytes in generated nonce values.
-
-
Method Details
-
generate
Description copied from interface:Nonce
Generates a nonce value.- Specified by:
generate
in interfaceNonce
- Returns:
- Nonce bytes.
- Throws:
LimitException
- When a limit imposed by the nonce generation strategy, if any, is exceeded.
-
getLength
public int getLength()
-