Package javax.crypto.spec
Class IvParameterSpec
java.lang.Object
javax.crypto.spec.IvParameterSpec
- All Implemented Interfaces:
AlgorithmParameterSpec
public class IvParameterSpec extends Object implements AlgorithmParameterSpec
The algorithm parameter specification for an initialization vector.
-
Constructor Summary
Constructors Constructor Description IvParameterSpec(byte[] iv)Creates a newIvParameterSpecinstance with the bytes from the specified buffer iv used as initialization vector.IvParameterSpec(byte[] iv, int offset, int byteCount)Creates a newIvParameterSpecinstance withbyteCountbytes from the specified bufferivstarting atoffset. -
Method Summary
Modifier and Type Method Description byte[]getIV()Returns a copy of the initialization vector data.
-
Constructor Details
-
IvParameterSpec
public IvParameterSpec(byte[] iv)Creates a newIvParameterSpecinstance with the bytes from the specified buffer iv used as initialization vector.- Parameters:
iv- the buffer used as initialization vector.- Throws:
NullPointerException- if the specified buffer is null.
-
IvParameterSpec
public IvParameterSpec(byte[] iv, int offset, int byteCount)Creates a newIvParameterSpecinstance withbyteCountbytes from the specified bufferivstarting atoffset.- Throws:
IllegalArgumentException- if the specified buffer is null oroffsetandbyteCountdo not specify a valid chunk in the specified buffer.ArrayIndexOutOfBoundsException- ifoffsetorbyteCountare negative.
-
-
Method Details
-
getIV
public byte[] getIV()Returns a copy of the initialization vector data.- Returns:
- a copy of the initialization vector data.
-