|
|
@ -9,10 +9,10 @@ import enigmail |
|
|
|
import pEp_JSON |
|
|
|
import thunderbird |
|
|
|
from enigmail import thunderbird_base |
|
|
|
from base64 import b64encode |
|
|
|
|
|
|
|
|
|
|
|
own_pgp_keys = enigmail.own_pgp_keys() |
|
|
|
identities = enigmail.identities() |
|
|
|
#identities = enigmail.identities() |
|
|
|
|
|
|
|
#print identities |
|
|
|
#print thunderbird.enigmail_assignKeysByEmailAddr(thunderbird_base) |
|
|
@ -20,5 +20,29 @@ identities = enigmail.identities() |
|
|
|
#print enigmail.comm_partner_pgp_keys() |
|
|
|
|
|
|
|
with pEp_JSON.Connection() as call: |
|
|
|
print call("serverVersion")[u'return'] |
|
|
|
|
|
|
|
# own keys |
|
|
|
|
|
|
|
own_pgp_keys = enigmail.own_pgp_keys() |
|
|
|
print own_pgp_keys |
|
|
|
|
|
|
|
for own_key in own_pgp_keys: |
|
|
|
|
|
|
|
# import keydata |
|
|
|
|
|
|
|
keydata = enigmail.secret(own_key['fpr']) |
|
|
|
call('import_key', b64encode(keydata), 23, [ '42', ]) |
|
|
|
|
|
|
|
# set as own key |
|
|
|
|
|
|
|
for uid in own_key['uids']: |
|
|
|
me = { |
|
|
|
'username': uid['name'], |
|
|
|
'user_id': 'pEp_own_userId', |
|
|
|
'address': uid['email'], |
|
|
|
'fpr': own_key['fpr'], |
|
|
|
} |
|
|
|
print call('set_own_key', me, own_key['fpr']) |
|
|
|
|
|
|
|
# set own identities |
|
|
|
|