Package org.apache.sshd.client.kex
Class DHGEXClient
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.common.kex.dh.AbstractDHKeyExchange
-
- org.apache.sshd.client.kex.AbstractDHClientKeyExchange
-
- org.apache.sshd.client.kex.DHGEXClient
-
- All Implemented Interfaces:
ClientSessionHolder
,KeyExchange
,NamedResource
,SessionContextHolder
,SessionHolder<Session>
public class DHGEXClient extends AbstractDHClientKeyExchange
- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractDH
dh
protected byte
expected
protected DHFactory
factory
protected byte[]
g
protected int
max
protected int
min
protected int
prf
-
Fields inherited from class org.apache.sshd.common.kex.dh.AbstractDHKeyExchange
h, hash, i_c, i_s, k, v_c, v_s
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Fields inherited from interface org.apache.sshd.common.kex.KeyExchange
GROUP_KEX_OPCODES_MAP, SIMPLE_KEX_OPCODES_MAP
-
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DHGEXClient(DHFactory factory, Session session)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AbstractDH
getDH(BigInteger p, BigInteger g)
String
getName()
protected byte[]
getP()
protected BigInteger
getPValue()
void
init(byte[] v_s, byte[] v_c, byte[] i_s, byte[] i_c)
Initialize the key exchange algorithm.static KeyExchangeFactory
newFactory(DHFactory delegate)
boolean
next(int cmd, Buffer buffer)
Process the next packetprotected void
setP(byte[] p)
protected void
validateEValue()
protected void
validateFValue()
-
Methods inherited from class org.apache.sshd.client.kex.AbstractDHClientKeyExchange
getClientSession
-
Methods inherited from class org.apache.sshd.common.kex.dh.AbstractDHKeyExchange
getE, getEValue, getF, getFValue, getH, getHash, getK, getSession, setE, setF, toString, updateE, updateE, updateF, updateF, validateEValue, validateFValue
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.session.SessionHolder
getSessionContext
-
-
-
-
Field Detail
-
factory
protected final DHFactory factory
-
expected
protected byte expected
-
min
protected int min
-
prf
protected int prf
-
max
protected int max
-
dh
protected AbstractDH dh
-
g
protected byte[] g
-
-
Method Detail
-
getName
public final String getName()
-
getP
protected byte[] getP()
-
getPValue
protected BigInteger getPValue()
-
setP
protected void setP(byte[] p)
-
newFactory
public static KeyExchangeFactory newFactory(DHFactory delegate)
-
init
public void init(byte[] v_s, byte[] v_c, byte[] i_s, byte[] i_c) throws Exception
Description copied from interface:KeyExchange
Initialize the key exchange algorithm.- Specified by:
init
in interfaceKeyExchange
- Overrides:
init
in classAbstractDHKeyExchange
- Parameters:
v_s
- the server identification stringv_c
- the client identification stringi_s
- the server key initialization packeti_c
- the client key initialization packet- Throws:
Exception
- if an error occurs
-
next
public boolean next(int cmd, Buffer buffer) throws Exception
Description copied from interface:KeyExchange
Process the next packet- Parameters:
cmd
- the commandbuffer
- the packet contents positioned after the command- Returns:
- a boolean indicating if the processing is complete or if more packets are to be received
- Throws:
Exception
- if an error occurs
-
getDH
protected AbstractDH getDH(BigInteger p, BigInteger g) throws Exception
- Throws:
Exception
-
-