/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to seahorse.py

  • Committer: Daniel Schierbeck
  • Date: 2008-04-03 20:20:39 UTC
  • mto: (450.1.18 trunk)
  • mto: This revision was merged to the branch mainline in revision 458.
  • Revision ID: daniel.schierbeck@gmail.com-20080403202039-22d9vdjo5eoum8q1
Made the signature checking code not try to discover the signature key.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
LOCATION_REMOTE = 50
60
60
LOCATION_LOCAL = 100
61
61
 
62
 
def discover(*key_ids):
63
 
    return openpgp.DiscoverKeys(key_ids, 0)
 
62
keyset = dict()
64
63
 
65
64
def verify(crypttext):
66
65
    (cleartext, key) = crypto.VerifyText(KEY_TYPE_OPENPGP, 1, crypttext)
67
66
 
68
 
    return Key(key)
 
67
    if key != "":
 
68
        if key not in keyset:
 
69
            keyset[key] = Key(key)
 
70
 
 
71
        return keyset[key]
69
72
 
70
73
class Key:
71
74
 
76
79
        self.flags = None
77
80
        self.display_name = None
78
81
        self.location = None
79
 
 
80
 
        if self.is_available():
81
 
            discover(key)
 
82
        
 
83
        (keys, unmatched) = openpgp.MatchKeys([self.get_id()], 0x00000010)
 
84
        self.available = (key in keys)
82
85
 
83
86
    def get_field(self, field, default=None):
84
87
        (valid, value) = openpgp.GetKeyField(self.key, field)
122
125
        return self.location
123
126
 
124
127
    def is_available(self):
125
 
        return self.key != ""
 
128
        return self.available
126
129
 
127
130
    def is_trusted(self):
128
131
        return self.get_flags() & FLAG_TRUSTED