public class IDEAParameterSpec extends java.lang.Object implements java.security.spec.AlgorithmParameterSpec, ASN1Type
It specifies the initialization vector (IV), and is designed for use with the IDEA symmetric block cipher.
IDEAParameter ::= SEQUENCE {
iv OCTET STRING OPTIONAL -- exactly 8 octets
}
| Constructor and Description |
|---|
IDEAParameterSpec()
The default constructor.
|
IDEAParameterSpec(ASN1Object obj)
Creates a new
IDEAParameterSpec object from an
ASN1Object. |
IDEAParameterSpec(byte[] iv)
Creates a new
IDEAParameterSpec object with the specified
component. |
IDEAParameterSpec(byte[] iv,
int offset)
Creates a new
IDEAParameterSpec object with the specified
component. |
| Modifier and Type | Method and Description |
|---|---|
void |
decode(ASN1Object obj)
Decodes an
IDEAParameterSpec object from an
ASN1Object. |
byte[] |
getIV()
Returns a copy of the initialization vector (IV).
|
void |
setIV(byte[] iv,
int offset)
Sets the initialization vector (IV) by copying 8 bytes of data from the
byte array beginning at the specified offset.
|
ASN1Object |
toASN1Object()
Encodes this
IDEAParameterSpec object as an
ASN1Object. |
java.lang.String |
toString()
Creates a text representation of the ASN.1 structure of this
IDEAParameterSpec object. |
public IDEAParameterSpec()
It creates a new IDEAParameterSpec object with the
initialization vector (IV) not set (IV is an optional component).
public IDEAParameterSpec(byte[] iv)
IDEAParameterSpec object with the specified
component.
The first 8 bytes of the supplied byte array are copied, and used as the
initialization vector (IV). If the byte array is null, the
IV is not set (IV is an optional component).
iv - a byte array containing the initialization vectorjava.lang.ArrayIndexOutOfBoundsException - thrown if an 8-byte initialization vector could not be extracted
from the byte arraypublic IDEAParameterSpec(byte[] iv,
int offset)
IDEAParameterSpec object with the specified
component.
The 8-byte initialization vector (IV) is copied from the supplied byte array
starting at the indicated offset. If the byte array is null,
the IV is not set (IV is an optional component).
iv - a byte array containing the initialization vectoroffset - the offset in the byte array where the initialization vector beginsjava.lang.ArrayIndexOutOfBoundsException - thrown if an 8-byte initialization vector could not be extracted
from the byte arraypublic IDEAParameterSpec(ASN1Object obj) throws CodingException
IDEAParameterSpec object from an
ASN1Object.
The ASN1Object must be a IDEAParameter structure.
obj - the ASN.1 representation of a IDEAParameter structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic byte[] getIV()
If no IV has been set, null is returned.
public void setIV(byte[] iv,
int offset)
If the supplied byte array is null, then IV is set to
null (IV is an optional component).
iv - a byte array containing the initialization vectoroffset - the offset in the byte array where the initialization vector beginsjava.lang.ArrayIndexOutOfBoundsException - thrown if an 8-byte initialization vector could not be extracted
from the byte arraypublic void decode(ASN1Object obj) throws CodingException
IDEAParameterSpec object from an
ASN1Object.
The ASN1Object must be a IDEAParameter structure.
decode in interface ASN1Typeobj - an ASN.1 representation of a IDEAParameter structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic ASN1Object toASN1Object()
IDEAParameterSpec object as an
ASN1Object.toASN1Object in interface ASN1Typepublic java.lang.String toString()
IDEAParameterSpec object.toString in class java.lang.Object