Top Description Fields Constructors Methods
org.bouncycastle.jcajce.spec

public Class DSADomainParametersGenerationParameterSpec

extends Object
implements AlgorithmParameterSpec
Class Inheritance
All Implemented Interfaces
java.security.spec.AlgorithmParameterSpec
Imports
java.math.BigInteger, java.security.spec.AlgorithmParameterSpec, org.bouncycastle.crypto.DigestAlgorithm, org.bouncycastle.crypto.fips.FipsSHS, org.bouncycastle.util.Arrays

Parameter spec for guiding the generation of DSA Domain Parameters.

Field Summary

Modifier and TypeField and Description
private final int
private final DigestAlgorithm
public static final int
public static final int
private final int
l

private final int
n

private final BigInteger
p

private final BigInteger
q

private final byte[]
private final int

Constructor Summary

AccessConstructor and Description
public
DSADomainParametersGenerationParameterSpec(int
desired length of prime P in bits (the effective key size).
L
,
int
desired length of prime Q in bits.
N
,
int
certainty level for prime number generation.
certainty
)

Construct without a usage index, this will do a random construction of G.

public
DSADomainParametersGenerationParameterSpec(int
desired length of prime P in bits (the effective key size).
L
,
int
desired length of prime Q in bits.
N
,
int
certainty level for prime number generation.
certainty
,
int
a valid usage index.
usageIndex
)

Construct for a specific usage index - this has the effect of using verifiable canonical generation of G.

public
DSADomainParametersGenerationParameterSpec(BigInteger
the prime p.
p
,
BigInteger
the sub-prime q.
q
)

Construct using a specific value of p and q - this will do a random construction of g.

public
DSADomainParametersGenerationParameterSpec(BigInteger
the prime p.
p
,
BigInteger
the sub-prime q.
q
,
byte[]
the seed used to generate p and q.
seed
,
int
a valid usage index.
usageIndex
)

Construct using a specific value of p and q, but with a seed and usageIndex as well - this has the effect of using verifiable canonical generation of G.

private
DSADomainParametersGenerationParameterSpec(DigestAlgorithm digestAlgorithm, int L, int N, int certainty, BigInteger p, BigInteger q, byte[] seed, int usageIndex)

Method Summary

Modifier and TypeMethod and Description
public int
public DigestAlgorithm
public int
getL()

public int
getN()

public BigInteger
getP()

public BigInteger
getQ()

public byte[]
public int
public DSADomainParametersGenerationParameterSpec

Returns:

a new parameters generator spec.
withDigestAlgorithm
(DigestAlgorithm
the specific digest algorithm to use.
digestAlgorithm
)

Create a spec which also specifies a specific digest algorithm to use for parameters generation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

certaintyback to summary
private final int certainty
digestAlgorithmback to summary
private final DigestAlgorithm digestAlgorithm
DIGITAL_SIGNATURE_USAGEback to summary
public static final int DIGITAL_SIGNATURE_USAGE
KEY_ESTABLISHMENT_USAGEback to summary
public static final int KEY_ESTABLISHMENT_USAGE
lback to summary
private final int l
nback to summary
private final int n
pback to summary
private final BigInteger p
qback to summary
private final BigInteger q
seedback to summary
private final byte[] seed
usageIndexback to summary
private final int usageIndex

Constructor Detail

DSADomainParametersGenerationParameterSpecback to summary
public DSADomainParametersGenerationParameterSpec(int L, int N, int certainty)

Construct without a usage index, this will do a random construction of G.

Parameters
L:int

desired length of prime P in bits (the effective key size).

N:int

desired length of prime Q in bits.

certainty:int

certainty level for prime number generation.

DSADomainParametersGenerationParameterSpecback to summary
public DSADomainParametersGenerationParameterSpec(int L, int N, int certainty, int usageIndex)

Construct for a specific usage index - this has the effect of using verifiable canonical generation of G.

Parameters
L:int

desired length of prime P in bits (the effective key size).

N:int

desired length of prime Q in bits.

certainty:int

certainty level for prime number generation.

usageIndex:int

a valid usage index.

DSADomainParametersGenerationParameterSpecback to summary
public DSADomainParametersGenerationParameterSpec(BigInteger p, BigInteger q)

Construct using a specific value of p and q - this will do a random construction of g.

Parameters
p:BigInteger

the prime p.

q:BigInteger

the sub-prime q.

DSADomainParametersGenerationParameterSpecback to summary
public DSADomainParametersGenerationParameterSpec(BigInteger p, BigInteger q, byte[] seed, int usageIndex)

Construct using a specific value of p and q, but with a seed and usageIndex as well - this has the effect of using verifiable canonical generation of G.

Parameters
p:BigInteger

the prime p.

q:BigInteger

the sub-prime q.

seed:byte[]

the seed used to generate p and q.

usageIndex:int

a valid usage index.

DSADomainParametersGenerationParameterSpecback to summary
private DSADomainParametersGenerationParameterSpec(DigestAlgorithm digestAlgorithm, int L, int N, int certainty, BigInteger p, BigInteger q, byte[] seed, int usageIndex)

Method Detail

getCertaintyback to summary
public int getCertainty()
getDigestAlgorithmback to summary
public DigestAlgorithm getDigestAlgorithm()
getLback to summary
public int getL()
getNback to summary
public int getN()
getPback to summary
public BigInteger getP()
getQback to summary
public BigInteger getQ()
getSeedback to summary
public byte[] getSeed()
getUsageIndexback to summary
public int getUsageIndex()
withDigestAlgorithmback to summary
public DSADomainParametersGenerationParameterSpec withDigestAlgorithm(DigestAlgorithm digestAlgorithm)

Create a spec which also specifies a specific digest algorithm to use for parameters generation.

Parameters
digestAlgorithm:DigestAlgorithm

the specific digest algorithm to use.

Returns:DSADomainParametersGenerationParameterSpec

a new parameters generator spec.