de.fhg.igd.crypto
Class DESParameters

java.lang.Object
  extended by java.security.AlgorithmParametersSpi
      extended by de.fhg.igd.crypto.DESParameters

public class DESParameters
extends AlgorithmParametersSpi

This class represents a DES Parameter as defined in RFC 2311 : S/MIME Version 2 Message Specification.

Version:
"$Id: DESParameters.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Oliver Neumann

Field Summary
protected  byte[] iv_
          The initialisation vector (IV), consisting of 8 bytes.
 
Constructor Summary
DESParameters()
           
 
Method Summary
 byte[] engineGetEncoded()
           
 byte[] engineGetEncoded(String format)
          This method returns the ASN.1/DER encoded parameter structure as defined in the S/MIME standard.
 AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec)
           
 void engineInit(AlgorithmParameterSpec paramSpec)
          This method accepts an IvParameterSpec.
 void engineInit(byte[] encoded)
          This method expects DER encoded DESParameters as defined in the S/MIME standard.
 void engineInit(byte[] params, String format)
          This method ignores the format string and attempts to decode according to ASN.1/DER and the parameter structure defined in the S/MIME standard.
 String engineToString()
           
static void main(String[] argv)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iv_

protected byte[] iv_
The initialisation vector (IV), consisting of 8 bytes.

Constructor Detail

DESParameters

public DESParameters()
Method Detail

main

public static void main(String[] argv)

engineInit

public void engineInit(AlgorithmParameterSpec paramSpec)
                throws InvalidParameterSpecException
This method accepts an IvParameterSpec. Other specs cause an exception being thrown.

Specified by:
engineInit in class AlgorithmParametersSpi
Parameters:
paramSpec - The IvParameterSpec with the IV.
Throws:
InvalidParameterSpecException

engineInit

public void engineInit(byte[] encoded)
                throws IOException
This method expects DER encoded DESParameters as defined in the S/MIME standard. In case of a bad encoding an IllegalArgumentException is thrown.

Specified by:
engineInit in class AlgorithmParametersSpi
Parameters:
encoded - The encoded algorithm parameters.
Throws:
IllegalArgumentException - in case of a bad encoding.
IOException

engineInit

public void engineInit(byte[] params,
                       String format)
                throws IOException
This method ignores the format string and attempts to decode according to ASN.1/DER and the parameter structure defined in the S/MIME standard.

Specified by:
engineInit in class AlgorithmParametersSpi
Throws:
IOException

engineGetParameterSpec

public AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec)
                                              throws InvalidParameterSpecException
Specified by:
engineGetParameterSpec in class AlgorithmParametersSpi
Throws:
InvalidParameterSpecException

engineGetEncoded

public byte[] engineGetEncoded()
                        throws IOException
Specified by:
engineGetEncoded in class AlgorithmParametersSpi
Throws:
IOException

engineGetEncoded

public byte[] engineGetEncoded(String format)
                        throws IOException
This method returns the ASN.1/DER encoded parameter structure as defined in the S/MIME standard. The format string is ignored since no standardised names exist for different encoding formats.

Specified by:
engineGetEncoded in class AlgorithmParametersSpi
Parameters:
format - The name of the encoding format; this parameter is ignored.
Returns:
The ASN.1/DER encoded S/MIME DESParameters.
Throws:
IOException

engineToString

public String engineToString()
Specified by:
engineToString in class AlgorithmParametersSpi


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.