Sample code for 30+ languages & platforms
Xojo Plugin Requires Chilkat v10.1.2+

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 Xojo Plugin Downloads

Xojo Plugin
Dim success As Boolean
success = False

Dim certStore As New Chilkat.CertStore

//  The "AddressBook" is the "Other People" certificate store as shown in certmgr.msc
Dim readOnly As Boolean
readOnly = True
success = certStore.OpenWindowsStore("CurrentUser","AddressBook",readOnly)
If (success <> True) Then
    System.DebugLog(certStore.LastErrorText)
    Return
End If

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

Dim cert As New Chilkat.Cert
success = certStore.FindCert(jsonE,cert)
If (success = False) Then
    System.DebugLog(certStore.LastErrorText)
    Return
End If

System.DebugLog("Found certificate: " + cert.SubjectDN)