diff options
author | Justus Winter <[email protected]> | 2016-05-10 11:19:26 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2016-05-10 11:19:26 +0000 |
commit | f4ba16b31ea282d0787a40be3f37b951584143a1 (patch) | |
tree | ebb1ed1945dee5fc0e8e21ca62420a51924bbbad /lang/python/examples | |
parent | Merge branch 'master' into justus/pyme3 (diff) | |
download | gpgme-f4ba16b31ea282d0787a40be3f37b951584143a1.tar.gz gpgme-f4ba16b31ea282d0787a40be3f37b951584143a1.zip |
python: Rename bindings.
--
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'lang/python/examples')
-rw-r--r-- | lang/python/examples/Examples.rst | 7 | ||||
-rwxr-xr-x | lang/python/examples/delkey.py | 34 | ||||
-rwxr-xr-x | lang/python/examples/encrypt-to-all.py | 68 | ||||
-rwxr-xr-x | lang/python/examples/exportimport.py | 75 | ||||
-rwxr-xr-x | lang/python/examples/genkey.py | 45 | ||||
-rw-r--r-- | lang/python/examples/inter-edit.py | 57 | ||||
-rwxr-xr-x | lang/python/examples/sign.py | 31 | ||||
-rwxr-xr-x | lang/python/examples/signverify.py | 78 | ||||
-rwxr-xr-x | lang/python/examples/simple.py | 52 | ||||
-rw-r--r-- | lang/python/examples/t-edit.py | 59 | ||||
-rw-r--r-- | lang/python/examples/testCMSgetkey.py | 49 | ||||
-rwxr-xr-x | lang/python/examples/verifydetails.py | 100 |
12 files changed, 655 insertions, 0 deletions
diff --git a/lang/python/examples/Examples.rst b/lang/python/examples/Examples.rst new file mode 100644 index 00000000..18b03b27 --- /dev/null +++ b/lang/python/examples/Examples.rst @@ -0,0 +1,7 @@ +=============== +Example Scripts +=============== + +Most of the examples have been converted to work with Python 3, just as the original versions worked with Python 2. A small number produce errors on OS X, but may behave differently on other POSIX systems. The GTK based scripts (PyGtkGpgKeys.py and pygpa.py) have not been modified at all. + +When using or referring to the example scripts here, the most common change has been the byte encoded strings, so if something does not work then chances are that it will be related to the encoding or decoding of UTF-8. diff --git a/lang/python/examples/delkey.py b/lang/python/examples/delkey.py new file mode 100755 index 00000000..dfcc5ea4 --- /dev/null +++ b/lang/python/examples/delkey.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 +# $Id$ +# Copyright (C) 2004,2008 Igor Belyi <[email protected]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Sample of key deletion +# It deletes keys for [email protected] generated by genkey.pl script + +from pyme import core + +core.check_version(None) + +# Note that we need to collect all keys out of the iterator return by c.op_keylist_all() +# method before starting to delete them. If you delete a key in the middle of iteration +# c.op_keylist_next() will raise INV_VALUE exception + +c = core.Context() +# 0 in keylist means to list not only public but secret keys as well. +for thekey in [x for x in c.op_keylist_all(b"[email protected]", 0)]: + # 1 in delete means to delete not only public but secret keys as well. + c.op_delete(thekey, 1) diff --git a/lang/python/examples/encrypt-to-all.py b/lang/python/examples/encrypt-to-all.py new file mode 100755 index 00000000..8f9d2500 --- /dev/null +++ b/lang/python/examples/encrypt-to-all.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python3 +# $Id$ +# Copyright (C) 2008 Igor Belyi <[email protected]> +# Copyright (C) 2002 John Goerzen <[email protected]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +""" +This program will try to encrypt a simple message to each key on your +keyring. If your keyring has any invalid keys on it, those keys will +be skipped and it will re-try the encryption.""" + +from pyme import core +from pyme.core import Data, Context +from pyme.constants import validity + +core.check_version(None) + +plain = Data(b'This is my message.') + +c = Context() +c.set_armor(1) + +def sendto(keylist): + cipher = Data() + c.op_encrypt(keylist, 1, plain, cipher) + cipher.seek(0,0) + return cipher.read() + +names = [] +for key in c.op_keylist_all(None, 0): + try: + print(" *** Found key for %s" % key.uids[0].uid) + valid = 0 + for subkey in key.subkeys: + keyid = subkey.keyid + if keyid == None: + break + can_encrypt = subkey.can_encrypt + valid += can_encrypt + print(" Subkey %s: encryption %s" % \ + (keyid, can_encrypt and "enabled" or "disabled")) + except UnicodeEncodeError as e: + print(e) + + if valid: + names.append(key) + else: + print(" This key cannot be used for encryption; skipping.") + +passno = 0 + +print("Encrypting to %d recipients" % len(names)) +print(sendto(names)) + + diff --git a/lang/python/examples/exportimport.py b/lang/python/examples/exportimport.py new file mode 100755 index 00000000..54204fb7 --- /dev/null +++ b/lang/python/examples/exportimport.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 +# $Id$ +# Copyright (C) 2004,2008 Igor Belyi <[email protected]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Sample of export and import of keys +# It uses keys for [email protected] generated by genkey.pl script + +import sys +from pyme import core + +core.check_version(None) + +expkey = core.Data() +c = core.Context() +c.set_armor(1) +user = b"[email protected]" + +print(" - Export %s's public keys - " % user) +c.op_export(user, 0, expkey) + +# print out exported data to see how it looks in armor. +expkey.seek(0,0) +expstring = expkey.read() +if expstring: + print(expstring) +else: + print("No %s's keys to export!" % user) + sys.exit(0) + + +# delete keys to ensure that they came from our imported data. +# Note that since joe's key has private part as well we can only delete +# both of them. As a side effect joe won't have private key for this +# exported public one. If it's Ok with you uncomment the next 4 lines. +#print " - Delete %s's public keys - " % user +#for thekey in [x for x in c.op_keylist_all(user, 0)]: +# if not thekey.secret: +# c.op_delete(thekey, 1) + + +# initialize import data from a string as if it was read from a file. +newkey = core.Data(expstring) + +print(" - Import exported keys - ") +c.op_import(newkey) +result = c.op_import_result() + +# show the import result +if result: + print(" - Result of the import - ") + for k in dir(result): + if not k in result.__dict__ and not k.startswith("_"): + if k == "imports": + print(k, ":") + for impkey in result.__getattr__(k): + print(" fpr=%s result=%d status=%x" % \ + (impkey.fpr, impkey.result, impkey.status)) + else: + print(k, ":", result.__getattr__(k)) +else: + print(" - No import result - ") diff --git a/lang/python/examples/genkey.py b/lang/python/examples/genkey.py new file mode 100755 index 00000000..14497eb7 --- /dev/null +++ b/lang/python/examples/genkey.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +# $Id$ +# Copyright (C) 2004 Igor Belyi <[email protected]> +# Copyright (C) 2002 John Goerzen <[email protected]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +from pyme import core, callbacks + +# Initialize our context. +core.check_version(None) + +c = core.Context() +c.set_armor(1) +c.set_progress_cb(callbacks.progress_stdout, None) + +# This example from the GPGME manual + +parms = b"""<GnupgKeyParms format="internal"> +Key-Type: RSA +Key-Length: 2048 +Subkey-Type: RSA +Subkey-Length: 2048 +Name-Real: Joe Tester +Name-Comment: with stupid passphrase +Name-Email: [email protected] +Passphrase: Crypt0R0cks +Expire-Date: 2020-12-31 +</GnupgKeyParms> +""" + +c.op_genkey(parms, None, None) +print(c.op_genkey_result().fpr) diff --git a/lang/python/examples/inter-edit.py b/lang/python/examples/inter-edit.py new file mode 100644 index 00000000..f97232b7 --- /dev/null +++ b/lang/python/examples/inter-edit.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +# $Id$ +# Copyright (C) 2005 Igor Belyi <[email protected]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +import os, sys +from pyme import core +from pyme.core import Data, Context +from pyme.constants import status + +core.check_version(None) + +# Get names for the status codes +stat2str = {} +for name in dir(status): + if not name.startswith('__') and name != "util": + stat2str[getattr(status, name)] = name + +# Print the output received since the last prompt before giving the new prompt +def edit_fnc(stat, args, helper): + global stat_strings + try: + while True: + helper["data"].seek(helper["skip"],0) + data = helper["data"].read() + helper["skip"] += len(data) + print(data) + return input("(%s) %s > " % (stat2str[stat], args)) + except EOFError: + pass + +# Simple interactive editor to test editor scripts +if len(sys.argv) != 2: + sys.stderr.write("Usage: %s <Gpg key patter>\n" % sys.argv[0]) +else: + c = Context() + out = Data() + c.op_keylist_start(sys.argv[1].encode('utf-8'), 0) + key = c.op_keylist_next() + helper = {"skip": 0, "data": out} + c.op_edit(key, edit_fnc, helper, out) + print("[-- Final output --]") + out.seek(helper["skip"],0) + print(out.read()) diff --git a/lang/python/examples/sign.py b/lang/python/examples/sign.py new file mode 100755 index 00000000..5667cc2b --- /dev/null +++ b/lang/python/examples/sign.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +# $Id$ +# Copyright (C) 2002 John Goerzen +# <[email protected]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +from pyme import core, callbacks +from pyme.constants.sig import mode + +core.check_version(None) + +plain = core.Data(b"Test message") +sig = core.Data() +c = core.Context() +c.set_passphrase_cb(callbacks.passphrase_stdin, b'for signing') +c.op_sign(plain, sig, mode.CLEAR) +sig.seek(0,0) +print(sig.read()) diff --git a/lang/python/examples/signverify.py b/lang/python/examples/signverify.py new file mode 100755 index 00000000..f8804ca9 --- /dev/null +++ b/lang/python/examples/signverify.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python3 +# $Id$ +# Copyright (C) 2004,2008 Igor Belyi <[email protected]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Sample of unattended signing/verifying of a message. +# It uses keys for [email protected] generated by genkey.pl script + +import sys +from pyme import core, callbacks +from pyme.constants.sig import mode + +core.check_version(None) + +plain = core.Data(b"Test message") +sig = core.Data() +c = core.Context() +user = b"[email protected]" + +c.signers_clear() +# Add [email protected]'s keys in the list of signers +for sigkey in c.op_keylist_all(user, 1): + if sigkey.can_sign: + c.signers_add(sigkey) +if not c.signers_enum(0): + print("No secret %s's keys suitable for signing!" % user) + sys.exit(0) + +# This is a map between signer e-mail and its password +passlist = { + b"<[email protected]>": b"Crypt0R0cks" + } + +# callback will return password based on the e-mail listed in the hint. +c.set_passphrase_cb(lambda x,y,z: passlist[x[x.rindex("<"):]]) + +c.op_sign(plain, sig, mode.CLEAR) + +# Print out the signature (don't forget to rewind since signing put sig at EOF) +sig.seek(0,0) +signedtext = sig.read() +print(signedtext) + +# Create Data with signed text. +sig2 = core.Data(signedtext) +plain2 = core.Data() + +# Verify. +c.op_verify(sig2, None, plain2) +result = c.op_verify_result() + +# List results for all signatures. Status equal 0 means "Ok". +index = 0 +for sign in result.signatures: + index += 1 + print("signature", index, ":") + print(" summary: ", sign.summary) + print(" status: ", sign.status) + print(" timestamp: ", sign.timestamp) + print(" fingerprint:", sign.fpr) + print(" uid: ", c.get_key(sign.fpr, 0).uids[0].uid) + +# Print "unsigned" text. Rewind since verify put plain2 at EOF. +plain2.seek(0,0) +print("\n", plain2.read()) diff --git a/lang/python/examples/simple.py b/lang/python/examples/simple.py new file mode 100755 index 00000000..5693d40a --- /dev/null +++ b/lang/python/examples/simple.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +# $Id$ +# Copyright (C) 2005 Igor Belyi <[email protected]> +# Copyright (C) 2002 John Goerzen <[email protected]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +import sys +from pyme import core, constants, errors +import pyme.constants.validity + +core.check_version(None) + +# Set up our input and output buffers. + +plain = core.Data(b'This is my message.') +cipher = core.Data() + +# Initialize our context. + +c = core.Context() +c.set_armor(1) + +# Set up the recipients. + +sys.stdout.write("Enter name of your recipient: ") +name = sys.stdin.readline().strip() +c.op_keylist_start(name, 0) +r = c.op_keylist_next() + +if r == None: + print("The key for user \"%s\" was not found" % name) +else: + # Do the encryption. + try: + c.op_encrypt([r], 1, plain, cipher) + cipher.seek(0,0) + print(cipher.read()) + except errors.GPGMEError as ex: + print(ex.getstring()) diff --git a/lang/python/examples/t-edit.py b/lang/python/examples/t-edit.py new file mode 100644 index 00000000..6c533429 --- /dev/null +++ b/lang/python/examples/t-edit.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 +# $Id$ +# Copyright (C) 2005 Igor Belyi <[email protected]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +import os +from pyme import core +from pyme.core import Data, Context + +core.check_version(None) + +class KeyEditor: + def __init__(self): + self.steps = ["fpr", "expire", "1", "primary", "quit"] + self.step = 0 + + def edit_fnc(self, status, args, out): + print("[-- Response --]") + out.seek(0,0) + print(out.read(), end=' ') + print("[-- Code: %d, %s --]" % (status, args)) + + if args == "keyedit.prompt": + result = self.steps[self.step] + self.step += 1 + elif args == "keyedit.save.okay": + result = "Y" + elif args == "keygen.valid": + result = "0" + else: + result = None + + return result + +if not os.getenv("GNUPGHOME"): + print("Please, set GNUPGHOME env.var. pointing to GPGME's tests/gpg dir") +else: + c = Context() + c.set_passphrase_cb(lambda x,y,z: "abc") + out = Data() + c.op_keylist_start(b"Alpha", 0) + key = c.op_keylist_next() + c.op_edit(key, KeyEditor().edit_fnc, out, out) + print("[-- Last response --]") + out.seek(0,0) + print(out.read(), end=' ') diff --git a/lang/python/examples/testCMSgetkey.py b/lang/python/examples/testCMSgetkey.py new file mode 100644 index 00000000..53fdef77 --- /dev/null +++ b/lang/python/examples/testCMSgetkey.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 +# initial 20080124 [email protected] +# 20080124-2: removed some superflous imports +# 20080703: adapted for pyme-0.8.0 +# This script is Free Software under GNU GPL v>=2. +# +# No modification made for python3 port, Bernhard can field this one +# if it is still required. -- Ben McGinnes +# +"""A test applicaton for gpg_get_key() protocol.CMS. + +Tested on Debian Etch with + pyme 0.8.0 (manually compiled) + libgpgme11 1.1.6-0kk2 + gpgsm 2.0.9-0kk2 +""" + +import sys +from pyme import core +from pyme.constants import protocol + +def printgetkeyresults(keyfpr): + """Run gpgme_get_key().""" + + # gpgme_check_version() necessary for initialisation according to + # gogme 1.1.6 and this is not done automatically in pyme-0.7.0 + print("gpgme version:", core.check_version(None)) + c = core.Context() + c.set_protocol(protocol.CMS) + + key = c.get_key(keyfpr, False) + + print("got key: ", key.subkeys[0].fpr) + + for uid in key.uids: + print(uid.uid) + +def main(): + if len(sys.argv) < 2: + print("fingerprint or unique key ID for gpgme_get_key()") + sys.exit(1) + + printgetkeyresults(sys.argv[1]) + + +if __name__ == "__main__": + main() + + diff --git a/lang/python/examples/verifydetails.py b/lang/python/examples/verifydetails.py new file mode 100755 index 00000000..0d47ba54 --- /dev/null +++ b/lang/python/examples/verifydetails.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python3 +# initial 20080123 build from the example: +# very simple - probably INCOMPLETE +# 20080703 Bernhard +# added second usage for detached signatures. +# added output of signature.summary (another bitfield) +# printing signature bitfield in hex format +# +# $Id$ +# +# Copyright (C) 2004,2008 Igor Belyi <[email protected]> +# Copyright (c) 2008 Bernhard Reiter <[email protected]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +import sys +from pyme import core, callbacks, constants +from pyme.constants.sig import mode +from pyme.constants import protocol + +def print_engine_infos(): + print("gpgme version:", core.check_version(None)) + print("engines:") + + for engine in core.get_engine_info(): + print(engine.file_name, engine.version) + + for proto in [protocol.OpenPGP, protocol.CMS]: + print(core.get_protocol_name(proto), core.engine_check_version(proto)) + + +def verifyprintdetails(sigfilename, filefilename=None): + """Verify a signature, print a lot of details.""" + c = core.Context() + + # Create Data with signed text. + sig2 = core.Data(file=sigfilename) + if filefilename: + file2 = core.Data(file=filefilename) + plain2 = None + else: + file2 = None + plain2 = core.Data() + + # Verify. + c.op_verify(sig2, file2, plain2) + result = c.op_verify_result() + + # List results for all signatures. Status equal 0 means "Ok". + index = 0 + for sign in result.signatures: + index += 1 + print("signature", index, ":") + print(" summary: %#0x" % (sign.summary)) + print(" status: %#0x" % (sign.status)) + print(" timestamp: ", sign.timestamp) + print(" fingerprint:", sign.fpr) + print(" uid: ", c.get_key(sign.fpr, 0).uids[0].uid) + + # Print "unsigned" text if inline signature + if plain2: + #Rewind since verify put plain2 at EOF. + plain2.seek(0,0) + print("\n", plain2.read()) + +def main(): + print_engine_infos() + + print() + + argc= len(sys.argv) + if argc < 2 or argc > 3: + print("need a filename for inline signature") + print("or two filename for detached signature and file to check") + sys.exit(1) + + if argc == 2: + print("trying to verify file: " + sys.argv[1].encode('utf-8')) + verifyprintdetails(sys.argv[1].encode('utf-8')) + if argc == 3: + print("trying to verify signature %s for file %s" \ + % (sys.argv[1].encode('utf-8'), sys.argv[2].encode('utf-8'))) + + verifyprintdetails(sys.argv[1].encode('utf-8'), sys.argv[2].encode('utf-8')) + +if __name__ == "__main__": + main() + + |