def get_export_data(self, kgk_manager):
        """
        This gives you a base64 encoded string of encrypted settings data (the blob).

        :param kgk_manager: kgk manager
        :type kgk_manager: KgkManager
        :return: encrypted settings blob
        :rtype: str
        """
        kgk_block = kgk_manager.get_fresh_encrypted_kgk()
        settings_list = self.get_settings_as_dict()['settings']
        if self.remote_data:
            for domain_name in self.remote_data.keys():
                data_set = self.remote_data[domain_name]
                if 'deleted' in data_set and data_set['deleted']:
                    for i, setting_dict in enumerate(settings_list):
                        if setting_dict['domain'] == setting_dict['domain'] and \
                                PasswordSetting.convert_ISO_date(data_set['mDate']) > \
                                PasswordSetting.convert_ISO_date(setting_dict['mDate']):
                            settings_list[i] = data_set
                if domain_name not in settings_list.keys():
                    settings_list[domain_name] = {
                        'mDate': datetime.now(),
                        'deleted': True
                    }
        settings_crypter = self.get_settings_crypter(kgk_manager)
        return b64encode(b'\x01' + kgk_manager.get_kgk_crypter_salt() +
                         kgk_block + settings_crypter.encrypt(
                             Packer.compress(json.dumps(settings_list))))
    def update_from_export_data(self, kgk_manager, blob):
        """
        Call this method to pull settings from the sync server.

        :param kgk_manager: the kgk manager used for the decryption
        :type kgk_manager: KgkManager
        :param blob: the export data
        :type blob: bytes
        """
        if not blob[0] == 1:
            print(
                "Version error: Wrong data format. Could not import anything.")
            return True
        settings_crypter = self.get_settings_crypter(kgk_manager)
        decrypted_settings = settings_crypter.decrypt(blob[145:])
        if len(decrypted_settings) <= 0:
            print("Wrong password.")
            return False
        self.remote_data = json.loads(
            str(Packer.decompress(decrypted_settings), encoding='utf-8'))
        self.update_remote = False
        for domain_name in self.remote_data.keys():
            data_set = self.remote_data[domain_name]
            found = False
            i = 0
            while i < len(self.settings):
                setting = self.settings[i]
                if setting.get_domain() == domain_name:
                    found = True
                    if 'mDate' in data_set:
                        last_modification_date = data_set['mDate']
                    else:
                        last_modification_date = data_set['cDate']
                    if PasswordSetting.convert_ISO_date(
                            last_modification_date) > setting.get_m_date():
                        if 'deleted' in data_set and data_set['deleted']:
                            self.settings.pop(i)
                        else:
                            setting.load_from_dict(data_set)
                            setting.set_synced(True)
                            self.update_remote = True
                            i += 1
                    else:
                        i += 1
                else:
                    i += 1
            if not found:
                new_setting = PasswordSetting(domain_name)
                new_setting.load_from_dict(data_set)
                new_setting.set_synced(True)
                self.settings.append(new_setting)
        for setting in self.settings:
            found = False
            for domain_name in self.remote_data.keys():
                data_set = self.remote_data[domain_name]
                if setting.get_domain() == domain_name:
                    found = True
                    if 'mDate' in data_set:
                        last_modification_date = data_set['mDate']
                    else:
                        last_modification_date = data_set['cDate']
                    if setting.get_m_date(
                    ) >= PasswordSetting.convert_ISO_date(
                            last_modification_date):
                        self.update_remote = True
            if not found:
                self.update_remote = True
        self.store_local_settings(kgk_manager)
        return self.update_remote