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 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:
      getIV in interface ParametersWithIV<T extends GeneralParameters>
      Returns:
      the current IV.
    • withIV

      public T withIV(SecureRandom random)
      Return an implementation of our parameterized type with an IV constructed from the passed in SecureRandom.
      Specified by:
      withIV in interface ParametersWithIV<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 interface ParametersWithIV<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.