Sample code for 30+ languages & platforms
Xojo Plugin

Apple Keychain - List Certificates

See more Apple Keychain Examples

Iterates over the certificates in the Apple Keychain.

Chilkat Xojo Plugin Downloads

Xojo Plugin
Dim success As Boolean
success = False

Dim certStore As New Chilkat.CertStore

// On MacOS and iOS, the OpenCurrentUserStore method opens the Keychain.
// The argument passed to OpenCurrentUserStore is ignored.
success = certStore.OpenCurrentUserStore(False)
If (success = False) Then
    System.DebugLog(certStore.LastErrorText)
    Return
End If

Dim numCerts As Int32
numCerts = certStore.NumCertificates
System.DebugLog("numCerts = " + Str(numCerts))

Dim cert As New Chilkat.Cert
Dim i As Int32
i = 0
While i < numCerts
    success = certStore.GetCert(i,cert)
    System.DebugLog(cert.SubjectDN)
    System.DebugLog(cert.SubjectCN)
    System.DebugLog(cert.SerialNumber)
    System.DebugLog("----")
    i = i + 1
Wend

success = certStore.CloseCertStore()