Skip to content

Most visited

Recently visited

navigation
Added in API level 1

KeyGeneratorSpi

public abstract class KeyGeneratorSpi
extends Object

java.lang.Object
   ↳ javax.crypto.KeyGeneratorSpi


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

See also:

Summary

Public constructors

KeyGeneratorSpi()

Creates a new KeyGeneratorSpi instance.

Protected methods

abstract SecretKey engineGenerateKey()

Generates a secret key.

abstract void engineInit(int keysize, SecureRandom random)

Initializes this KeyGenerator instance for the specified key size (in bits) using the specified randomness source.

abstract void engineInit(SecureRandom random)

Initializes this KeyGenerator with the specified randomness source.

abstract void engineInit(AlgorithmParameterSpec params, SecureRandom random)

Initializes this KeyGeneratorSpi instance with the specified algorithm parameters and randomness source.

Inherited methods

From class java.lang.Object

Public constructors

KeyGeneratorSpi

Added in API level 1
KeyGeneratorSpi ()

Creates a new KeyGeneratorSpi instance.

Protected methods

engineGenerateKey

Added in API level 1
SecretKey engineGenerateKey ()

Generates a secret key.

Returns
SecretKey the generated secret key.

engineInit

Added in API level 1
void engineInit (int keysize, 
                SecureRandom random)

Initializes this KeyGenerator instance for the specified key size (in bits) using the specified randomness source.

Parameters
keysize int: the size of the key (in bits).
random SecureRandom: the randomness source for any random bytes.

engineInit

Added in API level 1
void engineInit (SecureRandom random)

Initializes this KeyGenerator with the specified randomness source.

Parameters
random SecureRandom: the randomness source for any random bytes.

engineInit

Added in API level 1
void engineInit (AlgorithmParameterSpec params, 
                SecureRandom random)

Initializes this KeyGeneratorSpi instance with the specified algorithm parameters and randomness source.

Parameters
params AlgorithmParameterSpec: the parameters for the key generation algorithm.
random SecureRandom: the randomness source for any random bytes.
Throws
InvalidAlgorithmParameterException if the parameters cannot be uses to initialize this key generator algorithm.
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.