public class EncryptedNonce extends java.lang.Object implements Nonce
Instances of this class are thread safe.
| Modifier and Type | Field and Description |
|---|---|
private org.bouncycastle.crypto.BlockCipher |
cipher
Block cipher.
|
private javax.crypto.SecretKey |
key
Encryption key.
|
| Constructor and Description |
|---|
EncryptedNonce(org.bouncycastle.crypto.BlockCipher cipher,
javax.crypto.SecretKey key)
Creates a new instance.
|
EncryptedNonce(Spec<org.bouncycastle.crypto.BlockCipher> cipherSpec,
javax.crypto.SecretKey key)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
generate()
Generates a nonce value.
|
int |
getLength() |
private final org.bouncycastle.crypto.BlockCipher cipher
private final javax.crypto.SecretKey key
public EncryptedNonce(Spec<org.bouncycastle.crypto.BlockCipher> cipherSpec, javax.crypto.SecretKey key)
cipherSpec - Block cipher specification.key - Symmetric key.public EncryptedNonce(org.bouncycastle.crypto.BlockCipher cipher,
javax.crypto.SecretKey key)
cipher - Block cipher to use.key - Symmetric key.public byte[] generate()
throws LimitException
Noncegenerate in interface NonceLimitException - When a limit imposed by the nonce generation strategy, if any, is exceeded.