Sample code for 30+ languages & platforms
Lianja

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 Lianja Downloads

Lianja
llSuccess = .F.

// This is a Windows-only example because it lists the certificates
// stored in the Windows Current User Certificate Store located in the
// Windows Registry.

loCertStore = createobject("CkCertStore")

llReadOnly = .T.
llSuccess = loCertStore.OpenCurrentUserStore(llReadOnly)
if (llSuccess = .F.) then
    ? loCertStore.LastErrorText
    release loCertStore
    return
endif

loCert = createobject("CkCert")
lnNumCerts = loCertStore.NumCertificates
i = 0
do while i < lnNumCerts
    loCertStore.GetCert(i,loCert)
    ? "DN = " + loCert.SubjectDN
    ? "Email = " + loCert.SubjectE
    i = i + 1
enddo


release loCertStore
release loCert