iaik.security.spec
Class IaikPBEParameterSpec

java.lang.Object
  |
  +--javax.crypto.spec.PBEParameterSpec
        |
        +--iaik.security.spec.IaikPBEParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec, ASN1Type

public class IaikPBEParameterSpec
extends PBEParameterSpec
implements ASN1Type

This class extends PBEParameterSpec and implements the ASN1Type interface. A PBEParameterSpec specifies the parameters salt and iteration count, as used by password based encryption according to PKCS#5.

Version:
File Revision 12

Constructor Summary
IaikPBEParameterSpec(ASN1Object algorithmParameter)
          Creates a PBE paramter specification from an ASN1Object.
IaikPBEParameterSpec(byte[] salt, int iterationCount)
          Specifies the PBE parameters, using a salt and a iteration count.
 
Method Summary
 void decode(ASN1Object obj)
          Decodes the given ASN.1 object and parses it for salt and iteration count.
 int getIterationCount()
          Returns the iteration count.
 byte[] getSalt()
          Returns the salt.
 ASN1Object toASN1Object()
          Returns this PBE parameter specification as an ASN1Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IaikPBEParameterSpec

public IaikPBEParameterSpec(byte[] salt,
                            int iterationCount)
Specifies the PBE parameters, using a salt and a iteration count.
Parameters:
salt - the salt value
iterationCount - the iteration count value

IaikPBEParameterSpec

public IaikPBEParameterSpec(ASN1Object algorithmParameter)
                     throws CodingException
Creates a PBE paramter specification from an ASN1Object. PBE parameters are most often transported as algorithm parameters. This constructor can be used to create PBE parameters from an algorithm parameter. Simply call:

IaikPBEParameterSpec params = new IaikPBEParameterSpec(encryptionAlg.getParameter());

Parameters:
algorithmParameter - the algorithm parameters as ASN1Object
Throws:
CodingException - if the parameter could not be decoded
Method Detail

getSalt

public byte[] getSalt()
Returns the salt.
Overrides:
getSalt in class PBEParameterSpec
Returns:
the salt

getIterationCount

public int getIterationCount()
Returns the iteration count.
Overrides:
getIterationCount in class PBEParameterSpec
Returns:
the iteration count

decode

public void decode(ASN1Object obj)
            throws CodingException
Decodes the given ASN.1 object and parses it for salt and iteration count.
Specified by:
decode in interface ASN1Type
Parameters:
obj - the algorithm parameters as ASN1Object
Throws:
CodingException - if the parameter could not be decoded

toASN1Object

public ASN1Object toASN1Object()
Returns this PBE parameter specification as an ASN1Object. An object of ASN.1 type SEQUENCE is created containing the salt at component 0 and the iteration count at component 1.
Specified by:
toASN1Object in interface ASN1Type
Returns:
this PBE parameter specification as an ASN1Object

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK