How to use the pykeepass.kdbx_parsing.kdbx.KDBX function in pykeepass

To help you get started, we’ve selected a few pykeepass examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github libkeepass / pykeepass / pykeepass / pykeepass.py View on Github external
def read(self, filename=None, password=None, keyfile=None,
             transformed_key=None):
        self.password = password
        self.keyfile = keyfile
        if not filename:
            filename = self.filename

        try:
            self.kdbx = KDBX.parse_file(
                filename,
                password=password,
                keyfile=keyfile,
                transformed_key=transformed_key
            )
        except ChecksumError:
            raise CredentialsIntegrityError
github FalkAlexander / PasswordSafe / passwordsafe / database_manager.py View on Github external
def save_database(self):
        if self.save_running is False and self.changes is True:
            self.save_running = True

            try:
                self.db.save()
                self.logging_manager.debug("Saved database")
                self.changes = False
            except Exception:
                self.logging_manager.error("Error occured while saving database")

            # Workaround
            # Fix created and proposed: https://github.com/pschmitt/pykeepass/pull/102
            self.db.kdbx = KDBX.parse_file(self.db.filename, password=self.db.password, keyfile=self.db.keyfile, transformed_key=None)

            self.save_running = False
github libkeepass / pykeepass / pykeepass / pykeepass.py View on Github external
def save(self, filename=None, transformed_key=None):
        if not filename:
            filename = self.filename

        with open(filename, 'wb') as f:
            f.write(
                KDBX.build(
                    self.kdbx,
                    password=self.password,
                    keyfile=self.keyfile,
                    transformed_key=transformed_key
                )