Class AbstractDHKeyExchange

java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.common.kex.dh.AbstractDHKeyExchange
All Implemented Interfaces:
KeyExchange, org.apache.sshd.common.NamedResource, org.apache.sshd.common.session.SessionContextHolder, SessionHolder<Session>
Direct Known Subclasses:
AbstractDHClientKeyExchange, AbstractDHServerKeyExchange

public abstract class AbstractDHKeyExchange extends org.apache.sshd.common.util.logging.AbstractLoggingBean implements KeyExchange
Author:
Apache MINA SSHD Project
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected byte[]
     
    protected org.apache.sshd.common.digest.Digest
     
    protected byte[]
     
    protected byte[]
     
    protected byte[]
     
    protected byte[]
     
    protected byte[]
     

    Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean

    log

    Fields inherited from interface 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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected byte[]
     
    protected BigInteger
     
    protected byte[]
     
    protected BigInteger
     
    byte[]
    Retrieves the computed h parameter
    org.apache.sshd.common.digest.Digest
    The message digest used by this key exchange algorithm.
    byte[]
    Retrieves the computed k parameter
     
    void
    init(byte[] v_s, byte[] v_c, byte[] i_s, byte[] i_c)
    Initialize the key exchange algorithm.
    protected byte[]
    normalize(byte[] mpInt)
     
    protected void
    setE(byte[] e)
     
    protected void
    setF(byte[] f)
     
     
    protected byte[]
    updateE(byte[] mpInt)
     
    protected byte[]
    updateE(org.apache.sshd.common.util.buffer.Buffer buffer)
     
    protected byte[]
    updateF(byte[] mpInt)
     
    protected byte[]
    updateF(org.apache.sshd.common.util.buffer.Buffer buffer)
     
    protected void
     
    protected void
     

    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 Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface KeyExchange

    next

    Methods inherited from interface org.apache.sshd.common.NamedResource

    getName

    Methods inherited from interface SessionHolder

    getSessionContext
  • Field Details

    • 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 org.apache.sshd.common.digest.Digest hash
    • k

      protected byte[] k
    • h

      protected byte[] h
  • Constructor Details

    • AbstractDHKeyExchange

      protected AbstractDHKeyExchange(Session session)
  • Method Details

    • 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 interface KeyExchange
      Parameters:
      v_s - the server identification string
      v_c - the client identification string
      i_s - the server key initialization packet
      i_c - the client key initialization packet
      Throws:
      Exception - if an error occurs
    • getSession

      public Session getSession()
      Specified by:
      getSession in interface SessionHolder<Session>
    • getHash

      public org.apache.sshd.common.digest.Digest getHash()
      Description copied from interface: KeyExchange
      The message digest used by this key exchange algorithm.
      Specified by:
      getHash in interface KeyExchange
      Returns:
      the message digest
    • getH

      public byte[] getH()
      Description copied from interface: KeyExchange
      Retrieves the computed h parameter
      Specified by:
      getH in interface KeyExchange
      Returns:
      The h parameter
    • getK

      public byte[] getK()
      Description copied from interface: KeyExchange
      Retrieves the computed k parameter
      Specified by:
      getK in interface KeyExchange
      Returns:
      The k parameter
    • getE

      protected byte[] getE()
    • getEValue

      protected BigInteger getEValue()
    • updateE

      protected byte[] updateE(org.apache.sshd.common.util.buffer.Buffer buffer)
    • updateE

      protected byte[] updateE(byte[] mpInt)
    • setE

      protected void setE(byte[] e)
    • validateEValue

      protected void validateEValue(BigInteger pValue) throws org.apache.sshd.common.SshException
      Throws:
      org.apache.sshd.common.SshException
    • getF

      protected byte[] getF()
    • getFValue

      protected BigInteger getFValue()
    • updateF

      protected byte[] updateF(org.apache.sshd.common.util.buffer.Buffer buffer)
    • updateF

      protected byte[] updateF(byte[] mpInt)
    • setF

      protected void setF(byte[] f)
    • validateFValue

      protected void validateFValue(BigInteger pValue) throws org.apache.sshd.common.SshException
      Throws:
      org.apache.sshd.common.SshException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • normalize

      protected byte[] normalize(byte[] mpInt)