com.ibm.crypto.provider
Class DSAKeyFactory
java.lang.Object
|
+--java.security.KeyFactorySpi
|
+--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. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
DSAKeyFactory
public DSAKeyFactory()
- Constructs a new instance of this class.
engineGeneratePrivate
protected PrivateKey engineGeneratePrivate(KeySpec keySpec)
throws InvalidKeySpecException
- Generates a private key for the given key specification.
- Overrides:
- 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.
- Overrides:
- 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.
- Overrides:
- 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.
- Overrides:
- 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.