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:Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
DSSKeyPairGenerator() |
Modifier and Type | Method and Description |
---|---|
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.
|
public static final java.lang.String MODULUS_LENGTH
public static final java.lang.String USE_DEFAULTS
public static final java.lang.String SOURCE_OF_RANDOMNESS
SecureRandom
instance to use. The
default is to use a classloader singleton from PRNG
.public static final java.lang.String DSS_PARAMETERS
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.public static final java.security.spec.DSAParameterSpec KEY_PARAMS_512
public static final java.security.spec.DSAParameterSpec KEY_PARAMS_768
public static final java.security.spec.DSAParameterSpec KEY_PARAMS_1024
public java.lang.String name()
IKeyPairGenerator
name
in interface IKeyPairGenerator
public void setup(java.util.Map attributes)
Configures this instance.
setup
in interface IKeyPairGenerator
attributes
- the map of name/value pairs to use.java.lang.IllegalArgumentException
- if the designated MODULUS_LENGTH
value is not greater than 512, less than 1024 and not of the form
512 + 64j
.public java.security.KeyPair generate()
IKeyPairGenerator
generate
in interface IKeyPairGenerator
Copyright © 2025. All rights reserved.