Delphi DLL
Delphi DLL
Example: Crypt2.AddPfxSourceBd method
Demonstrates how to call the AddPfxSourceBd method.Chilkat Delphi DLL Downloads
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, BinData, Crypt2;
...
procedure TForm1.Button1Click(Sender: TObject);
var
success: Boolean;
crypt: HCkCrypt2;
bdPfx: HCkBinData;
pfxPassword: PWideChar;
begin
success := False;
crypt := CkCrypt2_Create();
success := False;
// Do public-key decryption (RSA)
CkCrypt2_putCryptAlgorithm(crypt,'pki');
// ...
// ...
// ...
bdPfx := CkBinData_Create();
success := CkBinData_LoadFile(bdPfx,'c:/my_pfx_files/a.pfx');
// ...
pfxPassword := 'secret1';
success := CkCrypt2_AddPfxSourceBd(crypt,bdPfx,pfxPassword);
if (success = False) then
begin
Memo1.Lines.Add(CkCrypt2__lastErrorText(crypt));
Exit;
end;
// Add as many as PFX sources as desired...
success := CkBinData_LoadFile(bdPfx,'c:/my_pfx_files/b.pfx');
pfxPassword := 'secret2';
success := CkCrypt2_AddPfxSourceBd(crypt,bdPfx,pfxPassword);
if (success = False) then
begin
Memo1.Lines.Add(CkCrypt2__lastErrorText(crypt));
Exit;
end;
// ...
// ...
CkCrypt2_Dispose(crypt);
CkBinData_Dispose(bdPfx);
end;