CkPython
CkPython
Get Public Key from Certificate PEM
See more Certificates Examples
Loads a certificate from a PEM file and gets the cert's public key.Chilkat CkPython Downloads
import sys
import chilkat
success = False
cert = chilkat.CkCert()
success = cert.LoadFromFile("qa_data/certs/someCert.pem")
if (success == False):
print(cert.lastErrorText())
sys.exit()
# Get the certificate's public key:
pubkey = chilkat.CkPublicKey()
cert.GetPublicKey(pubkey)
print(pubkey.getPem(False))
# OK.. we have the public key which can be used in other Chilkat classes/methods...