de.fhg.igd.crypto
Class PBEParameters

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

public class PBEParameters
extends AlgorithmParametersSpi

This class represents a PBEParameter structure as defined in PKCS#5. This structure is identified by the following OIDs, depending on the actual algorithm for which it is used:

PBEWithMD2AndDES[-CBC]
iso(1) member-body(2) US(840) rsadsi(113549) pkcs(1) pkcs-5(5) 1
PBEWithMD5AndDES[-CBC]
iso(1) member-body(2) US(840) rsadsi(113549) pkcs(1) pkcs-5(5) 3
PBEWithSHA1And128BitRC4
iso(1) member-body(2) US(840) rsadsi(113549) pkcs(1) pkcs-5(5) 12

Version:
"$Id: PBEParameters.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Volker Roth

Field Summary
protected  int count_
          The iteration count.
protected  byte[] salt_
          The salt value.
 
Constructor Summary
PBEParameters()
           
 
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 PBEParameterSpec.
 void engineInit(byte[] b)
          This method expects DER encoded PBEParameters as defined in the PKCS#5 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

count_

protected int count_
The iteration count.


salt_

protected byte[] salt_
The salt value.

Constructor Detail

PBEParameters

public PBEParameters()
Method Detail

engineInit

public void engineInit(AlgorithmParameterSpec paramSpec)
                throws InvalidParameterSpecException
This method accepts an PBEParameterSpec. Other specs cause an exception being thrown. The parameter spec must have an iteration count in the range [1,Integer.MAX_VALUE] and exactly 8 salt bytes.

Specified by:
engineInit in class AlgorithmParametersSpi
Parameters:
paramSpec - The PBEParameterSpec with the salt and iteration count.
Throws:
InvalidParameterSpecException

engineInit

public void engineInit(byte[] b)
                throws IOException
This method expects DER encoded PBEParameters as defined in the PKCS#5 standard. In case of a bad encoding an exception is thrown.

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

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.