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

public abstract Class GeneralParametersWithIV<T extends GeneralParameters<T extends Algorithm>>

extends GeneralParameters<GeneralAlgorithm>
implements ParametersWithIV<T extends GeneralParameters<T extends Algorithm>>
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.ParametersWithIV, org.bouncycastle.crypto.Parameters
Known Direct Subclasses
org.bouncycastle.crypto.general.AES.Parameters, org.bouncycastle.crypto.general.AES.WrapParameters, org.bouncycastle.crypto.general.Blowfish.Parameters, org.bouncycastle.crypto.general.Camellia.Parameters, org.bouncycastle.crypto.general.CAST5.Parameters, org.bouncycastle.crypto.general.ChaCha20.Parameters, org.bouncycastle.crypto.general.SEED.Parameters, org.bouncycastle.crypto.general.Serpent.Parameters, org.bouncycastle.crypto.general.SHACAL2.Parameters, org.bouncycastle.crypto.general.IDEA.Parameters, org.bouncycastle.crypto.general.TripleDES.Parameters, org.bouncycastle.crypto.general.Twofish.Parameters, org.bouncycastle.crypto.general.GeneralAuthParameters
Type Parameters
<T>
the actual parameters type that extends this class.
Imports
java.security.SecureRandom, org.bouncycastle.crypto.ParametersWithIV, org.bouncycastle.util.Arrays

Base class for parameter classes for algorithms that require an initialization vector or nonce.

Field Summary

Modifier and TypeField and Description
protected final int
protected final byte[]

Constructor Summary

AccessConstructor and Description
pack-priv
GeneralParametersWithIV(GeneralAlgorithm algorithm, int blockSize, byte[] iv)

Method Summary

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

public byte[]

Returns:

the current IV.
getIV
()

Implements org.bouncycastle.crypto.ParametersWithIV.getIV.

Return a copy of the current IV value.
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
)

Implements org.bouncycastle.crypto.ParametersWithIV.withIV.

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

Returns:

a new instance of our parameterized type with a new IV.
withIV
(byte[]
the bytes making up the iv, or nonce, to use.
iv
)

Implements org.bouncycastle.crypto.ParametersWithIV.withIV.

Return an implementation of our parameterized type containing the passed in IV.
Inherited from org.bouncycastle.crypto.general.GeneralParameters:
getAlgorithm

Field Detail

blockSizeback to summary
protected final int blockSize
ivback to summary
protected final byte[] iv

Constructor Detail

GeneralParametersWithIVback to summary
pack-priv GeneralParametersWithIV(GeneralAlgorithm algorithm, int blockSize, byte[] iv)

Method Detail

createback to summary
pack-priv abstract T create(GeneralAlgorithm algorithm, byte[] iv)
getIVback to summary
public byte[] getIV()

Implements org.bouncycastle.crypto.ParametersWithIV.getIV.

Return a copy of the current IV value.

Returns:byte[]

the current IV.

withIVback to summary
public T withIV(SecureRandom random)

Implements org.bouncycastle.crypto.ParametersWithIV.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.

Returns:T

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

withIVback to summary
public T withIV(byte[] iv)

Implements org.bouncycastle.crypto.ParametersWithIV.withIV.

Return an implementation of our parameterized type containing the passed in IV.

Parameters
iv:byte[]

the bytes making up the iv, or nonce, to use.

Returns:T

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