Skip navigation links

Oracle Security Developer Tools Crypto FIPS Java API Reference
11g (11.1.1)

E10696-02


oracle.security.crypto.core
Class KeyPairGenerator

java.lang.Object
  extended by oracle.security.crypto.core.KeyPairGenerator

Direct Known Subclasses:
DHKeyPairGenerator, DSAKeyPairGenerator, RSAKeyPairGenerator

public abstract class KeyPairGenerator
extends java.lang.Object

An abstract class for randomly generating public/private key pairs.

This class has a factory method, getInstance, which can be used to create an instance for a particular algorithm.


Field Summary
protected  RandomBitsSource rbs
          The source of randomness for the KeyPairGenerator.

 

Constructor Summary
protected KeyPairGenerator()
          Empty constructor.

 

Method Summary
abstract  KeyPair generateKeyPair()
          Generates a public/private key pair.
abstract  java.lang.String getAlgorithm()
          Returns the name of the algorithm for which the generated keys can be used.
static KeyPairGenerator getInstance(AlgorithmIdentifier algID)
          Return a KeyPairGenerator for the given AlgorithmIdentifier.
abstract  void initialize(int strength, RandomBitsSource rbs)
          Initializes the key pair generator with the given source of randomness.
abstract  void setAlgID(AlgorithmIdentifier algID)
          Called by getInstance(oracle.security.crypto.core.AlgorithmIdentifier) to initialize the key pair generator using the algorithm identifier and its parameters (if any).
 void setRandomBitsSource(RandomBitsSource rbs)
          Sets the RandomBitsSource.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

rbs

protected RandomBitsSource rbs
The source of randomness for the KeyPairGenerator.

Constructor Detail

KeyPairGenerator

protected KeyPairGenerator()
Empty constructor.

Method Detail

setRandomBitsSource

public void setRandomBitsSource(RandomBitsSource rbs)
Sets the RandomBitsSource.

initialize

public abstract void initialize(int strength,
                                RandomBitsSource rbs)
Initializes the key pair generator with the given source of randomness.
Parameters:
strength - Indicates the size of the generated keys in an algorithm-specific way.
rbs - A secure random bits source.

setAlgID

public abstract void setAlgID(AlgorithmIdentifier algID)
                       throws AlgorithmIdentifierException
Called by getInstance(oracle.security.crypto.core.AlgorithmIdentifier) to initialize the key pair generator using the algorithm identifier and its parameters (if any).
Throws:
AlgorithmIdentifierException

generateKeyPair

public abstract KeyPair generateKeyPair()
Generates a public/private key pair.

getAlgorithm

public abstract java.lang.String getAlgorithm()
Returns the name of the algorithm for which the generated keys can be used.

getInstance

public static KeyPairGenerator getInstance(AlgorithmIdentifier algID)
                                    throws java.lang.IllegalArgumentException
Return a KeyPairGenerator for the given AlgorithmIdentifier.
Throws:
IllegalArgumentException - if no KeyPairGenerator is registered for the algorithm ID.
java.lang.IllegalArgumentException

Skip navigation links

Oracle Security Developer Tools Crypto FIPS Java API Reference
11g (11.1.1)

E10696-02


Copyright © 2005, 2009, Oracle. All rights reserved.