summaryrefslogtreecommitdiff
path: root/alot/crypto.py
diff options
context:
space:
mode:
authorJohannes Kulick <kulick@hildensia.de>2012-12-12 12:48:30 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2013-02-19 10:10:07 +0000
commit91ba77f5109cabd70341e8c7377fba6df565fb2d (patch)
tree868d31cf811ca0d3f1d4671de0a69c6eb08a151d /alot/crypto.py
parentfd049b65bea0567aa645461d751c2971c6ef5440 (diff)
pep8 corrections
Diffstat (limited to 'alot/crypto.py')
-rw-r--r--alot/crypto.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/alot/crypto.py b/alot/crypto.py
index 2f1781f2..dfa8491f 100644
--- a/alot/crypto.py
+++ b/alot/crypto.py
@@ -152,9 +152,12 @@ def detached_signature_for(plaintext_str, key=None):
signature = signature_data.read()
return sigs, signature
+
def encrypt(plaintext_str, key=None):
"""
- Encrypts the given plaintext string and returns a PGP/MIME compatible string
+ Encrypts the given plaintext string and returns a PGP/MIME compatible
+ string
+
:param plaintext_str: the mail to encrypt
:param key: gpgme_key_t object representing the key to use
:rtype: a string holding the encrypted mail
@@ -163,9 +166,8 @@ def encrypt(plaintext_str, key=None):
encrypted_data = StringIO()
ctx = gpgme.Context()
ctx.armor = True
- ctx.encrypt([key], gpgme.ENCRYPT_ALWAYS_TRUST, plaintext_data, encrypted_data)
+ ctx.encrypt([key], gpgme.ENCRYPT_ALWAYS_TRUST, plaintext_data,
+ encrypted_data)
encrypted_data.seek(0, 0)
encrypted = encrypted_data.read()
return encrypted
-
-