to top
Android APIs
public abstract class

KeyFactorySpi

extends Object
java.lang.Object
   ↳ java.security.KeyFactorySpi

Class Overview

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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public KeyFactorySpi ()

Since: API Level 1

Protected Methods

protected abstract PrivateKey engineGeneratePrivate (KeySpec keySpec)

Since: API Level 1

Generates a instance of PrivateKey from the given key specification.

Parameters
keySpec the specification of the private key.
Returns
  • the private key.
Throws
InvalidKeySpecException if the specified keySpec is invalid.

protected abstract PublicKey engineGeneratePublic (KeySpec keySpec)

Since: API Level 1

Generates a instance of PublicKey from the given key specification.

Parameters
keySpec the specification of the public key.
Returns
  • the public key.
Throws
InvalidKeySpecException if the specified keySpec is invalid.

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

Since: API Level 1

Returns the key specification for the specified key.

Parameters
key the key from which the specification is requested.
keySpec the type of the requested KeySpec.
Returns
  • 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.

protected abstract Key engineTranslateKey (Key key)

Since: API Level 1

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

Parameters
key the key to translate.
Returns
  • the translated key.
Throws
InvalidKeyException if the specified key can not be translated by this key factory.