Commit f054c992 authored by ale's avatar ale
Browse files

add the "fp" command to dump fingerprints; minor fixes to the help doc

parent 112c04e3
......@@ -28,7 +28,10 @@ Known commands:
List all known certificates
files <TAG>...
fp [<TAG>...]
Print SHA1/MD5 fingerprints of certificates
files <TAG>
Dump all the certificate-related files of this TAG
......@@ -86,9 +89,16 @@ def main():
elif cmd == 'list':
for cert in sorted(certs, key=lambda x:
print,, cert.get_expiration_date()
elif cmd == 'fp' or cmd == 'fingerprint':
if len(args) > 0:
certs = [find_cert(certs, x) for x in args]
for cert in certs:
print ' SHA1:', cert.get_fingerprint('sha1')
print ' MD5:', cert.get_fingerprint('md5')
elif cmd == 'check':
now = time.time()
warning_time = 8640000 * int(global_config.get('warning_days', 15))
warning_time = 86400 * int(global_config.get('warning_days', 15))
for cert in certs:
exp = cert.get_expiration_date()
if exp and (exp - now) < warning_time:
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