Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/xmlsec/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ def _get_cert_by_fp(self, fp):

def _cert_fingerprint(cert_pem):
if "-----BEGIN CERTIFICATE" in cert_pem:
if isinstance(cert_pem, six.text_type):
cert_pem = cert_pem.encode()
cert = load_pem_x509_certificate(cert_pem, backend=default_backend())
else:
cert = load_der_x509_certificate(base64.standard_b64decode(cert_pem), backend=default_backend())
Expand Down