[Pkg-privacy-commits] [monkeysign] 02/03: gpg: Implemented revoked for OpenPGP UIDs

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:34:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch dev/revoked
in repository monkeysign.

commit 9033bbb3fea0566cf710b4cd569897797e6cbafa
Author: Tobias Mueller <muelli at cryptobitch.de>
Date:   Mon Feb 16 11:50:01 2015 +0100

    gpg: Implemented revoked for OpenPGP UIDs
    
    We already have the information whether the UID has been revoked.  It
    came as the trust attribute and returning that is straight forward.
    However, for secret keys, the information is not exported and you need
    to find the appropriate public key in order to determine whether the UID
    is revoked.
---
 monkeysign/gpg.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/monkeysign/gpg.py b/monkeysign/gpg.py
index 8dac868..b6f1b01 100644
--- a/monkeysign/gpg.py
+++ b/monkeysign/gpg.py
@@ -777,6 +777,27 @@ class OpenPGPuid():
         self.expire = expire
         self.uidhash = uidhash
 
+
+    @property
+    def revoked(self):
+        '''Whether this UID has been revoked
+        
+        Note that, due to GnuPG not exporting that information
+        for secret keys, UIDs of secret keys do not carry that
+        information.
+        
+        Return None if it cannot be determined whether this UID
+        has been revoked.  Try again with the public key.'''
+        if self.trust == '-':
+            is_revoked = None
+        elif self.trust == 'r':
+            is_revoked = True
+        else:
+            is_revoked = False
+            
+        return is_revoked
+
+
     def get_trust(self):
         return OpenPGPkey.trust_map[self.trust]
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/monkeysign.git



More information about the Pkg-privacy-commits mailing list