support/testing: add python-asn1crypto runtime test
Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
committed by
Thomas Petazzoni
parent
c306853074
commit
2fe638af26
11
support/testing/tests/package/sample_python_asn1crypto.py
Normal file
11
support/testing/tests/package/sample_python_asn1crypto.py
Normal file
@@ -0,0 +1,11 @@
|
||||
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"
|
||||
Reference in New Issue
Block a user