unit Chilkat.Pkcs11;

{
  Pascal wrapper for Chilkat Pkcs11.
  Auto-generated by PascalWrapperGenerator -- do not edit manually.
}

{$IFDEF FPC}
  {$MODE DELPHI}
{$ENDIF}

interface

uses
  SysUtils,
  Chilkat.Base;

type

  { TPkcs11 wraps CkPkcs11 via the C bridge layer. }
  TPkcs11 = class(TChilkatBase)
  private
    function  GetLastErrorHtml: string;
    function  GetLastErrorText: string;
    function  GetLastErrorXml: string;
    function  GetVersion: string;
    function  GetDebugLogFilePath: string;
    procedure SetDebugLogFilePath(AValue: string);
    function  GetVerboseLogging: Boolean;
    procedure SetVerboseLogging(AValue: Boolean);
    function  GetLastMethodSuccess: Boolean;
    procedure SetLastMethodSuccess(AValue: Boolean);
    function  GetSharedLibPath: string;
    procedure SetSharedLibPath(AValue: string);
    function  GetNumCerts: Integer;
    function  GetSigContextPin: string;
    procedure SetSigContextPin(AValue: string);
    function  GetUncommonOptions: string;
    procedure SetUncommonOptions(AValue: string);
  public
    constructor Create;
    destructor  Destroy; override;

    property LastErrorHtml: string read GetLastErrorHtml;
    property LastErrorText: string read GetLastErrorText;
    property LastErrorXml: string read GetLastErrorXml;
    property Version: string read GetVersion;
    property DebugLogFilePath: string read GetDebugLogFilePath write SetDebugLogFilePath;
    property VerboseLogging: Boolean read GetVerboseLogging write SetVerboseLogging;
    property LastMethodSuccess: Boolean read GetLastMethodSuccess write SetLastMethodSuccess;
    property SharedLibPath: string read GetSharedLibPath write SetSharedLibPath;
    property NumCerts: Integer read GetNumCerts;
    property SigContextPin: string read GetSigContextPin write SetSigContextPin;
    property UncommonOptions: string read GetUncommonOptions write SetUncommonOptions;

    function  Initialize: Boolean;
    function  Discover(onlyTokensPresent: Boolean; json: TChilkatBase): Boolean;
    function  OpenSession(slotId: Integer; readWrite: Boolean): Boolean;
    function  CloseSession: Boolean;
    function  Login(userType: Integer; const pin: string): Boolean;
    function  Logout: Boolean;
    function  FindAllCerts: Boolean;
    function  GetCert(index: Integer; cert: TChilkatBase): Boolean;
    function  FindCert(const certPart: string; const partValue: string; cert: TChilkatBase): Boolean;
    function  SetPin(const oldPin: string; const newPin: string): Boolean;
    function  InitPin(const pin: string): Boolean;
    function  InitToken(slotId: Integer; const pin: string; const tokenLabel: string): Boolean;
    function  FindAllKeys(const keyClass: string; json: TChilkatBase): Boolean;
    function  GenSecretKey(const keyType: string; jsonTemplate: TChilkatBase): LongWord;
    function  GenRsaKey(publicAttrs: TChilkatBase; privateAttrs: TChilkatBase; jsonOut: TChilkatBase; pubKey: TChilkatBase): Boolean;
    function  GenEcKey(publicAttrs: TChilkatBase; privateAttrs: TChilkatBase; jsonOut: TChilkatBase; pubKey: TChilkatBase): Boolean;
    function  CreatePkcs11Object(attrs: TChilkatBase): LongWord;
    function  QuickSession(userType: Integer; const pin: string): Boolean;
    function  ImportPrivateKey(privKey: TChilkatBase; jsonTemplate: TChilkatBase): LongWord;
    function  DestroyObject(hObject: LongWord): Boolean;
    function  FindObject(jsonTemplate: TChilkatBase): LongWord;
    function  ImportSshKey(sshKey: TChilkatBase; jsonTemplate: TChilkatBase): LongWord;
    function  ExportPublicKey(keyHandle: LongWord; pubKey: TChilkatBase): Boolean;
  end;

implementation

uses
  CkDllLoader,
  Chilkat.Utils;

