Sample code for 30+ languages & platforms
Delphi ActiveX

Load a Certificate from the Windows Certificate Store

See more Certificates Examples

Demonstrates how to load a certificate that has been pre-installed in the registry-based Windows certificate store. This is generally how one would load a certificate that is stored on a smart card or usb token.

Chilkat Delphi ActiveX Downloads

Delphi ActiveX
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB;

...

procedure TForm1.Button1Click(Sender: TObject);
var
success: Integer;
cert: TChilkatCert;

begin
success := 0;

cert := TChilkatCert.Create(Self);

success := cert.LoadByCommonName('PIVKey 7ED53EC611D3F84396212C5842BB563F');
if (success <> 1) then
  begin
    Memo1.Lines.Add(cert.LastErrorText);
    Exit;
  end;

Memo1.Lines.Add('Loaded: ' + cert.SubjectDN);
end;