java.security
Class KeyFactorySpi
java.lang.Object
|
+--java.security.KeyFactorySpi
public abstract class
KeyFactorySpiextends
ObjectKeyFactorySpi is the Service Provider Interface (SPI) for the
KeyFactory class. This is the interface for providers to
supply to implement a key factory for an algorithm.
Key factories are used to convert keys (opaque cryptographic
keys of type Key) into key specifications (transparent
representations of the underlying key material).
Key factories are bi-directional. They allow a key class
to be converted into a key specification (key material) and
back again.
For example DSA public keys can be specified as
DSAPublicKeySpec or X509EncodedKeySpec. The key factory
translate these key specifications.
Since:Author:KeyFactorySpi
public KeyFactorySpi()
Constucts a new KeyFactorySpi.
engineGeneratePrivate
protected PrivateKey engineGeneratePrivate(java.security.spec.KeySpec keySpec)
Generates a private key from the provided key specification.
Parameters:
Returns:
Throws:
engineGeneratePublic
protected PublicKey engineGeneratePublic(java.security.spec.KeySpec keySpec)
Generates a public key from the provided key specification.
Parameters:
Returns:
Throws:
engineGetKeySpec
protected KeySpec engineGetKeySpec(java.security.Key key, java.lang.Class keySpec)
Returns a key specification for the given key. keySpec
identifies the specification class to return the key
material in.
Parameters:
Returns:
- the key specification in an instance of the requested
specification class
Throws:
InvalidKeySpecException
- the requested key specification
is inappropriate for this key or the key is
unrecognized.
engineTranslateKey
protected Key engineTranslateKey(java.security.Key key)
Translates the key from an unknown or untrusted provider
into a key for this key factory.
Parameters:
Returns:
Throws: