Package org.apache.sshd.common.kex.dh
Class AbstractDHKeyExchange
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.common.kex.dh.AbstractDHKeyExchange
-
- All Implemented Interfaces:
KeyExchange,NamedResource,SessionContextHolder,SessionHolder<Session>
- Direct Known Subclasses:
AbstractDHClientKeyExchange,AbstractDHServerKeyExchange
public abstract class AbstractDHKeyExchange extends AbstractLoggingBean implements KeyExchange
- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]hprotected Digesthashprotected byte[]i_cprotected byte[]i_sprotected byte[]kprotected byte[]v_cprotected byte[]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 protectedAbstractDHKeyExchange(Session session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]getE()protected BigIntegergetEValue()protected byte[]getF()protected BigIntegergetFValue()byte[]getH()Retrieves the computedhparameterDigestgetHash()The message digest used by this key exchange algorithm.byte[]getK()Retrieves the computed k parameterSessiongetSession()voidinit(byte[] v_s, byte[] v_c, byte[] i_s, byte[] i_c)Initialize the key exchange algorithm.protected voidsetE(byte[] e)protected voidsetF(byte[] f)StringtoString()protected byte[]updateE(byte[] mpInt)protected byte[]updateE(Buffer buffer)protected byte[]updateF(byte[] mpInt)protected byte[]updateF(Buffer buffer)protected voidvalidateEValue(BigInteger pValue)protected voidvalidateFValue(BigInteger pValue)-
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.kex.KeyExchange
next
-
Methods inherited from interface org.apache.sshd.common.NamedResource
getName
-
Methods inherited from interface org.apache.sshd.common.session.SessionHolder
getSessionContext
-
-
-
-
Field Detail
-
v_s
protected byte[] v_s
-
v_c
protected byte[] v_c
-
i_s
protected byte[] i_s
-
i_c
protected byte[] i_c
-
hash
protected Digest hash
-
k
protected byte[] k
-
h
protected byte[] h
-
-
Constructor Detail
-
AbstractDHKeyExchange
protected AbstractDHKeyExchange(Session session)
-
-
Method Detail
-
init
public void init(byte[] v_s, byte[] v_c, byte[] i_s, byte[] i_c) throws ExceptionDescription copied from interface:KeyExchangeInitialize the key exchange algorithm.- Specified by:
initin interfaceKeyExchange- 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
-
getSession
public Session getSession()
- Specified by:
getSessionin interfaceSessionHolder<Session>
-
getHash
public Digest getHash()
Description copied from interface:KeyExchangeThe message digest used by this key exchange algorithm.- Specified by:
getHashin interfaceKeyExchange- Returns:
- the message digest
-
getH
public byte[] getH()
Description copied from interface:KeyExchangeRetrieves the computedhparameter- Specified by:
getHin interfaceKeyExchange- Returns:
- The
hparameter
-
getK
public byte[] getK()
Description copied from interface:KeyExchangeRetrieves the computed k parameter- Specified by:
getKin interfaceKeyExchange- Returns:
- The
kparameter
-
getE
protected byte[] getE()
-
getEValue
protected BigInteger getEValue()
-
updateE
protected byte[] updateE(Buffer buffer)
-
updateE
protected byte[] updateE(byte[] mpInt)
-
setE
protected void setE(byte[] e)
-
validateEValue
protected void validateEValue(BigInteger pValue) throws SshException
- Throws:
SshException
-
getF
protected byte[] getF()
-
getFValue
protected BigInteger getFValue()
-
updateF
protected byte[] updateF(Buffer buffer)
-
updateF
protected byte[] updateF(byte[] mpInt)
-
setF
protected void setF(byte[] f)
-
validateFValue
protected void validateFValue(BigInteger pValue) throws SshException
- Throws:
SshException
-
-