de.flexiprovider.core.rijndael
Class RijndaelParameters

java.lang.Object
  |
  +--java.security.AlgorithmParametersSpi
        |
        +--de.flexiprovider.api.parameters.AlgorithmParameters
              |
              +--de.flexiprovider.core.rijndael.RijndaelParameters

public class RijndaelParameters
extends AlgorithmParameters

This class is used as an opaque representation of Rijndael parameters. ASN.1/DER encoding and decoding are supported.

Author:
Katja Rauch
See Also:
AlgorithmParameterSpec

Constructor Summary
RijndaelParameters()
           
 
Method Summary
 byte[] getEncoded()
          Return the parameters encoded in the primary encoding format (ASN.1).
 byte[] getEncoded(java.lang.String format)
          Return the parameters encoded in the specified encoding format.
 AlgorithmParameterSpec getParameterSpec(java.lang.Class paramSpec)
          Return a transparent specification of this parameters object.
 void init(AlgorithmParameterSpec params)
          Initialize this parameters object using the given parameter specification.
 void init(byte[] encParams)
          Import the specified parameters and decode them according to the primary decoding format (ASN.1).
 void init(byte[] encParams, java.lang.String format)
          Import the specified parameters and decode them according to the specified decoding format.
 java.lang.String toString()
           
 
Methods inherited from class de.flexiprovider.api.parameters.AlgorithmParameters
engineGetEncoded, engineGetEncoded, engineGetParameterSpec, engineInit, engineInit, engineInit, engineToString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RijndaelParameters

public RijndaelParameters()
Method Detail

init

public void init(AlgorithmParameterSpec params)
          throws InvalidParameterSpecException
Initialize this parameters object using the given parameter specification. The parameter specification has to be an instance of RijndaelParameterSpec.
Overrides:
init in class AlgorithmParameters
Parameters:
params - the parameter specification
Throws:
InvalidParameterSpecException - if the parameter specification is null or of an unsupported type.

init

public void init(byte[] encParams)
          throws java.io.IOException
Import the specified parameters and decode them according to the primary decoding format (ASN.1).
Overrides:
init in class AlgorithmParameters
Parameters:
encParams - the encoded parameters.
Throws:
java.io.IOException - on decoding errors

init

public void init(byte[] encParams,
                 java.lang.String format)
          throws java.io.IOException
Import the specified parameters and decode them according to the specified decoding format. Currently, only the primary decoding format (ASN.1) is supported.
Overrides:
init in class AlgorithmParameters
Parameters:
encParams - the encoded parameters
format - the name of the decoding format
Throws:
java.io.IOException - if format is not equal to "ASN.1" or on decoding errors.

getEncoded

public byte[] getEncoded()
Return the parameters encoded in the primary encoding format (ASN.1).

The ASN.1 definition of the parameters structure is:

 RijndaelParameters ::= SEQUENCE {
   blockSize  INTEGER,
   iv         CHOICE {
     NULL,
     OCTET STRING
   }
 }
 
Overrides:
getEncoded in class AlgorithmParameters
Returns:
the encoded parameters

getEncoded

public byte[] getEncoded(java.lang.String format)
                  throws java.io.IOException
Return the parameters encoded in the specified encoding format. Currently, only the primary encoding format (ASN.1) is supported.
Overrides:
getEncoded in class AlgorithmParameters
Parameters:
format - the name of the encoding format
Returns:
the encoded parameters
Throws:
java.io.IOException - if format is not equal to "ASN.1" or on decoding errors.

getParameterSpec

public AlgorithmParameterSpec getParameterSpec(java.lang.Class paramSpec)
                                        throws InvalidParameterSpecException
Return a transparent specification of this parameters object. paramSpec identifies the specification class in which the parameters should be returned. Currently, only RijndaelParameterSpec is supported.
Overrides:
getParameterSpec in class AlgorithmParameters
Parameters:
paramSpec - the the specification class in which the parameters should be returned
Returns:
the parameter specification
Throws:
InvalidParameterSpecException - if the requested parameter is not RijndaelParameterSpec.

toString

public java.lang.String toString()
Overrides:
toString in class AlgorithmParameters
Returns:
a formatted string describing the parameters