summaryrefslogtreecommitdiff
path: root/alot/crypto.py
diff options
context:
space:
mode:
authorJohannes Kulick <kulick@hildensia.de>2012-12-13 12:16:18 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2013-02-19 10:10:07 +0000
commit8448de9d8a81225ac43f625c4bd99358e4329546 (patch)
tree46f778d0db1b6bcae9de551a828244efd118d6f4 /alot/crypto.py
parent88e73d066982018fdd666e49ec33c3f81419098c (diff)
support multiple recipients in encryption
Multiple recipient-keys can be specified. They are shown in the envelope buffer. A new command is introduced: 'rmencrypt' do remove a key from the encryption lsit. Unfortunately pygpgme doesn't implement __cmp__() so we have to either write something similar on our own or use this solution (index of the key in encryption list)
Diffstat (limited to 'alot/crypto.py')
-rw-r--r--alot/crypto.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/alot/crypto.py b/alot/crypto.py
index dfa8491f..be7e83e2 100644
--- a/alot/crypto.py
+++ b/alot/crypto.py
@@ -153,7 +153,7 @@ def detached_signature_for(plaintext_str, key=None):
return sigs, signature
-def encrypt(plaintext_str, key=None):
+def encrypt(plaintext_str, keys=None):
"""
Encrypts the given plaintext string and returns a PGP/MIME compatible
string
@@ -166,7 +166,7 @@ def encrypt(plaintext_str, key=None):
encrypted_data = StringIO()
ctx = gpgme.Context()
ctx.armor = True
- ctx.encrypt([key], gpgme.ENCRYPT_ALWAYS_TRUST, plaintext_data,
+ ctx.encrypt(keys, gpgme.ENCRYPT_ALWAYS_TRUST, plaintext_data,
encrypted_data)
encrypted_data.seek(0, 0)
encrypted = encrypted_data.read()