Sample code for 30+ languages & platforms
Chilkat2-Python

Example: Crypt2.SetSigningCert method

Demonstrates how to call the SetSigningCert method.

Chilkat Chilkat2-Python Downloads

Chilkat2-Python
import chilkat2

success = False

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

# Load from a PFX
cryptA = chilkat2.Crypt2()
certA = chilkat2.Cert()
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 = chilkat2.Crypt2()
certB = chilkat2.Cert()
certB.SmartCardPin = "123456"
success = certB.LoadFromSmartcard("")
success = cryptB.SetSigningCert(certB)
# ...

# Load from a the Windows certificate store or macOS keychain
cryptC = chilkat2.Crypt2()
certC = chilkat2.Cert()
success = certC.LoadByCommonName("Xyz 123")
success = cryptC.SetSigningCert(certC)
# ...