Top Description Fields Constructors Methods
org.bouncycastle.crypto.general

public abstract Class GeneralAuthParameters<T extends GeneralAuthParameters>

extends GeneralParametersWithIV<T extends GeneralAuthParameters>
implements AuthenticationParametersWithIV<T extends GeneralAuthParameters>
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.AuthenticationParametersWithIV, org.bouncycastle.crypto.ParametersWithIV, org.bouncycastle.crypto.Parameters, org.bouncycastle.crypto.AuthenticationParameters
Known Direct Subclasses
org.bouncycastle.crypto.general.GOST28147.AuthParameters, org.bouncycastle.crypto.general.AES.AuthParameters, org.bouncycastle.crypto.general.Blowfish.AuthParameters, org.bouncycastle.crypto.general.Camellia.AuthParameters, org.bouncycastle.crypto.general.CAST5.AuthParameters, org.bouncycastle.crypto.general.DES.AuthParameters, org.bouncycastle.crypto.general.RC2.AuthParameters, org.bouncycastle.crypto.general.SEED.AuthParameters, org.bouncycastle.crypto.general.Serpent.AuthParameters, org.bouncycastle.crypto.general.SHACAL2.AuthParameters, org.bouncycastle.crypto.general.IDEA.AuthParameters, org.bouncycastle.crypto.general.Poly1305.AuthParameters, org.bouncycastle.crypto.general.TripleDES.AuthParameters, org.bouncycastle.crypto.general.Twofish.AuthParameters
Type Parameters
<T>
the actual parameters type that extends this class.
Imports
java.security.SecureRandom, org.bouncycastle.crypto.AuthenticationParametersWithIV

Base class for parameter classes for algorithms allow for authentication using MACs.

Field Summary

Modifier and TypeField and Description
protected final int
Inherited from org.bouncycastle.crypto.general.GeneralParametersWithIV:
blockSizeiv

Constructor Summary

AccessConstructor and Description
protected
GeneralAuthParameters(GeneralAlgorithm
algorithm mode.
algorithm
,
int
block size of the cipher in bytes.
blockSize
,
byte[]
iv, or nonce, to be used with this algorithm.
iv
,
int
length of the checksum tag in bits.
macSizeInBits
)

Base Constructor that takes an iv (nonce) and a tag length.

Method Summary

Modifier and TypeMethod and Description
protected T
pack-priv abstract T
create(GeneralAlgorithm algorithm, byte[] iv, int macSizeInBits)

public int

Returns:

the MAC size in bits.
getMACSizeInBits
()

Implements org.bouncycastle.crypto.AuthenticationParameters.getMACSizeInBits.

Return the size of the MAC these parameters are for.
public T

Returns:

a new instance of our parameterized type with a new IV.
withIV
(SecureRandom
the SecureRandom to use as the source of IV data.
random
,
int
the length (in bytes) of the IV to be generated.
ivLen
)

Implements org.bouncycastle.crypto.AuthenticationParametersWithIV.withIV.

Return an implementation of our parameterized type with an IV constructed from the passed in SecureRandom.
public T

Returns:

the new parameter set.
withMACSize
(int
bit length of the MAC length.
macSizeInBits
)

Implements org.bouncycastle.crypto.AuthenticationParameters.withMACSize.

Create a parameter set with the specified MAC size associated with it.
Inherited from org.bouncycastle.crypto.general.GeneralParametersWithIV:
getIVwithIVwithIV

Field Detail

macLenInBitsback to summary
protected final int macLenInBits

Constructor Detail

GeneralAuthParametersback to summary
protected GeneralAuthParameters(GeneralAlgorithm algorithm, int blockSize, byte[] iv, int macSizeInBits)

Base Constructor that takes an iv (nonce) and a tag length.

Parameters
algorithm:GeneralAlgorithm

algorithm mode.

blockSize:int

block size of the cipher in bytes.

iv:byte[]

iv, or nonce, to be used with this algorithm.

macSizeInBits:int

length of the checksum tag in bits.

Method Detail

createback to summary
protected T create(GeneralAlgorithm algorithm, byte[] iv)

Implements abstract org.bouncycastle.crypto.general.GeneralParametersWithIV.create.

createback to summary
pack-priv abstract T create(GeneralAlgorithm algorithm, byte[] iv, int macSizeInBits)
getMACSizeInBitsback to summary
public int getMACSizeInBits()

Implements org.bouncycastle.crypto.AuthenticationParameters.getMACSizeInBits.

Return the size of the MAC these parameters are for.

Returns:int

the MAC size in bits.

withIVback to summary
public T withIV(SecureRandom random, int ivLen)

Implements org.bouncycastle.crypto.AuthenticationParametersWithIV.withIV.

Return an implementation of our parameterized type with an IV constructed from the passed in SecureRandom.

Parameters
random:SecureRandom

the SecureRandom to use as the source of IV data.

ivLen:int

the length (in bytes) of the IV to be generated.

Returns:T

a new instance of our parameterized type with a new IV.

withMACSizeback to summary
public T withMACSize(int macSizeInBits)

Implements org.bouncycastle.crypto.AuthenticationParameters.withMACSize.

Create a parameter set with the specified MAC size associated with it.

Parameters
macSizeInBits:int

bit length of the MAC length.

Returns:T

the new parameter set.