Sample code for 30+ languages & platforms
Go

Example: Crypt2.SetSigningCert method

Demonstrates how to call the SetSigningCert method.

Chilkat Go Downloads

Go
    success := false

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

    // Load from a PFX
    cryptA := chilkat.NewCrypt2()
    certA := 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 := chilkat.NewCrypt2()
    certB := chilkat.NewCert()
    certB.SetSmartCardPin("123456")
    success = certB.LoadFromSmartcard("")
    success = cryptB.SetSigningCert(certB)
    // ...

    // Load from a the Windows certificate store or macOS keychain
    cryptC := chilkat.NewCrypt2()
    certC := chilkat.NewCert()
    success = certC.LoadByCommonName("Xyz 123")
    success = cryptC.SetSigningCert(certC)
    // ...

    cryptA.DisposeCrypt2()
    certA.DisposeCert()
    cryptB.DisposeCrypt2()
    certB.DisposeCert()
    cryptC.DisposeCrypt2()
    certC.DisposeCert()