java.security
Class KeyPairGeneratorSpi

java.lang.Object
  extended by java.security.KeyPairGeneratorSpi
Direct Known Subclasses:
KeyPairGenerator

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  Object clone()
          We override clone here to make it accessible for use by DummyKeyPairGenerator.
abstract  KeyPair generateKeyPair()
          Generates a KeyPair according the rules for the algorithm.
 void initialize(AlgorithmParameterSpec params, SecureRandom random)
          Initialize the KeyPairGeneratorSpi with the specified AlgorithmParameterSpec and source of randomness This is a concrete method.
abstract  void initialize(int keysize, SecureRandom random)
          Initialize the KeyPairGeneratorSpi with the specified key size and source of randomness
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyPairGeneratorSpi

public KeyPairGeneratorSpi()
Constructs a new KeyPairGeneratorSpi

Method Detail

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)
                throws InvalidAlgorithmParameterException
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

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

clone

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

Overrides:
clone in class Object
Returns:
a copy of the Object
Throws:
CloneNotSupportedException - If this Object does not implement Cloneable
See Also:
Cloneable