Interface KeyExchange

All Superinterfaces:
NamedResource, SessionContextHolder, SessionHolder<Session>
All Known Implementing Classes:
AbstractDHClientKeyExchange, AbstractDHKeyExchange, AbstractDHServerKeyExchange, DHGClient, DHGEXClient, DHGEXServer, DHGServer

public interface KeyExchange extends NamedResource, SessionHolder<Session>
Key exchange algorithm.
Author:
Apache MINA SSHD Project
  • Field Details

  • Method Details

    • init

      void init(byte[] v_s, byte[] v_c, byte[] i_s, byte[] i_c) throws Exception
      Initialize the key exchange algorithm.
      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
    • next

      boolean next(int cmd, Buffer buffer) throws Exception
      Process the next packet
      Parameters:
      cmd - the command
      buffer - 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
    • getHash

      Digest getHash()
      The message digest used by this key exchange algorithm.
      Returns:
      the message digest
    • getH

      byte[] getH()
      Retrieves the computed h parameter
      Returns:
      The h parameter
    • getK

      byte[] getK()
      Retrieves the computed k parameter
      Returns:
      The k parameter
    • getGroupKexOpcodeName

      static String getGroupKexOpcodeName(int cmd)
    • getSimpleKexOpcodeName

      static String getSimpleKexOpcodeName(int cmd)
    • isValidDHValue

      static boolean isValidDHValue(BigInteger value, BigInteger p)