public interface KeyPairGenDSA
The library contains a default implementation of this class, based on the JCE classes available in Java SE from 1.4.
The actual implementation class is chosen by the configuration option
"keypairgen.dsa"
, and then instantiated using the no-argument
constructor. The library uses each instance only for one key generation.
This object will create a DSA key pair, consisting of a public key
(p
, q
, g
, y
)
and a private key x
.
Here q
is a 160-bit prime (when using SHA-1),
p
a prime of the given key size such that
p-1
is a multiple of q
, g
is a generator of a
multiplicative subgroup of order q
of (Z/pZ)^*
.
p
, q
and g
are called
community parameters and can be shared by many keys (some
implementations may have precalculated ones).
x
is a random number with 0 < x < q
, and
y = g^x mod p
- these two numbers are key pair specific, and
x
must be preserved secretely.
Modifier and Type | Method and Description |
---|---|
byte[] |
getG()
The generator
g of the subgroup. |
byte[] |
getP()
The modulus
p , a prime. |
byte[] |
getQ()
The order
q of the subgroup of (Z/pZ)^* generated by g ,
also prime. |
byte[] |
getX()
The secret key
x . |
byte[] |
getY()
The public key
y = g^x mod p . |
void |
init(int key_size)
Generates a key pair.
|
void init(int key_size) throws Exception
key_size
- the number of bits of the key to be produced.Exception
byte[] getX()
x
.byte[] getY()
y = g^x mod p
.byte[] getP()
p
, a prime.byte[] getQ()
q
of the subgroup of (Z/pZ)^* generated by g
,
also prime.byte[] getG()
g
of the subgroup.This is an inofficial Javadoc created by PaĆlo Ebermann. Have a look at the official homepage.