Sample code for 30+ languages & platforms
CkPython

Get Issuer Certificate Information

See more Certificates Examples

A certificate contains information about its issuer. This example demonstrates how to get the issuer information from a certificate.

Chilkat CkPython Downloads

CkPython
import sys
import chilkat

success = False

cert = chilkat.CkCert()

success = cert.LoadFromFile("qa_data/certs/sample.cer")
if (success == False):
    print(cert.lastErrorText())
    sys.exit()

# Get issuer information:

# -----------------------------------------------------------------------
# (Not all subject fields may exist depending on the issuer certificate.)
# -----------------------------------------------------------------------

# Issuer DN (Distinguished Name, i.e. all the Issuer subject parts)
print("DN: " + cert.issuerDN())

# Common Subject parts:
# Issuer Common Name
print("CN: " + cert.issuerCN())

# Issuer Country
print("C: " + cert.issuerC())

# Issuer Email address
print("E: " + cert.issuerE())

# Issuer Locality
print("L: " + cert.issuerL())

# Issuer Organization
print("O: " + cert.issuerO())

# Issuer Organizational Unit
print("OU: " + cert.issuerOU())

# Issuer State
print("S: " + cert.issuerS())