ds.ov2.util
Class Unsecure_rsa_key

java.lang.Object
  extended by ds.ov2.util.Unsecure_rsa_key

public class Unsecure_rsa_key
extends Object

Unsecure RSA key generation. Do not use this class for real keys. But for key sizes below 512 bits, where KeyPairGenerator.generateKeyPair() refuses to work, this class can be used. RSA Key sizes below 512 bits are unsecure anyway.

Static class.

CPP Preprocessing
no cpp preprocessing needed
Execution Environment:
host
Author:
Hendrik Tews
Version:
$Revision: 1.5 $
Last Commit:
$Date: 2009-04-09 10:42:17 $ by $Author: tews $

Constructor Summary
protected Unsecure_rsa_key()
          Static class, object creation disabled.
 
Method Summary
static BigInteger[] generate(int key_size, int certainty, Random rand)
          Unsecure RSA key generation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Unsecure_rsa_key

protected Unsecure_rsa_key()
Static class, object creation disabled.

Method Detail

generate

public static BigInteger[] generate(int key_size,
                                    int certainty,
                                    Random rand)
Unsecure RSA key generation. Use this method for unsecure key sizes below 512 bits for testing only, where KeyPairGenerator.generateKeyPair() refuses to work.

Parameters:
key_size - desired size of the RSA modulus
certainty - certainty parameter for probabilistic prime generation, see second argument of BigInteger.BigInteger(int, int, Random)
Returns:
an array of length 3, containing the RSA modulus and the two factors.