public final class IvParameters
extends java.security.AlgorithmParametersSpi
IV algorithm parameters contain a 8-byte initialization vector. These parameters are designed to be used with the an 8-byte block symmetric cipher (i.e. DESede) in a block mode that requires an initialization vector (i.e. CBC).
This class provides the capability to convert IV algorithm parameters to/from transparent representation. Currently, the following transparent algorithm parameter representations are supported:
javax.crypto.spec.IvParameterSpeccom.entrust.toolkit.security.spec.IvParameterSpecThis class also provides the capability to convert IV algorithm parameters to/from encoded representation. Currently, the following encoding/decoding formats are supported:
The following ASN.1 structure is supported by the ASN.1 encoding/decoding format:
IV ::= OCTET STRING -- exactly 8 octets
| Constructor and Description |
|---|
IvParameters()
The constructor; creates a new instance of IV algorithm parameters.
|
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
engineGetEncoded()
Returns the algorithm parameters in encoded representation by encoding
them using the primary encoding format.
|
protected byte[] |
engineGetEncoded(java.lang.String format)
Returns the algorithm parameters in encoded representation by encoding
them using the specified encoding format.
|
protected <T extends java.security.spec.AlgorithmParameterSpec> |
engineGetParameterSpec(java.lang.Class<T> paramSpec)
Returns the algorithm parameters in transparent representation.
|
protected void |
engineInit(java.security.spec.AlgorithmParameterSpec paramSpec)
Initializes this algorithm parameters object using the algorithm
parameters provided in transparent representation.
|
protected void |
engineInit(byte[] params)
Initializes this algorithm parameters object using the algorithm
parameters provided in encoded representation by decoding them using
the primary decoding format.
|
protected void |
engineInit(byte[] params,
java.lang.String format)
Initializes this algorithm parameters object using the algorithm
parameters provided in encoded representation by decoding them using
the specified decoding format.
|
protected java.lang.String |
engineToString()
Returns a formatted string describing the parameters.
|
public IvParameters()
Applications should never use this constructor, instead the algorithm
parameters should be requested from the appropriate JCA/JCE cryptographic
service provider as follows:
AlgorithmParameters.getInstance("IV", "Entrust").
protected void engineInit(java.security.spec.AlgorithmParameterSpec paramSpec)
throws java.security.spec.InvalidParameterSpecException
For details on the algorithm parameter specifications supported refer to the class documentation of the instance.
engineInit in class java.security.AlgorithmParametersSpiparamSpec - the algorithm parameters in transparent representationjava.security.spec.InvalidParameterSpecException - if the given algorithm parameter specification is
inappropriate for the initialization of this parameters
objectprotected void engineInit(byte[] params)
throws java.io.IOException
The primary decoding format is 'ASN.1'; for details on this format refer to the class documentation of the instance.
engineInit in class java.security.AlgorithmParametersSpiparams - the algorithm parameters in encoded representationjava.io.IOException - on decoding errorsprotected void engineInit(byte[] params,
java.lang.String format)
throws java.io.IOException
If format is null, the primary decoding format is used.
The primary decoding format is 'ASN.1'; for details on the supported
decoding formats refer to the class documentation of the instance.
engineInit in class java.security.AlgorithmParametersSpiparams - the algorithm parameters in encoded representationformat - the name of the decoding formatjava.io.IOException - if the decoding format is unsupported or a decoding error
occursprotected byte[] engineGetEncoded()
The primary encoding format is 'ASN.1'; for details on this format refer to the class documentation of the instance.
engineGetEncoded in class java.security.AlgorithmParametersSpiprotected byte[] engineGetEncoded(java.lang.String format)
throws java.io.IOException
If format is null, the primary encoding format is used.
The primary encoding format is 'ASN.1'; for details on the supported
encoding formats refer to the class documentation of the instance.
engineGetEncoded in class java.security.AlgorithmParametersSpiformat - the name of the encoding formatjava.io.IOException - if the encoding format is unsupportedprotected <T extends java.security.spec.AlgorithmParameterSpec> T engineGetParameterSpec(java.lang.Class<T> paramSpec)
throws java.security.spec.InvalidParameterSpecException
For details on the parameter specifications supported refer to the class documentation of the instance.
engineGetParameterSpec in class java.security.AlgorithmParametersSpiparamSpec - the parameter specification class in which the algorithm
parameters should be returnedjava.security.spec.InvalidParameterSpecException - if the requested parameter specification is inappropriate for
this parameters objectprotected java.lang.String engineToString()
engineToString in class java.security.AlgorithmParametersSpi