code: def save_key_file(self):
          
          if self.client_key is None:
              return
  
          if self.key_file_path:
              key_file_path = self.key_file_path
          else:
              key_file_path = self._get_key_file_path()
  
          logger.debug('save keyfile to %s', key_file_path);
  
          with open(key_file_path, 'w+') as f:
              raw_data = f.read()
              key_dict = {}
  
              if raw_data:
                  key_dict = json.loads(raw_data)
  
              key_dict[self.ip] = self.client_key
  
              f.write(json.dumps(key_dict))
docs: Save the current client key.