Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.security

Class KeyFactorySpi

java.lang.Object
|
+--java.security.KeyFactorySpi


public abstract class KeyFactorySpi

extends 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:Author:

Constructor Summary

KeyFactorySpi()

Constucts a new KeyFactorySpi.

Method Summary

java.security.PrivateKeyengineGeneratePrivate(java.security.spec.KeySpec keySpec)

Generates a private key from the provided key specification.
java.security.PublicKeyengineGeneratePublic(java.security.spec.KeySpec keySpec)

Generates a public key from the provided key specification.
java.security.spec.KeySpecengineGetKeySpec(java.security.Key key, java.lang.Class keySpec)

Returns a key specification for the given key.
java.security.KeyengineTranslateKey(java.security.Key key)

Translates the key from an unknown or untrusted provider into a key for this key factory.

Constructor Details

KeyFactorySpi

public KeyFactorySpi()

Constucts a new KeyFactorySpi.


Method Details

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:

Throws:


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: