How can I decode a pem-encoded (base64) certificate with Python? For example this here from github.com:
-----BEGIN CERTIFICATE-----
MIIHKjCCBhKgAwIBAgIQDnd2i
I am not Sure how you received it but another simple way for getting it installed is to just write it as a binary file and then run it using os
import os
cert= function_gives_binary_cert()
with open('RecvdCert.der','wb') as file:
file.write(cert)
os.startfile('RecvdCert.der')
Beware of running received binary from an unknown source. Just want to decode then use OpenSSL as mentioned in other answers.