Sample code for 30+ languages & platforms
VBScript

Transition from Cert.GetCertChain to Cert.BuildCertChain

Provides instructions for replacing deprecated GetCertChain method calls with BuildCertChain.

Chilkat VBScript Downloads

VBScript
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)

success = 0

set cert = CreateObject("Chilkat.Cert")

' ------------------------------------------------------------------------
' The GetCertChain method is deprecated:

' certchainObj is a Chilkat.CertChain
Set certchainObj = cert.GetCertChain()
If (cert.LastMethodSuccess = 0) Then
    outFile.WriteLine(cert.LastErrorText)
    WScript.Quit
End If

' ...
' ...

' ------------------------------------------------------------------------
' Do the equivalent using BuildCertChain.
' Your application creates a new, empty CertChain object which is passed 
' in the last argument and filled upon success.

set certchainOut = CreateObject("Chilkat.CertChain")
success = cert.BuildCertChain(certchainOut)
If (success = 0) Then
    outFile.WriteLine(cert.LastErrorText)
    WScript.Quit
End If


outFile.Close