public class DHG extends AbstractDH
Modifier and Type | Field and Description |
---|---|
private java.math.BigInteger |
f |
private Factory<? extends Digest> |
factory |
private java.math.BigInteger |
g |
static java.lang.String |
KEX_TYPE |
private java.math.BigInteger |
p |
myKeyAgree
Constructor and Description |
---|
DHG(Factory<? extends Digest> digestFactory) |
DHG(Factory<? extends Digest> digestFactory,
java.math.BigInteger pValue,
java.math.BigInteger gValue) |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
calculateE()
Lazy-called by
AbstractDH.getE() if the public key data has not been generated yet. |
protected byte[] |
calculateK()
Lazy-called by
AbstractDH.getK() if the shared secret data has not been calculated yet |
java.math.BigInteger |
getG() |
Digest |
getHash() |
java.math.BigInteger |
getP() |
void |
setF(java.math.BigInteger f) |
void |
setF(byte[] f) |
void |
setG(java.math.BigInteger g) |
void |
setG(byte[] g) |
void |
setP(java.math.BigInteger p) |
void |
setP(byte[] p) |
java.lang.String |
toString() |
checkKeyAgreementNecessity, getE, getK, isPublicDataAvailable, isSharedSecretAvailable, putE, putF, stripLeadingZeroes
public static final java.lang.String KEX_TYPE
private java.math.BigInteger p
private java.math.BigInteger g
private java.math.BigInteger f
public DHG(Factory<? extends Digest> digestFactory) throws java.lang.Exception
java.lang.Exception
protected byte[] calculateE() throws java.lang.Exception
AbstractDH
AbstractDH.getE()
if the public key data has not been generated yet.calculateE
in class AbstractDH
java.lang.Exception
- If failed to generate the relevant dataprotected byte[] calculateK() throws java.lang.Exception
AbstractDH
AbstractDH.getK()
if the shared secret data has not been calculated yetcalculateK
in class AbstractDH
java.lang.Exception
- If failed to calculate itpublic void setP(byte[] p)
public void setG(byte[] g)
public void setF(byte[] f)
setF
in class AbstractDH
public java.math.BigInteger getP()
public void setP(java.math.BigInteger p)
public java.math.BigInteger getG()
public void setG(java.math.BigInteger g)
public void setF(java.math.BigInteger f)
public Digest getHash() throws java.lang.Exception
getHash
in class AbstractDH
java.lang.Exception
public java.lang.String toString()
toString
in class AbstractDH