![]() |
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 Crypt2.GetSignerCertChain to Crypt2.LastSignerCertProvides instructions for replacing deprecated GetSignerCertChain 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, Crypt2; ... procedure TForm1.Button1Click(Sender: TObject); var crypt2: HCkCrypt2; index: Integer; certchainObj: HCkCertChain; signerCert: HCkCert; success: Boolean; certChain: HCkCertChain; begin crypt2 := CkCrypt2_Create(); // ... // ... index := 0; // ------------------------------------------------------------------------ // The GetSignerCertChain method is deprecated: certchainObj := CkCrypt2_GetSignerCertChain(crypt2,index); if (CkCrypt2_getLastMethodSuccess(crypt2) = False) then begin Memo1.Lines.Add(CkCrypt2__lastErrorText(crypt2)); Exit; end; // ... // ... CkCertChain_Dispose(certchainObj); // ------------------------------------------------------------------------ // Do the equivalent using LastSignerCert, and then get the certificate chain from the cert. // Your application creates a new, empty Cert object which is passed // in the last argument and filled upon success. signerCert := CkCert_Create(); success := CkCrypt2_LastSignerCert(crypt2,index,signerCert); if (success = False) then begin Memo1.Lines.Add(CkCrypt2__lastErrorText(crypt2)); Exit; end; certChain := CkCertChain_Create(); success := CkCert_BuildCertChain(signerCert,certChain); if (success = False) then begin Memo1.Lines.Add(CkCert__lastErrorText(signerCert)); Exit; end; CkCrypt2_Dispose(crypt2); CkCert_Dispose(signerCert); CkCertChain_Dispose(certChain); end; |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.