T
- the actual parameters type that extends this class.public abstract class GeneralAuthParameters<T extends GeneralAuthParameters> extends GeneralParametersWithIV<T> implements AuthenticationParametersWithIV<T>
Modifier and Type | Field and Description |
---|---|
protected int |
macLenInBits |
blockSize, iv
Modifier | Constructor and Description |
---|---|
protected |
GeneralAuthParameters(GeneralAlgorithm algorithm,
int blockSize,
byte[] iv,
int macSizeInBits)
Base Constructor that takes an iv (nonce) and a tag length.
|
Modifier and Type | Method and Description |
---|---|
protected T |
create(GeneralAlgorithm algorithm,
byte[] iv) |
int |
getMACSizeInBits()
Return the size of the MAC these parameters are for.
|
T |
withIV(java.security.SecureRandom random,
int ivLen)
Return an implementation of our parameterized type with an IV constructed from the passed in SecureRandom.
|
T |
withMACSize(int macSizeInBits)
Create a parameter set with the specified MAC size associated with it.
|
getIV, withIV, withIV
getAlgorithm
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIV, withIV, withIV
getAlgorithm
protected GeneralAuthParameters(GeneralAlgorithm algorithm, int blockSize, byte[] iv, int macSizeInBits)
algorithm
- algorithm mode.blockSize
- block size of the cipher in bytes.iv
- iv, or nonce, to be used with this algorithm.macSizeInBits
- length of the checksum tag in bits.public int getMACSizeInBits()
getMACSizeInBits
in interface AuthenticationParameters<T extends GeneralAuthParameters>
public T withIV(java.security.SecureRandom random, int ivLen)
withIV
in interface AuthenticationParametersWithIV<T extends GeneralAuthParameters>
random
- the SecureRandom to use as the source of IV data.ivLen
- the length (in bytes) of the IV to be generated.public T withMACSize(int macSizeInBits)
withMACSize
in interface AuthenticationParameters<T extends GeneralAuthParameters>
macSizeInBits
- bit length of the MAC length.protected T create(GeneralAlgorithm algorithm, byte[] iv)