For the latest news and information visit
The GNU Crypto project

gnu.crypto.key.dss
Class DSSKeyPairGenerator

java.lang.Object
  extended bygnu.crypto.key.dss.DSSKeyPairGenerator
All Implemented Interfaces:
IKeyPairGenerator

public class DSSKeyPairGenerator
extends java.lang.Object
implements IKeyPairGenerator

A key-pair generator for asymetric keys to use in conjunction with the DSS (Digital Signature Standard).

References:
Digital Signature Standard (DSS), Federal Information Processing Standards Publication 186. National Institute of Standards and Technology.

Version:
$Revision: 1.2 $

Field Summary
static java.lang.String DSS_PARAMETERS
          Property name of an optional DSAParameterSpec instance to use for this generator's p, q, and g values.
static java.security.spec.DSAParameterSpec KEY_PARAMS_1024
           
static java.security.spec.DSAParameterSpec KEY_PARAMS_512
           
static java.security.spec.DSAParameterSpec KEY_PARAMS_768
           
static java.lang.String MODULUS_LENGTH
          Property name of the length (Integer) of the modulus (p) of a DSS key.
static java.lang.String SOURCE_OF_RANDOMNESS
          Property name of an optional SecureRandom instance to use.
static java.lang.String USE_DEFAULTS
          Property name of the Boolean indicating wether or not to use defaults.
 
Constructor Summary
DSSKeyPairGenerator()
           
 
Method Summary
 java.security.KeyPair generate()
          Generates a new keypair based on the attributes used to configure the instance.
 java.lang.String name()
          Returns the canonical name of this keypair generator.
 void setup(java.util.Map attributes)
          Configures this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODULUS_LENGTH

public static final java.lang.String MODULUS_LENGTH
Property name of the length (Integer) of the modulus (p) of a DSS 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

SOURCE_OF_RANDOMNESS

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

See Also:
Constant Field Values

DSS_PARAMETERS

public static final java.lang.String DSS_PARAMETERS
Property name of an optional DSAParameterSpec instance to use for this generator's p, q, and g values. The default is to generate these values or use pre-computed ones, depending on the value of the USE_DEFAULTS attribute.

See Also:
Constant Field Values

KEY_PARAMS_512

public static final java.security.spec.DSAParameterSpec KEY_PARAMS_512

KEY_PARAMS_768

public static final java.security.spec.DSAParameterSpec KEY_PARAMS_768

KEY_PARAMS_1024

public static final java.security.spec.DSAParameterSpec KEY_PARAMS_1024
Constructor Detail

DSSKeyPairGenerator

public DSSKeyPairGenerator()
Method Detail

name

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

Specified by:
name in interface IKeyPairGenerator
Returns:
the canonical name of this instance.

setup

public void setup(java.util.Map attributes)

Configures this instance.

Specified by:
setup in interface IKeyPairGenerator
Parameters:
attributes - the map of name/value pairs to use.
Throws:
java.lang.IllegalArgumentException - if the designated MODULUS_LENGTH value is not greater than 512, less than 1024 and not of the form 512 + 64j.

generate

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

Specified by:
generate in interface IKeyPairGenerator
Returns:
a new keypair.

For the latest news and information visit
The GNU Crypto project

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.