public class IDEAParameters extends IvParameters
The parameters for the IDEA algorithm are specified in RFC3058 and consist of only an optional initialization vector (of eight octets):
IDEA-CBCPar ::= SEQUENCE {
iv OCTET STRING OPTIONAL } -- exactly 8 octets
IDEAParameters can be generated provide-independently by calling one of the
AlgorithmParameters.getInstance methods for the algorithm in
mind. Subsequently, the new AlgorithmParameters object must be initialized
with a proper IDEA parameter specification or a DER encoded byte array. If
the first way is chosen, the parameter value (iv) for initializing the new
AlgorithmParameters object taken from the given IDEA parameter
specification. If the parameters are given as DER encoded byte array, the
value are parsed from the derived ASN.1 object, e.g.:
IDEAParameterspec ideaParmSpec = ...; AlgorithmParameters params = AlgorithmParameters.getInstance( "IDEA", "Entrust" ); params.init(ideaParamsSpec);
For obtaining IDEA parameters in transparent representation from an opaque
IDEAParameters object, the getParameterSpec method can be used.
For obtaining the parameters as DER encoded ASN.1 object, use
getEncoded.
iv| Constructor and Description |
|---|
IDEAParameters()
The default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
engineGetEncoded()
Returns the parameters as a DER byte array.
|
protected byte[] |
engineGetEncoded(java.lang.String format)
Returns the parameters as a DER byte array.
|
protected java.security.spec.AlgorithmParameterSpec |
engineGetParameterSpec(java.lang.Class paramSpec)
Returns the IDEA parameters as a transparent IDEA parameter specification
of the given class type.
|
protected void |
engineInit(java.security.spec.AlgorithmParameterSpec paramSpec)
Initializes this IDEAParameters with the IDEA parameter values from a
given IDEAParameterspec or a IvParameterSpec.
|
protected void |
engineInit(byte[] params)
Initializes this IDEAParameters object by parsing the given DER encoded
byte array.
|
protected void |
engineInit(byte[] params,
java.lang.String format)
Inits the parameters from an DER encoded byte array.
|
protected java.lang.String |
engineToString()
Returns a String representation of the IDEA parameters.
|
public IDEAParameters()
IDEAParameters object. Applications shall use one of the
AlgorithmParameters.getInstance factory methods for
obtaining IDEAParameters.protected byte[] engineGetEncoded()
IDEA-CBCPar ::= SEQUENCE { iv OCTET STRING OPTIONAL } -- exactly 8 octets
engineGetEncoded in class IvParametersprotected byte[] engineGetEncoded(java.lang.String format)
throws java.io.IOException
The format is ignored. Only DER-encoding is supported at this time. This
method simply calls engineGetEncoded() for
encoding the IV value as an ASN.1 OCTET STRING, regardless of what is
specified in the format string.
engineGetEncoded in class IvParametersformat - the encoding format - ignoredjava.io.IOException - if an encoding error occursprotected java.security.spec.AlgorithmParameterSpec engineGetParameterSpec(java.lang.Class paramSpec)
throws java.security.spec.InvalidParameterSpecException
engineGetParameterSpec in class IvParametersparamSpec - the desired parameter specification class (IDEAParameterSpec)java.security.spec.InvalidParameterSpecException - if the parameters cannot be
converted to the desired parameter specificationprotected void engineInit(java.security.spec.AlgorithmParameterSpec paramSpec)
throws java.security.spec.InvalidParameterSpecException
engineInit in class IvParametersparamSpec - the parameter specification, which has to be a
IDEAParameterSpec or a IvParameterSpecjava.security.spec.InvalidParameterSpecException - if the given parameter specification
is not a IDEAParameterSpec or a
IvParameterSpec, or the included
parameters are invalidprotected void engineInit(byte[] params)
throws java.io.IOException
engineInit in class IvParametersparams - the DER encoded byte arrayjava.io.IOException - if an error occurs when decoding the given byte
array or the derived parameter values are invalidprotected void engineInit(byte[] params,
java.lang.String format)
throws java.io.IOException
engineInit(params) for initializing this
IDEAParameters object from the given DER encoded byte array, regardless of
what is specified in the format string.engineInit in class IvParametersparams - the DER encoded byte arrayformat - the encoding format - ignoredjava.io.IOException - if an error occurs when decoding the given byte arrayprotected java.lang.String engineToString()
engineToString in class IvParameters