iaik.me.security.rsa
Class RSAKeyPairGenerator
java.lang.Object
|
+--iaik.me.security.KeyPairGenerator
|
+--iaik.me.security.rsa.RSAKeyPairGenerator
- public class RSAKeyPairGenerator
- extends KeyPairGenerator
Method Summary |
CryptoBag |
generateKeyPair()
This method generates a new keypair with the previously initialized parameters and returns it as a CryptoBag object. |
void |
initialize(int keyLength,
Object parameter,
SecureRandom random)
The KeypairGenerator can be provided with the following paramters:
the keylength of the requested key
an optional exponent value (If this value is not defined a preset value will be used)
a secure random number generator
Typical values for the public exponent are the Fermat primes F4 and F0 (0x10001 and 0x11) and, less commonly, 17.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RSAKeyPairGenerator
public RSAKeyPairGenerator()
initialize
public void initialize(int keyLength,
Object parameter,
SecureRandom random)
throws CryptoException
- The KeypairGenerator can be provided with the following paramters:
- the keylength of the requested key
- an optional exponent value (If this value is not defined a preset value will be used)
- a secure random number generator
Typical values for the public exponent are the Fermat primes F4 and F0 (0x10001 and 0x11) and, less commonly, 17.
If no values are provided by the developer, the keygeneration is performed with preset values.
For example:
KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
BigInteger big = new BigInteger("17");
kpg.initialize(1024, big, new SecureRandom());
CryptoBag cb = kpg.generateKeyPair();
- Overrides:
initialize
in class KeyPairGenerator
- Parameters:
keyLength
- length of the requested keyparamter
- an optional exponent value, has to be set to null if not self-definedrandom
- a secrandom generator
generateKeyPair
public CryptoBag generateKeyPair()
- Description copied from class:
KeyPairGenerator
- This method generates a new keypair with the previously initialized parameters and returns it as a
CryptoBag
object.
- Overrides:
generateKeyPair
in class KeyPairGenerator
- Following copied from class:
iaik.me.security.KeyPairGenerator
- See Also:
CryptoBag
IAIK-JCE ME 3.04, (c) 2002 IAIK, (c) 2003 to 2006 Stiftung SIC