mirror of
https://github.com/adulau/crl-monitor.git
synced 2024-11-22 01:57:05 +00:00
Initial version of the ICSI Notary lookup of FP
This commit is contained in:
parent
ad94a7c7f3
commit
6bc6d92ca9
1 changed files with 31 additions and 0 deletions
31
bin/x509/icsi.py
Normal file
31
bin/x509/icsi.py
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# ICSI Notary lookup of FP
|
||||||
|
#
|
||||||
|
# Software is free software released under the GNU General Public License version 3 and later
|
||||||
|
#
|
||||||
|
# Copyright (c) 2015 Alexandre Dulaunoy - a@foo.be
|
||||||
|
|
||||||
|
|
||||||
|
import dns.resolver
|
||||||
|
import argparse
|
||||||
|
import fileinput
|
||||||
|
|
||||||
|
suffix = '.notary.icsi.berkeley.edu'
|
||||||
|
|
||||||
|
resolver = dns.resolver.Resolver()
|
||||||
|
fp = '592978A72A9061F70AD7C44C4D449DCF258CD534'
|
||||||
|
|
||||||
|
argParser = argparse.ArgumentParser(description='Lookup a series of certificate fingerprints ICSI Certificate Notary')
|
||||||
|
argParser.add_argument('-r', default='-', help='Read from a file, default is stdin')
|
||||||
|
args = argParser.parse_args()
|
||||||
|
|
||||||
|
for l in fileinput.input(args.r):
|
||||||
|
fp = l.rstrip()
|
||||||
|
try:
|
||||||
|
r = resolver.query(fp+suffix, 'TXT')[0]
|
||||||
|
except:
|
||||||
|
print ("Non-existing certificate {}".format(fp))
|
||||||
|
continue
|
||||||
|
print ("{},{}".format(fp,r))
|
Loading…
Reference in a new issue