Sample code for 30+ languages & platforms
VB.NET

Transition from Email.GetSignedByCertChain to Email.LastSignerCert

Provides instructions for replacing deprecated GetSignedByCertChain method calls with LastSignerCert.

Chilkat VB.NET Downloads

VB.NET
Dim success As Boolean = False

Dim email As New Chilkat.Email

' ...
' ...

' ------------------------------------------------------------------------
' The GetSignedByCertChain method is deprecated:

Dim certChainObj As Chilkat.CertChain = email.GetSignedByCertChain()
If (email.LastMethodSuccess = False) Then
    Debug.WriteLine(email.LastErrorText)
    Exit Sub
End If


' ...
' ...



' ------------------------------------------------------------------------
' Do the equivalent using LastSignerCert to get the signing certificate,
' then build the cert chain from the signing certificate object.

Dim signerCert As New Chilkat.Cert
success = email.LastSignerCert(0,signerCert)
If (success = False) Then
    Debug.WriteLine(email.LastErrorText)
    Exit Sub
End If


' Get the certificate chain from the signer certificate.
Dim certChain As New Chilkat.CertChain
success = signerCert.BuildCertChain(certChain)
If (success = False) Then
    Debug.WriteLine(signerCert.LastErrorText)
    Exit Sub
End If