gnu.crypto.key.dh
public abstract class GnuDHKey extends Object implements Key, DHKey
A base asbtract class for both public and private Diffie-Hellman keys. It
encapsulates the two DH numbers: p
, and g
.
According to the JDK, cryptographic Keys all have a format.
The format used in this implementation is called Raw, and basically
consists of the raw byte sequences of algorithm parameters. The exact order
of the byte sequences and the implementation details are given in each of
the relevant getEncoded()
methods of each of the private and
public keys.
Reference:
Version: $Revision: 1.2 $
Field Summary | |
---|---|
protected BigInteger | g The generator g. |
protected BigInteger | p The public prime p. |
protected BigInteger | q The public prime q. |
Constructor Summary | |
---|---|
protected | GnuDHKey(BigInteger q, BigInteger p, BigInteger g) Trivial protected constructor. |
Method Summary | |
---|---|
boolean | equals(Object obj) Returns |
String | getAlgorithm() |
String | getFormat() |
DHParameterSpec | getParams() |
BigInteger | getQ() |
Trivial protected constructor.
Parameters: q a prime divisor of p-1. p the public prime. g the generator of the group.
Returns true
if the designated object is an instance of
DHKey and has the same Diffie-Hellman parameter values as this
one.
Parameters: obj the other non-null DH key to compare to.
Returns: true
if the designated object is of the same type and
value as this one.