iaik.pkcs.pkcs1
Class MGF1ParameterSpec

java.lang.Object
  |
  +--iaik.pkcs.pkcs1.PKCS1AlgorithmParameterSpec
        |
        +--iaik.pkcs.pkcs1.MGF1ParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec

public class MGF1ParameterSpec
extends PKCS1AlgorithmParameterSpec

Algorithm parameter specification for the PKCS#1v2.1 MGF1 mask generation function.

According to PKCS#1v2.1 the only parameter used by MGF1 is the algorithm id of the hash algorithm (default SHA-1) to be used:

 mgf1SHA1 MaskGenAlgorithm ::= {
   algorithm id-mgf1,
   parameters HashAlgorithm : sha1
 }
 

Version:
File Revision 15

Constructor Summary
MGF1ParameterSpec()
          Creates a new MGF1ParameterSpec for the default hash algorithm (SHA-1) to be used with MGF1.
MGF1ParameterSpec(AlgorithmID hashAlgorithm)
          Creates a new MGF1ParameterSpec for the hash algorithm to be used with MGF1.
 
Method Summary
 AlgorithmID getHashAlgorithm()
          Returns the hash algorihtm to be used
 MessageDigest getHashEngine()
          Gets the JCA MessageDigest engine to be used by MGF1.
 void setHashEngine(MessageDigest hashEngine)
          Sets the JCA MessageDigest engine to be used by MGF1.
 String toString()
          Returns a String representation of this object.
 
Methods inherited from class iaik.pkcs.pkcs1.PKCS1AlgorithmParameterSpec
getSecureRandom, setSecureRandom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MGF1ParameterSpec

public MGF1ParameterSpec()
Creates a new MGF1ParameterSpec for the default hash algorithm (SHA-1) to be used with MGF1.

MGF1ParameterSpec

public MGF1ParameterSpec(AlgorithmID hashAlgorithm)
Creates a new MGF1ParameterSpec for the hash algorithm to be used with MGF1.
Parameters:
hashAlgorithm - the hash algorithm ID
Method Detail

getHashAlgorithm

public AlgorithmID getHashAlgorithm()
Returns the hash algorihtm to be used
Returns:
the hash algorithm

setHashEngine

public void setHashEngine(MessageDigest hashEngine)
Sets the JCA MessageDigest engine to be used by MGF1.

This method may be used to set a JCA MessageDigest engine to be used by MGF1 for doing the any required hashing operations. If not set by this method, getHashEngine will try to create a MessageDigest engine from the algorithm id.

Parameters:
hashEngine - the JCA MessageDigest engine to be used

getHashEngine

public MessageDigest getHashEngine()
                            throws NoSuchAlgorithmException
Gets the JCA MessageDigest engine to be used by MGF1.

If method setHashEngine has been used to set a MessageDigest engine, this engine is returned; otherwise it is tried to create a MessageDigest engine from the aslgorithm id.

Returns:
the MessageDigest engine to be used by MGF1

toString

public String toString()
Returns a String representation of this object.
Overrides:
toString in class Object
Returns:
a String representation this object

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