Sample code for 30+ languages & platforms
Visual Basic 6.0

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 Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

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

Dim certStore As New ChilkatCertStore

Dim readOnly As Long
readOnly = 1
success = certStore.OpenCurrentUserStore(readOnly)
If (success = 0) Then
    Debug.Print certStore.LastErrorText
    Exit Sub
End If

Dim cert As New ChilkatCert
Dim numCerts As Long
numCerts = certStore.NumCertificates
Dim i As Long
i = 0
Do While i < numCerts
    success = certStore.GetCert(i,cert)
    Debug.Print "DN = " & cert.SubjectDN
    Debug.Print "Email = " & cert.SubjectE
    i = i + 1
Loop