Top Description Fields Constructors Methods
org.apache.sshd.common.kex

public Class DHG

extends AbstractDH
Class Inheritance
Imports
java.math.BigInteger, java.security.KeyFactory, .KeyPair, .KeyPairGenerator, .PublicKey, java.util.Objects, javax.crypto.interfaces.DHPublicKey, javax.crypto.spec.DHParameterSpec, .DHPublicKeySpec, org.apache.sshd.common.Factory, org.apache.sshd.common.digest.Digest, org.apache.sshd.common.util.security.SecurityUtils

Diffie-Hellman key generator.
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private BigInteger
f

private Factory<? extends Digest>
private BigInteger
g

public static final String
private BigInteger
p

Inherited from org.apache.sshd.common.kex.AbstractDH:
myKeyAgree

Constructor Summary

AccessConstructor and Description
public
DHG(Factory<? extends Digest> digestFactory)

public
DHG(Factory<? extends Digest> digestFactory, BigInteger pValue, BigInteger gValue)

Method Summary

Modifier and TypeMethod and Description
protected byte[]
calculateE()

Implements abstract org.apache.sshd.common.kex.AbstractDH.calculateE.

Lazy-called by getE() if the public key data has not been generated yet.

protected byte[]
calculateK()

Implements abstract org.apache.sshd.common.kex.AbstractDH.calculateK.

Lazy-called by getK() if the shared secret data has not been calculated yet

public BigInteger
getG()

public Digest
public BigInteger
getP()

public void
setF(byte[] f)

Implements abstract org.apache.sshd.common.kex.AbstractDH.setF.

public void
public void
setG(byte[] g)

public void
public void
setP(byte[] p)

public void
public String
toString()

Overrides org.apache.sshd.common.kex.AbstractDH.toString.

Returns a string representation of the object.

Inherited from org.apache.sshd.common.kex.AbstractDH:
checkKeyAgreementNecessitygetEgetKgetKeyEncapsulationisPublicDataAvailableisSharedSecretAvailableputEputFstripLeadingZeroes

Field Detail

fback to summary
private BigInteger f
factoryback to summary
private Factory<? extends Digest> factory
gback to summary
private BigInteger g
KEX_TYPEback to summary
public static final String KEX_TYPE
pback to summary
private BigInteger p

Constructor Detail

DHGback to summary
public DHG(Factory<? extends Digest> digestFactory) throws Exception
DHGback to summary
public DHG(Factory<? extends Digest> digestFactory, BigInteger pValue, BigInteger gValue) throws Exception

Method Detail

calculateEback to summary
protected byte[] calculateE() throws Exception

Implements abstract org.apache.sshd.common.kex.AbstractDH.calculateE.

Doc from org.apache.sshd.common.kex.AbstractDH.calculateE.

Lazy-called by getE() if the public key data has not been generated yet.

Returns:byte[]

The calculated public key data

Annotations
@Override
Exceptions
Exception:
If failed to generate the relevant data
calculateKback to summary
protected byte[] calculateK() throws Exception

Implements abstract org.apache.sshd.common.kex.AbstractDH.calculateK.

Doc from org.apache.sshd.common.kex.AbstractDH.calculateK.

Lazy-called by getK() if the shared secret data has not been calculated yet

Returns:byte[]

The shared secret data

Annotations
@Override
Exceptions
Exception:
If failed to calculate it
getGback to summary
public BigInteger getG()
getHashback to summary
public Digest getHash() throws Exception

Implements abstract org.apache.sshd.common.kex.AbstractDH.getHash.

Annotations
@Override
getPback to summary
public BigInteger getP()
setFback to summary
public void setF(byte[] f)

Implements abstract org.apache.sshd.common.kex.AbstractDH.setF.

Annotations
@Override
setFback to summary
public void setF(BigInteger f)
setGback to summary
public void setG(byte[] g)
setGback to summary
public void setG(BigInteger g)
setPback to summary
public void setP(byte[] p)
setPback to summary
public void setP(BigInteger p)
toStringback to summary
public String toString()

Overrides org.apache.sshd.common.kex.AbstractDH.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override