Sample code for 30+ languages & platforms
Chilkat2-Python

List Certificates in the Current User Certificate Store (Windows Only)

See more Certificates Examples

This is a Windows-only example to list the certificates in the current-user certificate store (located in the Windows Registry).

Chilkat Chilkat2-Python Downloads

Chilkat2-Python
import sys
import chilkat2

success = False

# This is a Windows-only example because it lists the certificates
# stored in the Windows Current User Certificate Store located in the
# Windows Registry.

certStore = chilkat2.CertStore()

readOnly = True
success = certStore.OpenCurrentUserStore(readOnly)
if (success == False):
    print(certStore.LastErrorText)
    sys.exit()

cert = chilkat2.Cert()
numCerts = certStore.NumCertificates
i = 0
while i < numCerts :
    certStore.GetCert(i,cert)
    print("DN = " + cert.SubjectDN)
    print("Email = " + cert.SubjectE)
    i = i + 1