com.ibm.crypto.fips.provider
Class DSAKeyFactory
- java.lang.Object
-
- java.security.KeyFactorySpi
-
- com.ibm.crypto.fips.provider.DSAKeyFactory
-
public final class DSAKeyFactory extends java.security.KeyFactorySpiThis class is a concrete implementaion of key factory for DSA.
-
-
Constructor Summary
Constructors Constructor and Description DSAKeyFactory()Constructs a new instance of this class.
-
Method Summary
Methods Modifier and Type Method and Description protected java.security.PrivateKeyengineGeneratePrivate(java.security.spec.KeySpec keySpec)Generates a private key for the given key specification.protected java.security.PublicKeyengineGeneratePublic(java.security.spec.KeySpec keySpec)Generates a public key for the given key specification.protected java.security.spec.KeySpecengineGetKeySpec(java.security.Key key, java.lang.Class keySpec)Answers a key specification for a given key.protected java.security.KeyengineTranslateKey(java.security.Key key)This action is not allowed in this provider.protected java.security.PrivateKeyinternalGeneratePrivate(java.security.spec.KeySpec keySpec)Generates a private key for the given key specification.protected java.security.PublicKeyinternalGeneratePublic(java.security.spec.KeySpec keySpec)Generates a public key for the given key specification.protected java.security.spec.KeySpecinternalGetKeySpec(java.security.Key key, java.lang.Class keySpec)Answers a key specification for a given key.
-
-
-
Method Detail
-
engineGeneratePrivate
protected java.security.PrivateKey engineGeneratePrivate(java.security.spec.KeySpec keySpec) throws java.security.spec.InvalidKeySpecExceptionGenerates a private key for the given key specification.- Specified by:
engineGeneratePrivatein classjava.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 appropriateFIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalGeneratePrivate
protected java.security.PrivateKey internalGeneratePrivate(java.security.spec.KeySpec keySpec) throws java.security.spec.InvalidKeySpecExceptionGenerates 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.InvalidKeySpecExceptionGenerates a public key for the given key specification.- Specified by:
engineGeneratePublicin classjava.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 appropriateFIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalGeneratePublic
protected java.security.PublicKey internalGeneratePublic(java.security.spec.KeySpec keySpec) throws java.security.spec.InvalidKeySpecExceptionGenerates 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.InvalidKeySpecExceptionAnswers a key specification for a given key.- Specified by:
engineGetKeySpecin classjava.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 appropriateFIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalGetKeySpec
protected java.security.spec.KeySpec internalGetKeySpec(java.security.Key key, java.lang.Class keySpec) throws java.security.spec.InvalidKeySpecExceptionAnswers 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.InvalidKeyExceptionThis 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.- Specified by:
engineTranslateKeyin classjava.security.KeyFactorySpi- Parameters:
key- the key.- Throws:
java.security.InvalidKeyException- if the given key is null.
-
-