java.security

Class KeyPairGeneratorSpi

public abstract class KeyPairGeneratorSpi extends Object

KeyPairGeneratorSpi is the interface used to generate key pairs for security algorithms.
Constructor Summary
KeyPairGeneratorSpi()
Constructs a new KeyPairGeneratorSpi
Method Summary
protected Objectclone()
We override clone here to make it accessible for use by DummyKeyPairGenerator.
abstract KeyPairgenerateKeyPair()
Generates a KeyPair according the rules for the algorithm.
abstract voidinitialize(int keysize, SecureRandom random)
Initialize the KeyPairGeneratorSpi with the specified key size and source of randomness
voidinitialize(AlgorithmParameterSpec params, SecureRandom random)
Initialize the KeyPairGeneratorSpi with the specified AlgorithmParameterSpec and source of randomness This is a concrete method.

Constructor Detail

KeyPairGeneratorSpi

public KeyPairGeneratorSpi()
Constructs a new KeyPairGeneratorSpi

Method Detail

clone

protected Object clone()
We override clone here to make it accessible for use by DummyKeyPairGenerator.

generateKeyPair

public abstract KeyPair generateKeyPair()
Generates a KeyPair according the rules for the algorithm. Unless intialized, algorithm defaults will be used. It creates a unique key pair each time.

Returns: a key pair

initialize

public abstract void initialize(int keysize, SecureRandom random)
Initialize the KeyPairGeneratorSpi with the specified key size and source of randomness

Parameters: keysize size of the key to generate random A SecureRandom source of randomness

initialize

public void initialize(AlgorithmParameterSpec params, SecureRandom random)
Initialize the KeyPairGeneratorSpi with the specified AlgorithmParameterSpec and source of randomness This is a concrete method. It may be overridden by the provider and if the AlgorithmParameterSpec class is invalid throw InvalidAlgorithmParameterException. By default this method just throws UnsupportedOperationException.

Parameters: params A AlgorithmParameterSpec to intialize with random A SecureRandom source of randomness

Throws: InvalidAlgorithmParameterException