libkeepass / pykeepass

Python library to interact with keepass databases (supports KDBX3 and KDBX4)
https://pypi.org/project/pykeepass/
GNU General Public License v3.0
411 stars 96 forks source link

Feature Request: Add option to provide keyfile as bytes #363

Closed ghost closed 10 months ago

ghost commented 11 months ago

Currently keyfile must be a link to a real file. Using a Yubikey challenge response in upcoming Secrets we could use the bytes directly to open our database. The current workaround is to create a new file just for the keyfile handover.

Can we change the current implementation to bytes or add a new option for bytes transfer?

ghost commented 11 months ago

@A6GibKm FYI

A6GibKm commented 11 months ago

If I am not mistaken, the current documentation suggests that you should be able to pass a bytes like object instead of a path, so it could be patched to do so.

ghost commented 11 months ago

If I am not mistaken, the current documentation suggests that you should be able to pass a bytes like object instead of a path, so it could be patched to do so.

Where is it mentioned in doc?

A6GibKm commented 11 months ago

See https://github.com/libkeepass/pykeepass/pull/201/files, filename takes a stream which is also useful (One can use a pythonio.BytesIO). But yeah, no mention about it for keyfiles.