Sample code for 30+ languages & platforms
Chilkat2-Python

Load a Certificate from the Windows Certificate Store

See more Certificates Examples

Demonstrates how to load a certificate that has been pre-installed in the registry-based Windows certificate store. This is generally how one would load a certificate that is stored on a smart card or usb token.

Chilkat Chilkat2-Python Downloads

Chilkat2-Python
import sys
import chilkat2

success = False

cert = chilkat2.Cert()

success = cert.LoadByCommonName("PIVKey 7ED53EC611D3F84396212C5842BB563F")
if (success != True):
    print(cert.LastErrorText)
    sys.exit()

print("Loaded: " + cert.SubjectDN)