Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Crypto Java API Reference 10g Release 3 (10.1.3) B25378-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.security.crypto.core
Class KeyPairGenerator

`java.lang.Object
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()`

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`.
`static KeyPairGenerator` | `getInstance(java.lang.String algName)` Deprecated. use the version of `getInstance` that takes an `AlgorithmIdentifier` as an argument.
`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(java.lang.String)` 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()

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(java.lang.String)` 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(java.lang.String algName)
                                        throws java.lang.IllegalArgumentException

  Deprecated. use the version of `getInstance` that takes an `AlgorithmIdentifier` as an argument.
  Return a KeyPairGenerator of the given type. Supported algorithms are: "RSA", "DSA", "DSAold", "Diffie-Hellman".
  Throws:
    `java.lang.IllegalArgumentException` - if the type is unrecognized

### 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`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Crypto Java API Reference 10g Release 3 (10.1.3) B25378-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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