diff options
| author | J08nY | 2017-07-27 17:30:51 +0200 |
|---|---|---|
| committer | J08nY | 2017-07-27 17:30:51 +0200 |
| commit | c401f2c6cc5f0aa4c6de245dcf252d3bbcc920fd (patch) | |
| tree | fd39f7101ce620ed75b0db20f8961c84c892b94a /src/mailman_pgp/pgp/wrapper.py | |
| parent | 6dfc81e703c4ed7518a6342b24abb16f104c17b6 (diff) | |
| download | mailman-pgp-c401f2c6cc5f0aa4c6de245dcf252d3bbcc920fd.tar.gz mailman-pgp-c401f2c6cc5f0aa4c6de245dcf252d3bbcc920fd.tar.zst mailman-pgp-c401f2c6cc5f0aa4c6de245dcf252d3bbcc920fd.zip | |
Diffstat (limited to 'src/mailman_pgp/pgp/wrapper.py')
| -rw-r--r-- | src/mailman_pgp/pgp/wrapper.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mailman_pgp/pgp/wrapper.py b/src/mailman_pgp/pgp/wrapper.py index cbfa7f2..a1041ad 100644 --- a/src/mailman_pgp/pgp/wrapper.py +++ b/src/mailman_pgp/pgp/wrapper.py @@ -81,6 +81,16 @@ class PGPWrapper(): elif self.inline.is_signed(): yield from self.inline.get_signed() + def get_signature(self): + """ + + :return: + """ + if self.mime.is_signed(): + yield from self.mime.get_signature() + elif self.inline.is_signed(): + yield from self.inline.get_signature() + def sign(self, key, **kwargs): """ Sign a message with key. @@ -129,6 +139,17 @@ class PGPWrapper(): """ return self.mime.has_encryption() or self.inline.has_encryption() + + def get_encrypted(self): + """ + + :return: + """ + if self.mime.is_signed(): + yield from self.mime.get_encrypted() + elif self.inline.is_signed(): + yield from self.inline.get_encrypted() + def encrypt(self, *keys, **kwargs): """ Encrypt the message with key/s, using cipher. |
