Lua Requires Chilkat v10.1.2+
Lua
List Certificates in the Current User Certificate Store (Windows Only)
See more Certificates Examples
This is a Windows-only example to list the certificates in the current-user certificate store (located in the Windows Registry).Chilkat Lua Downloads
local chilkat = require("chilkat")
-- This is a Windows-only example because it lists the certificates
-- stored in the Windows Current User Certificate Store located in the
-- Windows Registry.
local certStore = chilkat.CertStore.new()
local readOnly = true
local success = certStore:open_current_user_store(readOnly)
if not success then
print(certStore.last_error_text)
return
end
local cert = chilkat.Cert.new()
local numCerts = certStore.num_certificates
local i = 0
while i < numCerts do
certStore:get_cert(i, cert)
print("DN = " .. cert.subject_dn)
print("Email = " .. cert.subject_e)
i = i + 1
end