public abstract class KeyPairGenerator
extends java.lang.Object
This class has a factory method, getInstance
, which can be used to create an instance for a particular algorithm.
Modifier and Type | Field and Description |
---|---|
protected RandomBitsSource |
rbs
The source of randomness for the
KeyPairGenerator . |
Modifier | Constructor and Description |
---|---|
protected |
KeyPairGenerator()
Empty constructor.
|
Modifier and Type | Method and Description |
---|---|
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 . |
protected RandomBitsSource rbs
KeyPairGenerator
.public void setRandomBitsSource(RandomBitsSource rbs)
RandomBitsSource
.public abstract void initialize(int strength, RandomBitsSource rbs)
strength
- Indicates the size of the generated keys in an algorithm-specific way.rbs
- A secure random bits source.public abstract void setAlgID(AlgorithmIdentifier algID) throws AlgorithmIdentifierException
getInstance(oracle.security.crypto.core.AlgorithmIdentifier)
to initialize the key pair generator using the algorithm identifier and its parameters (if any).AlgorithmIdentifierException
public abstract KeyPair generateKeyPair()
public abstract java.lang.String getAlgorithm()
public static KeyPairGenerator getInstance(AlgorithmIdentifier algID) throws java.lang.IllegalArgumentException
KeyPairGenerator
for the given AlgorithmIdentifier
.IllegalArgumentException
- if no KeyPairGenerator
is registered for the algorithm ID.java.lang.IllegalArgumentException