{ ---- C bridge function pointer types ---- }
type
  TCkPkcs11_Create  = function(): Pointer; cdecl;
  TCkPkcs11_Dispose = procedure(handle: Pointer); cdecl;
  TCkPkcs11_get_LastErrorHtml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkPkcs11_get_LastErrorText = function(handle: Pointer): PAnsiChar; cdecl;
  TCkPkcs11_get_LastErrorXml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkPkcs11_get_Version = function(handle: Pointer): PAnsiChar; cdecl;
  TCkPkcs11_get_DebugLogFilePath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkPkcs11_put_DebugLogFilePath = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkPkcs11_get_VerboseLogging = function(handle: Pointer): LongBool; cdecl;
  TCkPkcs11_put_VerboseLogging = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkPkcs11_get_LastMethodSuccess = function(handle: Pointer): LongBool; cdecl;
  TCkPkcs11_put_LastMethodSuccess = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkPkcs11_get_SharedLibPath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkPkcs11_put_SharedLibPath = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkPkcs11_get_NumCerts = function(handle: Pointer): Integer; cdecl;
  TCkPkcs11_get_SigContextPin = function(handle: Pointer): PAnsiChar; cdecl;
  TCkPkcs11_put_SigContextPin = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkPkcs11_get_UncommonOptions = function(handle: Pointer): PAnsiChar; cdecl;
  TCkPkcs11_put_UncommonOptions = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkPkcs11_Initialize = function(handle: Pointer): LongBool; cdecl;
  TCkPkcs11_Discover = function(handle: Pointer; onlyTokensPresent: LongBool; json: Pointer): LongBool; cdecl;
  TCkPkcs11_OpenSession = function(handle: Pointer; slotId: Integer; readWrite: LongBool): LongBool; cdecl;
  TCkPkcs11_CloseSession = function(handle: Pointer): LongBool; cdecl;
  TCkPkcs11_Login = function(handle: Pointer; userType: Integer; pin: PAnsiChar): LongBool; cdecl;
  TCkPkcs11_Logout = function(handle: Pointer): LongBool; cdecl;
  TCkPkcs11_FindAllCerts = function(handle: Pointer): LongBool; cdecl;
  TCkPkcs11_GetCert = function(handle: Pointer; index: Integer; cert: Pointer): LongBool; cdecl;
  TCkPkcs11_FindCert = function(handle: Pointer; certPart: PAnsiChar; partValue: PAnsiChar; cert: Pointer): LongBool; cdecl;
  TCkPkcs11_SetPin = function(handle: Pointer; oldPin: PAnsiChar; newPin: PAnsiChar): LongBool; cdecl;
  TCkPkcs11_InitPin = function(handle: Pointer; pin: PAnsiChar): LongBool; cdecl;
  TCkPkcs11_InitToken = function(handle: Pointer; slotId: Integer; pin: PAnsiChar; tokenLabel: PAnsiChar): LongBool; cdecl;
  TCkPkcs11_FindAllKeys = function(handle: Pointer; keyClass: PAnsiChar; json: Pointer): LongBool; cdecl;
  TCkPkcs11_GenSecretKey = function(handle: Pointer; keyType: PAnsiChar; jsonTemplate: Pointer): LongWord; cdecl;
  TCkPkcs11_GenRsaKey = function(handle: Pointer; publicAttrs: Pointer; privateAttrs: Pointer; jsonOut: Pointer; pubKey: Pointer): LongBool; cdecl;
  TCkPkcs11_GenEcKey = function(handle: Pointer; publicAttrs: Pointer; privateAttrs: Pointer; jsonOut: Pointer; pubKey: Pointer): LongBool; cdecl;
  TCkPkcs11_CreatePkcs11Object = function(handle: Pointer; attrs: Pointer): LongWord; cdecl;
  TCkPkcs11_QuickSession = function(handle: Pointer; userType: Integer; pin: PAnsiChar): LongBool; cdecl;
  TCkPkcs11_ImportPrivateKey = function(handle: Pointer; privKey: Pointer; jsonTemplate: Pointer): LongWord; cdecl;
  TCkPkcs11_DestroyObject = function(handle: Pointer; hObject: LongWord): LongBool; cdecl;
  TCkPkcs11_FindObject = function(handle: Pointer; jsonTemplate: Pointer): LongWord; cdecl;
  TCkPkcs11_ImportSshKey = function(handle: Pointer; sshKey: Pointer; jsonTemplate: Pointer): LongWord; cdecl;
  TCkPkcs11_ExportPublicKey = function(handle: Pointer; keyHandle: LongWord; pubKey: Pointer): LongBool; cdecl;

