public class IvParameterSpec
extends Object implements AlgorithmParameterSpec
| java.lang.Object | |
| javax.crypto.spec.IvParameterSpec | |
这个类指定了一个初始化向量 (IV)。 使用IV的示例是反馈模式下的密码,例如CBC模式下的DES和OAEP编码操作的RSA密码。
Public constructors |
|
|---|---|
IvParameterSpec(byte[] iv) 使用 |
|
IvParameterSpec(byte[] iv, int offset, int len) 创建使用第一构造一个IvParameterSpec对象 |
|
公共方法(Public methods) |
|
|---|---|
byte[] |
getIV() 返回初始化向量(IV)。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
IvParameterSpec (byte[] iv)
使用 iv的字节作为IV创建一个IvParameterSpec对象。
| 参数(Parameters) | |
|---|---|
iv |
byte: the buffer with the IV. The contents of the buffer are copied to protect against subsequent modification. |
| 抛出异常(Throws) | |
|---|---|
NullPointerException |
if iv is null |
IvParameterSpec (byte[] iv,
int offset,
int len)
创建使用第一构造一个IvParameterSpec对象 len字节 iv ,在开始 offset以下,作为IV。
构成IV的字节是 iv[offset]和 iv[offset+len-1]之间的那些字节。
| 参数(Parameters) | |
|---|---|
iv |
byte: the buffer with the IV. The first len bytes of the buffer beginning at offset inclusive are copied to protect against subsequent modification. |
offset |
int: the offset in iv where the IV starts. |
len |
int: the number of IV bytes. |
| 抛出异常(Throws) | |
|---|---|
IllegalArgumentException |
if iv is null or (iv.length - offset < len) |
ArrayIndexOutOfBoundsException |
is thrown if offset or len index bytes outside the iv. |
byte[] getIV ()
返回初始化向量(IV)。
| 返回(Returns) | |
|---|---|
byte[] |
the initialization vector (IV). Returns a new array each time this method is called. |