Sample code for 30+ languages & platforms
Delphi DLL Requires Chilkat v11.0.0+

Transition from Email.GetEncryptedByCert to Email.LastDecryptCert

Provides instructions for replacing deprecated GetEncryptedByCert method calls with LastDecryptCert.

Chilkat Delphi DLL Downloads

Delphi DLL
var
success: Boolean;
email: HCkEmail;
certObj: HCkCert;
certOut: HCkCert;

begin
success := False;

email := CkEmail_Create();

//  ...
//  ...

//  ------------------------------------------------------------------------
//  The GetEncryptedByCert method is deprecated:

certObj := CkEmail_GetEncryptedByCert(email);
if (CkEmail_getLastMethodSuccess(email) = False) then
  begin
    Memo1.Lines.Add(CkEmail__lastErrorText(email));
    Exit;
  end;

//  ...
//  ...

CkCert_Dispose(certObj);

//  ------------------------------------------------------------------------
//  Do the equivalent using LastDecryptCert.
//  Your application creates a new, empty Cert object which is passed 
//  in the last argument and filled upon success.

certOut := CkCert_Create();
success := CkEmail_LastDecryptCert(email,certOut);
if (success = False) then
  begin
    Memo1.Lines.Add(CkEmail__lastErrorText(email));
    Exit;
  end;

CkEmail_Dispose(email);
CkCert_Dispose(certOut);