From 024a2481dfe320b7e4604d8e3088d6b88dab7325 Mon Sep 17 00:00:00 2001 From: J08nY Date: Wed, 23 Aug 2017 23:15:23 +0200 Subject: Implement signature stripping if the list is set to. --- src/mailman_pgp/pgp/wrapper.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/mailman_pgp/pgp/wrapper.py') diff --git a/src/mailman_pgp/pgp/wrapper.py b/src/mailman_pgp/pgp/wrapper.py index f746229..fdb7eeb 100644 --- a/src/mailman_pgp/pgp/wrapper.py +++ b/src/mailman_pgp/pgp/wrapper.py @@ -112,6 +112,21 @@ class PGPWrapper(BaseWrapper): elif self.inline.is_signed(): yield from self.inline.get_signature() + def strip_signature(self): + """ + + :return: + :rtype: PGPWrapper + """ + result = None + if self.mime.is_signed(): + result = self.mime.strip_signature() + elif self.multisig.is_signed(): + result = self.multisig.strip_signature() + elif self.inline.is_signed(): + result = self.inline.strip_signature() + return self._rewrap(result) + def sign(self, key, **kwargs): """ Sign a message with key. -- cgit v1.2.3-70-g09d2