kkapsner / keepassxc-mail

MailExtension to talk to keepassxc
GNU General Public License v3.0
62 stars 5 forks source link

Support Passwords for Private-Keys #60

Closed BarbarossaCode closed 2 years ago

BarbarossaCode commented 2 years ago

It would be nice if the extension would provide the possibility to retrive the password of private OpenPGP keys. Edit: Support for CalDav passwords would also be nice.

kkapsner commented 2 years ago

Sounds like a good idea and should be doable.

CalDav should already work. It works for me.

BarbarossaCode commented 2 years ago

For me the extention seemed to interrupt the setup process for a new email account. By standard Thunderbird searches at the end for CardDav adressbooks and CalDav calendars. For my adressbook the correct password was suggestet. But for my calendat no password was recomended at all, but username, server, etc. are all the same. I`d guess it might be a onetime error.

kkapsner commented 2 years ago

You can look at the console (Ctrl+Shift+J) and there you can see when keepassxc-mail requests a password. Maybe the protocol was wrong.

The OpenPGP thing is a little bit more complicated because it does not use string bundles.

@jobisoft: I did not find how to get the Localization constructor (to be used like here). In the Thunderbird code it seems to be available in the global namespace. But in the experiment it's not. I could also not find it in Cc. Also using stringBundleService.createBundle("chrome://messenger/openpgp/keyWizard.ftl"); does not work as the format is different. (Throws NS_ERROR_UNEXPECTED when I call GetStringFromName.) So how can I get the translations from messenger/openpgp/keyWizard.ftl?

kkapsner commented 2 years ago

@jobisoft: can you help? Also fine if not - just want to know if I should wait for an answer from you.

jobisoft commented 2 years ago

I am not sure. Can you try

XPCOMUtils.defineLazyGlobalGetters(this, ["Localization"]);

or

Cu.importGlobalProperties(["Localization"]);

kkapsner commented 2 years ago

Thanks. The first one works. I have to confess that I'm not familiar with how the global properties in Gecko work.

@BarbarossaCode: Now I have to implement the actual logic. I would say the "URL" in KeePassXC should be "openpgp://{FINGERPRINT OF THE KEY}" and no login should be set. Or what do you think?

Please check if the attached zip adds the KeePassXC-mail things to the password prompt. keepassxc-mail-1.1.zip

kkapsner commented 2 years ago

@BarbarossaCode: ping.

BarbarossaCode commented 2 years ago

Im sorry at the moment i dont have a Setup to test it.