public abstract class

SecretKeyFactorySpi

extends Object
java.lang.Object
   ↳ javax.crypto.SecretKeyFactorySpi

Class Overview

The Service Provider Interface (SPI) definition for the SecretKeyFactory class.

Summary

Public Constructors
SecretKeyFactorySpi()
Creates a new SecretKeyFactorySpi instance.
Protected Methods
abstract SecretKey engineGenerateSecret(KeySpec keySpec)
Generate a secret key from the specified key specification.
abstract KeySpec engineGetKeySpec(SecretKey key, Class keySpec)
Returns the key specification of the specified secret key.
abstract SecretKey engineTranslateKey(SecretKey key)
Translates the specified secret key into an instance of the corresponding key from the provider of this key factory.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public SecretKeyFactorySpi ()

Creates a new SecretKeyFactorySpi instance.

Protected Methods

protected abstract SecretKey engineGenerateSecret (KeySpec keySpec)

Generate a secret key from the specified key specification.

Parameters
keySpec the key specification.
Returns
  • a secret key.
Throws
InvalidKeySpecException if the specified key specification cannot be used to generate a secret key.

protected abstract KeySpec engineGetKeySpec (SecretKey key, Class keySpec)

Returns the key specification of the specified secret key.

Parameters
key the secret key to get the specification from.
keySpec the target key specification class.
Returns
  • an instance of the specified key specification class.
Throws
InvalidKeySpecException if the specified secret key cannot be transformed into the requested key specification.

protected abstract SecretKey engineTranslateKey (SecretKey key)

Translates the specified secret key into an instance of the corresponding key from the provider of this key factory.

Parameters
key the secret key to translate.
Returns
  • the corresponding translated key.
Throws
InvalidKeyException if the specified key cannot be translated using this key factory.