aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/pgp/inline.py
diff options
context:
space:
mode:
authorJ08nY2017-06-19 23:55:24 +0200
committerJ08nY2017-06-19 23:55:24 +0200
commitcb9faf28501d3748135700285a4cbdedfb6c6d5b (patch)
treea9180471eb8600eff72312835ec35c0232a523b7 /src/mailman_pgp/pgp/inline.py
parent625d264965f91dfefd301b361524d13b64901c7a (diff)
downloadmailman-pgp-cb9faf28501d3748135700285a4cbdedfb6c6d5b.tar.gz
mailman-pgp-cb9faf28501d3748135700285a4cbdedfb6c6d5b.tar.zst
mailman-pgp-cb9faf28501d3748135700285a4cbdedfb6c6d5b.zip
Diffstat (limited to 'src/mailman_pgp/pgp/inline.py')
-rw-r--r--src/mailman_pgp/pgp/inline.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mailman_pgp/pgp/inline.py b/src/mailman_pgp/pgp/inline.py
index 8f3ad88..4a5ea2c 100644
--- a/src/mailman_pgp/pgp/inline.py
+++ b/src/mailman_pgp/pgp/inline.py
@@ -1,12 +1,21 @@
""""""
from email.message import Message
+from pgpy import PGPMessage
+
+
class PGPInlineWrapper:
def __init__(self, msg: Message):
self.msg = msg
+ self.pgp = None
+ if not msg.is_multipart():
+ try:
+ self.pgp = PGPMessage.from_blob(msg.get_payload())
+ except:
+ pass
def is_inline_signed(self):
- pass
+ return self.pgp is not None and self.pgp.is_signed
def is_inline_encrypted(self):
- pass
+ return self.pgp is not None and self.pgp.is_encrypted