(Xojo Plugin) Load PFX (PKCS#12) and List Certificates
Loads a PFX file (.pfx, .p12) and iterates over the certificates found within.
Dim certStore As New Chilkat.CertStore
Dim success As Boolean
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 i As Int32
i = 0
While i < numCerts
Dim cert As Chilkat.Cert
cert = certStore.GetCertificate(i)
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
|