Browse Source

own_pgp_keys incl. uids

master
Volker Birk 2 years ago
parent
commit
b935cf8a3d
2 changed files with 16 additions and 3 deletions
  1. +14
    -0
      gnupg.py
  2. +2
    -3
      pEp_import.py

+ 14
- 0
gnupg.py View File

@ -50,6 +50,20 @@ def own_keys():
return [ fpr_from_keyid(x[4]) for x in command('-K') if x[0] == 'sec' and x[1] == 'u' ]
def own_pgp_keys():
result = []
key = {}
for x in command('-K'):
if x[0] == 'sec' and x[1] == 'u':
key = { 'fpr': fpr_from_keyid(x[4]) , 'uids': [] }
result.append(key)
elif x[0] == 'sec':
key = { 'uids': [] }
elif x[0] == 'uid':
key['uids'].append(x[9])
return result
def keydata(fpr):
return export_command('--export', fpr)


+ 2
- 3
pEp_import.py View File

@ -6,10 +6,9 @@
import sys
import gnupg
import thunderbird
own_keys = gnupg.own_keys()
own_pgp_keys = gnupg.own_pgp_keys()
print own_keys
print own_pgp_keys

Loading…
Cancel
Save