Class DSAKeyFactoryImpl
java.lang.Object
java.security.KeyFactorySpi
org.apache.harmony.security.provider.crypto.DSAKeyFactoryImpl
public class DSAKeyFactoryImpl extends KeyFactorySpi
-
Constructor Summary
Constructors Constructor Description DSAKeyFactoryImpl() -
Method Summary
Modifier and Type Method Description protected PrivateKeyengineGeneratePrivate(KeySpec keySpec)This method generates a DSAPrivateKey object from the provided key specification.protected PublicKeyengineGeneratePublic(KeySpec keySpec)This method generates a DSAPublicKey object from the provided key specification.protected <T extends KeySpec>
TengineGetKeySpec(Key key, Class<T> keySpec)This method returns a specification for the supplied key.protected KeyengineTranslateKey(Key key)The method generates a DSAPublicKey object from the provided key.
-
Constructor Details
-
DSAKeyFactoryImpl
public DSAKeyFactoryImpl()
-
-
Method Details
-
engineGeneratePrivate
This method generates a DSAPrivateKey object from the provided key specification.- Specified by:
engineGeneratePrivatein classKeyFactorySpi- Parameters:
keySpec- - the specification (key material) for the DSAPrivateKey.- Returns:
- a DSAPrivateKey object
- Throws:
InvalidKeySpecException- if "keySpec" is neither DSAPrivateKeySpec nor PKCS8EncodedKeySpec
-
engineGeneratePublic
This method generates a DSAPublicKey object from the provided key specification.- Specified by:
engineGeneratePublicin classKeyFactorySpi- Parameters:
keySpec- - the specification (key material) for the DSAPublicKey.- Returns:
- a DSAPublicKey object
- Throws:
InvalidKeySpecException- if "keySpec" is neither DSAPublicKeySpec nor X509EncodedKeySpec
-
engineGetKeySpec
protected <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpec) throws InvalidKeySpecExceptionThis method returns a specification for the supplied key. The specification will be returned in the form of an object of the type specified by keySpec.- Specified by:
engineGetKeySpecin classKeyFactorySpi- Parameters:
key- - either DSAPrivateKey or DSAPublicKeykeySpec- - either DSAPrivateKeySpec.class or DSAPublicKeySpec.class- Returns:
- either a DSAPrivateKeySpec or a DSAPublicKeySpec
- Throws:
InvalidKeySpecException- if "keySpec" is not a specification for DSAPublicKey or DSAPrivateKey
-
engineTranslateKey
The method generates a DSAPublicKey object from the provided key.- Specified by:
engineTranslateKeyin classKeyFactorySpi- Parameters:
key- - a DSAPublicKey object or DSAPrivateKey object.- Returns:
- object of the same type as the "key" argument
- Throws:
InvalidKeyException- if "key" is neither DSAPublicKey nor DSAPrivateKey
-