![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(C) Transition from Email.GetSignedByCertChain to Email.LastSignerCertProvides instructions for replacing deprecated GetSignedByCertChain method calls with LastSignerCert. Note: This example requires Chilkat v11.0.0 or greater.
#include <C_CkEmail.h> #include <C_CkCertChain.h> #include <C_CkCert.h> void ChilkatSample(void) { HCkEmail email; HCkCertChain certChainObj; HCkCert signerCert; BOOL success; HCkCertChain certChain; email = CkEmail_Create(); // ... // ... // ------------------------------------------------------------------------ // The GetSignedByCertChain method is deprecated: certChainObj = CkEmail_GetSignedByCertChain(email); if (CkEmail_getLastMethodSuccess(email) == FALSE) { printf("%s\n",CkEmail_lastErrorText(email)); CkEmail_Dispose(email); return; } // ... // ... CkCertChain_Dispose(certChainObj); // ------------------------------------------------------------------------ // Do the equivalent using LastSignerCert to get the signing certificate, // then build the cert chain from the signing certificate object. signerCert = CkCert_Create(); success = CkEmail_LastSignerCert(email,0,signerCert); if (success == FALSE) { printf("%s\n",CkEmail_lastErrorText(email)); CkEmail_Dispose(email); CkCert_Dispose(signerCert); return; } // Get the certificate chain from the signer certificate. certChain = CkCertChain_Create(); success = CkCert_BuildCertChain(signerCert,certChain); if (success == FALSE) { printf("%s\n",CkCert_lastErrorText(signerCert)); CkEmail_Dispose(email); CkCert_Dispose(signerCert); CkCertChain_Dispose(certChain); return; } CkEmail_Dispose(email); CkCert_Dispose(signerCert); CkCertChain_Dispose(certChain); } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.