diff options
author | JinWang An <jinwang.an@samsung.com> | 2021-12-01 16:54:36 +0900 |
---|---|---|
committer | JinWang An <jinwang.an@samsung.com> | 2021-12-01 16:54:36 +0900 |
commit | 3a4efa5aa27f73c93a1b020b8b30f07f0b4e46c7 (patch) | |
tree | b736cbf7c30b64e009a62666238787ae6881eb2c /lang/python/examples/exportimport.py | |
parent | 10e16af58579b2e22154d944d8cb4144924a8406 (diff) | |
download | gpgme-3a4efa5aa27f73c93a1b020b8b30f07f0b4e46c7.tar.gz gpgme-3a4efa5aa27f73c93a1b020b8b30f07f0b4e46c7.tar.bz2 gpgme-3a4efa5aa27f73c93a1b020b8b30f07f0b4e46c7.zip |
Imported Upstream version 1.8.0upstream/1.8.0
Diffstat (limited to 'lang/python/examples/exportimport.py')
-rwxr-xr-x | lang/python/examples/exportimport.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lang/python/examples/exportimport.py b/lang/python/examples/exportimport.py index bc946bc..8ae87a8 100755 --- a/lang/python/examples/exportimport.py +++ b/lang/python/examples/exportimport.py @@ -17,18 +17,18 @@ # along with this program; if not, see <http://www.gnu.org/licenses/>. # Sample of export and import of keys -# It uses keys for joe+pyme@example.org generated by genkey.py script +# It uses keys for joe+gpg@example.org generated by genkey.py script from __future__ import absolute_import, print_function, unicode_literals del absolute_import, print_function, unicode_literals import sys import os -import pyme +import gpg -user = "joe+pyme@example.org" +user = "joe+gpg@example.org" -with pyme.Context(armor=True) as c, pyme.Data() as expkey: +with gpg.Context(armor=True) as c, gpg.Data() as expkey: print(" - Export %s's public keys - " % user) c.op_export(user, 0, expkey) @@ -43,7 +43,7 @@ with pyme.Context(armor=True) as c, pyme.Data() as expkey: # delete keys to ensure that they came from our imported data. Note # that if joe's key has private part as well we can only delete both # of them. -with pyme.Context() as c: +with gpg.Context() as c: # Note: We must not modify the key store during iteration, # therfore, we explicitly make a list. keys = list(c.keylist(user)) @@ -51,7 +51,7 @@ with pyme.Context() as c: for k in keys: c.op_delete(k, True) -with pyme.Context() as c: +with gpg.Context() as c: print(" - Import exported keys - ") c.op_import(expstring) result = c.op_import_result() |