2018-09-17 22:32:30 +00:00
|
|
|
from __future__ import absolute_import
|
|
|
|
|
|
|
|
import cython
|
2018-09-16 03:48:12 +00:00
|
|
|
import gpg
|
|
|
|
|
|
|
|
c = gpg.Context()
|
|
|
|
seckeys = c.keylist(pattern=None, secret=True)
|
|
|
|
pubkeys = c.keylist(pattern=None, secret=False)
|
|
|
|
|
|
|
|
seclist = list(seckeys)
|
|
|
|
secnum = len(seclist)
|
|
|
|
|
|
|
|
publist = list(pubkeys)
|
|
|
|
pubnum = len(publist)
|
|
|
|
|
2018-09-17 22:32:30 +00:00
|
|
|
if cython.compiled is True:
|
|
|
|
cc = "Powered by Cython compiled C code."
|
|
|
|
else:
|
|
|
|
cc = "Powered by Python."
|
|
|
|
|
2018-09-16 03:48:12 +00:00
|
|
|
print("""
|
2018-09-17 22:32:30 +00:00
|
|
|
Number of secret keys: {0}
|
|
|
|
Number of public keys: {1}
|
|
|
|
|
|
|
|
{2}
|
|
|
|
""".format(secnum, pubnum, cc))
|