public final class RSAKeyPairGenerator extends KeyPairGenerator
rbs
Constructor and Description |
---|
RSAKeyPairGenerator()
Creates a new, uninitialized
RSAKeyPairGenerator . |
Modifier and Type | Method and Description |
---|---|
KeyPair |
generateKeyPair()
Generates a public/private key pair.
|
java.lang.String |
getAlgorithm()
Returns "RSA".
|
void |
initialize(int strength, RandomBitsSource rbs)
Initializes the key pair generator with the given strength and source of randomness.
|
void |
setAlgID(AlgorithmIdentifier keyAlgID)
Throws an exception if the algothrithm identifier OID is not that of
AlgID.rsaEncryption , otherwise does nothing. |
getInstance, setRandomBitsSource
public RSAKeyPairGenerator()
RSAKeyPairGenerator
.public void setAlgID(AlgorithmIdentifier keyAlgID) throws AlgorithmIdentifierException
AlgID.rsaEncryption
, otherwise does nothing.setAlgID
in class KeyPairGenerator
AlgorithmIdentifierException
public void initialize(int strength, RandomBitsSource rbs)
initialize
in class KeyPairGenerator
strength
- Sets the length in bits of the public modulus.rbs
- A secure random bits source.public KeyPair generateKeyPair()
KeyPairGenerator
generateKeyPair
in class KeyPairGenerator
public java.lang.String getAlgorithm()
getAlgorithm
in class KeyPairGenerator