+ expiry = cert.get_expiration_date()
+ state = 'OK'
+ expiry_str = ''
+ if not expiry:
+ state = 'MISSING'
+ else:
+ if expiry < now:
+ state = 'EXPIRED'
+ expiry_str = time.strftime('%Y/%m/%d', time.gmtime(expiry))
+ print cert.name, cert.cn, state, expiry_str
+ elif cmd == 'fp' or cmd == 'fingerprint':
+ if len(args) > 0:
+ certs = [find_cert(certs, x) for x in args]
+ for cert in certs:
+ print cert.name, cert.cn
+ print ' SHA1:', cert.get_fingerprint('sha1')
+ print ' MD5:', cert.get_fingerprint('md5')