--- Begin Message --- i have figured out how to add a PGP key to Thunderbird, in case anyone finds it useful:

|var pcUser = "Administrator"; // <== Put your Windows user name var privateKeysFolder = "C:\\Users\\" + pcUser + "\\Desktop\\gpg-private-keys"; // <== place your priv keys here! Components.utils.import("resource://gre/modules/FileUtils.jsm"); var EnigmailKeyRing = ChromeUtils.import("chrome://openpgp/content/modules/keyRing.jsm").EnigmailKeyRing; function importSecretKeyFromFile(filename){ var file = new FileUtils.File(filename); let resultKeys = {}; let errorMsgObj = {}; EnigmailKeyRing.importKeyFromFile( window, function(win, fpr, userFlags){ resultFlags.canceled = false; return ""; }, // <== returns key passphrase, if any file, errorMsgObj, resultKeys, false, true); return resultKeys.keys[0]; } var k = importSecretKeyFromFile(privateKeysFolder + "\\privatekey_em...@example.com.asc"); console.log("imported key id: " + k); |

Now i just need to associate the imported key to an identity, and i've asked about it on bugzilla https://bugzilla.mozilla.org/show_bug.cgi?id=1671834 They don't seem to reply though. Anyway i have basically tried with Services.prefs.setStringPref , but it doesn't work||

|var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); Services.prefs.setStringPref( "mail.identity." + identity.key + ".openpgp_key_id", k ); // associate this pgp key with identity... won't work|

From the identity manager popup of the Thunderbird UI i don't see any
PGP key for the identity, under "End-to-end cryptography" tab.
I have even tried removing the "0x" prefix from the key id ( the "k" variable), ... no difference. I see the PGP key in the OpenPGP key manager popup though, and the email of the key matches with identity.email

Do you have any idea please? Thanks


--- End Message ---
_______________________________________________
enigmail-users mailing list
enigmail-users@enigmail.net
To unsubscribe or make changes to your subscription click here:
https://admin.hostpoint.ch/mailman/listinfo/enigmail-users_enigmail.net

Reply via email to