Sample code for 30+ languages & platforms
C#

Example: Crypt2.SetSigningCert method

Demonstrates how to call the SetSigningCert method.

Chilkat C# Downloads

C#
bool success = false;

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

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

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