gnu.crypto.key.dh
Class GnuDHKey
- DHKey, Key
public abstract class GnuDHKey
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:
- Diffie-Hellman Key
Agreement Method
Eric Rescorla.
protected BigInteger | g - The generator g.
|
protected BigInteger | p - The public prime p.
|
protected BigInteger | q - The public prime q.
|
GnuDHKey(BigInteger q, BigInteger p, BigInteger g) - Trivial protected constructor.
|
boolean | equals(Object obj) - Returns
true if the designated object is an instance of
DHKey and has the same Diffie-Hellman parameter values as this
one.
|
String | getAlgorithm()
|
String | getFormat()
|
DHParameterSpec | getParams()
|
BigInteger | getQ()
|
g
protected BigInteger g
The generator g.
p
protected BigInteger p
The public prime p.
q
protected BigInteger q
The public prime q. A prime divisor of p-1.
GnuDHKey
protected GnuDHKey(BigInteger q,
BigInteger p,
BigInteger g)
Trivial protected constructor.
q
- a prime divisor of p-1.p
- the public prime.g
- the generator of the group.
equals
public boolean equals(Object obj)
Returns true
if the designated object is an instance of
DHKey
and has the same Diffie-Hellman parameter values as this
one.
obj
- the other non-null DH key to compare to.
true
if the designated object is of the same type and
value as this one.
getAlgorithm
public String getAlgorithm()
getFormat
public String getFormat()
getParams
public DHParameterSpec getParams()
getQ
public BigInteger getQ()
Copyright © 2001, 2002, 2003
Free Software Foundation,
Inc. All Rights Reserved.