]> git.siccegge.de Git - dane-monitoring-plugins.git/blob - check_dane/cert.py
Initial implementation of DANE SMTP check
[dane-monitoring-plugins.git] / check_dane / cert.py
1 #!/usr/bin/python3
2
3 from pyasn1_modules import rfc2459
4 from pyasn1.codec.der import decoder, encoder
5
6
7 def get_spki(certificate):
8 cert = decoder.decode(certificate, asn1Spec=rfc2459.Certificate())[0]
9 spki = cert['tbsCertificate']["subjectPublicKeyInfo"]
10 return encoder.encode(spki)