java.lang.Object
java.security.KeyFactorySpi
- public abstract class KeyFactorySpi
- extends java.lang.Object
KeyFactorySpi 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:
- JDK 1.2
|
Constructor Summary |
KeyFactorySpi()
Constucts a new KeyFactorySpi. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KeyFactorySpi
public KeyFactorySpi()
- Constucts a new KeyFactorySpi.
engineGeneratePublic
protected abstract PublicKey engineGeneratePublic(java.security.spec.KeySpec keySpec)
throws java.security.spec.InvalidKeySpecException
- Generates a public key from the provided key specification.
engineGeneratePrivate
protected abstract PrivateKey engineGeneratePrivate(java.security.spec.KeySpec keySpec)
throws java.security.spec.InvalidKeySpecException
- Generates a private key from the provided key specification.
engineGetKeySpec
protected abstract java.security.spec.KeySpec engineGetKeySpec(Key key,
java.lang.Class keySpec)
throws java.security.spec.InvalidKeySpecException
- Returns a key specification for the given key. keySpec
identifies the specification class to return the key
material in.
engineTranslateKey
protected abstract Key engineTranslateKey(Key key)
throws InvalidKeyException
- Translates the key from an unknown or untrusted provider
into a key for this key factory.