code: def _handshake(self, conn, addr):
          '''
          Ensures that the client receives the AES key.
          '''
          # waiting for the magic request message
          msg = conn.recv(len(MAGIC_REQ))
          log.debug('Received message %s from %s', msg, addr)
          if msg != MAGIC_REQ:
              log.warning('%s is not a valid REQ message from %s', msg, addr)
              return
          log.debug('Sending the private key')
          conn.send(self.__key)
          # wait for explicit ACK
          log.debug('Waiting for the client to confirm')
          msg = conn.recv(len(MAGIC_ACK))
          if msg != MAGIC_ACK:
              return
          log.debug('Sending the signature key')
          conn.send(self.__sgn)
          # wait for explicit ACK
          log.debug('Waiting for the client to confirm')
          msg = conn.recv(len(MAGIC_ACK))
          if msg != MAGIC_ACK:
              return
          log.info('%s is now authenticated', addr)
          self.keep_alive(connf _handshake(self, conn, addr):
          '''
          Ensures that the client receives the AES key.
          '''
          # waiting for the magic request message
          msg = conn.recv(len(MAGIC_REQ))
          log.debug('Received message %s from %s', msg, addr)
          if msg != MAGIC_REQ:
              log.warning('%s is not a valid REQ message from %s', msg, addr)
              return
          log.debug('Sending the private key')
          conn.send(self.__key)
          # wait for explicit ACK
          log.debug('Waiting for the client to confirm')
          msg = conn.recv(len(MAGIC_ACK))
          if msg != MAGIC_ACK:
              return
          log.debug('Sending the signature key')
          conn.send(self.__sgn)
          # wait for explicit ACK
          log.debug('Waiting for the client to confirm')
          msg = conn.recv(len(MAGIC_ACK))
          if msg != MAGIC_ACK:
              return
          log.info('%s is now authenticated', addr)
          self.keep_alive(conn)
docs: Ensures that the client receives the AES key.