Package org.apache.sshd.common.kex
Class DHG
java.lang.Object
org.apache.sshd.common.kex.AbstractDH
org.apache.sshd.common.kex.DHG
Diffie-Hellman key generator.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BigIntegerprivate BigIntegerstatic final Stringprivate BigIntegerFields inherited from class org.apache.sshd.common.kex.AbstractDH
myKeyAgree -
Constructor Summary
ConstructorsConstructorDescriptionDHG(Factory<? extends Digest> digestFactory, BigInteger pValue, BigInteger gValue) -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]Lazy-called byAbstractDH.getE()if the public key data has not been generated yet.protected byte[]Lazy-called byAbstractDH.getK()if the shared secret data has not been calculated yetgetG()getHash()getP()voidsetF(byte[] f) voidsetF(BigInteger f) voidsetG(byte[] g) voidsetG(BigInteger g) voidsetP(byte[] p) voidsetP(BigInteger p) toString()Methods inherited from class org.apache.sshd.common.kex.AbstractDH
checkKeyAgreementNecessity, getE, getK, isPublicDataAvailable, isSharedSecretAvailable, putE, putF, stripLeadingZeroes
-
Field Details
-
KEX_TYPE
- See Also:
-
p
-
g
-
f
-
factory
-
-
Constructor Details
-
DHG
- Throws:
Exception
-
DHG
public DHG(Factory<? extends Digest> digestFactory, BigInteger pValue, BigInteger gValue) throws Exception - Throws:
Exception
-
-
Method Details
-
calculateE
Description copied from class:AbstractDHLazy-called byAbstractDH.getE()if the public key data has not been generated yet.- Specified by:
calculateEin classAbstractDH- Returns:
- The calculated public key data
- Throws:
Exception- If failed to generate the relevant data
-
calculateK
Description copied from class:AbstractDHLazy-called byAbstractDH.getK()if the shared secret data has not been calculated yet- Specified by:
calculateKin classAbstractDH- Returns:
- The shared secret data
- Throws:
Exception- If failed to calculate it
-
setP
public void setP(byte[] p) -
setG
public void setG(byte[] g) -
setF
public void setF(byte[] f) - Specified by:
setFin classAbstractDH
-
getP
-
setP
-
getG
-
setG
-
setF
-
getHash
- Specified by:
getHashin classAbstractDH- Throws:
Exception
-
toString
- Overrides:
toStringin classAbstractDH
-