Sample code for 30+ languages & platforms
AutoIt

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

AutoIt
Local $bSuccess = False

$oCertStore = ObjCreate("Chilkat.CertStore")

; The "AddressBook" is the "Other People" certificate store as shown in certmgr.msc
Local $bReadOnly = True
$bSuccess = $oCertStore.OpenWindowsStore("CurrentUser","AddressBook",$bReadOnly)
If ($bSuccess <> True) Then
    ConsoleWrite($oCertStore.LastErrorText & @CRLF)
    Exit
EndIf

; Find the certificate for the email address:
$oJsonE = ObjCreate("Chilkat.JsonObject")
$oJsonE.UpdateString("email","joe@example.com")

$oCert = ObjCreate("Chilkat.Cert")
$bSuccess = $oCertStore.FindCert($oJsonE,$oCert)
If ($bSuccess = False) Then
    ConsoleWrite($oCertStore.LastErrorText & @CRLF)
    Exit
EndIf

ConsoleWrite("Found certificate: " & $oCert.SubjectDN & @CRLF)