mirror of
https://github.com/PartialVolume/shredos.x86_64.git
synced 2026-03-01 22:12:12 +00:00
12 lines
312 B
Python
12 lines
312 B
Python
|
|
from asn1crypto import pem, x509
|
||
|
|
|
||
|
|
|
||
|
|
with open('/etc/ssl/certs/ISRG_Root_X2.pem', 'rb') as f:
|
||
|
|
der_bytes = f.read()
|
||
|
|
if pem.detect(der_bytes):
|
||
|
|
type_name, headers, der_bytes = pem.unarmor(der_bytes)
|
||
|
|
|
||
|
|
cert = x509.Certificate.load(der_bytes)
|
||
|
|
|
||
|
|
assert cert.subject.native["common_name"] == "ISRG Root X2"
|