Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Load PFX (PKCS#12) and List CertificatesLoads a PFX file (.pfx, .p12) and iterates over the certificates found within. Dim certStore As New ChilkatCertStore Dim success As Long 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 <> 1) Then Text1.Text = Text1.Text & certStore.LastErrorText & vbCrLf Exit Sub End If Dim i As Long Dim numCerts As Long numCerts = certStore.NumCertificates Text1.Text = Text1.Text & "PFX contains " & numCerts _ & " certificates" & vbCrLf If (numCerts = 0) Then Exit Sub End If For i = 0 To (numCerts - 1) Dim cert As ChilkatCert Set cert = certStore.GetCertificate(i) If (Not (cert Is Nothing )) Then Text1.Text = Text1.Text & i & ": (Common Name) " _ & cert.SubjectCN & vbCrLf Text1.Text = Text1.Text & i & ": (Serial Number) " _ & cert.SerialNumber & vbCrLf Text1.Text = Text1.Text & i & ": (Distinguished Name) " _ & cert.SubjectDN & vbCrLf End If Next |
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.