diff options
| author | J08nY | 2017-08-01 22:53:15 +0200 |
|---|---|---|
| committer | J08nY | 2017-08-02 01:35:10 +0200 |
| commit | dff7befbc5860f2f78f63ab694ef88d21a53771f (patch) | |
| tree | 458e8004705eab2ca024da0cd21057cc2f5f56f3 /src/mailman_pgp/pgp/wrapper.py | |
| parent | 7c0aaf28767e494323557b6cb8fb6500df5822e5 (diff) | |
| download | mailman-pgp-dff7befbc5860f2f78f63ab694ef88d21a53771f.tar.gz mailman-pgp-dff7befbc5860f2f78f63ab694ef88d21a53771f.tar.zst mailman-pgp-dff7befbc5860f2f78f63ab694ef88d21a53771f.zip | |
Diffstat (limited to 'src/mailman_pgp/pgp/wrapper.py')
| -rw-r--r-- | src/mailman_pgp/pgp/wrapper.py | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/mailman_pgp/pgp/wrapper.py b/src/mailman_pgp/pgp/wrapper.py index 6193b57..f0519cb 100644 --- a/src/mailman_pgp/pgp/wrapper.py +++ b/src/mailman_pgp/pgp/wrapper.py @@ -270,7 +270,7 @@ class PGPWrapper(): Get the collection of keys in this message. :return: A collection of keys. - :rtype: Generator[pgpy.PGPKey] + :rtype: typing.Generator[pgpy.PGPKey] """ if self.mime.has_keys(): yield from self.mime.keys() @@ -278,3 +278,32 @@ class PGPWrapper(): yield from self.multisig.keys() elif self.inline.has_keys(): yield from self.inline.keys() + + def has_revocs(self): + """ + + :return: + :rtype: bool + """ + return any(wrapper.has_revocs() for wrapper in self.wrappers) + + def is_revocs(self): + """ + + :return: + :rtype: bool + """ + return any(wrapper.is_revocs() for wrapper in self.wrappers) + + def revocs(self): + """ + + :return: + :rtype: typing.Generator[pgpy.PGPSignature] + """ + if self.mime.has_revocs(): + yield from self.mime.revocs() + elif self.multisig.has_revocs(): + yield from self.multisig.revocs() + elif self.inline.has_revocs(): + yield from self.inline.revocs() |
