javax.crypto.spec
Class IvParameterSpec

java.lang.Object
  extended by javax.crypto.spec.IvParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec

public class IvParameterSpec
extends Object
implements AlgorithmParameterSpec

A wrapper for an initialization vector. An initialization vector is necessary for any cipher in any feedback mode, e.g. CBC.


Constructor Summary
IvParameterSpec(byte[] iv)
          Create a new initialization vector spec from an entire byte array.
IvParameterSpec(byte[] iv, int off, int len)
          Create a new initialization vector spec from part of a byte array.
 
Method Summary
 byte[] getIV()
          Returns the IV.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IvParameterSpec

public IvParameterSpec(byte[] iv)
Create a new initialization vector spec from an entire byte array.

Parameters:
iv - The IV bytes.

IvParameterSpec

public IvParameterSpec(byte[] iv,
                       int off,
                       int len)
Create a new initialization vector spec from part of a byte array.

Parameters:
iv - The IV bytes.
off - The offset into the IV bytes.
len - The number of IV bytes.
Method Detail

getIV

public byte[] getIV()
Returns the IV. This method does not copy the byte array.

Returns:
The IV.