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,ARIA.Parameters,Blowfish.Parameters,Camellia.Parameters,CAST5.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.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getIV()Return a copy of the current IV value.withIV(byte[] iv) Return an implementation of our parameterized type containing the passed in IV.withIV(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
getAlgorithmMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bouncycastle.crypto.Parameters
getAlgorithm
-
Field Details
-
blockSize
protected final int blockSize -
iv
protected final byte[] iv
-
-
Method Details
-
getIV
public byte[] getIV()Return a copy of the current IV value.- Specified by:
getIVin interfaceParametersWithIV<T extends GeneralParameters>- Returns:
- the current IV.
-
withIV
Return an implementation of our parameterized type with an IV constructed from the passed in SecureRandom.- Specified by:
withIVin 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
Return an implementation of our parameterized type containing the passed in IV.- Specified by:
withIVin 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.
-