Sample code for 30+ languages & platforms
CkPython

Example: Crypt2.SetSigningCert method

Demonstrates how to call the SetSigningCert method.

Chilkat CkPython Downloads

CkPython
import chilkat

success = False

# Signing certificates can be obtained from many different sources..

# Load from a PFX
cryptA = chilkat.CkCrypt2()
certA = chilkat.CkCert()
success = certA.LoadPfxFile("c:/someDir/pfx_files/a.pfx","pfx_file_password")
success = cryptA.SetSigningCert(certA)
# ...

# Load from a smart card or USB token.
cryptB = chilkat.CkCrypt2()
certB = chilkat.CkCert()
certB.put_SmartCardPin("123456")
success = certB.LoadFromSmartcard("")
success = cryptB.SetSigningCert(certB)
# ...

# Load from a the Windows certificate store or macOS keychain
cryptC = chilkat.CkCrypt2()
certC = chilkat.CkCert()
success = certC.LoadByCommonName("Xyz 123")
success = cryptC.SetSigningCert(certC)
# ...