Commit 1c063489 authored by ale's avatar ale
Browse files

print expiration dates in the "list" command

parent f054c992
......@@ -87,8 +87,18 @@ def main():
print c.public_key_file
print c.private_key_file
elif cmd == 'list':
now = time.time()
for cert in sorted(certs, key=lambda x:
print,, cert.get_expiration_date()
expiry = cert.get_expiration_date()
state = 'OK'
expiry_str = ''
if not expiry:
state = 'MISSING'
if expiry < now:
state = 'EXPIRED'
expiry_str = time.strftime('%Y/%m/%d', time.gmtime(expiry))
print,, state, expiry_str
elif cmd == 'fp' or cmd == 'fingerprint':
if len(args) > 0:
certs = [find_cert(certs, x) for x in args]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment