Class LongCounterNonce
java.lang.Object
org.cryptacular.generator.sp80038a.LongCounterNonce
- All Implemented Interfaces:
Nonce
Simple counter nonce that uses a long integer counter internally and produces 8-byte nonces. Note that this component
is suitable exclusively for ciphers with block length 8, e.g. Blowfish.
Instances of this class are thread safe.
- Author:
- Middleware Services
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance whose counter values start at 1.LongCounterNonce
(long start) Creates a new instance whose counter values start above the given value. -
Method Summary
-
Constructor Details
-
LongCounterNonce
public LongCounterNonce()Creates a new instance whose counter values start at 1. -
LongCounterNonce
public LongCounterNonce(long start) Creates a new instance whose counter values start above the given value.- Parameters:
start
- Start value.
-
-
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()
-