Class KeyFactory
java.lang.Object
java.security.KeyFactorySpi
org.bouncycastle.jcajce.provider.asymmetric.x509.KeyFactory
public class KeyFactory extends KeyFactorySpi
-
Constructor Summary
Constructors Constructor Description KeyFactory() -
Method Summary
Modifier and Type Method Description protected PrivateKeyengineGeneratePrivate(KeySpec keySpec)Generates a instance ofPrivateKeyfrom the given key specification.protected PublicKeyengineGeneratePublic(KeySpec keySpec)Generates a instance ofPublicKeyfrom the given key specification.protected KeySpecengineGetKeySpec(Key key, Class keySpec)Returns the key specification for the specified key.protected KeyengineTranslateKey(Key key)Translates the given key into a key from this key factory.
-
Constructor Details
-
KeyFactory
public KeyFactory()
-
-
Method Details
-
engineGeneratePrivate
Description copied from class:KeyFactorySpiGenerates a instance ofPrivateKeyfrom the given key specification.- Specified by:
engineGeneratePrivatein classKeyFactorySpi- Parameters:
keySpec- the specification of the private key.- Returns:
- the private key.
- Throws:
InvalidKeySpecException- if the specifiedkeySpecis invalid.
-
engineGeneratePublic
Description copied from class:KeyFactorySpiGenerates a instance ofPublicKeyfrom the given key specification.- Specified by:
engineGeneratePublicin classKeyFactorySpi- Parameters:
keySpec- the specification of the public key.- Returns:
- the public key.
- Throws:
InvalidKeySpecException- if the specifiedkeySpecis invalid.
-
engineGetKeySpec
Description copied from class:KeyFactorySpiReturns the key specification for the specified key.- Specified by:
engineGetKeySpecin classKeyFactorySpi- Parameters:
key- the key from which the specification is requested.keySpec- the type of the requestedKeySpec.- Returns:
- the key specification for the specified key.
- Throws:
InvalidKeySpecException- if the key can not be processed, or the requested requestedKeySpecis inappropriate for the given key.
-
engineTranslateKey
Description copied from class:KeyFactorySpiTranslates the given key into a key from this key factory.- Specified by:
engineTranslateKeyin classKeyFactorySpi- Parameters:
key- the key to translate.- Returns:
- the translated key.
- Throws:
InvalidKeyException- if the specified key can not be translated by this key factory.
-