Skip to content

Most visited

Recently visited

navigation
Added in API level 1

KeyFactorySpi

public abstract class KeyFactorySpi
extends Object

java.lang.Object
   ↳ java.security.KeyFactorySpi


KeyFactorySpi is the Service Provider Interface (SPI) definition for KeyFactory.

See also:

Summary

Public constructors

KeyFactorySpi()

Protected methods

abstract PrivateKey engineGeneratePrivate(KeySpec keySpec)

Generates a instance of PrivateKey from the given key specification.

abstract PublicKey engineGeneratePublic(KeySpec keySpec)

Generates a instance of PublicKey from the given key specification.

abstract <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpec)

Returns the key specification for the specified key.

abstract Key engineTranslateKey(Key key)

Translates the given key into a key from this key factory.

Inherited methods

From class java.lang.Object

Public constructors

KeyFactorySpi

Added in API level 1
KeyFactorySpi ()

Protected methods

engineGeneratePrivate

Added in API level 1
PrivateKey engineGeneratePrivate (KeySpec keySpec)

Generates a instance of PrivateKey from the given key specification.

Parameters
keySpec KeySpec: the specification of the private key.
Returns
PrivateKey the private key.
Throws
InvalidKeySpecException if the specified keySpec is invalid.

engineGeneratePublic

Added in API level 1
PublicKey engineGeneratePublic (KeySpec keySpec)

Generates a instance of PublicKey from the given key specification.

Parameters
keySpec KeySpec: the specification of the public key.
Returns
PublicKey the public key.
Throws
InvalidKeySpecException if the specified keySpec is invalid.

engineGetKeySpec

Added in API level 1
T engineGetKeySpec (Key key, 
                Class<T> keySpec)

Returns the key specification for the specified key.

Parameters
key Key: the key from which the specification is requested.
keySpec Class: the type of the requested KeySpec.
Returns
T the key specification for the specified key.
Throws
InvalidKeySpecException if the key can not be processed, or the requested requested KeySpec is inappropriate for the given key.

engineTranslateKey

Added in API level 1
Key engineTranslateKey (Key key)

Translates the given key into a key from this key factory.

Parameters
key Key: the key to translate.
Returns
Key the translated key.
Throws
InvalidKeyException if the specified key can not be translated by this key factory.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.