Android APIs
public abstract class

KeyGeneratorSpi

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

Class Overview

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

Public Constructors

public KeyGeneratorSpi ()

Added in API level 1

Creates a new KeyGeneratorSpi instance.

Protected Methods

protected abstract SecretKey engineGenerateKey ()

Added in API level 1

Generates a secret key.

Returns
  • the generated secret key.

protected abstract void engineInit (int keysize, SecureRandom random)

Added in API level 1

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

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

protected abstract void engineInit (SecureRandom random)

Added in API level 1

Initializes this KeyGenerator with the specified randomness source.

Parameters
random the randomness source for any random bytes.

protected abstract void engineInit (AlgorithmParameterSpec params, SecureRandom random)

Added in API level 1

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

Parameters
params the parameters for the key generation algorithm.
random the randomness source for any random bytes.
Throws
InvalidAlgorithmParameterException if the parameters cannot be uses to initialize this key generator algorithm.