Skip to content

Most visited

Recently visited

navigation
Added in API level 1

SecretKeyFactorySpi

public abstract class SecretKeyFactorySpi
extends Object

java.lang.Object
   ↳ javax.crypto.SecretKeyFactorySpi


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.

Inherited methods

From class java.lang.Object

Public constructors

SecretKeyFactorySpi

Added in API level 1
SecretKeyFactorySpi ()

Creates a new SecretKeyFactorySpi instance.

Protected methods

engineGenerateSecret

Added in API level 1
SecretKey engineGenerateSecret (KeySpec keySpec)

Generate a secret key from the specified key specification.

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

engineGetKeySpec

Added in API level 1
KeySpec engineGetKeySpec (SecretKey key, 
                Class keySpec)

Returns the key specification of the specified secret key.

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

engineTranslateKey

Added in API level 1
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 SecretKey: the secret key to translate.
Returns
SecretKey the corresponding translated key.
Throws
InvalidKeyException if the specified key cannot be translated using 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.