diff options
| author | J08nY | 2017-06-19 23:55:24 +0200 |
|---|---|---|
| committer | J08nY | 2017-06-19 23:55:24 +0200 |
| commit | cb9faf28501d3748135700285a4cbdedfb6c6d5b (patch) | |
| tree | a9180471eb8600eff72312835ec35c0232a523b7 /src/mailman_pgp/pgp/inline.py | |
| parent | 625d264965f91dfefd301b361524d13b64901c7a (diff) | |
| download | mailman-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.py | 13 |
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 |
