Sample code for 30+ languages & platforms
C#

Transition from Email.GetSignedByCertChain to Email.LastSignerCert

Provides instructions for replacing deprecated GetSignedByCertChain method calls with LastSignerCert.

Chilkat C# Downloads

C#
bool success = false;

Chilkat.Email email = new Chilkat.Email();

//  ...
//  ...

//  ------------------------------------------------------------------------
//  The GetSignedByCertChain method is deprecated:

Chilkat.CertChain certChainObj = email.GetSignedByCertChain();
if (email.LastMethodSuccess == false) {
    Debug.WriteLine(email.LastErrorText);
    return;
}

//  ...
//  ...

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

Chilkat.Cert signerCert = new Chilkat.Cert();
success = email.LastSignerCert(0,signerCert);
if (success == false) {
    Debug.WriteLine(email.LastErrorText);
    return;
}

//  Get the certificate chain from the signer certificate.
Chilkat.CertChain certChain = new Chilkat.CertChain();
success = signerCert.BuildCertChain(certChain);
if (success == false) {
    Debug.WriteLine(signerCert.LastErrorText);
    return;
}