Sample code for 30+ languages & platforms
Lua

Example: Crypt2.SetSigningCert method

Demonstrates how to call the SetSigningCert method.

Chilkat Lua Downloads

Lua
local chilkat = require("chilkat")

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

-- Load from a PFX
local cryptA = chilkat.Crypt2.new()
local certA = chilkat.Cert.new()
local success = certA:load_pfx_file("c:/someDir/pfx_files/a.pfx", "pfx_file_password")
success = cryptA:set_signing_cert(certA)
-- ...

-- Load from a smart card or USB token.
local cryptB = chilkat.Crypt2.new()
local certB = chilkat.Cert.new()
certB.smart_card_pin = "123456"
success = certB:load_from_smartcard("")
success = cryptB:set_signing_cert(certB)
-- ...

-- Load from a the Windows certificate store or macOS keychain
local cryptC = chilkat.Crypt2.new()
local certC = chilkat.Cert.new()
success = certC:load_by_common_name("Xyz 123")
success = cryptC:set_signing_cert(certC)
-- ...