|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.security.KeyFactorySpi
public abstract class KeyFactorySpi
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.
Constructor Summary | |
---|---|
KeyFactorySpi()
Constucts a new KeyFactorySpi. |
Method Summary | ||
---|---|---|
protected abstract PrivateKey |
engineGeneratePrivate(KeySpec keySpec)
Generates a private key from the provided key specification. |
|
protected abstract PublicKey |
engineGeneratePublic(KeySpec keySpec)
Generates a public key from the provided key specification. |
|
protected abstract
|
engineGetKeySpec(Key key,
Class<T> keySpec)
Returns a key specification for the given key. keySpec identifies the specification class to return the key material in. |
|
protected abstract Key |
engineTranslateKey(Key key)
Translates the key from an unknown or untrusted provider into a key for this key factory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KeyFactorySpi()
Method Detail |
---|
protected abstract PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException
keySpec
- key specification
InvalidKeySpecException
- invalid key specification for
this key factory to produce a public keyprotected abstract PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException
keySpec
- key specification
InvalidKeySpecException
- invalid key specification for
this key factory to produce a private keyprotected abstract <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpec) throws InvalidKeySpecException
key
- the keykeySpec
- the specification class to return the
key material in.
InvalidKeySpecException
- the requested key specification
is inappropriate for this key or the key is
unrecognized.protected abstract Key engineTranslateKey(Key key) throws InvalidKeyException
key
- key from an unknown or untrusted provider
InvalidKeyException
- if the key cannot be
processed by this key factory
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |