aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/commands/eml_key.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman_pgp/commands/eml_key.py')
-rw-r--r--src/mailman_pgp/commands/eml_key.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mailman_pgp/commands/eml_key.py b/src/mailman_pgp/commands/eml_key.py
index e182451..b958b93 100644
--- a/src/mailman_pgp/commands/eml_key.py
+++ b/src/mailman_pgp/commands/eml_key.py
@@ -23,6 +23,7 @@ from mailman.interfaces.command import ContinueProcessing, IEmailCommand
from mailman.interfaces.pending import IPendings
from mailman.interfaces.subscriptions import ISubscriptionManager
from mailman.interfaces.usermanager import IUserManager
+from pgpy.constants import KeyFlags
from public import public
from zope.component import getUtility
from zope.interface import implementer
@@ -77,7 +78,7 @@ def _cmd_set(pgp_list, mlist, msg, msgdata, arguments, results):
file=results)
return ContinueProcessing.no
- if not key_usable(key):
+ if not key_usable(key, {KeyFlags.EncryptCommunications, KeyFlags.Sign}):
print('Need a key which can be used to encrypt communications.',
file=results)
return ContinueProcessing.no
@@ -228,7 +229,7 @@ def _cmd_change(pgp_list, mlist, msg, msgdata, arguments, results):
file=results)
return ContinueProcessing.no
- if not key_usable(key):
+ if not key_usable(key, {KeyFlags.EncryptCommunications, KeyFlags.Sign}):
print('Need a key which can be used to encrypt communications.',
file=results)
return ContinueProcessing.no