Class EncryptedNonce
java.lang.Object
org.cryptacular.generator.sp80038a.EncryptedNonce
- All Implemented Interfaces:
Nonce
Nonce generation strategy that produces a random value according to NIST
SP-800-38a, appendix C, method 1 (encrypted nonce), 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
ConstructorsConstructorDescriptionEncryptedNonce(org.bouncycastle.crypto.BlockCipher cipher, SecretKey key) Creates a new instance.EncryptedNonce(Spec<org.bouncycastle.crypto.BlockCipher> cipherSpec, SecretKey key) Creates a new instance. -
Method Summary
-
Constructor Details
-
EncryptedNonce
Creates a new instance.- Parameters:
cipherSpec- Block cipher specification.key- Symmetric key.
-
EncryptedNonce
Creates a new instance.- Parameters:
cipher- Block cipher to use.key- Symmetric key.
-
-
Method Details
-
generate
Description copied from interface:NonceGenerates a nonce value.- Specified by:
generatein interfaceNonce- Returns:
- Nonce bytes.
- Throws:
LimitException- When a limit imposed by the nonce generation strategy, if any, is exceeded.
-
getLength
public int getLength()
-