Package java.security
Class KeyFactorySpi
- java.lang.Object
-
- java.security.KeyFactorySpi
-
- Direct Known Subclasses:
BaseKeyFactorySpi,KeyFactory,OpenSSLECKeyFactory,OpenSSLRSAKeyFactory
public abstract class KeyFactorySpi extends Object
KeyFactorySpiis the Service Provider Interface (SPI) definition forKeyFactory.- See Also:
KeyFactory
-
-
Constructor Summary
Constructors Constructor Description KeyFactorySpi()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description protected abstract PrivateKeyengineGeneratePrivate(KeySpec keySpec)Generates a instance ofPrivateKeyfrom the given key specification.protected abstract PublicKeyengineGeneratePublic(KeySpec keySpec)Generates a instance ofPublicKeyfrom the given key specification.protected abstract <T extends KeySpec>
TengineGetKeySpec(Key key, Class<T> keySpec)Returns the key specification for the specified key.protected abstract KeyengineTranslateKey(Key key)Translates the given key into a key from this key factory.
-
-
-
Method Detail
-
engineGeneratePublic
protected abstract PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException
Generates a instance ofPublicKeyfrom the given key specification.- Parameters:
keySpec- the specification of the public key.- Returns:
- the public key.
- Throws:
InvalidKeySpecException- if the specifiedkeySpecis invalid.
-
engineGeneratePrivate
protected abstract PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException
Generates a instance ofPrivateKeyfrom the given key specification.- Parameters:
keySpec- the specification of the private key.- Returns:
- the private key.
- Throws:
InvalidKeySpecException- if the specifiedkeySpecis invalid.
-
engineGetKeySpec
protected abstract <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpec) throws InvalidKeySpecException
Returns the key specification for the specified key.- 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
protected abstract Key engineTranslateKey(Key key) throws InvalidKeyException
Translates the given key into a key from this key factory.- Parameters:
key- the key to translate.- Returns:
- the translated key.
- Throws:
InvalidKeyException- if the specified key can not be translated by this key factory.
-
-