We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e45d4e8 commit 169c73cCopy full SHA for 169c73c
src/cryptojwt/jwk/x509.py
@@ -62,6 +62,20 @@ def import_public_key_from_pem_data(pem_data):
62
return cert.public_key()
63
64
65
+def import_public_key_from_cert_file(filename):
66
+ """
67
+ Read a public key from a certificate file.
68
+
69
+ :param filename: The name of the file
70
+ :return: A public key instance
71
72
+ with open(filename, "rb") as key_file:
73
+ cert = x509.load_pem_x509_certificate(
74
+ key_file.read(), backend=default_backend()
75
+ )
76
+ return cert.public_key()
77
78
79
def der_cert(der_data):
80
"""
81
Load a DER encoded certificate
0 commit comments