Sample code for 30+ languages & platforms
Visual Basic 6.0

Find a Certificate in the "Other People" Windows Certificate Store

See more Certificates Examples

Demonstrates how to open the "Current User --> Other People" Windows certificate store, and locates a certificate matching an email address.

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

Dim certStore As New ChilkatCertStore

' The "AddressBook" is the "Other People" certificate store as shown in certmgr.msc
Dim readOnly As Long
readOnly = 1
success = certStore.OpenWindowsStore("CurrentUser","AddressBook",readOnly)
If (success <> 1) Then
    Debug.Print certStore.LastErrorText
    Exit Sub
End If

' Find the certificate for the email address:
Dim jsonE As New ChilkatJsonObject
success = jsonE.UpdateString("email","joe@example.com")

Dim cert As New ChilkatCert
success = certStore.FindCert(jsonE,cert)
If (success = 0) Then
    Debug.Print certStore.LastErrorText
    Exit Sub
End If

Debug.Print "Found certificate: " & cert.SubjectDN