fingerprint.py 440 B

1234567891011121314151617
  1. from argparse import ArgumentParser
  2. from openleadr.utils import certificate_fingerprint
  3. def show_fingerprint():
  4. parser = ArgumentParser()
  5. parser.add_argument('certificate', type=str)
  6. args = parser.parse_args()
  7. if 'certificate' in args:
  8. with open(args.certificate) as file:
  9. cert_str = file.read()
  10. print(certificate_fingerprint(cert_str))
  11. if __name__ == "__main__":
  12. show_fingerprint()