com.ibm.crypto.fips.provider
Class DSAKeyFactory

java.lang.Object
  |
  +--java.security.KeyFactorySpi
        |
        +--com.ibm.crypto.fips.provider.DSAKeyFactory
All Implemented Interfaces:
AlgorithmStatus

public class DSAKeyFactory
extends java.security.KeyFactorySpi
implements AlgorithmStatus

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

Version:
1.0
Author:
OTI

Constructor Summary
DSAKeyFactory()
          Constructs a new instance of this class.
 
Method Summary
protected  java.security.PrivateKey engineGeneratePrivate(java.security.spec.KeySpec keySpec)
          Generates a private key for the given key specification.
protected  java.security.PublicKey engineGeneratePublic(java.security.spec.KeySpec keySpec)
          Generates a public key for the given key specification.
protected  java.security.spec.KeySpec engineGetKeySpec(java.security.Key key, java.lang.Class keySpec)
          Answers a key specification for a given key.
protected  java.security.Key engineTranslateKey(java.security.Key key)
          This action is not allowed in this provider.
protected  java.security.PrivateKey internalGeneratePrivate(java.security.spec.KeySpec keySpec)
          Generates a private key for the given key specification.
protected  java.security.PublicKey internalGeneratePublic(java.security.spec.KeySpec keySpec)
          Generates a public key for the given key specification.
protected  java.security.spec.KeySpec internalGetKeySpec(java.security.Key key, java.lang.Class keySpec)
          Answers a key specification for a given key.
 boolean isFipsApproved()
          Module identifies if the cryptographic operation (algorithm) is FIPS certified
 
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

isFipsApproved

public boolean isFipsApproved()
Description copied from interface: AlgorithmStatus
Module identifies if the cryptographic operation (algorithm) is FIPS certified
Specified by:
isFipsApproved in interface AlgorithmStatus
See Also:
AlgorithmStatus.isFipsApproved()

engineGeneratePrivate

protected java.security.PrivateKey engineGeneratePrivate(java.security.spec.KeySpec keySpec)
                                                  throws java.security.spec.InvalidKeySpecException
Generates a private key for the given key specification.
Overrides:
engineGeneratePrivate in class java.security.KeyFactorySpi
Parameters:
keySpec - KeySpec the key specification to be used for key generation.
Returns:
PrivateKey the newly created DSA private key
Throws:
java.security.spec.InvalidKeySpecException - if the provided key specification is not appropriate
FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.

internalGeneratePrivate

protected java.security.PrivateKey internalGeneratePrivate(java.security.spec.KeySpec keySpec)
                                                    throws java.security.spec.InvalidKeySpecException
Generates a private key for the given key specification.
Parameters:
keySpec - KeySpec the key specification to be used for key generation.
Returns:
PrivateKey the newly created DSA private key
Throws:
java.security.spec.InvalidKeySpecException - if the provided key specification is not appropriate

engineGeneratePublic

protected java.security.PublicKey engineGeneratePublic(java.security.spec.KeySpec keySpec)
                                                throws java.security.spec.InvalidKeySpecException
Generates a public key for the given key specification.
Overrides:
engineGeneratePublic in class java.security.KeyFactorySpi
Parameters:
keySpec - KeySpec the key specification to be used for key generation.
Returns:
PublicKey the newly created public key
Throws:
java.security.spec.InvalidKeySpecException - if the provided key specification is not appropriate
FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.

internalGeneratePublic

protected java.security.PublicKey internalGeneratePublic(java.security.spec.KeySpec keySpec)
                                                  throws java.security.spec.InvalidKeySpecException
Generates a public key for the given key specification.
Parameters:
keySpec - KeySpec the key specification to be used for key generation.
Returns:
PublicKey the newly created public key
Throws:
java.security.spec.InvalidKeySpecException - if the provided key specification is not appropriate

engineGetKeySpec

protected java.security.spec.KeySpec engineGetKeySpec(java.security.Key key,
                                                      java.lang.Class keySpec)
                                               throws java.security.spec.InvalidKeySpecException
Answers a key specification for a given key.
Overrides:
engineGetKeySpec in class java.security.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:
java.security.spec.InvalidKeySpecException - if the provided key specification is not appropriate
FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.

internalGetKeySpec

protected java.security.spec.KeySpec internalGetKeySpec(java.security.Key key,
                                                        java.lang.Class keySpec)
                                                 throws java.security.spec.InvalidKeySpecException
Answers a key specification for a given key.
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:
java.security.spec.InvalidKeySpecException - if the provided key specification is not appropriate

engineTranslateKey

protected java.security.Key engineTranslateKey(java.security.Key key)
                                        throws java.security.InvalidKeyException
This action is not allowed in this provider. This method is only here to be complient wiht the SUN JCE JCK tests. If a key is passed in, this method will basically return it back to you without doing any work.
Overrides:
engineTranslateKey in class java.security.KeyFactorySpi
Parameters:
key - the key.
Throws:
java.security.InvalidKeyException - if the given key is null.