File: fingerprint.py

package info (click to toggle)
python-openleadr-python 0.5.34%2Bdfsg.1-2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,496 kB
  • sloc: python: 6,942; xml: 663; makefile: 32; sh: 18
file content (17 lines) | stat: -rw-r--r-- 440 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from argparse import ArgumentParser
from openleadr.utils import certificate_fingerprint


def show_fingerprint():
    parser = ArgumentParser()
    parser.add_argument('certificate', type=str)
    args = parser.parse_args()

    if 'certificate' in args:
        with open(args.certificate) as file:
            cert_str = file.read()
            print(certificate_fingerprint(cert_str))


if __name__ == "__main__":
    show_fingerprint()