Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.javax.crypto.key.srp6
Class SRPKeyPairGenerator  view SRPKeyPairGenerator download SRPKeyPairGenerator.java

java.lang.Object
  extended bygnu.javax.crypto.key.srp6.SRPKeyPairGenerator
All Implemented Interfaces:
gnu.java.security.key.IKeyPairGenerator

public class SRPKeyPairGenerator
extends java.lang.Object
implements gnu.java.security.key.IKeyPairGenerator

Reference:

  1. SRP Protocol Design
    Thomas J. Wu.


Field Summary
private static boolean DEBUG
           
private static int debuglevel
           
private static int DEFAULT_MODULUS_LENGTH
          Default value for the modulus length.
private static java.io.PrintWriter err
           
private  java.math.BigInteger g
          The Field generator.
static java.lang.String GENERATOR
          Property name of the generator (g) of an SRP key.
private  int l
          Bit length of the shared modulus.
static java.lang.String MODULUS_LENGTH
          Property name of the length (Integer) of the modulus (N) of an SRP key.
private  java.math.BigInteger N
          The shared public modulus.
private static java.lang.String NAME
           
private static java.math.BigInteger ONE
           
private  gnu.java.security.util.PRNG prng
          Our default source of randomness.
private  java.security.SecureRandom rnd
          The optional java.security.SecureRandom instance to use.
static java.lang.String SHARED_MODULUS
          Property name of the modulus (N) of an SRP key.
static java.lang.String SOURCE_OF_RANDOMNESS
          Property name of an optional java.security.SecureRandom instance to use.
private static java.math.BigInteger THREE
           
private static java.math.BigInteger TWO
           
static java.lang.String USE_DEFAULTS
          Property name of the Boolean indicating wether or not to use defaults.
static java.lang.String USER_VERIFIER
          Property name of the user's verifier (v) for a Server SRP key.
private  java.math.BigInteger v
          The user's verifier MPI.
private static java.math.BigInteger ZERO
           
 
Constructor Summary
SRPKeyPairGenerator()
           
 
Method Summary
private static void debug(java.lang.String s)
           
 java.security.KeyPair generate()
          Generates a new keypair based on the attributes used to configure the instance.
private  java.math.BigInteger[] generateParameters()
           
private  gnu.java.security.util.PRNG getDefaultPRNG()
           
private  java.security.KeyPair hostKeyPair()
           
 java.lang.String name()
          Returns the canonical name of this keypair generator.
private  void nextRandomBytes(byte[] buffer)
           
 void setup(java.util.Map attributes)
          [Re]-initialises this instance for use with a given set of attributes.
private  java.security.KeyPair userKeyPair()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

private static final java.lang.String NAME
See Also:
Constant Field Values

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

debuglevel

private static final int debuglevel
See Also:
Constant Field Values

err

private static final java.io.PrintWriter err

ZERO

private static final java.math.BigInteger ZERO

ONE

private static final java.math.BigInteger ONE

TWO

private static final java.math.BigInteger TWO

THREE

private static final java.math.BigInteger THREE

MODULUS_LENGTH

public static final java.lang.String MODULUS_LENGTH
Property name of the length (Integer) of the modulus (N) of an SRP key.

See Also:
Constant Field Values

USE_DEFAULTS

public static final java.lang.String USE_DEFAULTS
Property name of the Boolean indicating wether or not to use defaults.

See Also:
Constant Field Values

SHARED_MODULUS

public static final java.lang.String SHARED_MODULUS
Property name of the modulus (N) of an SRP key.

See Also:
Constant Field Values

GENERATOR

public static final java.lang.String GENERATOR
Property name of the generator (g) of an SRP key.

See Also:
Constant Field Values

USER_VERIFIER

public static final java.lang.String USER_VERIFIER
Property name of the user's verifier (v) for a Server SRP key.

See Also:
Constant Field Values

SOURCE_OF_RANDOMNESS

public static final java.lang.String SOURCE_OF_RANDOMNESS
Property name of an optional java.security.SecureRandom instance to use. The default is to use a classloader singleton from gnu.java.security.util.PRNG.

See Also:
Constant Field Values

DEFAULT_MODULUS_LENGTH

private static final int DEFAULT_MODULUS_LENGTH
Default value for the modulus length.

See Also:
Constant Field Values

rnd

private java.security.SecureRandom rnd
The optional java.security.SecureRandom instance to use.


l

private int l
Bit length of the shared modulus.


N

private java.math.BigInteger N
The shared public modulus.


g

private java.math.BigInteger g
The Field generator.


v

private java.math.BigInteger v
The user's verifier MPI.


prng

private gnu.java.security.util.PRNG prng
Our default source of randomness.

Constructor Detail

SRPKeyPairGenerator

public SRPKeyPairGenerator()
Method Detail

debug

private static void debug(java.lang.String s)

name

public java.lang.String name()
Description copied from interface: gnu.java.security.key.IKeyPairGenerator
Returns the canonical name of this keypair generator.

Specified by:
name in interface gnu.java.security.key.IKeyPairGenerator

setup

public void setup(java.util.Map attributes)
Description copied from interface: gnu.java.security.key.IKeyPairGenerator
[Re]-initialises this instance for use with a given set of attributes.

Specified by:
setup in interface gnu.java.security.key.IKeyPairGenerator

generate

public java.security.KeyPair generate()
Description copied from interface: gnu.java.security.key.IKeyPairGenerator
Generates a new keypair based on the attributes used to configure the instance.

Specified by:
generate in interface gnu.java.security.key.IKeyPairGenerator

generateParameters

private java.math.BigInteger[] generateParameters()

hostKeyPair

private java.security.KeyPair hostKeyPair()

userKeyPair

private java.security.KeyPair userKeyPair()

nextRandomBytes

private void nextRandomBytes(byte[] buffer)

getDefaultPRNG

private gnu.java.security.util.PRNG getDefaultPRNG()