Skip to content

Commit e565402

Browse files
authored
Add benchmark for loading DER certificates (pyca#8597)
1 parent 3df3fc8 commit e565402

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/bench/test_x509.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ def test_aki_public_bytes(benchmark):
2222
benchmark(aki.public_bytes)
2323

2424

25+
def test_load_der_certificate(benchmark):
26+
cert_bytes = load_vectors_from_file(
27+
os.path.join("x509", "PKITS_data", "certs", "GoodCACert.crt"),
28+
loader=lambda pemfile: pemfile.read(),
29+
mode="rb",
30+
)
31+
32+
benchmark(x509.load_der_x509_certificate, cert_bytes)
33+
34+
2535
def test_load_pem_certificate(benchmark):
2636
cert_bytes = load_vectors_from_file(
2737
os.path.join("x509", "cryptography.io.pem"),

0 commit comments

Comments
 (0)