Re: [Enigmail] Importing PGP key via code

2020-11-04 Thread it_support via enigmail-users
--- 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


[Enigmail] Importing PGP key via code

2020-11-01 Thread it_support via enigmail-users
--- Begin Message ---

Hello,

i have asked bugzilla how to import a PGP key file via Javascript (i 
will run it from the Thunderbird console).


But they told me they don't give add-on support there. So i guess i have 
to ask you about this.


Anyway, i have found the functions i need to call to do this:

it's getGpgKeyData

from 
https://hg.mozilla.org/comm-central/file/595dddfbd18b/mail/extensions/openpgp/content/modules/cryptoAPI/gnupg-keylist.jsm 



or  importKeyFromFileAPI

from 
https://hg.mozilla.org/comm-central/file/595dddfbd18b/mail/extensions/openpgp/content/modules/cryptoAPI/gnupg-key.jsm


But both of them are not implemented. Indeed they do nothing other than 
throwing a "Not implemented" exception.


Are you going to implement those methods soon? Or do you suggest another 
solution?


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


[Enigmail] Obsolete PGP encryption method

2020-10-05 Thread it_support via enigmail-users
--- Begin Message ---
Hello,

i am encrypting emails via PGP on mail server, and i have not the
possibility to sign them because i can only have the public keys
available on server.

So when i download the emails with Thunderbird , they are PGP encrypted
but not signed.

When i open these emails with Thunderbird, i get an error saying the
message has been encrypted by an obsolete method, and may have been
modified during transmission, so it will not be displayed.

I guess the problem is missing signature? Is there a way to tell
Enigmail to ignore the missing signature and decrypt the message anyway?
Or may the problem be the

application/pgp mime type i am using, which is obsolete? 
I may try with
Content-Type: multipart/encrypted; protocol="application/pgp-encrypted";
but i guess it makes no difference if the problem is in the missing signature

Example email that gives me the error:





Content-Type: multipart/alternative;
boundary="_000_VI1P194MB063950F8AFCFEF8AE12E5510A13C0VI1P194MB0639EURP_"



--_000_VI1P194MB063950F8AFCFEF8AE12E5510A13C0VI1P194MB0639EURP_
Content-Type: application/pgp

-BEGIN PGP MESSAGE-
Version: BCPG C# v1.6.1.0

hQIMA3drgilSCIWPAQ/9Hu9QPY3oTma4xDs7HR6/rcAASC+avaxbUlw/LUx2mHaj
TcyxpTQz7xFoegvz/lv7P7uKxgcEVsG+splamkT20IwG0wUifsCCSJLjtnSh9QH5
uxj0nkas5BgIWT47YycL8gRxQfAkMmXWuYS9tO3QZi6gIn9/lgj/npclZhSnZZzJ
BVJWwBPPUBc7EKkgJW0bAbtZbyrs5n0CEvqbWx6w6Yjp/xf0naB0oT1oROQB053s
iIFkXdhhdDI56zNIETeh/RuLVMJ0tqmEAYnzX7oX5+30d4ZA8Du0rU2ygwfHtvhd
AgbmT6Zglp+kFmLt5Uq/MyovnJfk6e5dHqNZ03O7YsoMaBoeJ3/3R6pCH4Yr+S2R
SJtRIuVoDRcMZYjE56dqVCrCPCxHFNP0EzIZS6oOd6PSIeA67nZVCiBOdEEdGes/
8RY5/OsI8iGezaEDgxljEDFSkw96ujf4GZxZ5OXhxPKF0oyY2bQnQz+WzjocXvHR
R6iMk3G1nAK20EwURKnFkWI0IJiUb0JJbrnVbhuOx15QHs+DLuUj/WjWj37HWqa3
ckeQOYcV7E2snCNucgmbmfmxmHAmZM1HK5ZRcHWThK++F0gAv5GXUD4HiiaarxTc
A8YR7RwdIf1wnIb3+yoA0sxDXIV+mcyT38U10nj5PDjvdCwUar5spOXvpiU2TPfJ
Jwlu+mjBBsRHPcAP/Oq/kqTXtvowcJxGvz16MlfO/PWofOEIhUz1Dg==
=d10C
-END PGP MESSAGE-

--_000_VI1P194MB063950F8AFCFEF8AE12E5510A13C0VI1P194MB0639EURP_--

--- 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