(Go) Example: Crypt2.SetSigningCert method
Demonstrates how to call the SetSigningCert method.
// Signing certificates can be obtained from many different sources..
// Load from a PFX
cryptA := Crypt2_Ref.html">chilkat.NewCrypt2()
certA := Cert_Ref.html">chilkat.NewCert()
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 := Crypt2_Ref.html">chilkat.NewCrypt2()
certB := Cert_Ref.html">chilkat.NewCert()
certB.SetSmartCardPin("123456")
success = certB.LoadFromSmartcard("")
success = cryptB.SetSigningCert(certB)
// ...
// Load from a the Windows certificate store or macOS keychain
cryptC := Crypt2_Ref.html">chilkat.NewCrypt2()
certC := Cert_Ref.html">chilkat.NewCert()
success = certC.LoadByCommonName("Xyz 123")
success = cryptC.SetSigningCert(certC)
// ...
cryptA.DisposeCrypt2()
certA.DisposeCert()
cryptB.DisposeCrypt2()
certB.DisposeCert()
cryptC.DisposeCrypt2()
certC.DisposeCert()
|