de.flexiprovider.core.rijndael
Class RijndaelParameterSpec

java.lang.Object
  |
  +--de.flexiprovider.core.rijndael.RijndaelParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec, java.security.spec.AlgorithmParameterSpec

public class RijndaelParameterSpec
extends java.lang.Object
implements AlgorithmParameterSpec

This class specifies the parameters used by the Rijndael block cipher.

The parameters consist of the block size and an optional initialization vector (IV).

Values for block size, as specified in the AES standards, are 128, 192, and 256 bits. The default block size is 128 bits. IVs are used by ciphers in CBC, CFB and OFB mode.

Author:
Katja Rauch, Martin Döring

Field Summary
static int DEFAULT_BLOCK_SIZE
          The default block size (128 bits)
 
Constructor Summary
RijndaelParameterSpec()
          Construct the default Rijndael parameters without an initialization vector (IV).
RijndaelParameterSpec(int blockSize)
          Construct new Rijndael parameters from the given block size.
RijndaelParameterSpec(int blockSize, ModeParameterSpec modeParams)
          Construct new Rijndael parameters from the given block size and initialization vector (IV).
RijndaelParameterSpec(ModeParameterSpec modeParams)
          Construct the default Rijndael parameters with the given initialization vector (IV).
 
Method Summary
 boolean equals(java.lang.Object other)
          Compare these parameters with another object.
 int getBlockSize()
           
 byte[] getIV()
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BLOCK_SIZE

public static final int DEFAULT_BLOCK_SIZE
The default block size (128 bits)
Constructor Detail

RijndaelParameterSpec

public RijndaelParameterSpec()
Construct the default Rijndael parameters without an initialization vector (IV). Set the block size to DEFAULT_BLOCK_SIZE.

RijndaelParameterSpec

public RijndaelParameterSpec(ModeParameterSpec modeParams)
Construct the default Rijndael parameters with the given initialization vector (IV). Set the block size to DEFAULT_BLOCK_SIZE.
Parameters:
modeParams - the mode parameters containing the IV

RijndaelParameterSpec

public RijndaelParameterSpec(int blockSize)
Construct new Rijndael parameters from the given block size. If the block size is invalid, the default block size is chosen.
Parameters:
blockSize - the block size (128, 192, or 256 bits)

RijndaelParameterSpec

public RijndaelParameterSpec(int blockSize,
                             ModeParameterSpec modeParams)
Construct new Rijndael parameters from the given block size and initialization vector (IV). If the block size is invalid, the default block size is chosen.
Parameters:
blockSize - the block size (128, 192, or 256 bits)
modeParams - the mode parameters containing the IV
Method Detail

getBlockSize

public int getBlockSize()
Returns:
the block size in bits

getIV

public byte[] getIV()
Returns:
the initialization vector (maybe null)

equals

public boolean equals(java.lang.Object other)
Compare these parameters with another object.
Overrides:
equals in class java.lang.Object
Parameters:
other - the other object
Returns:
the result of the comparison

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
the hash code of these parameters