def __regen_keypair(self, key_id):
"""
If the datestamps on either member of a keypair have expired, or if the
date parameter in the slot is un-set for either of the pair, generate
new keys for both slots.
"""
for key_type in ["sign", "encrypt"]:
section = key_type + "_" + key_id
if not self.config.has_section(section):
self.__create_slotpair(key_id)
if self.config.get(section, "date") == '':
self.__write_keypair(key_id)
break
else:
keydate = self.config.getint(section, "date")
# syslog.syslog("regen id %s keydate: %s expiry: %s"
# % (key_id, str(keydate), str(keydate + self.lifetime)))
if self.time > (keydate + self.lifetime):
syslog.syslog("regen keyid " + key_id)
self.__write_keypair(key_id)
break
评论列表
文章目录