aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/examples/howto/encrypt-sign-file.py
diff options
context:
space:
mode:
Diffstat (limited to 'lang/python/examples/howto/encrypt-sign-file.py')
-rwxr-xr-xlang/python/examples/howto/encrypt-sign-file.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lang/python/examples/howto/encrypt-sign-file.py b/lang/python/examples/howto/encrypt-sign-file.py
index 41aaac86..a08176b7 100755
--- a/lang/python/examples/howto/encrypt-sign-file.py
+++ b/lang/python/examples/howto/encrypt-sign-file.py
@@ -3,6 +3,9 @@
from __future__ import absolute_import, division, unicode_literals
+import gpg
+import sys
+
# Copyright (C) 2018 Ben McGinnes <[email protected]>
#
# This program is free software; you can redistribute it and/or modify it under
@@ -24,9 +27,6 @@ from __future__ import absolute_import, division, unicode_literals
# Lesser General Public along with this program; if not, see
# <http://www.gnu.org/licenses/>.
-import gpg
-import sys
-
"""
Signs and encrypts a file to a specified key. If entering both the key and the
filename on the command line, the key must be entered first.
@@ -58,13 +58,13 @@ with open(filename, "rb") as f:
with gpg.Context(armor=True) as ca:
ciphertext, result, sign_result = ca.encrypt(text, recipients=rkey,
always_trust=True,
- add_encrypt_to=True)
+ add_encrypt_to=True)
with open("{0}.asc".format(filename), "wb") as fa:
fa.write(ciphertext)
with gpg.Context() as cg:
ciphertext, result, sign_result = cg.encrypt(text, recipients=rkey,
always_trust=True,
- add_encrypt_to=True)
+ add_encrypt_to=True)
with open("{0}.gpg".format(filename), "wb") as fg:
fg.write(ciphertext)