IvParameterSpecpublic class IvParameterSpec extends Object implements AlgorithmParameterSpecThe algorithm parameter specification for an initialization vector. |
Fields Summary |
---|
private final byte[] | iv |
Constructors Summary |
---|
public IvParameterSpec(byte[] iv)Creates a new IvParameterSpec instance with the bytes from
the specified buffer iv used as initialization vector.
if (iv == null) {
throw new NullPointerException(Messages.getString("crypto.38")); //$NON-NLS-1$
}
this.iv = new byte[iv.length];
System.arraycopy(iv, 0, this.iv, 0, iv.length);
| public IvParameterSpec(byte[] iv, int offset, int len)Creates a new IvParameterSpec instance with len
bytes from the specified buffer iv starting at
offset .
if ((iv == null) || (iv.length - offset < len)) {
throw new IllegalArgumentException(
Messages.getString("crypto.39")); //$NON-NLS-1$
}
if (offset < 0 || len < 0) {
throw new ArrayIndexOutOfBoundsException(Messages.getString("crypto.3A")); //$NON-NLS-1$
}
this.iv = new byte[len];
System.arraycopy(iv, offset, this.iv, 0, len);
|
Methods Summary |
---|
public byte[] | getIV()Returns a copy of the initialization vector data.
byte[] res = new byte[iv.length];
System.arraycopy(iv, 0, res, 0, iv.length);
return res;
|
|