(AutoIt) Apple Keychain - List Certificates
Iterates over the certificates in the Apple Keychain.
Note: This example requires Chilkat v10.0.0 or greater.
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oCertStore = ObjCreate("Chilkat.CertStore")
; On MacOS and iOS, the OpenCurrentUserStore method opens the Keychain.
; The argument passed to OpenCurrentUserStore is ignored.
Local $bSuccess = $oCertStore.OpenCurrentUserStore(False)
If ($bSuccess = False) Then
ConsoleWrite($oCertStore.LastErrorText & @CRLF)
Exit
EndIf
Local $iNumCerts = $oCertStore.NumCertificates
ConsoleWrite("numCerts = " & $iNumCerts & @CRLF)
Local $i = 0
While $i < $iNumCerts
Local $oCert = $oCertStore.GetCertificate($i)
ConsoleWrite($oCert.SubjectDN & @CRLF)
$i = $i + 1
Wend
$oCertStore.CloseCertStore()
|