public class RBGNonce extends Object implements Nonce
NOTE: users of this class are responsible for counting number of invocations and enforcing the constraints described in section 8.3; namely the following:
The total number of invocations of the authenticated encryption function shall not exceed 232, including all IV lengths and all instances of the authenticated encryption function with the given key.
Instances of this class are thread safe.
Constructor and Description |
---|
RBGNonce()
Creates a new instance that produces 12-bytes (96-bits) of random data;
that is, the fixed field of the nonce is null.
|
RBGNonce(int randomLength)
Creates a new instance that produces length bytes of random data; that is,
the fixed field of the nonce is null.
|
RBGNonce(String fixed,
int randomLength)
Creates a new instance using the given fixed field value.
|
public RBGNonce()
public RBGNonce(int randomLength)
randomLength
- Number of bytes in the random part of the nonce. MUST
be at least 12.public RBGNonce(String fixed, int randomLength)
fixed
- User-defined fixed field value.randomLength
- Number of bytes in the random part of the nonce. MUST
be at least 12.public byte[] generate() throws LimitException
generate
in interface Nonce
LimitException
- When a limit imposed by the nonce generation
strategy, if any, is exceeded.Copyright © 2016 JBoss by Red Hat. All rights reserved.