(PowerBuilder) Load a Certificate from the Windows Certificate Store
Demonstrates how to load a certificate that has been pre-installed in the registry-based Windows certificate store. This is generally how one would load a certificate that is stored on a smart card or usb token.
integer li_rc
oleobject loo_Cert
integer li_Success
loo_Cert = create oleobject
// Use "Chilkat_9_5_0.Cert" for versions of Chilkat < 10.0.0
li_rc = loo_Cert.ConnectToNewObject("Chilkat.Cert")
if li_rc < 0 then
destroy loo_Cert
MessageBox("Error","Connecting to COM object failed")
return
end if
li_Success = loo_Cert.LoadByCommonName("PIVKey 7ED53EC611D3F84396212C5842BB563F")
if li_Success <> 1 then
Write-Debug loo_Cert.LastErrorText
destroy loo_Cert
return
end if
Write-Debug "Loaded: " + loo_Cert.SubjectDN
destroy loo_Cert
|