de.flexiprovider.core.rprimersa
Class RprimeRSAKeyPairGenerator

java.lang.Object
  |
  +--java.security.KeyPairGeneratorSpi
        |
        +--de.flexiprovider.api.keys.KeyPairGenerator
              |
              +--de.flexiprovider.core.rprimersa.RprimeRSAKeyPairGenerator

public class RprimeRSAKeyPairGenerator
extends KeyPairGenerator

This class is used to generate key pairs for the rebalanced multi-prime RSA algorithm. It can be initialized with an instance of RprimeRSAKeyGenParameterSpec or with a key size. The key size translates directly to the bit length of the modulus n = p*q. The key pair generation follows the PKCS #1 standard.

Author:
Paul Nguentcheu, Martin Döring

Constructor Summary
RprimeRSAKeyPairGenerator()
           
 
Method Summary
 KeyPair genKeyPair()
          Generate a multi-prime RSA key pair.
 void initialize(AlgorithmParameterSpec params, SecureRandom secureRand)
          Initialize the key pair generator with the given parameters and source of randomness.
 void initialize(int keySize, SecureRandom random)
          Initialize the key pair generator with the given key size and source of randomness.
 
Methods inherited from class de.flexiprovider.api.keys.KeyPairGenerator
generateKeyPair, initialize, initialize
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RprimeRSAKeyPairGenerator

public RprimeRSAKeyPairGenerator()
Method Detail

initialize

public void initialize(AlgorithmParameterSpec params,
                       SecureRandom secureRand)
                throws InvalidAlgorithmParameterException
Initialize the key pair generator with the given parameters and source of randomness. If the parameters are null, the default parameters are used.
Overrides:
initialize in class KeyPairGenerator
Parameters:
params - an AlgorithmParameterSpec object
secureRand - the source of randomness
Throws:
InvalidAlgorithmParameterException - if the parameters are not an instance of RprimeRSAKeyGenParameterSpec.

initialize

public void initialize(int keySize,
                       SecureRandom random)
Initialize the key pair generator with the given key size and source of randomness.
Overrides:
initialize in class KeyPairGenerator
Parameters:
keySize - the bit length of the modulus n
random - the source of randomness

genKeyPair

public KeyPair genKeyPair()
Generate a multi-prime RSA key pair.
Overrides:
genKeyPair in class KeyPairGenerator
Returns:
the key pair, consisting of an MpRSAPrivateKey and an RSAPublicKey