Sample code for 30+ languages & platforms
PowerBuilder

Load a Certificate from the Windows Certificate Store

See more Certificates Examples

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.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
integer li_Success
oleobject loo_Cert

li_Success = 0

loo_Cert = create oleobject
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