Interface KeyExchange

    • Field Detail

      • GROUP_KEX_OPCODES_MAP

        static final java.util.NavigableMap<java.lang.Integer,​java.lang.String> GROUP_KEX_OPCODES_MAP
      • SIMPLE_KEX_OPCODES_MAP

        static final java.util.NavigableMap<java.lang.Integer,​java.lang.String> SIMPLE_KEX_OPCODES_MAP
    • Method Detail

      • init

        void init​(byte[] v_s,
                  byte[] v_c,
                  byte[] i_s,
                  byte[] i_c)
           throws java.lang.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:
        java.lang.Exception - if an error occurs
      • next

        boolean next​(int cmd,
                     Buffer buffer)
              throws java.lang.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:
        java.lang.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 java.lang.String getGroupKexOpcodeName​(int cmd)
      • getSimpleKexOpcodeName

        static java.lang.String getSimpleKexOpcodeName​(int cmd)
      • isValidDHValue

        static boolean isValidDHValue​(java.math.BigInteger value,
                                      java.math.BigInteger p)