Sample code for 30+ languages & platforms
Xojo Plugin

Load PFX (PKCS#12) and List Certificates

See more Certificates Examples

Loads a PFX file (.pfx, .p12) and iterates over the certificates found within.

Chilkat Xojo Plugin Downloads

Xojo Plugin
Dim success As Boolean
success = False

Dim certStore As New Chilkat.CertStore

Dim pfxPath As String
pfxPath = "/Users/chilkat/testData/pfx/chilkat_ssl.pfx"
Dim pfxPassword As String
pfxPassword = "test"
success = certStore.LoadPfxFile(pfxPath,pfxPassword)
If (success <> True) Then
    System.DebugLog(certStore.LastErrorText)
    Return
End If

Dim numCerts As Int32
numCerts = certStore.NumCertificates

System.DebugLog("PFX contains " + Str(numCerts) + " certificates")

Dim cert As New Chilkat.Cert
Dim i As Int32
i = 0
While i < numCerts
    success = certStore.GetCert(i,cert)

    System.DebugLog(Str(i) + ": (Common Name) " + cert.SubjectCN)
    System.DebugLog(Str(i) + ": (Serial Number) " + cert.SerialNumber)
    System.DebugLog(Str(i) + ": (Distinguished Name) " + cert.SubjectDN)

    i = i + 1
Wend