Sample code for 30+ languages & platforms
Xojo Plugin

Load PFX/P12 File into Certificate Store Object

Demonstrates how to load a .pfx/.p12 into a certificate store object.

Chilkat Xojo Plugin Downloads

Xojo Plugin
Dim success As Boolean
success = False

Dim certStore As New Chilkat.CertStore

// This only loads the contents of the PFX file into the certStore object.
// It is not importing the PFX into the Windows certificate stores.
Dim pfxPassword As String
pfxPassword = "badssl.com"
success = certStore.LoadPfxFile("qa_data/pfx/badssl.com-client.p12",pfxPassword)
If (success = False) Then
    System.DebugLog(certStore.LastErrorText)
    Return
End If

// Examine each certificate (loaded from the PFX) in this certStore object
Dim cert As New Chilkat.Cert
Dim numCerts As Int32
numCerts = certStore.NumCertificates
Dim i As Int32
i = 0
While i < numCerts
    success = certStore.GetCert(i,cert)
    System.DebugLog("hasPrivateKey=" + Str(cert.HasPrivateKey()) + ", " + cert.SubjectCN)
    i = i + 1
Wend