![]() |
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
(Unicode 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_CkEmailW.h> #include <C_CkCertChainW.h> #include <C_CkCertW.h> void ChilkatSample(void) { HCkEmailW email; HCkCertChainW certChainObj; HCkCertW signerCert; BOOL success; HCkCertChainW certChain; email = CkEmailW_Create(); // ... // ... // ------------------------------------------------------------------------ // The GetSignedByCertChain method is deprecated: certChainObj = CkEmailW_GetSignedByCertChain(email); if (CkEmailW_getLastMethodSuccess(email) == FALSE) { wprintf(L"%s\n",CkEmailW_lastErrorText(email)); CkEmailW_Dispose(email); return; } // ... // ... CkCertChainW_Dispose(certChainObj); // ------------------------------------------------------------------------ // Do the equivalent using LastSignerCert to get the signing certificate, // then build the cert chain from the signing certificate object. signerCert = CkCertW_Create(); success = CkEmailW_LastSignerCert(email,0,signerCert); if (success == FALSE) { wprintf(L"%s\n",CkEmailW_lastErrorText(email)); CkEmailW_Dispose(email); CkCertW_Dispose(signerCert); return; } // Get the certificate chain from the signer certificate. certChain = CkCertChainW_Create(); success = CkCertW_BuildCertChain(signerCert,certChain); if (success == FALSE) { wprintf(L"%s\n",CkCertW_lastErrorText(signerCert)); CkEmailW_Dispose(email); CkCertW_Dispose(signerCert); CkCertChainW_Dispose(certChain); return; } CkEmailW_Dispose(email); CkCertW_Dispose(signerCert); CkCertChainW_Dispose(certChain); } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.