Class DHGEXServer

    • Field Detail

      • dh

        protected DHG dh
      • min

        protected int min
      • prf

        protected int prf
      • max

        protected int max
      • expected

        protected byte expected
      • oldRequest

        protected boolean oldRequest
    • Constructor Detail

    • Method Detail

      • getName

        public final java.lang.String getName()
        Returns:
        The resource name
      • init

        public void init​(byte[] v_s,
                         byte[] v_c,
                         byte[] i_s,
                         byte[] i_c)
                  throws java.lang.Exception
        Description copied from interface: KeyExchange
        Initialize the key exchange algorithm.
        Specified by:
        init in interface KeyExchange
        Overrides:
        init in class AbstractDHKeyExchange
        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

        public boolean next​(int cmd,
                            Buffer buffer)
                     throws java.lang.Exception
        Description copied from interface: KeyExchange
        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
      • chooseDH

        protected DHG chooseDH​(int min,
                               int prf,
                               int max)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • selectModuliGroups

        protected java.util.List<Moduli.DhGroup> selectModuliGroups​(ServerSession session,
                                                                    int min,
                                                                    int prf,
                                                                    int max,
                                                                    java.util.List<Moduli.DhGroup> groups)
                                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • loadModuliGroups

        protected java.util.List<Moduli.DhGroup> loadModuliGroups​(ServerSession session)
                                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getDH

        protected DHG getDH​(java.math.BigInteger p,
                            java.math.BigInteger g)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception