com.ibm.crypto.provider
Class DSAKeyFactory

java.lang.Object
  extended by java.security.KeyFactorySpi
      extended by com.ibm.crypto.provider.DSAKeyFactory

public class DSAKeyFactory
extends KeyFactorySpi

This class is a concrete implementaion of key factory for DSA.


Constructor Summary
DSAKeyFactory()
          Constructs a new instance of this class.
 
Method Summary
protected  PrivateKey engineGeneratePrivate(KeySpec keySpec)
          Generates a private key for the given key specification.
protected  PublicKey engineGeneratePublic(KeySpec keySpec)
          Generates a public key for the given key specification.
protected  KeySpec engineGetKeySpec(Key key, Class keySpec)
          Answers a key specification for a given key.
protected  Key engineTranslateKey(Key key)
          Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSAKeyFactory

public DSAKeyFactory()
Constructs a new instance of this class.

Method Detail

engineGeneratePrivate

protected PrivateKey engineGeneratePrivate(KeySpec keySpec)
                                    throws InvalidKeySpecException
Generates a private key for the given key specification.

Specified by:
engineGeneratePrivate in class KeyFactorySpi
Parameters:
keySpec - KeySpec the key specification to be used for key generation.
Returns:
PrivateKey the newly created DSA private key
Throws:
InvalidKeySpecException - if the provided key specification is not appropriate

engineGeneratePublic

protected PublicKey engineGeneratePublic(KeySpec keySpec)
                                  throws InvalidKeySpecException
Generates a public key for the given key specification.

Specified by:
engineGeneratePublic in class KeyFactorySpi
Parameters:
keySpec - KeySpec the key specification to be used for key generation.
Returns:
PublicKey the newly created public key
Throws:
InvalidKeySpecException - if the provided key specification is not appropriate

engineGetKeySpec

protected KeySpec engineGetKeySpec(Key key,
                                   Class keySpec)
                            throws InvalidKeySpecException
Answers a key specification for a given key.

Specified by:
engineGetKeySpec in class KeyFactorySpi
Parameters:
key - Key the key for which the specification is to be computed.
keySpec - Class the class of the result specification
Returns:
a key specification for a given key. The class of the result object will be keySpec.
Throws:
InvalidKeySpecException - if the provided key specification is not appropriate

engineTranslateKey

protected Key engineTranslateKey(Key key)
                          throws InvalidKeyException
Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.

Specified by:
engineTranslateKey in class KeyFactorySpi
Parameters:
key - the key whose provider is unknown or untrusted
Returns:
the translated key
Throws:
InvalidKeyException - if the given key cannot be processed by this key factory.