{ ---- C bridge function pointer variables ---- }
var
  CkPkcs11_Create:  TCkPkcs11_Create  = nil;
  CkPkcs11_Dispose: TCkPkcs11_Dispose = nil;
  CkPkcs11_get_LastErrorHtml: TCkPkcs11_get_LastErrorHtml = nil;
  CkPkcs11_get_LastErrorText: TCkPkcs11_get_LastErrorText = nil;
  CkPkcs11_get_LastErrorXml: TCkPkcs11_get_LastErrorXml = nil;
  CkPkcs11_get_Version: TCkPkcs11_get_Version = nil;
  CkPkcs11_get_DebugLogFilePath: TCkPkcs11_get_DebugLogFilePath = nil;
  CkPkcs11_put_DebugLogFilePath: TCkPkcs11_put_DebugLogFilePath = nil;
  CkPkcs11_get_VerboseLogging: TCkPkcs11_get_VerboseLogging = nil;
  CkPkcs11_put_VerboseLogging: TCkPkcs11_put_VerboseLogging = nil;
  CkPkcs11_get_LastMethodSuccess: TCkPkcs11_get_LastMethodSuccess = nil;
  CkPkcs11_put_LastMethodSuccess: TCkPkcs11_put_LastMethodSuccess = nil;
  CkPkcs11_get_SharedLibPath: TCkPkcs11_get_SharedLibPath = nil;
  CkPkcs11_put_SharedLibPath: TCkPkcs11_put_SharedLibPath = nil;
  CkPkcs11_get_NumCerts: TCkPkcs11_get_NumCerts = nil;
  CkPkcs11_get_SigContextPin: TCkPkcs11_get_SigContextPin = nil;
  CkPkcs11_put_SigContextPin: TCkPkcs11_put_SigContextPin = nil;
  CkPkcs11_get_UncommonOptions: TCkPkcs11_get_UncommonOptions = nil;
  CkPkcs11_put_UncommonOptions: TCkPkcs11_put_UncommonOptions = nil;
  CkPkcs11_Initialize: TCkPkcs11_Initialize = nil;
  CkPkcs11_Discover: TCkPkcs11_Discover = nil;
  CkPkcs11_OpenSession: TCkPkcs11_OpenSession = nil;
  CkPkcs11_CloseSession: TCkPkcs11_CloseSession = nil;
  CkPkcs11_Login: TCkPkcs11_Login = nil;
  CkPkcs11_Logout: TCkPkcs11_Logout = nil;
  CkPkcs11_FindAllCerts: TCkPkcs11_FindAllCerts = nil;
  CkPkcs11_GetCert: TCkPkcs11_GetCert = nil;
  CkPkcs11_FindCert: TCkPkcs11_FindCert = nil;
  CkPkcs11_SetPin: TCkPkcs11_SetPin = nil;
  CkPkcs11_InitPin: TCkPkcs11_InitPin = nil;
  CkPkcs11_InitToken: TCkPkcs11_InitToken = nil;
  CkPkcs11_FindAllKeys: TCkPkcs11_FindAllKeys = nil;
  CkPkcs11_GenSecretKey: TCkPkcs11_GenSecretKey = nil;
  CkPkcs11_GenRsaKey: TCkPkcs11_GenRsaKey = nil;
  CkPkcs11_GenEcKey: TCkPkcs11_GenEcKey = nil;
  CkPkcs11_CreatePkcs11Object: TCkPkcs11_CreatePkcs11Object = nil;
  CkPkcs11_QuickSession: TCkPkcs11_QuickSession = nil;
  CkPkcs11_ImportPrivateKey: TCkPkcs11_ImportPrivateKey = nil;
  CkPkcs11_DestroyObject: TCkPkcs11_DestroyObject = nil;
  CkPkcs11_FindObject: TCkPkcs11_FindObject = nil;
  CkPkcs11_ImportSshKey: TCkPkcs11_ImportSshKey = nil;
  CkPkcs11_ExportPublicKey: TCkPkcs11_ExportPublicKey = nil;

constructor TPkcs11.Create;
begin
  inherited Create;
  FHandle := CkPkcs11_Create();
end;

destructor TPkcs11.Destroy;
begin
  if FHandle <> nil then
    CkPkcs11_Dispose(FHandle);
  FHandle := nil;
  inherited;
