Package org.bouncycastle.crypto.general
Class GeneralParametersWithIV<T extends GeneralParameters>
- java.lang.Object
-
- org.bouncycastle.crypto.general.GeneralParameters<GeneralAlgorithm>
-
- org.bouncycastle.crypto.general.GeneralParametersWithIV<T>
-
- Type Parameters:
T
- the actual parameters type that extends this class.
- All Implemented Interfaces:
Parameters
,ParametersWithIV<T>
- Direct Known Subclasses:
AES.Parameters
,AES.WrapParameters
,Blowfish.Parameters
,Camellia.Parameters
,CAST5.Parameters
,ChaCha20.Parameters
,GeneralAuthParameters
,IDEA.Parameters
,SEED.Parameters
,Serpent.Parameters
,SHACAL2.Parameters
,TripleDES.Parameters
,Twofish.Parameters
public abstract class GeneralParametersWithIV<T extends GeneralParameters> extends GeneralParameters<GeneralAlgorithm> implements ParametersWithIV<T>
Base class for parameter classes for algorithms that require an initialization vector or nonce.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getIV()
Return a copy of the current IV value.T
withIV(byte[] iv)
Return an implementation of our parameterized type containing the passed in IV.T
withIV(java.security.SecureRandom random)
Return an implementation of our parameterized type with an IV constructed from the passed in SecureRandom.-
Methods inherited from class org.bouncycastle.crypto.general.GeneralParameters
getAlgorithm
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bouncycastle.crypto.Parameters
getAlgorithm
-
-
-
-
Method Detail
-
getIV
public byte[] getIV()
Return a copy of the current IV value.- Specified by:
getIV
in interfaceParametersWithIV<T extends GeneralParameters>
- Returns:
- the current IV.
-
withIV
public T withIV(java.security.SecureRandom random)
Return an implementation of our parameterized type with an IV constructed from the passed in SecureRandom.- Specified by:
withIV
in interfaceParametersWithIV<T extends GeneralParameters>
- Parameters:
random
- the SecureRandom to use as the source of IV data.- Returns:
- a new instance of our parameterized type with a new IV.
-
withIV
public T withIV(byte[] iv)
Return an implementation of our parameterized type containing the passed in IV.- Specified by:
withIV
in interfaceParametersWithIV<T extends GeneralParameters>
- Parameters:
iv
- the bytes making up the iv, or nonce, to use.- Returns:
- a new instance of our parameterized type with a new IV.
-
-