[VB6 equivalent: X509_GetCertFromP7Chain]
Dim nRet As Integer
Dim strListFile As String
Dim strCertFile As String
Dim nCerts As Integer
Dim iCert As Integer
strListFile = "bob.p7b"
' How many certificates?
nCerts = X509.GetCertFromP7Chain("", strListFile, 0)
Console.WriteLine("X509_GetCertFromP7Chain(0) returns " & nCerts & " for " & strListFile)
' Enumerate through them all
If nCerts > 0 Then
For iCert = 1 To nCerts
strCertFile = "bobcert" & iCert & ".cer"
nRet = X509.GetCertFromP7Chain(strCertFile, strListFile, iCert)
Console.WriteLine("X509_GetCertFromP7Chain(" & iCert & ") returns " _
& nRet & "->" & strCertFile)
Next
End If
See Also:
X509.GetCertFromP7Chain Method