![]() |
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
(Delphi DLL) 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.
uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, CertChain, Cert, Email; ... procedure TForm1.Button1Click(Sender: TObject); var email: HCkEmail; certChainObj: HCkCertChain; signerCert: HCkCert; success: Boolean; certChain: HCkCertChain; begin email := CkEmail_Create(); // ... // ... // ------------------------------------------------------------------------ // The GetSignedByCertChain method is deprecated: certChainObj := CkEmail_GetSignedByCertChain(email); if (CkEmail_getLastMethodSuccess(email) = False) then begin Memo1.Lines.Add(CkEmail__lastErrorText(email)); Exit; end; // ... // ... 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) then begin Memo1.Lines.Add(CkEmail__lastErrorText(email)); Exit; end; // Get the certificate chain from the signer certificate. certChain := CkCertChain_Create(); success := CkCert_BuildCertChain(signerCert,certChain); if (success = False) then begin Memo1.Lines.Add(CkCert__lastErrorText(signerCert)); Exit; end; CkEmail_Dispose(email); CkCert_Dispose(signerCert); CkCertChain_Dispose(certChain); end; |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.