Browse Source

read trust

master
Volker Birk 2 years ago
parent
commit
454500a165
2 changed files with 21 additions and 0 deletions
  1. +19
    -0
      enigmail.py
  2. +2
    -0
      pEp_import.py

+ 19
- 0
enigmail.py View File

@ -82,6 +82,25 @@ def own_pgp_keys():
return result
def comm_partner_pgp_keys():
result = []
key = {}
for x in command('--list-key'):
if x[0] == 'pub' and x[1] == '-' and x[8] != 'n':
try:
key = { 'fpr': fpr_from_keyid(x[4]), 'trust': x[8] == 'f' or x[8] == 'u', 'uids': [] }
result.append(key)
except LookupError:
key = { 'uids': [] }
elif x[0] == 'pub':
key = { 'uids': [] }
elif x[0] == 'uid':
try:
key['uids'].append(uid(x[9]))
except LookupError: pass
return result
def keydata(fpr):
return export_command('--export', fpr)


+ 2
- 0
pEp_import.py View File

@ -22,3 +22,5 @@ with pEp_JSON.Connection() as connect:
print thunderbird.enigmail_assignKeysByEmailAddr(thunderbird_base)
print enigmail.rules.test_address("vb@pibit.ch")
print enigmail.comm_partner_pgp_keys()

Loading…
Cancel
Save