get the expired key information back

This commit is contained in:
Yann Leboulanger 2013-07-17 15:04:10 +02:00
parent 874e79d820
commit e2ec2e5e6c
1 changed files with 5 additions and 2 deletions

View File

@ -494,6 +494,7 @@ class Sign(object):
self.type = None self.type = None
self.hash_algo = None self.hash_algo = None
self.fingerprint = None self.fingerprint = None
self.status = ''
def __nonzero__(self): def __nonzero__(self):
return self.fingerprint is not None return self.fingerprint is not None
@ -506,9 +507,11 @@ class Sign(object):
def handle_status(self, key, value): def handle_status(self, key, value):
if key in ("USERID_HINT", "NEED_PASSPHRASE", "BAD_PASSPHRASE", if key in ("USERID_HINT", "NEED_PASSPHRASE", "BAD_PASSPHRASE",
"GOOD_PASSPHRASE", "BEGIN_SIGNING", "CARDCTRL", "INV_SGNR", "GOOD_PASSPHRASE", "BEGIN_SIGNING", "CARDCTRL", "INV_SGNR",
"KEYEXPIRED", "SIGEXPIRED", "KEYREVOKED", "NO_SGNR", "KEYREVOKED", "NO_SGNR", "MISSING_PASSPHRASE",
"MISSING_PASSPHRASE", "SC_OP_FAILURE", "SC_OP_SUCCESS"): "SC_OP_FAILURE", "SC_OP_SUCCESS"):
pass pass
elif key in ("KEYEXPIRED", "SIGEXPIRED"):
self.status = 'key expired'
elif key == "SIG_CREATED": elif key == "SIG_CREATED":
(self.type, (self.type,
algo, self.hash_algo, cls, algo, self.hash_algo, cls,