end;

function TPkcs11.GetLastErrorHtml: string;
begin
  Result := CkToStr(CkPkcs11_get_LastErrorHtml(FHandle));
end;

function TPkcs11.GetLastErrorText: string;
begin
  Result := CkToStr(CkPkcs11_get_LastErrorText(FHandle));
end;

function TPkcs11.GetLastErrorXml: string;
begin
  Result := CkToStr(CkPkcs11_get_LastErrorXml(FHandle));
end;

function TPkcs11.GetVersion: string;
begin
  Result := CkToStr(CkPkcs11_get_Version(FHandle));
end;

function TPkcs11.GetDebugLogFilePath: string;
begin
  Result := CkToStr(CkPkcs11_get_DebugLogFilePath(FHandle));
end;

procedure TPkcs11.SetDebugLogFilePath(AValue: string);
begin
  CkPkcs11_put_DebugLogFilePath(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TPkcs11.GetVerboseLogging: Boolean;
begin
  Result := Boolean(CkPkcs11_get_VerboseLogging(FHandle));
end;

procedure TPkcs11.SetVerboseLogging(AValue: Boolean);
begin
  CkPkcs11_put_VerboseLogging(FHandle, LongBool(AValue));
end;

function TPkcs11.GetLastMethodSuccess: Boolean;
begin
  Result := Boolean(CkPkcs11_get_LastMethodSuccess(FHandle));
end;

procedure TPkcs11.SetLastMethodSuccess(AValue: Boolean);
begin
  CkPkcs11_put_LastMethodSuccess(FHandle, LongBool(AValue));
end;

function TPkcs11.GetSharedLibPath: string;
begin
  Result := CkToStr(CkPkcs11_get_SharedLibPath(FHandle));
end;

procedure TPkcs11.SetSharedLibPath(AValue: string);
begin
  CkPkcs11_put_SharedLibPath(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TPkcs11.GetNumCerts: Integer;
begin
  Result := CkPkcs11_get_NumCerts(FHandle);
end;

function TPkcs11.GetSigContextPin: string;
begin
  Result := CkToStr(CkPkcs11_get_SigContextPin(FHandle));
end;

procedure TPkcs11.SetSigContextPin(AValue: string);
begin
  CkPkcs11_put_SigContextPin(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TPkcs11.GetUncommonOptions: string;
begin
  Result := CkToStr(CkPkcs11_get_UncommonOptions(FHandle));
end;

procedure TPkcs11.SetUncommonOptions(AValue: string);
begin
  CkPkcs11_put_UncommonOptions(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TPkcs11.Initialize: Boolean;
begin
  Result := Boolean(CkPkcs11_Initialize(FHandle));
end;

function TPkcs11.Discover(onlyTokensPresent: Boolean; json: TChilkatBase): Boolean;
begin
  Result := Boolean(CkPkcs11_Discover(FHandle, LongBool(onlyTokensPresent), json.Handle));
end;

function TPkcs11.OpenSession(slotId: Integer; readWrite: Boolean): Boolean;
begin
  Result := Boolean(CkPkcs11_OpenSession(FHandle, slotId, LongBool(readWrite)));
end;

function TPkcs11.CloseSession: Boolean;
begin
  Result := Boolean(CkPkcs11_CloseSession(FHandle));
end;

function TPkcs11.Login(userType: Integer; const pin: string): Boolean;
begin
  Result := Boolean(CkPkcs11_Login(FHandle, userType, PAnsiChar(StrToCk(pin))));
end;

function TPkcs11.Logout: Boolean;
begin
  Result := Boolean(CkPkcs11_Logout(FHandle));
end;

function TPkcs11.FindAllCerts: Boolean;
begin
  Result := Boolean(CkPkcs11_FindAllCerts(FHandle));
end;

function TPkcs11.GetCert(index: Integer; cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkPkcs11_GetCert(FHandle, index, cert.Handle));
end;

function TPkcs11.FindCert(const certPart: string; const partValue: string; cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkPkcs11_FindCert(FHandle, PAnsiChar(StrToCk(certPart)), PAnsiChar(StrToCk(partValue)), cert.Handle));
end;

function TPkcs11.SetPin(const oldPin: string; const newPin: string): Boolean;
begin
  Result := Boolean(CkPkcs11_SetPin(FHandle, PAnsiChar(StrToCk(oldPin)), PAnsiChar(StrToCk(newPin))));
end;

function TPkcs11.InitPin(const pin: string): Boolean;
begin
  Result := Boolean(CkPkcs11_InitPin(FHandle, PAnsiChar(StrToCk(pin))));
end;

function TPkcs11.InitToken(slotId: Integer; const pin: string; const tokenLabel: string): Boolean;
begin
  Result := Boolean(CkPkcs11_InitToken(FHandle, slotId, PAnsiChar(StrToCk(pin)), PAnsiChar(StrToCk(tokenLabel))));
end;

function TPkcs11.FindAllKeys(const keyClass: string; json: TChilkatBase): Boolean;
begin
  Result := Boolean(CkPkcs11_FindAllKeys(FHandle, PAnsiChar(StrToCk(keyClass)), json.Handle));
end;

function TPkcs11.GenSecretKey(const keyType: string; jsonTemplate: TChilkatBase): LongWord;
begin
  Result := CkPkcs11_GenSecretKey(FHandle, PAnsiChar(StrToCk(keyType)), jsonTemplate.Handle);
end;

function TPkcs11.GenRsaKey(publicAttrs: TChilkatBase; privateAttrs: TChilkatBase; jsonOut: TChilkatBase; pubKey: TChilkatBase): Boolean;
begin
  Result := Boolean(CkPkcs11_GenRsaKey(FHandle, publicAttrs.Handle, privateAttrs.Handle, jsonOut.Handle, pubKey.Handle));
end;

function TPkcs11.GenEcKey(publicAttrs: TChilkatBase; privateAttrs: TChilkatBase; jsonOut: TChilkatBase; pubKey: TChilkatBase): Boolean;
begin
  Result := Boolean(CkPkcs11_GenEcKey(FHandle, publicAttrs.Handle, privateAttrs.Handle, jsonOut.Handle, pubKey.Handle));
end;

function TPkcs11.CreatePkcs11Object(attrs: TChilkatBase): LongWord;
begin
  Result := CkPkcs11_CreatePkcs11Object(FHandle, attrs.Handle);
end;

function TPkcs11.QuickSession(userType: Integer; const pin: string): Boolean;
begin
  Result := Boolean(CkPkcs11_QuickSession(FHandle, userType, PAnsiChar(StrToCk(pin))));
end;

function TPkcs11.ImportPrivateKey(privKey: TChilkatBase; jsonTemplate: TChilkatBase): LongWord;
begin
  Result := CkPkcs11_ImportPrivateKey(FHandle, privKey.Handle, jsonTemplate.Handle);
end;

function TPkcs11.DestroyObject(hObject: LongWord): Boolean;
begin
  Result := Boolean(CkPkcs11_DestroyObject(FHandle, hObject));
end;

function TPkcs11.FindObject(jsonTemplate: TChilkatBase): LongWord;
begin
  Result := CkPkcs11_FindObject(FHandle, jsonTemplate.Handle);
end;

function TPkcs11.ImportSshKey(sshKey: TChilkatBase; jsonTemplate: TChilkatBase): LongWord;
begin
  Result := CkPkcs11_ImportSshKey(FHandle, sshKey.Handle, jsonTemplate.Handle);
end;

function TPkcs11.ExportPublicKey(keyHandle: LongWord; pubKey: TChilkatBase): Boolean;
begin
  Result := Boolean(CkPkcs11_ExportPublicKey(FHandle, keyHandle, pubKey.Handle));
end;

initialization
  Chilkat_GetProcedureAddress(CkPkcs11_Create,  'CkPkcs11_Create');
  Chilkat_GetProcedureAddress(CkPkcs11_Dispose, 'CkPkcs11_Dispose');
  Chilkat_GetProcedureAddress(CkPkcs11_get_LastErrorHtml, 'CkPkcs11_get_LastErrorHtml');
  Chilkat_GetProcedureAddress(CkPkcs11_get_LastErrorText, 'CkPkcs11_get_LastErrorText');
  Chilkat_GetProcedureAddress(CkPkcs11_get_LastErrorXml, 'CkPkcs11_get_LastErrorXml');
  Chilkat_GetProcedureAddress(CkPkcs11_get_Version, 'CkPkcs11_get_Version');
  Chilkat_GetProcedureAddress(CkPkcs11_get_DebugLogFilePath, 'CkPkcs11_get_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkPkcs11_put_DebugLogFilePath, 'CkPkcs11_put_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkPkcs11_get_VerboseLogging, 'CkPkcs11_get_VerboseLogging');
  Chilkat_GetProcedureAddress(CkPkcs11_put_VerboseLogging, 'CkPkcs11_put_VerboseLogging');
  Chilkat_GetProcedureAddress(CkPkcs11_get_LastMethodSuccess, 'CkPkcs11_get_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkPkcs11_put_LastMethodSuccess, 'CkPkcs11_put_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkPkcs11_get_SharedLibPath, 'CkPkcs11_get_SharedLibPath');
  Chilkat_GetProcedureAddress(CkPkcs11_put_SharedLibPath, 'CkPkcs11_put_SharedLibPath');
  Chilkat_GetProcedureAddress(CkPkcs11_get_NumCerts, 'CkPkcs11_get_NumCerts');
  Chilkat_GetProcedureAddress(CkPkcs11_get_SigContextPin, 'CkPkcs11_get_SigContextPin');
  Chilkat_GetProcedureAddress(CkPkcs11_put_SigContextPin, 'CkPkcs11_put_SigContextPin');
  Chilkat_GetProcedureAddress(CkPkcs11_get_UncommonOptions, 'CkPkcs11_get_UncommonOptions');
  Chilkat_GetProcedureAddress(CkPkcs11_put_UncommonOptions, 'CkPkcs11_put_UncommonOptions');
  Chilkat_GetProcedureAddress(CkPkcs11_Initialize, 'CkPkcs11_Initialize');
  Chilkat_GetProcedureAddress(CkPkcs11_Discover, 'CkPkcs11_Discover');
  Chilkat_GetProcedureAddress(CkPkcs11_OpenSession, 'CkPkcs11_OpenSession');
  Chilkat_GetProcedureAddress(CkPkcs11_CloseSession, 'CkPkcs11_CloseSession');
  Chilkat_GetProcedureAddress(CkPkcs11_Login, 'CkPkcs11_Login');
  Chilkat_GetProcedureAddress(CkPkcs11_Logout, 'CkPkcs11_Logout');
  Chilkat_GetProcedureAddress(CkPkcs11_FindAllCerts, 'CkPkcs11_FindAllCerts');
  Chilkat_GetProcedureAddress(CkPkcs11_GetCert, 'CkPkcs11_GetCert');
  Chilkat_GetProcedureAddress(CkPkcs11_FindCert, 'CkPkcs11_FindCert');
  Chilkat_GetProcedureAddress(CkPkcs11_SetPin, 'CkPkcs11_SetPin');
  Chilkat_GetProcedureAddress(CkPkcs11_InitPin, 'CkPkcs11_InitPin');
  Chilkat_GetProcedureAddress(CkPkcs11_InitToken, 'CkPkcs11_InitToken');
  Chilkat_GetProcedureAddress(CkPkcs11_FindAllKeys, 'CkPkcs11_FindAllKeys');
  Chilkat_GetProcedureAddress(CkPkcs11_GenSecretKey, 'CkPkcs11_GenSecretKey');
  Chilkat_GetProcedureAddress(CkPkcs11_GenRsaKey, 'CkPkcs11_GenRsaKey');
  Chilkat_GetProcedureAddress(CkPkcs11_GenEcKey, 'CkPkcs11_GenEcKey');
  Chilkat_GetProcedureAddress(CkPkcs11_CreatePkcs11Object, 'CkPkcs11_CreatePkcs11Object');
  Chilkat_GetProcedureAddress(CkPkcs11_QuickSession, 'CkPkcs11_QuickSession');
  Chilkat_GetProcedureAddress(CkPkcs11_ImportPrivateKey, 'CkPkcs11_ImportPrivateKey');
  Chilkat_GetProcedureAddress(CkPkcs11_DestroyObject, 'CkPkcs11_DestroyObject');
  Chilkat_GetProcedureAddress(CkPkcs11_FindObject, 'CkPkcs11_FindObject');
  Chilkat_GetProcedureAddress(CkPkcs11_ImportSshKey, 'CkPkcs11_ImportSshKey');
  Chilkat_GetProcedureAddress(CkPkcs11_ExportPublicKey, 'CkPkcs11_ExportPublicKey');

end.
