wtanaka.praya.gale
Class GaleKeyGen

java.lang.Object
  |
  +--wtanaka.praya.gale.GaleKeyGen

public class GaleKeyGen
extends java.lang.Object

Generator for keys. Based on openssl 0.9.6b written by the OpenSSL Project.

Return to Sourceforge or the Praya Homepage

Version:
$Name: $ $Date: 2002/01/27 20:22:17 $
Author:
$Author: wtanaka $

Inner Class Summary
static class GaleKeyGen.Callback
           
 
Field Summary
private  java.math.BigInteger d
           
private  java.math.BigInteger dmp1
           
private  java.math.BigInteger dmq1
           
private  java.math.BigInteger e
           
(package private)  int flags
           
private  java.math.BigInteger iqmp
           
private  GalePrivateKey m_privateKey
           
private  GalePublicKey m_publicKey
           
static int MAX_RSA_MODULUS_BITS
           
static int MAX_RSA_MODULUS_LEN
           
static int MAX_RSA_PRIME_BITS
           
static int MIN_RSA_MODULUS_BITS
           
private  java.math.BigInteger n
           
private  java.math.BigInteger p
           
private  int pad
           
private  java.math.BigInteger q
           
(package private)  int references
           
private static long RSA_F4
           
private  int version
           
 
Constructor Summary
GaleKeyGen()
           
 
Method Summary
 void generate(java.lang.String id, java.lang.String owner, int bits, int certainty, java.util.Random random)
          Generate a new key.
 void generate(java.lang.String id, java.lang.String owner, int bits, java.util.Random random)
          Convenient method to generate a new key with certainty of primality equal to 1 - 1/2**1024.
 GalePrivateKey getPrivateKey()
           
 GalePublicKey getPublicKey()
           
private  void RSA_generate_key(int bits, long e_value, GaleKeyGen.Callback callback, java.lang.Object cb_arg, int certainty, java.util.Random random)
          Ported from openssl 0.9.6b crypto/rsa/rsa_gen.c.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

MIN_RSA_MODULUS_BITS

public static final int MIN_RSA_MODULUS_BITS

MAX_RSA_MODULUS_BITS

public static final int MAX_RSA_MODULUS_BITS

MAX_RSA_MODULUS_LEN

public static final int MAX_RSA_MODULUS_LEN

MAX_RSA_PRIME_BITS

public static final int MAX_RSA_PRIME_BITS

RSA_F4

private static final long RSA_F4

m_publicKey

private GalePublicKey m_publicKey

m_privateKey

private GalePrivateKey m_privateKey

pad

private int pad

version

private int version

n

private java.math.BigInteger n

e

private java.math.BigInteger e

d

private java.math.BigInteger d

p

private java.math.BigInteger p

q

private java.math.BigInteger q

dmp1

private java.math.BigInteger dmp1

dmq1

private java.math.BigInteger dmq1

iqmp

private java.math.BigInteger iqmp

references

int references

flags

int flags
Constructor Detail

GaleKeyGen

public GaleKeyGen()
Method Detail

generate

public void generate(java.lang.String id,
                     java.lang.String owner,
                     int bits,
                     java.util.Random random)
              throws java.lang.IllegalArgumentException
Convenient method to generate a new key with certainty of primality equal to 1 - 1/2**1024.
Parameters:
id - the name to embed in the key.
bits - must be between MIN_RSA_MODULUS_BITS and MAX_RSA_MODULUS_BITS, inclusive. If this parameter is set to 0, this method will assume the default value of 768.
owner - the owner string for this key
random - the source of random numbers.

generate

public void generate(java.lang.String id,
                     java.lang.String owner,
                     int bits,
                     int certainty,
                     java.util.Random random)
              throws java.lang.IllegalArgumentException
Generate a new key. Port of gale_crypto_generate from gale.
Parameters:
id - the name to embed in the key in OWO order. This name should have the most specific part first. e.g. mail.jtr@ofb.net or *.pub@ofb.net.
bits - must be between MIN_RSA_MODULUS_BITS and MAX_RSA_MODULUS_BITS, inclusive. If this parameter is set to 0, this method will assume the default value of 768.
owner - the owner string for this key
certainty - a measure of the uncertainty that the caller is willing to tolerate: the probability that the number is prime will exceed 1 - 1/2**certainty. The execution time is proportional to the value of the certainty parameter.
random - the source of random numbers.

RSA_generate_key

private void RSA_generate_key(int bits,
                              long e_value,
                              GaleKeyGen.Callback callback,
                              java.lang.Object cb_arg,
                              int certainty,
                              java.util.Random random)
Ported from openssl 0.9.6b crypto/rsa/rsa_gen.c. http://www.openssl.org/source/cvs/crypto/rsa/rsa_gen.c

getPublicKey

public GalePublicKey getPublicKey()

getPrivateKey

public GalePrivateKey getPrivateKey()