unit Chilkat.Crypt2;

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

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

interface

uses
  SysUtils,
  Chilkat.Base;

type

  { TCrypt2 wraps CkCrypt2 via the C bridge layer. }
  TCrypt2 = class(TChilkatBase)
  private
    FOnAbortCheck: TChilkatAbortCheckEvent;
    FOnPercentDone: TChilkatPercentDoneEvent;
    FOnProgressInfo: TChilkatProgressInfoEvent;
    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  GetAbortCurrent: Boolean;
    procedure SetAbortCurrent(AValue: Boolean);
    function  GetBlockSize: Integer;
    function  GetCadesEnabled: Boolean;
    procedure SetCadesEnabled(AValue: Boolean);
    function  GetCadesSigPolicyHash: string;
    procedure SetCadesSigPolicyHash(AValue: string);
    function  GetCadesSigPolicyId: string;
    procedure SetCadesSigPolicyId(AValue: string);
    function  GetCadesSigPolicyUri: string;
    procedure SetCadesSigPolicyUri(AValue: string);
    function  GetCharset: string;
    procedure SetCharset(AValue: string);
    function  GetCipherMode: string;
    procedure SetCipherMode(AValue: string);
    function  GetCryptAlgorithm: string;
    procedure SetCryptAlgorithm(AValue: string);
    function  GetEncodingMode: string;
    procedure SetEncodingMode(AValue: string);
    function  GetFirstChunk: Boolean;
    procedure SetFirstChunk(AValue: Boolean);
    function  GetHashAlgorithm: string;
    procedure SetHashAlgorithm(AValue: string);
    function  GetHavalRounds: Integer;
    procedure SetHavalRounds(AValue: Integer);
    function  GetHeartbeatMs: Integer;
    procedure SetHeartbeatMs(AValue: Integer);
    function  GetIV: TBytes;
    procedure SetIV(AValue: TBytes);
    function  GetIncludeCertChain: Boolean;
    procedure SetIncludeCertChain(AValue: Boolean);
    function  GetInitialCount: Integer;
    procedure SetInitialCount(AValue: Integer);
    function  GetIterationCount: Integer;
    procedure SetIterationCount(AValue: Integer);
    function  GetKeyLength: Integer;
    procedure SetKeyLength(AValue: Integer);
    function  GetLastChunk: Boolean;
    procedure SetLastChunk(AValue: Boolean);
    function  GetMacAlgorithm: string;
    procedure SetMacAlgorithm(AValue: string);
    function  GetNumSignerCerts: Integer;
    function  GetPaddingScheme: Integer;
    procedure SetPaddingScheme(AValue: Integer);
    function  GetPbesAlgorithm: string;
    procedure SetPbesAlgorithm(AValue: string);
    function  GetPbesPassword: string;
    procedure SetPbesPassword(AValue: string);
    function  GetPkcs7CryptAlg: string;
    procedure SetPkcs7CryptAlg(AValue: string);
    function  GetRc2EffectiveKeyLength: Integer;
    procedure SetRc2EffectiveKeyLength(AValue: Integer);
    function  GetSalt: TBytes;
    procedure SetSalt(AValue: TBytes);
    function  GetSecretKey: TBytes;
    procedure SetSecretKey(AValue: TBytes);
    function  GetUuFilename: string;
    procedure SetUuFilename(AValue: string);
    function  GetUuMode: string;
    procedure SetUuMode(AValue: string);
    function  GetBCryptWorkFactor: Integer;
    procedure SetBCryptWorkFactor(AValue: Integer);
    function  GetSigningAlg: string;
    procedure SetSigningAlg(AValue: string);
    function  GetOaepHash: string;
    procedure SetOaepHash(AValue: string);
    function  GetOaepPadding: Boolean;
    procedure SetOaepPadding(AValue: Boolean);
    function  GetOaepMgfHash: string;
    procedure SetOaepMgfHash(AValue: string);
    function  GetSigningAttributes: string;
    procedure SetSigningAttributes(AValue: string);
    function  GetCmsOptions: string;
    procedure SetCmsOptions(AValue: string);
    function  GetUncommonOptions: string;
    procedure SetUncommonOptions(AValue: string);
    procedure SetOnAbortCheck(AValue: TChilkatAbortCheckEvent);
    procedure SetOnPercentDone(AValue: TChilkatPercentDoneEvent);
    procedure SetOnProgressInfo(AValue: TChilkatProgressInfoEvent);
  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 AbortCurrent: Boolean read GetAbortCurrent write SetAbortCurrent;
    property BlockSize: Integer read GetBlockSize;
    property CadesEnabled: Boolean read GetCadesEnabled write SetCadesEnabled;
    property CadesSigPolicyHash: string read GetCadesSigPolicyHash write SetCadesSigPolicyHash;
    property CadesSigPolicyId: string read GetCadesSigPolicyId write SetCadesSigPolicyId;
    property CadesSigPolicyUri: string read GetCadesSigPolicyUri write SetCadesSigPolicyUri;
    property Charset: string read GetCharset write SetCharset;
    property CipherMode: string read GetCipherMode write SetCipherMode;
    property CryptAlgorithm: string read GetCryptAlgorithm write SetCryptAlgorithm;
    property EncodingMode: string read GetEncodingMode write SetEncodingMode;
    property FirstChunk: Boolean read GetFirstChunk write SetFirstChunk;
    property HashAlgorithm: string read GetHashAlgorithm write SetHashAlgorithm;
    property HavalRounds: Integer read GetHavalRounds write SetHavalRounds;
    property HeartbeatMs: Integer read GetHeartbeatMs write SetHeartbeatMs;
    property IV: TBytes read GetIV write SetIV;
    property IncludeCertChain: Boolean read GetIncludeCertChain write SetIncludeCertChain;
    property InitialCount: Integer read GetInitialCount write SetInitialCount;
    property IterationCount: Integer read GetIterationCount write SetIterationCount;
    property KeyLength: Integer read GetKeyLength write SetKeyLength;
    property LastChunk: Boolean read GetLastChunk write SetLastChunk;
    property MacAlgorithm: string read GetMacAlgorithm write SetMacAlgorithm;
    property NumSignerCerts: Integer read GetNumSignerCerts;
    property PaddingScheme: Integer read GetPaddingScheme write SetPaddingScheme;
    property PbesAlgorithm: string read GetPbesAlgorithm write SetPbesAlgorithm;
    property PbesPassword: string read GetPbesPassword write SetPbesPassword;
    property Pkcs7CryptAlg: string read GetPkcs7CryptAlg write SetPkcs7CryptAlg;
    property Rc2EffectiveKeyLength: Integer read GetRc2EffectiveKeyLength write SetRc2EffectiveKeyLength;
    property Salt: TBytes read GetSalt write SetSalt;
    property SecretKey: TBytes read GetSecretKey write SetSecretKey;
    property UuFilename: string read GetUuFilename write SetUuFilename;
    property UuMode: string read GetUuMode write SetUuMode;
    property BCryptWorkFactor: Integer read GetBCryptWorkFactor write SetBCryptWorkFactor;
    property SigningAlg: string read GetSigningAlg write SetSigningAlg;
    property OaepHash: string read GetOaepHash write SetOaepHash;
    property OaepPadding: Boolean read GetOaepPadding write SetOaepPadding;
    property OaepMgfHash: string read GetOaepMgfHash write SetOaepMgfHash;
    property SigningAttributes: string read GetSigningAttributes write SetSigningAttributes;
    property CmsOptions: string read GetCmsOptions write SetCmsOptions;
    property UncommonOptions: string read GetUncommonOptions write SetUncommonOptions;

    { Event callbacks.  Return True from OnAbortCheck / OnPercentDone
      to abort the running method.  Callbacks are invoked on the
      thread that called the Chilkat method.  The HeartbeatMs
      property controls the AbortCheck frequency. }
    property OnAbortCheck: TChilkatAbortCheckEvent read FOnAbortCheck write SetOnAbortCheck;
    property OnPercentDone: TChilkatPercentDoneEvent read FOnPercentDone write SetOnPercentDone;
    property OnProgressInfo: TChilkatProgressInfoEvent read FOnProgressInfo write SetOnProgressInfo;

    procedure AddEncryptCert(cert: TChilkatBase);
    function  AddPfxSourceFile(const pfxFilePath: string; const pfxPassword: string): Boolean;
    function  CkDecryptFile(const srcFile: string; const destFile: string): Boolean;
    function  CkEncryptFile(const srcFile: string; const destFile: string): Boolean;
    procedure ClearEncryptCerts;
    function  CrcFile(const crcAlg: string; const path: string): LongWord;
    function  CreateP7M(const inFilename: string; const p7mPath: string): Boolean;
    function  CreateP7S(const inFilename: string; const p7sPath: string): Boolean;
    function  DecodeString(const inStr: string; const charset: string; const encoding: string): string;
    function  DecryptEncoded(const encodedEncryptedData: string): string;
    function  DecryptStringENC(const str: string): string;
    function  EncodeBytes(pByteData: Pointer; szByteData: LongWord; const encoding: string): string;
    function  EncodeString(const strToEncode: string; const charsetName: string; const toEncodingName: string): string;
    function  EncryptEncoded(const str: string): string;
    function  EncryptStringENC(const str: string): string;
    function  GenRandomBytesENC(numBytes: Integer): string;
    function  GenerateUuid: string;
    function  GetEncodedAuthTag(const encoding: string): string;
    function  GetEncodedIV(const encoding: string): string;
    function  GetSignatureSigningTimeStr(index: Integer): string;
    function  HasSignatureSigningTime(index: Integer): Boolean;
    function  HashBeginString(const strData: string): Boolean;
    function  HashFileENC(const path: string): string;
    function  HashFinalENC: string;
    function  HashMoreString(const strData: string): Boolean;
    function  HashStringENC(const str: string): string;
    function  MacStringENC(const inText: string): string;
    function  MySqlAesDecrypt(const strEncryptedHex: string; const strPassword: string): string;
    function  MySqlAesEncrypt(const strData: string; const strPassword: string): string;
    function  OpaqueSignStringENC(const str: string): string;
    function  OpaqueVerifyStringENC(const p7m: string): string;
    function  Pbkdf1(const password: string; const charset: string; const hashAlg: string; const salt: string; iterationCount: Integer; outputKeyBitLen: Integer; const encoding: string): string;
    function  Pbkdf2(const password: string; const charset: string; const hashAlg: string; const salt: string; iterationCount: Integer; outputKeyBitLen: Integer; const encoding: string): string;
    procedure RandomizeIV;
    function  ReEncode(const encodedData: string; const fromEncoding: string; const toEncoding: string): string;
    function  SetDecryptCert(cert: TChilkatBase): Boolean;
    function  SetDecryptCert2(cert: TChilkatBase; key: TChilkatBase): Boolean;
    function  SetEncodedAad(const aadStr: string; const encoding: string): Boolean;
    function  SetEncodedAuthTag(const authTagStr: string; const encoding: string): Boolean;
    procedure SetEncodedIV(const ivStr: string; const encoding: string);
    procedure SetEncodedKey(const keyStr: string; const encoding: string);
    procedure SetEncodedSalt(const saltStr: string; const encoding: string);
    function  SetEncryptCert(cert: TChilkatBase): Boolean;
    procedure SetIV(pByteData: Pointer; szByteData: LongWord);
    function  SetMacKeyEncoded(const key: string; const encoding: string): Boolean;
    function  SetMacKeyString(const key: string): Boolean;
    procedure SetSecretKey(pByteData: Pointer; szByteData: LongWord);
    function  SetSigningCert(cert: TChilkatBase): Boolean;
    function  SetSigningCert2(cert: TChilkatBase; privateKey: TChilkatBase): Boolean;
    function  SetVerifyCert(cert: TChilkatBase): Boolean;
    function  SignStringENC(const str: string): string;
    function  UseCertVault(vault: TChilkatBase): Boolean;
    function  VerifyP7M(const p7mPath: string; const destPath: string): Boolean;
    function  VerifyP7S(const originalDataPath: string; const p7sPath: string): Boolean;
    function  VerifyStringENC(const str: string; const encodedSig: string): Boolean;
    function  BCryptHash(const password: string): string;
    function  BCryptVerify(const password: string; const bcryptHash: string): Boolean;
    function  AesKeyWrap(const kek: string; const keyData: string; const encoding: string): string;
    function  AesKeyUnwrap(const kek: string; const wrappedKeyData: string; const encoding: string): string;
    function  HashBdENC(bd: TChilkatBase): string;
    function  MacBdENC(bd: TChilkatBase): string;
    function  EncryptBd(bd: TChilkatBase): Boolean;
    function  DecryptBd(bd: TChilkatBase): Boolean;
    function  EncryptSb(sbIn: TChilkatBase; bdOut: TChilkatBase): Boolean;
    function  DecryptSb(bdIn: TChilkatBase; sbOut: TChilkatBase): Boolean;
    function  SignBdENC(dataToSign: TChilkatBase): string;
    function  SignSbENC(sb: TChilkatBase): string;
    function  OpaqueSignBd(bd: TChilkatBase): Boolean;
    function  OpaqueVerifyBd(bd: TChilkatBase): Boolean;
    function  VerifyBdENC(data: TChilkatBase; const encodedSig: string): Boolean;
    function  VerifySbENC(sb: TChilkatBase; const encodedSig: string): Boolean;
    function  EncryptSecureENC(secureStr: TChilkatBase): string;
    function  DecryptSecureENC(const cipherText: string; secureStr: TChilkatBase): Boolean;
    function  GetSignedAttributes(signerIndex: Integer; pkcs7Der: TChilkatBase; sbJson: TChilkatBase): Boolean;
    function  Hotp(const secret: string; const secretEnc: string; const counterHex: string; numDigits: Integer; truncOffset: Integer; const hashAlg: string): string;
    function  EncodeInt(value: Integer; numBytes: Integer; littleEndian: Boolean; const encoding: string): string;
    function  Totp(const secret: string; const secretEnc: string; const t0: string; const tNow: string; tStep: Integer; numDigits: Integer; truncOffset: Integer; const hashAlg: string): string;
    procedure SetTsaHttpObj(http: TChilkatBase);
    function  HashBeginBytes2(pByteData: Pointer; szByteData: LongWord): Boolean;
    function  HashMoreBytes2(pByteData: Pointer; szByteData: LongWord): Boolean;
    function  AddSigningCert(cert: TChilkatBase): Boolean;
    procedure ClearSigningCerts;
    function  CoSign(bdIn: TChilkatBase; cert: TChilkatBase; bdOut: TChilkatBase): Boolean;
    function  SignHashENC(const encodedHash: string; const hashAlg: string; const hashEncoding: string): string;
    procedure XtsSetEncodedTweakValue(const tweak: string; const encoding: string);
    procedure XtsSetDataUnitNumber(loUint32: LongWord; hiUint32: LongWord);
    procedure XtsSetEncodedTweakKey(const key: string; const encoding: string);
    function  AesKeyWrapWithPadding(const kek: string; const keyData: string; const encoding: string): string;
    function  AesKeyUnwrapWithPadding(const kek: string; const wrappedKeyData: string; const encoding: string): string;
    procedure GetLastJsonData(json: TChilkatBase);
    function  LastDecryptCert(cert: TChilkatBase): Boolean;
    function  LastSignerCert(index: Integer; cert: TChilkatBase): Boolean;
    function  AddPfxSourceBd(bd: TChilkatBase; const password: string): Boolean;
    function  CrcBd(const crcAlg: string; bd: TChilkatBase): LongWord;
    function  HashChunkBd(firstChunk: Boolean; bd: TChilkatBase): Boolean;
    function  Argon2DeriveKey(const password: string; const json: string; bdKey: TChilkatBase): Boolean;
    function  Argon2HashPassword(const password: string; const json: string): string;
    function  Argon2VerifyPassword(const password: string; const json: string; const phcHash: string): Integer;
  end;

implementation

uses
  CkDllLoader,
  Chilkat.Utils;

{ ---- C bridge function pointer types ---- }
type
  TCkCrypt2_Create  = function(): Pointer; cdecl;
  TCkCrypt2_Dispose = procedure(handle: Pointer); cdecl;
  TCkBridgeAbortCheckCb   = function(userData: Pointer): Integer; cdecl;
  TCkBridgePercentDoneCb  = function(pctDone: Integer; userData: Pointer): Integer; cdecl;
  TCkBridgeProgressInfoCb = procedure(name: PAnsiChar; value: PAnsiChar; userData: Pointer); cdecl;
  TCkCrypt2_SetAbortCheckCallback   = procedure(handle: Pointer; cb: TCkBridgeAbortCheckCb; userData: Pointer); cdecl;
  TCkCrypt2_SetPercentDoneCallback  = procedure(handle: Pointer; cb: TCkBridgePercentDoneCb; userData: Pointer); cdecl;
  TCkCrypt2_SetProgressInfoCallback = procedure(handle: Pointer; cb: TCkBridgeProgressInfoCb; userData: Pointer); cdecl;
  TCkCrypt2_get_LastErrorHtml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_get_LastErrorText = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_get_LastErrorXml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_get_Version = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_get_DebugLogFilePath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_DebugLogFilePath = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_VerboseLogging = function(handle: Pointer): LongBool; cdecl;
  TCkCrypt2_put_VerboseLogging = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkCrypt2_get_LastMethodSuccess = function(handle: Pointer): LongBool; cdecl;
  TCkCrypt2_put_LastMethodSuccess = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkCrypt2_get_AbortCurrent = function(handle: Pointer): LongBool; cdecl;
  TCkCrypt2_put_AbortCurrent = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkCrypt2_get_BlockSize = function(handle: Pointer): Integer; cdecl;
  TCkCrypt2_get_CadesEnabled = function(handle: Pointer): LongBool; cdecl;
  TCkCrypt2_put_CadesEnabled = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkCrypt2_get_CadesSigPolicyHash = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_CadesSigPolicyHash = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_CadesSigPolicyId = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_CadesSigPolicyId = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_CadesSigPolicyUri = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_CadesSigPolicyUri = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_Charset = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_Charset = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_CipherMode = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_CipherMode = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_CryptAlgorithm = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_CryptAlgorithm = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_EncodingMode = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_EncodingMode = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_FirstChunk = function(handle: Pointer): LongBool; cdecl;
  TCkCrypt2_put_FirstChunk = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkCrypt2_get_HashAlgorithm = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_HashAlgorithm = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_HavalRounds = function(handle: Pointer): Integer; cdecl;
  TCkCrypt2_put_HavalRounds = procedure(handle: Pointer; value: Integer); cdecl;
  TCkCrypt2_get_HeartbeatMs = function(handle: Pointer): Integer; cdecl;
  TCkCrypt2_put_HeartbeatMs = procedure(handle: Pointer; value: Integer); cdecl;
  TCkCrypt2_get_IV = function(handle: Pointer): Pointer; cdecl;
  TCkCrypt2_put_IV = procedure(handle: Pointer; value: Pointer); cdecl;
  TCkCrypt2_get_IncludeCertChain = function(handle: Pointer): LongBool; cdecl;
  TCkCrypt2_put_IncludeCertChain = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkCrypt2_get_InitialCount = function(handle: Pointer): Integer; cdecl;
  TCkCrypt2_put_InitialCount = procedure(handle: Pointer; value: Integer); cdecl;
  TCkCrypt2_get_IterationCount = function(handle: Pointer): Integer; cdecl;
  TCkCrypt2_put_IterationCount = procedure(handle: Pointer; value: Integer); cdecl;
  TCkCrypt2_get_KeyLength = function(handle: Pointer): Integer; cdecl;
  TCkCrypt2_put_KeyLength = procedure(handle: Pointer; value: Integer); cdecl;
  TCkCrypt2_get_LastChunk = function(handle: Pointer): LongBool; cdecl;
  TCkCrypt2_put_LastChunk = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkCrypt2_get_MacAlgorithm = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_MacAlgorithm = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_NumSignerCerts = function(handle: Pointer): Integer; cdecl;
  TCkCrypt2_get_PaddingScheme = function(handle: Pointer): Integer; cdecl;
  TCkCrypt2_put_PaddingScheme = procedure(handle: Pointer; value: Integer); cdecl;
  TCkCrypt2_get_PbesAlgorithm = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_PbesAlgorithm = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_PbesPassword = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_PbesPassword = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_Pkcs7CryptAlg = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_Pkcs7CryptAlg = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_Rc2EffectiveKeyLength = function(handle: Pointer): Integer; cdecl;
  TCkCrypt2_put_Rc2EffectiveKeyLength = procedure(handle: Pointer; value: Integer); cdecl;
  TCkCrypt2_get_Salt = function(handle: Pointer): Pointer; cdecl;
  TCkCrypt2_put_Salt = procedure(handle: Pointer; value: Pointer); cdecl;
  TCkCrypt2_get_SecretKey = function(handle: Pointer): Pointer; cdecl;
  TCkCrypt2_put_SecretKey = procedure(handle: Pointer; value: Pointer); cdecl;
  TCkCrypt2_get_UuFilename = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_UuFilename = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_UuMode = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_UuMode = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_BCryptWorkFactor = function(handle: Pointer): Integer; cdecl;
  TCkCrypt2_put_BCryptWorkFactor = procedure(handle: Pointer; value: Integer); cdecl;
  TCkCrypt2_get_SigningAlg = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_SigningAlg = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_OaepHash = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_OaepHash = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_OaepPadding = function(handle: Pointer): LongBool; cdecl;
  TCkCrypt2_put_OaepPadding = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkCrypt2_get_OaepMgfHash = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_OaepMgfHash = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_SigningAttributes = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_SigningAttributes = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_CmsOptions = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_CmsOptions = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_get_UncommonOptions = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_put_UncommonOptions = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkCrypt2_AddEncryptCert = procedure(handle: Pointer; cert: Pointer); cdecl;
  TCkCrypt2_AddPfxSourceFile = function(handle: Pointer; pfxFilePath: PAnsiChar; pfxPassword: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_CkDecryptFile = function(handle: Pointer; srcFile: PAnsiChar; destFile: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_CkEncryptFile = function(handle: Pointer; srcFile: PAnsiChar; destFile: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_ClearEncryptCerts = procedure(handle: Pointer); cdecl;
  TCkCrypt2_CrcFile = function(handle: Pointer; crcAlg: PAnsiChar; path: PAnsiChar): LongWord; cdecl;
  TCkCrypt2_CreateP7M = function(handle: Pointer; inFilename: PAnsiChar; p7mPath: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_CreateP7S = function(handle: Pointer; inFilename: PAnsiChar; p7sPath: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_DecodeString = function(handle: Pointer; inStr: PAnsiChar; charset: PAnsiChar; encoding: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_DecryptEncoded = function(handle: Pointer; encodedEncryptedData: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_DecryptStringENC = function(handle: Pointer; str: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_EncodeBytes = function(handle: Pointer; pByteData: Pointer; szByteData: LongWord; encoding: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_EncodeString = function(handle: Pointer; strToEncode: PAnsiChar; charsetName: PAnsiChar; toEncodingName: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_EncryptEncoded = function(handle: Pointer; str: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_EncryptStringENC = function(handle: Pointer; str: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_GenRandomBytesENC = function(handle: Pointer; numBytes: Integer): PAnsiChar; cdecl;
  TCkCrypt2_GenerateUuid = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_GetEncodedAuthTag = function(handle: Pointer; encoding: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_GetEncodedIV = function(handle: Pointer; encoding: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_GetSignatureSigningTimeStr = function(handle: Pointer; index: Integer): PAnsiChar; cdecl;
  TCkCrypt2_HasSignatureSigningTime = function(handle: Pointer; index: Integer): LongBool; cdecl;
  TCkCrypt2_HashBeginString = function(handle: Pointer; strData: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_HashFileENC = function(handle: Pointer; path: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_HashFinalENC = function(handle: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_HashMoreString = function(handle: Pointer; strData: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_HashStringENC = function(handle: Pointer; str: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_MacStringENC = function(handle: Pointer; inText: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_MySqlAesDecrypt = function(handle: Pointer; strEncryptedHex: PAnsiChar; strPassword: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_MySqlAesEncrypt = function(handle: Pointer; strData: PAnsiChar; strPassword: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_OpaqueSignStringENC = function(handle: Pointer; str: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_OpaqueVerifyStringENC = function(handle: Pointer; p7m: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_Pbkdf1 = function(handle: Pointer; password: PAnsiChar; charset: PAnsiChar; hashAlg: PAnsiChar; salt: PAnsiChar; iterationCount: Integer; outputKeyBitLen: Integer; encoding: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_Pbkdf2 = function(handle: Pointer; password: PAnsiChar; charset: PAnsiChar; hashAlg: PAnsiChar; salt: PAnsiChar; iterationCount: Integer; outputKeyBitLen: Integer; encoding: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_RandomizeIV = procedure(handle: Pointer); cdecl;
  TCkCrypt2_ReEncode = function(handle: Pointer; encodedData: PAnsiChar; fromEncoding: PAnsiChar; toEncoding: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_SetDecryptCert = function(handle: Pointer; cert: Pointer): LongBool; cdecl;
  TCkCrypt2_SetDecryptCert2 = function(handle: Pointer; cert: Pointer; key: Pointer): LongBool; cdecl;
  TCkCrypt2_SetEncodedAad = function(handle: Pointer; aadStr: PAnsiChar; encoding: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_SetEncodedAuthTag = function(handle: Pointer; authTagStr: PAnsiChar; encoding: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_SetEncodedIV = procedure(handle: Pointer; ivStr: PAnsiChar; encoding: PAnsiChar); cdecl;
  TCkCrypt2_SetEncodedKey = procedure(handle: Pointer; keyStr: PAnsiChar; encoding: PAnsiChar); cdecl;
  TCkCrypt2_SetEncodedSalt = procedure(handle: Pointer; saltStr: PAnsiChar; encoding: PAnsiChar); cdecl;
  TCkCrypt2_SetEncryptCert = function(handle: Pointer; cert: Pointer): LongBool; cdecl;
  TCkCrypt2_SetIV = procedure(handle: Pointer; pByteData: Pointer; szByteData: LongWord); cdecl;
  TCkCrypt2_SetMacKeyEncoded = function(handle: Pointer; key: PAnsiChar; encoding: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_SetMacKeyString = function(handle: Pointer; key: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_SetSecretKey = procedure(handle: Pointer; pByteData: Pointer; szByteData: LongWord); cdecl;
  TCkCrypt2_SetSigningCert = function(handle: Pointer; cert: Pointer): LongBool; cdecl;
  TCkCrypt2_SetSigningCert2 = function(handle: Pointer; cert: Pointer; privateKey: Pointer): LongBool; cdecl;
  TCkCrypt2_SetVerifyCert = function(handle: Pointer; cert: Pointer): LongBool; cdecl;
  TCkCrypt2_SignStringENC = function(handle: Pointer; str: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_UseCertVault = function(handle: Pointer; vault: Pointer): LongBool; cdecl;
  TCkCrypt2_VerifyP7M = function(handle: Pointer; p7mPath: PAnsiChar; destPath: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_VerifyP7S = function(handle: Pointer; originalDataPath: PAnsiChar; p7sPath: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_VerifyStringENC = function(handle: Pointer; str: PAnsiChar; encodedSig: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_BCryptHash = function(handle: Pointer; password: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_BCryptVerify = function(handle: Pointer; password: PAnsiChar; bcryptHash: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_AesKeyWrap = function(handle: Pointer; kek: PAnsiChar; keyData: PAnsiChar; encoding: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_AesKeyUnwrap = function(handle: Pointer; kek: PAnsiChar; wrappedKeyData: PAnsiChar; encoding: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_HashBdENC = function(handle: Pointer; bd: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_MacBdENC = function(handle: Pointer; bd: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_EncryptBd = function(handle: Pointer; bd: Pointer): LongBool; cdecl;
  TCkCrypt2_DecryptBd = function(handle: Pointer; bd: Pointer): LongBool; cdecl;
  TCkCrypt2_EncryptSb = function(handle: Pointer; sbIn: Pointer; bdOut: Pointer): LongBool; cdecl;
  TCkCrypt2_DecryptSb = function(handle: Pointer; bdIn: Pointer; sbOut: Pointer): LongBool; cdecl;
  TCkCrypt2_SignBdENC = function(handle: Pointer; dataToSign: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_SignSbENC = function(handle: Pointer; sb: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_OpaqueSignBd = function(handle: Pointer; bd: Pointer): LongBool; cdecl;
  TCkCrypt2_OpaqueVerifyBd = function(handle: Pointer; bd: Pointer): LongBool; cdecl;
  TCkCrypt2_VerifyBdENC = function(handle: Pointer; data: Pointer; encodedSig: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_VerifySbENC = function(handle: Pointer; sb: Pointer; encodedSig: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_EncryptSecureENC = function(handle: Pointer; secureStr: Pointer): PAnsiChar; cdecl;
  TCkCrypt2_DecryptSecureENC = function(handle: Pointer; cipherText: PAnsiChar; secureStr: Pointer): LongBool; cdecl;
  TCkCrypt2_GetSignedAttributes = function(handle: Pointer; signerIndex: Integer; pkcs7Der: Pointer; sbJson: Pointer): LongBool; cdecl;
  TCkCrypt2_Hotp = function(handle: Pointer; secret: PAnsiChar; secretEnc: PAnsiChar; counterHex: PAnsiChar; numDigits: Integer; truncOffset: Integer; hashAlg: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_EncodeInt = function(handle: Pointer; value: Integer; numBytes: Integer; littleEndian: LongBool; encoding: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_Totp = function(handle: Pointer; secret: PAnsiChar; secretEnc: PAnsiChar; t0: PAnsiChar; tNow: PAnsiChar; tStep: Integer; numDigits: Integer; truncOffset: Integer; hashAlg: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_SetTsaHttpObj = procedure(handle: Pointer; http: Pointer); cdecl;
  TCkCrypt2_HashBeginBytes2 = function(handle: Pointer; pByteData: Pointer; szByteData: LongWord): LongBool; cdecl;
  TCkCrypt2_HashMoreBytes2 = function(handle: Pointer; pByteData: Pointer; szByteData: LongWord): LongBool; cdecl;
  TCkCrypt2_AddSigningCert = function(handle: Pointer; cert: Pointer): LongBool; cdecl;
  TCkCrypt2_ClearSigningCerts = procedure(handle: Pointer); cdecl;
  TCkCrypt2_CoSign = function(handle: Pointer; bdIn: Pointer; cert: Pointer; bdOut: Pointer): LongBool; cdecl;
  TCkCrypt2_SignHashENC = function(handle: Pointer; encodedHash: PAnsiChar; hashAlg: PAnsiChar; hashEncoding: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_XtsSetEncodedTweakValue = procedure(handle: Pointer; tweak: PAnsiChar; encoding: PAnsiChar); cdecl;
  TCkCrypt2_XtsSetDataUnitNumber = procedure(handle: Pointer; loUint32: LongWord; hiUint32: LongWord); cdecl;
  TCkCrypt2_XtsSetEncodedTweakKey = procedure(handle: Pointer; key: PAnsiChar; encoding: PAnsiChar); cdecl;
  TCkCrypt2_AesKeyWrapWithPadding = function(handle: Pointer; kek: PAnsiChar; keyData: PAnsiChar; encoding: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_AesKeyUnwrapWithPadding = function(handle: Pointer; kek: PAnsiChar; wrappedKeyData: PAnsiChar; encoding: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_GetLastJsonData = procedure(handle: Pointer; json: Pointer); cdecl;
  TCkCrypt2_LastDecryptCert = function(handle: Pointer; cert: Pointer): LongBool; cdecl;
  TCkCrypt2_LastSignerCert = function(handle: Pointer; index: Integer; cert: Pointer): LongBool; cdecl;
  TCkCrypt2_AddPfxSourceBd = function(handle: Pointer; bd: Pointer; password: PAnsiChar): LongBool; cdecl;
  TCkCrypt2_CrcBd = function(handle: Pointer; crcAlg: PAnsiChar; bd: Pointer): LongWord; cdecl;
  TCkCrypt2_HashChunkBd = function(handle: Pointer; firstChunk: LongBool; bd: Pointer): LongBool; cdecl;
  TCkCrypt2_Argon2DeriveKey = function(handle: Pointer; password: PAnsiChar; json: PAnsiChar; bdKey: Pointer): LongBool; cdecl;
  TCkCrypt2_Argon2HashPassword = function(handle: Pointer; password: PAnsiChar; json: PAnsiChar): PAnsiChar; cdecl;
  TCkCrypt2_Argon2VerifyPassword = function(handle: Pointer; password: PAnsiChar; json: PAnsiChar; phcHash: PAnsiChar): Integer; cdecl;

{ ---- C bridge function pointer variables ---- }
var
  CkCrypt2_Create:  TCkCrypt2_Create  = nil;
  CkCrypt2_Dispose: TCkCrypt2_Dispose = nil;
  CkCrypt2_SetAbortCheckCallback:   TCkCrypt2_SetAbortCheckCallback   = nil;
  CkCrypt2_SetPercentDoneCallback:  TCkCrypt2_SetPercentDoneCallback  = nil;
  CkCrypt2_SetProgressInfoCallback: TCkCrypt2_SetProgressInfoCallback = nil;
  CkCrypt2_get_LastErrorHtml: TCkCrypt2_get_LastErrorHtml = nil;
  CkCrypt2_get_LastErrorText: TCkCrypt2_get_LastErrorText = nil;
  CkCrypt2_get_LastErrorXml: TCkCrypt2_get_LastErrorXml = nil;
  CkCrypt2_get_Version: TCkCrypt2_get_Version = nil;
  CkCrypt2_get_DebugLogFilePath: TCkCrypt2_get_DebugLogFilePath = nil;
  CkCrypt2_put_DebugLogFilePath: TCkCrypt2_put_DebugLogFilePath = nil;
  CkCrypt2_get_VerboseLogging: TCkCrypt2_get_VerboseLogging = nil;
  CkCrypt2_put_VerboseLogging: TCkCrypt2_put_VerboseLogging = nil;
  CkCrypt2_get_LastMethodSuccess: TCkCrypt2_get_LastMethodSuccess = nil;
  CkCrypt2_put_LastMethodSuccess: TCkCrypt2_put_LastMethodSuccess = nil;
  CkCrypt2_get_AbortCurrent: TCkCrypt2_get_AbortCurrent = nil;
  CkCrypt2_put_AbortCurrent: TCkCrypt2_put_AbortCurrent = nil;
  CkCrypt2_get_BlockSize: TCkCrypt2_get_BlockSize = nil;
  CkCrypt2_get_CadesEnabled: TCkCrypt2_get_CadesEnabled = nil;
  CkCrypt2_put_CadesEnabled: TCkCrypt2_put_CadesEnabled = nil;
  CkCrypt2_get_CadesSigPolicyHash: TCkCrypt2_get_CadesSigPolicyHash = nil;
  CkCrypt2_put_CadesSigPolicyHash: TCkCrypt2_put_CadesSigPolicyHash = nil;
  CkCrypt2_get_CadesSigPolicyId: TCkCrypt2_get_CadesSigPolicyId = nil;
  CkCrypt2_put_CadesSigPolicyId: TCkCrypt2_put_CadesSigPolicyId = nil;
  CkCrypt2_get_CadesSigPolicyUri: TCkCrypt2_get_CadesSigPolicyUri = nil;
  CkCrypt2_put_CadesSigPolicyUri: TCkCrypt2_put_CadesSigPolicyUri = nil;
  CkCrypt2_get_Charset: TCkCrypt2_get_Charset = nil;
  CkCrypt2_put_Charset: TCkCrypt2_put_Charset = nil;
  CkCrypt2_get_CipherMode: TCkCrypt2_get_CipherMode = nil;
  CkCrypt2_put_CipherMode: TCkCrypt2_put_CipherMode = nil;
  CkCrypt2_get_CryptAlgorithm: TCkCrypt2_get_CryptAlgorithm = nil;
  CkCrypt2_put_CryptAlgorithm: TCkCrypt2_put_CryptAlgorithm = nil;
  CkCrypt2_get_EncodingMode: TCkCrypt2_get_EncodingMode = nil;
  CkCrypt2_put_EncodingMode: TCkCrypt2_put_EncodingMode = nil;
  CkCrypt2_get_FirstChunk: TCkCrypt2_get_FirstChunk = nil;
  CkCrypt2_put_FirstChunk: TCkCrypt2_put_FirstChunk = nil;
  CkCrypt2_get_HashAlgorithm: TCkCrypt2_get_HashAlgorithm = nil;
  CkCrypt2_put_HashAlgorithm: TCkCrypt2_put_HashAlgorithm = nil;
  CkCrypt2_get_HavalRounds: TCkCrypt2_get_HavalRounds = nil;
  CkCrypt2_put_HavalRounds: TCkCrypt2_put_HavalRounds = nil;
  CkCrypt2_get_HeartbeatMs: TCkCrypt2_get_HeartbeatMs = nil;
  CkCrypt2_put_HeartbeatMs: TCkCrypt2_put_HeartbeatMs = nil;
  CkCrypt2_get_IV: TCkCrypt2_get_IV = nil;
  CkCrypt2_put_IV: TCkCrypt2_put_IV = nil;
  CkCrypt2_get_IncludeCertChain: TCkCrypt2_get_IncludeCertChain = nil;
  CkCrypt2_put_IncludeCertChain: TCkCrypt2_put_IncludeCertChain = nil;
  CkCrypt2_get_InitialCount: TCkCrypt2_get_InitialCount = nil;
  CkCrypt2_put_InitialCount: TCkCrypt2_put_InitialCount = nil;
  CkCrypt2_get_IterationCount: TCkCrypt2_get_IterationCount = nil;
  CkCrypt2_put_IterationCount: TCkCrypt2_put_IterationCount = nil;
  CkCrypt2_get_KeyLength: TCkCrypt2_get_KeyLength = nil;
  CkCrypt2_put_KeyLength: TCkCrypt2_put_KeyLength = nil;
  CkCrypt2_get_LastChunk: TCkCrypt2_get_LastChunk = nil;
  CkCrypt2_put_LastChunk: TCkCrypt2_put_LastChunk = nil;
  CkCrypt2_get_MacAlgorithm: TCkCrypt2_get_MacAlgorithm = nil;
  CkCrypt2_put_MacAlgorithm: TCkCrypt2_put_MacAlgorithm = nil;
  CkCrypt2_get_NumSignerCerts: TCkCrypt2_get_NumSignerCerts = nil;
  CkCrypt2_get_PaddingScheme: TCkCrypt2_get_PaddingScheme = nil;
  CkCrypt2_put_PaddingScheme: TCkCrypt2_put_PaddingScheme = nil;
  CkCrypt2_get_PbesAlgorithm: TCkCrypt2_get_PbesAlgorithm = nil;
  CkCrypt2_put_PbesAlgorithm: TCkCrypt2_put_PbesAlgorithm = nil;
  CkCrypt2_get_PbesPassword: TCkCrypt2_get_PbesPassword = nil;
  CkCrypt2_put_PbesPassword: TCkCrypt2_put_PbesPassword = nil;
  CkCrypt2_get_Pkcs7CryptAlg: TCkCrypt2_get_Pkcs7CryptAlg = nil;
  CkCrypt2_put_Pkcs7CryptAlg: TCkCrypt2_put_Pkcs7CryptAlg = nil;
  CkCrypt2_get_Rc2EffectiveKeyLength: TCkCrypt2_get_Rc2EffectiveKeyLength = nil;
  CkCrypt2_put_Rc2EffectiveKeyLength: TCkCrypt2_put_Rc2EffectiveKeyLength = nil;
  CkCrypt2_get_Salt: TCkCrypt2_get_Salt = nil;
  CkCrypt2_put_Salt: TCkCrypt2_put_Salt = nil;
  CkCrypt2_get_SecretKey: TCkCrypt2_get_SecretKey = nil;
  CkCrypt2_put_SecretKey: TCkCrypt2_put_SecretKey = nil;
  CkCrypt2_get_UuFilename: TCkCrypt2_get_UuFilename = nil;
  CkCrypt2_put_UuFilename: TCkCrypt2_put_UuFilename = nil;
  CkCrypt2_get_UuMode: TCkCrypt2_get_UuMode = nil;
  CkCrypt2_put_UuMode: TCkCrypt2_put_UuMode = nil;
  CkCrypt2_get_BCryptWorkFactor: TCkCrypt2_get_BCryptWorkFactor = nil;
  CkCrypt2_put_BCryptWorkFactor: TCkCrypt2_put_BCryptWorkFactor = nil;
  CkCrypt2_get_SigningAlg: TCkCrypt2_get_SigningAlg = nil;
  CkCrypt2_put_SigningAlg: TCkCrypt2_put_SigningAlg = nil;
  CkCrypt2_get_OaepHash: TCkCrypt2_get_OaepHash = nil;
  CkCrypt2_put_OaepHash: TCkCrypt2_put_OaepHash = nil;
  CkCrypt2_get_OaepPadding: TCkCrypt2_get_OaepPadding = nil;
  CkCrypt2_put_OaepPadding: TCkCrypt2_put_OaepPadding = nil;
  CkCrypt2_get_OaepMgfHash: TCkCrypt2_get_OaepMgfHash = nil;
  CkCrypt2_put_OaepMgfHash: TCkCrypt2_put_OaepMgfHash = nil;
  CkCrypt2_get_SigningAttributes: TCkCrypt2_get_SigningAttributes = nil;
  CkCrypt2_put_SigningAttributes: TCkCrypt2_put_SigningAttributes = nil;
  CkCrypt2_get_CmsOptions: TCkCrypt2_get_CmsOptions = nil;
  CkCrypt2_put_CmsOptions: TCkCrypt2_put_CmsOptions = nil;
  CkCrypt2_get_UncommonOptions: TCkCrypt2_get_UncommonOptions = nil;
  CkCrypt2_put_UncommonOptions: TCkCrypt2_put_UncommonOptions = nil;
  CkCrypt2_AddEncryptCert: TCkCrypt2_AddEncryptCert = nil;
  CkCrypt2_AddPfxSourceFile: TCkCrypt2_AddPfxSourceFile = nil;
  CkCrypt2_CkDecryptFile: TCkCrypt2_CkDecryptFile = nil;
  CkCrypt2_CkEncryptFile: TCkCrypt2_CkEncryptFile = nil;
  CkCrypt2_ClearEncryptCerts: TCkCrypt2_ClearEncryptCerts = nil;
  CkCrypt2_CrcFile: TCkCrypt2_CrcFile = nil;
  CkCrypt2_CreateP7M: TCkCrypt2_CreateP7M = nil;
  CkCrypt2_CreateP7S: TCkCrypt2_CreateP7S = nil;
  CkCrypt2_DecodeString: TCkCrypt2_DecodeString = nil;
  CkCrypt2_DecryptEncoded: TCkCrypt2_DecryptEncoded = nil;
  CkCrypt2_DecryptStringENC: TCkCrypt2_DecryptStringENC = nil;
  CkCrypt2_EncodeBytes: TCkCrypt2_EncodeBytes = nil;
  CkCrypt2_EncodeString: TCkCrypt2_EncodeString = nil;
  CkCrypt2_EncryptEncoded: TCkCrypt2_EncryptEncoded = nil;
  CkCrypt2_EncryptStringENC: TCkCrypt2_EncryptStringENC = nil;
  CkCrypt2_GenRandomBytesENC: TCkCrypt2_GenRandomBytesENC = nil;
  CkCrypt2_GenerateUuid: TCkCrypt2_GenerateUuid = nil;
  CkCrypt2_GetEncodedAuthTag: TCkCrypt2_GetEncodedAuthTag = nil;
  CkCrypt2_GetEncodedIV: TCkCrypt2_GetEncodedIV = nil;
  CkCrypt2_GetSignatureSigningTimeStr: TCkCrypt2_GetSignatureSigningTimeStr = nil;
  CkCrypt2_HasSignatureSigningTime: TCkCrypt2_HasSignatureSigningTime = nil;
  CkCrypt2_HashBeginString: TCkCrypt2_HashBeginString = nil;
  CkCrypt2_HashFileENC: TCkCrypt2_HashFileENC = nil;
  CkCrypt2_HashFinalENC: TCkCrypt2_HashFinalENC = nil;
  CkCrypt2_HashMoreString: TCkCrypt2_HashMoreString = nil;
  CkCrypt2_HashStringENC: TCkCrypt2_HashStringENC = nil;
  CkCrypt2_MacStringENC: TCkCrypt2_MacStringENC = nil;
  CkCrypt2_MySqlAesDecrypt: TCkCrypt2_MySqlAesDecrypt = nil;
  CkCrypt2_MySqlAesEncrypt: TCkCrypt2_MySqlAesEncrypt = nil;
  CkCrypt2_OpaqueSignStringENC: TCkCrypt2_OpaqueSignStringENC = nil;
  CkCrypt2_OpaqueVerifyStringENC: TCkCrypt2_OpaqueVerifyStringENC = nil;
  CkCrypt2_Pbkdf1: TCkCrypt2_Pbkdf1 = nil;
  CkCrypt2_Pbkdf2: TCkCrypt2_Pbkdf2 = nil;
  CkCrypt2_RandomizeIV: TCkCrypt2_RandomizeIV = nil;
  CkCrypt2_ReEncode: TCkCrypt2_ReEncode = nil;
  CkCrypt2_SetDecryptCert: TCkCrypt2_SetDecryptCert = nil;
  CkCrypt2_SetDecryptCert2: TCkCrypt2_SetDecryptCert2 = nil;
  CkCrypt2_SetEncodedAad: TCkCrypt2_SetEncodedAad = nil;
  CkCrypt2_SetEncodedAuthTag: TCkCrypt2_SetEncodedAuthTag = nil;
  CkCrypt2_SetEncodedIV: TCkCrypt2_SetEncodedIV = nil;
  CkCrypt2_SetEncodedKey: TCkCrypt2_SetEncodedKey = nil;
  CkCrypt2_SetEncodedSalt: TCkCrypt2_SetEncodedSalt = nil;
  CkCrypt2_SetEncryptCert: TCkCrypt2_SetEncryptCert = nil;
  CkCrypt2_SetIV: TCkCrypt2_SetIV = nil;
  CkCrypt2_SetMacKeyEncoded: TCkCrypt2_SetMacKeyEncoded = nil;
  CkCrypt2_SetMacKeyString: TCkCrypt2_SetMacKeyString = nil;
  CkCrypt2_SetSecretKey: TCkCrypt2_SetSecretKey = nil;
  CkCrypt2_SetSigningCert: TCkCrypt2_SetSigningCert = nil;
  CkCrypt2_SetSigningCert2: TCkCrypt2_SetSigningCert2 = nil;
  CkCrypt2_SetVerifyCert: TCkCrypt2_SetVerifyCert = nil;
  CkCrypt2_SignStringENC: TCkCrypt2_SignStringENC = nil;
  CkCrypt2_UseCertVault: TCkCrypt2_UseCertVault = nil;
  CkCrypt2_VerifyP7M: TCkCrypt2_VerifyP7M = nil;
  CkCrypt2_VerifyP7S: TCkCrypt2_VerifyP7S = nil;
  CkCrypt2_VerifyStringENC: TCkCrypt2_VerifyStringENC = nil;
  CkCrypt2_BCryptHash: TCkCrypt2_BCryptHash = nil;
  CkCrypt2_BCryptVerify: TCkCrypt2_BCryptVerify = nil;
  CkCrypt2_AesKeyWrap: TCkCrypt2_AesKeyWrap = nil;
  CkCrypt2_AesKeyUnwrap: TCkCrypt2_AesKeyUnwrap = nil;
  CkCrypt2_HashBdENC: TCkCrypt2_HashBdENC = nil;
  CkCrypt2_MacBdENC: TCkCrypt2_MacBdENC = nil;
  CkCrypt2_EncryptBd: TCkCrypt2_EncryptBd = nil;
  CkCrypt2_DecryptBd: TCkCrypt2_DecryptBd = nil;
  CkCrypt2_EncryptSb: TCkCrypt2_EncryptSb = nil;
  CkCrypt2_DecryptSb: TCkCrypt2_DecryptSb = nil;
  CkCrypt2_SignBdENC: TCkCrypt2_SignBdENC = nil;
  CkCrypt2_SignSbENC: TCkCrypt2_SignSbENC = nil;
  CkCrypt2_OpaqueSignBd: TCkCrypt2_OpaqueSignBd = nil;
  CkCrypt2_OpaqueVerifyBd: TCkCrypt2_OpaqueVerifyBd = nil;
  CkCrypt2_VerifyBdENC: TCkCrypt2_VerifyBdENC = nil;
  CkCrypt2_VerifySbENC: TCkCrypt2_VerifySbENC = nil;
  CkCrypt2_EncryptSecureENC: TCkCrypt2_EncryptSecureENC = nil;
  CkCrypt2_DecryptSecureENC: TCkCrypt2_DecryptSecureENC = nil;
  CkCrypt2_GetSignedAttributes: TCkCrypt2_GetSignedAttributes = nil;
  CkCrypt2_Hotp: TCkCrypt2_Hotp = nil;
  CkCrypt2_EncodeInt: TCkCrypt2_EncodeInt = nil;
  CkCrypt2_Totp: TCkCrypt2_Totp = nil;
  CkCrypt2_SetTsaHttpObj: TCkCrypt2_SetTsaHttpObj = nil;
  CkCrypt2_HashBeginBytes2: TCkCrypt2_HashBeginBytes2 = nil;
  CkCrypt2_HashMoreBytes2: TCkCrypt2_HashMoreBytes2 = nil;
  CkCrypt2_AddSigningCert: TCkCrypt2_AddSigningCert = nil;
  CkCrypt2_ClearSigningCerts: TCkCrypt2_ClearSigningCerts = nil;
  CkCrypt2_CoSign: TCkCrypt2_CoSign = nil;
  CkCrypt2_SignHashENC: TCkCrypt2_SignHashENC = nil;
  CkCrypt2_XtsSetEncodedTweakValue: TCkCrypt2_XtsSetEncodedTweakValue = nil;
  CkCrypt2_XtsSetDataUnitNumber: TCkCrypt2_XtsSetDataUnitNumber = nil;
  CkCrypt2_XtsSetEncodedTweakKey: TCkCrypt2_XtsSetEncodedTweakKey = nil;
  CkCrypt2_AesKeyWrapWithPadding: TCkCrypt2_AesKeyWrapWithPadding = nil;
  CkCrypt2_AesKeyUnwrapWithPadding: TCkCrypt2_AesKeyUnwrapWithPadding = nil;
  CkCrypt2_GetLastJsonData: TCkCrypt2_GetLastJsonData = nil;
  CkCrypt2_LastDecryptCert: TCkCrypt2_LastDecryptCert = nil;
  CkCrypt2_LastSignerCert: TCkCrypt2_LastSignerCert = nil;
  CkCrypt2_AddPfxSourceBd: TCkCrypt2_AddPfxSourceBd = nil;
  CkCrypt2_CrcBd: TCkCrypt2_CrcBd = nil;
  CkCrypt2_HashChunkBd: TCkCrypt2_HashChunkBd = nil;
  CkCrypt2_Argon2DeriveKey: TCkCrypt2_Argon2DeriveKey = nil;
  CkCrypt2_Argon2HashPassword: TCkCrypt2_Argon2HashPassword = nil;
  CkCrypt2_Argon2VerifyPassword: TCkCrypt2_Argon2VerifyPassword = nil;

constructor TCrypt2.Create;
begin
  inherited Create;
  FHandle := CkCrypt2_Create();
end;

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

{ ---- Event callback thunks ---- }
{ Standalone cdecl functions registered with the C bridge.  The bridge
  passes back the userData pointer, which carries the Pascal object
  instance.  A non-zero return value aborts the running method. }

function TCrypt2_AbortCheckThunk(userData: Pointer): Integer; cdecl;
var
  obj: TCrypt2;
begin
  Result := 0;
  obj := TCrypt2(userData);
  if Assigned(obj) and Assigned(obj.FOnAbortCheck) then
    if obj.FOnAbortCheck(obj) then Result := 1;
end;

function TCrypt2_PercentDoneThunk(pctDone: Integer; userData: Pointer): Integer; cdecl;
var
  obj: TCrypt2;
begin
  Result := 0;
  obj := TCrypt2(userData);
  if Assigned(obj) and Assigned(obj.FOnPercentDone) then
    if obj.FOnPercentDone(obj, pctDone) then Result := 1;
end;

procedure TCrypt2_ProgressInfoThunk(name: PAnsiChar; value: PAnsiChar; userData: Pointer); cdecl;
var
  obj: TCrypt2;
begin
  obj := TCrypt2(userData);
  if Assigned(obj) and Assigned(obj.FOnProgressInfo) then
    obj.FOnProgressInfo(obj, CkToStr(name), CkToStr(value));
end;

procedure TCrypt2.SetOnAbortCheck(AValue: TChilkatAbortCheckEvent);
begin
  FOnAbortCheck := AValue;
  if Assigned(AValue) then
    CkCrypt2_SetAbortCheckCallback(FHandle, @TCrypt2_AbortCheckThunk, Self)
  else
    CkCrypt2_SetAbortCheckCallback(FHandle, nil, nil);
end;

procedure TCrypt2.SetOnPercentDone(AValue: TChilkatPercentDoneEvent);
begin
  FOnPercentDone := AValue;
  if Assigned(AValue) then
    CkCrypt2_SetPercentDoneCallback(FHandle, @TCrypt2_PercentDoneThunk, Self)
  else
    CkCrypt2_SetPercentDoneCallback(FHandle, nil, nil);
end;

procedure TCrypt2.SetOnProgressInfo(AValue: TChilkatProgressInfoEvent);
begin
  FOnProgressInfo := AValue;
  if Assigned(AValue) then
    CkCrypt2_SetProgressInfoCallback(FHandle, @TCrypt2_ProgressInfoThunk, Self)
  else
    CkCrypt2_SetProgressInfoCallback(FHandle, nil, nil);
end;

function TCrypt2.GetLastErrorHtml: string;
begin
  Result := CkToStr(CkCrypt2_get_LastErrorHtml(FHandle));
end;

function TCrypt2.GetLastErrorText: string;
begin
  Result := CkToStr(CkCrypt2_get_LastErrorText(FHandle));
end;

function TCrypt2.GetLastErrorXml: string;
begin
  Result := CkToStr(CkCrypt2_get_LastErrorXml(FHandle));
end;

function TCrypt2.GetVersion: string;
begin
  Result := CkToStr(CkCrypt2_get_Version(FHandle));
end;

function TCrypt2.GetDebugLogFilePath: string;
begin
  Result := CkToStr(CkCrypt2_get_DebugLogFilePath(FHandle));
end;

procedure TCrypt2.SetDebugLogFilePath(AValue: string);
begin
  CkCrypt2_put_DebugLogFilePath(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetVerboseLogging: Boolean;
begin
  Result := Boolean(CkCrypt2_get_VerboseLogging(FHandle));
end;

procedure TCrypt2.SetVerboseLogging(AValue: Boolean);
begin
  CkCrypt2_put_VerboseLogging(FHandle, LongBool(AValue));
end;

function TCrypt2.GetLastMethodSuccess: Boolean;
begin
  Result := Boolean(CkCrypt2_get_LastMethodSuccess(FHandle));
end;

procedure TCrypt2.SetLastMethodSuccess(AValue: Boolean);
begin
  CkCrypt2_put_LastMethodSuccess(FHandle, LongBool(AValue));
end;

function TCrypt2.GetAbortCurrent: Boolean;
begin
  Result := Boolean(CkCrypt2_get_AbortCurrent(FHandle));
end;

procedure TCrypt2.SetAbortCurrent(AValue: Boolean);
begin
  CkCrypt2_put_AbortCurrent(FHandle, LongBool(AValue));
end;

function TCrypt2.GetBlockSize: Integer;
begin
  Result := CkCrypt2_get_BlockSize(FHandle);
end;

function TCrypt2.GetCadesEnabled: Boolean;
begin
  Result := Boolean(CkCrypt2_get_CadesEnabled(FHandle));
end;

procedure TCrypt2.SetCadesEnabled(AValue: Boolean);
begin
  CkCrypt2_put_CadesEnabled(FHandle, LongBool(AValue));
end;

function TCrypt2.GetCadesSigPolicyHash: string;
begin
  Result := CkToStr(CkCrypt2_get_CadesSigPolicyHash(FHandle));
end;

procedure TCrypt2.SetCadesSigPolicyHash(AValue: string);
begin
  CkCrypt2_put_CadesSigPolicyHash(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetCadesSigPolicyId: string;
begin
  Result := CkToStr(CkCrypt2_get_CadesSigPolicyId(FHandle));
end;

procedure TCrypt2.SetCadesSigPolicyId(AValue: string);
begin
  CkCrypt2_put_CadesSigPolicyId(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetCadesSigPolicyUri: string;
begin
  Result := CkToStr(CkCrypt2_get_CadesSigPolicyUri(FHandle));
end;

procedure TCrypt2.SetCadesSigPolicyUri(AValue: string);
begin
  CkCrypt2_put_CadesSigPolicyUri(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetCharset: string;
begin
  Result := CkToStr(CkCrypt2_get_Charset(FHandle));
end;

procedure TCrypt2.SetCharset(AValue: string);
begin
  CkCrypt2_put_Charset(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetCipherMode: string;
begin
  Result := CkToStr(CkCrypt2_get_CipherMode(FHandle));
end;

procedure TCrypt2.SetCipherMode(AValue: string);
begin
  CkCrypt2_put_CipherMode(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetCryptAlgorithm: string;
begin
  Result := CkToStr(CkCrypt2_get_CryptAlgorithm(FHandle));
end;

procedure TCrypt2.SetCryptAlgorithm(AValue: string);
begin
  CkCrypt2_put_CryptAlgorithm(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetEncodingMode: string;
begin
  Result := CkToStr(CkCrypt2_get_EncodingMode(FHandle));
end;

procedure TCrypt2.SetEncodingMode(AValue: string);
begin
  CkCrypt2_put_EncodingMode(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetFirstChunk: Boolean;
begin
  Result := Boolean(CkCrypt2_get_FirstChunk(FHandle));
end;

procedure TCrypt2.SetFirstChunk(AValue: Boolean);
begin
  CkCrypt2_put_FirstChunk(FHandle, LongBool(AValue));
end;

function TCrypt2.GetHashAlgorithm: string;
begin
  Result := CkToStr(CkCrypt2_get_HashAlgorithm(FHandle));
end;

procedure TCrypt2.SetHashAlgorithm(AValue: string);
begin
  CkCrypt2_put_HashAlgorithm(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetHavalRounds: Integer;
begin
  Result := CkCrypt2_get_HavalRounds(FHandle);
end;

procedure TCrypt2.SetHavalRounds(AValue: Integer);
begin
  CkCrypt2_put_HavalRounds(FHandle, AValue);
end;

function TCrypt2.GetHeartbeatMs: Integer;
begin
  Result := CkCrypt2_get_HeartbeatMs(FHandle);
end;

procedure TCrypt2.SetHeartbeatMs(AValue: Integer);
begin
  CkCrypt2_put_HeartbeatMs(FHandle, AValue);
end;

function TCrypt2.GetIV: TBytes;
begin
  Result := CkCrypt2_get_IV(FHandle);
end;

procedure TCrypt2.SetIV(AValue: TBytes);
begin
  CkCrypt2_put_IV(FHandle, AValue);
end;

function TCrypt2.GetIncludeCertChain: Boolean;
begin
  Result := Boolean(CkCrypt2_get_IncludeCertChain(FHandle));
end;

procedure TCrypt2.SetIncludeCertChain(AValue: Boolean);
begin
  CkCrypt2_put_IncludeCertChain(FHandle, LongBool(AValue));
end;

function TCrypt2.GetInitialCount: Integer;
begin
  Result := CkCrypt2_get_InitialCount(FHandle);
end;

procedure TCrypt2.SetInitialCount(AValue: Integer);
begin
  CkCrypt2_put_InitialCount(FHandle, AValue);
end;

function TCrypt2.GetIterationCount: Integer;
begin
  Result := CkCrypt2_get_IterationCount(FHandle);
end;

procedure TCrypt2.SetIterationCount(AValue: Integer);
begin
  CkCrypt2_put_IterationCount(FHandle, AValue);
end;

function TCrypt2.GetKeyLength: Integer;
begin
  Result := CkCrypt2_get_KeyLength(FHandle);
end;

procedure TCrypt2.SetKeyLength(AValue: Integer);
begin
  CkCrypt2_put_KeyLength(FHandle, AValue);
end;

function TCrypt2.GetLastChunk: Boolean;
begin
  Result := Boolean(CkCrypt2_get_LastChunk(FHandle));
end;

procedure TCrypt2.SetLastChunk(AValue: Boolean);
begin
  CkCrypt2_put_LastChunk(FHandle, LongBool(AValue));
end;

function TCrypt2.GetMacAlgorithm: string;
begin
  Result := CkToStr(CkCrypt2_get_MacAlgorithm(FHandle));
end;

procedure TCrypt2.SetMacAlgorithm(AValue: string);
begin
  CkCrypt2_put_MacAlgorithm(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetNumSignerCerts: Integer;
begin
  Result := CkCrypt2_get_NumSignerCerts(FHandle);
end;

function TCrypt2.GetPaddingScheme: Integer;
begin
  Result := CkCrypt2_get_PaddingScheme(FHandle);
end;

procedure TCrypt2.SetPaddingScheme(AValue: Integer);
begin
  CkCrypt2_put_PaddingScheme(FHandle, AValue);
end;

function TCrypt2.GetPbesAlgorithm: string;
begin
  Result := CkToStr(CkCrypt2_get_PbesAlgorithm(FHandle));
end;

procedure TCrypt2.SetPbesAlgorithm(AValue: string);
begin
  CkCrypt2_put_PbesAlgorithm(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetPbesPassword: string;
begin
  Result := CkToStr(CkCrypt2_get_PbesPassword(FHandle));
end;

procedure TCrypt2.SetPbesPassword(AValue: string);
begin
  CkCrypt2_put_PbesPassword(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetPkcs7CryptAlg: string;
begin
  Result := CkToStr(CkCrypt2_get_Pkcs7CryptAlg(FHandle));
end;

procedure TCrypt2.SetPkcs7CryptAlg(AValue: string);
begin
  CkCrypt2_put_Pkcs7CryptAlg(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetRc2EffectiveKeyLength: Integer;
begin
  Result := CkCrypt2_get_Rc2EffectiveKeyLength(FHandle);
end;

procedure TCrypt2.SetRc2EffectiveKeyLength(AValue: Integer);
begin
  CkCrypt2_put_Rc2EffectiveKeyLength(FHandle, AValue);
end;

function TCrypt2.GetSalt: TBytes;
begin
  Result := CkCrypt2_get_Salt(FHandle);
end;

procedure TCrypt2.SetSalt(AValue: TBytes);
begin
  CkCrypt2_put_Salt(FHandle, AValue);
end;

function TCrypt2.GetSecretKey: TBytes;
begin
  Result := CkCrypt2_get_SecretKey(FHandle);
end;

procedure TCrypt2.SetSecretKey(AValue: TBytes);
begin
  CkCrypt2_put_SecretKey(FHandle, AValue);
end;

function TCrypt2.GetUuFilename: string;
begin
  Result := CkToStr(CkCrypt2_get_UuFilename(FHandle));
end;

procedure TCrypt2.SetUuFilename(AValue: string);
begin
  CkCrypt2_put_UuFilename(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetUuMode: string;
begin
  Result := CkToStr(CkCrypt2_get_UuMode(FHandle));
end;

procedure TCrypt2.SetUuMode(AValue: string);
begin
  CkCrypt2_put_UuMode(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetBCryptWorkFactor: Integer;
begin
  Result := CkCrypt2_get_BCryptWorkFactor(FHandle);
end;

procedure TCrypt2.SetBCryptWorkFactor(AValue: Integer);
begin
  CkCrypt2_put_BCryptWorkFactor(FHandle, AValue);
end;

function TCrypt2.GetSigningAlg: string;
begin
  Result := CkToStr(CkCrypt2_get_SigningAlg(FHandle));
end;

procedure TCrypt2.SetSigningAlg(AValue: string);
begin
  CkCrypt2_put_SigningAlg(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetOaepHash: string;
begin
  Result := CkToStr(CkCrypt2_get_OaepHash(FHandle));
end;

procedure TCrypt2.SetOaepHash(AValue: string);
begin
  CkCrypt2_put_OaepHash(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetOaepPadding: Boolean;
begin
  Result := Boolean(CkCrypt2_get_OaepPadding(FHandle));
end;

procedure TCrypt2.SetOaepPadding(AValue: Boolean);
begin
  CkCrypt2_put_OaepPadding(FHandle, LongBool(AValue));
end;

function TCrypt2.GetOaepMgfHash: string;
begin
  Result := CkToStr(CkCrypt2_get_OaepMgfHash(FHandle));
end;

procedure TCrypt2.SetOaepMgfHash(AValue: string);
begin
  CkCrypt2_put_OaepMgfHash(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetSigningAttributes: string;
begin
  Result := CkToStr(CkCrypt2_get_SigningAttributes(FHandle));
end;

procedure TCrypt2.SetSigningAttributes(AValue: string);
begin
  CkCrypt2_put_SigningAttributes(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetCmsOptions: string;
begin
  Result := CkToStr(CkCrypt2_get_CmsOptions(FHandle));
end;

procedure TCrypt2.SetCmsOptions(AValue: string);
begin
  CkCrypt2_put_CmsOptions(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TCrypt2.GetUncommonOptions: string;
begin
  Result := CkToStr(CkCrypt2_get_UncommonOptions(FHandle));
end;

procedure TCrypt2.SetUncommonOptions(AValue: string);
begin
  CkCrypt2_put_UncommonOptions(FHandle, PAnsiChar(StrToCk(AValue)));
end;

procedure TCrypt2.AddEncryptCert(cert: TChilkatBase);
begin
  CkCrypt2_AddEncryptCert(FHandle, cert.Handle);
end;

function TCrypt2.AddPfxSourceFile(const pfxFilePath: string; const pfxPassword: string): Boolean;
begin
  Result := Boolean(CkCrypt2_AddPfxSourceFile(FHandle, PAnsiChar(StrToCk(pfxFilePath)), PAnsiChar(StrToCk(pfxPassword))));
end;

function TCrypt2.CkDecryptFile(const srcFile: string; const destFile: string): Boolean;
begin
  Result := Boolean(CkCrypt2_CkDecryptFile(FHandle, PAnsiChar(StrToCk(srcFile)), PAnsiChar(StrToCk(destFile))));
end;

function TCrypt2.CkEncryptFile(const srcFile: string; const destFile: string): Boolean;
begin
  Result := Boolean(CkCrypt2_CkEncryptFile(FHandle, PAnsiChar(StrToCk(srcFile)), PAnsiChar(StrToCk(destFile))));
end;

procedure TCrypt2.ClearEncryptCerts;
begin
  CkCrypt2_ClearEncryptCerts(FHandle);
end;

function TCrypt2.CrcFile(const crcAlg: string; const path: string): LongWord;
begin
  Result := CkCrypt2_CrcFile(FHandle, PAnsiChar(StrToCk(crcAlg)), PAnsiChar(StrToCk(path)));
end;

function TCrypt2.CreateP7M(const inFilename: string; const p7mPath: string): Boolean;
begin
  Result := Boolean(CkCrypt2_CreateP7M(FHandle, PAnsiChar(StrToCk(inFilename)), PAnsiChar(StrToCk(p7mPath))));
end;

function TCrypt2.CreateP7S(const inFilename: string; const p7sPath: string): Boolean;
begin
  Result := Boolean(CkCrypt2_CreateP7S(FHandle, PAnsiChar(StrToCk(inFilename)), PAnsiChar(StrToCk(p7sPath))));
end;

function TCrypt2.DecodeString(const inStr: string; const charset: string; const encoding: string): string;
begin
  Result := CkToStr(CkCrypt2_DecodeString(FHandle, PAnsiChar(StrToCk(inStr)), PAnsiChar(StrToCk(charset)), PAnsiChar(StrToCk(encoding))));
end;

function TCrypt2.DecryptEncoded(const encodedEncryptedData: string): string;
begin
  Result := CkToStr(CkCrypt2_DecryptEncoded(FHandle, PAnsiChar(StrToCk(encodedEncryptedData))));
end;

function TCrypt2.DecryptStringENC(const str: string): string;
begin
  Result := CkToStr(CkCrypt2_DecryptStringENC(FHandle, PAnsiChar(StrToCk(str))));
end;

function TCrypt2.EncodeBytes(pByteData: Pointer; szByteData: LongWord; const encoding: string): string;
begin
  Result := CkToStr(CkCrypt2_EncodeBytes(FHandle, pByteData, szByteData, PAnsiChar(StrToCk(encoding))));
end;

function TCrypt2.EncodeString(const strToEncode: string; const charsetName: string; const toEncodingName: string): string;
begin
  Result := CkToStr(CkCrypt2_EncodeString(FHandle, PAnsiChar(StrToCk(strToEncode)), PAnsiChar(StrToCk(charsetName)), PAnsiChar(StrToCk(toEncodingName))));
end;

function TCrypt2.EncryptEncoded(const str: string): string;
begin
  Result := CkToStr(CkCrypt2_EncryptEncoded(FHandle, PAnsiChar(StrToCk(str))));
end;

function TCrypt2.EncryptStringENC(const str: string): string;
begin
  Result := CkToStr(CkCrypt2_EncryptStringENC(FHandle, PAnsiChar(StrToCk(str))));
end;

function TCrypt2.GenRandomBytesENC(numBytes: Integer): string;
begin
  Result := CkToStr(CkCrypt2_GenRandomBytesENC(FHandle, numBytes));
end;

function TCrypt2.GenerateUuid: string;
begin
  Result := CkToStr(CkCrypt2_GenerateUuid(FHandle));
end;

function TCrypt2.GetEncodedAuthTag(const encoding: string): string;
begin
  Result := CkToStr(CkCrypt2_GetEncodedAuthTag(FHandle, PAnsiChar(StrToCk(encoding))));
end;

function TCrypt2.GetEncodedIV(const encoding: string): string;
begin
  Result := CkToStr(CkCrypt2_GetEncodedIV(FHandle, PAnsiChar(StrToCk(encoding))));
end;

function TCrypt2.GetSignatureSigningTimeStr(index: Integer): string;
begin
  Result := CkToStr(CkCrypt2_GetSignatureSigningTimeStr(FHandle, index));
end;

function TCrypt2.HasSignatureSigningTime(index: Integer): Boolean;
begin
  Result := Boolean(CkCrypt2_HasSignatureSigningTime(FHandle, index));
end;

function TCrypt2.HashBeginString(const strData: string): Boolean;
begin
  Result := Boolean(CkCrypt2_HashBeginString(FHandle, PAnsiChar(StrToCk(strData))));
end;

function TCrypt2.HashFileENC(const path: string): string;
begin
  Result := CkToStr(CkCrypt2_HashFileENC(FHandle, PAnsiChar(StrToCk(path))));
end;

function TCrypt2.HashFinalENC: string;
begin
  Result := CkToStr(CkCrypt2_HashFinalENC(FHandle));
end;

function TCrypt2.HashMoreString(const strData: string): Boolean;
begin
  Result := Boolean(CkCrypt2_HashMoreString(FHandle, PAnsiChar(StrToCk(strData))));
end;

function TCrypt2.HashStringENC(const str: string): string;
begin
  Result := CkToStr(CkCrypt2_HashStringENC(FHandle, PAnsiChar(StrToCk(str))));
end;

function TCrypt2.MacStringENC(const inText: string): string;
begin
  Result := CkToStr(CkCrypt2_MacStringENC(FHandle, PAnsiChar(StrToCk(inText))));
end;

function TCrypt2.MySqlAesDecrypt(const strEncryptedHex: string; const strPassword: string): string;
begin
  Result := CkToStr(CkCrypt2_MySqlAesDecrypt(FHandle, PAnsiChar(StrToCk(strEncryptedHex)), PAnsiChar(StrToCk(strPassword))));
end;

function TCrypt2.MySqlAesEncrypt(const strData: string; const strPassword: string): string;
begin
  Result := CkToStr(CkCrypt2_MySqlAesEncrypt(FHandle, PAnsiChar(StrToCk(strData)), PAnsiChar(StrToCk(strPassword))));
end;

function TCrypt2.OpaqueSignStringENC(const str: string): string;
begin
  Result := CkToStr(CkCrypt2_OpaqueSignStringENC(FHandle, PAnsiChar(StrToCk(str))));
end;

function TCrypt2.OpaqueVerifyStringENC(const p7m: string): string;
begin
  Result := CkToStr(CkCrypt2_OpaqueVerifyStringENC(FHandle, PAnsiChar(StrToCk(p7m))));
end;

function TCrypt2.Pbkdf1(const password: string; const charset: string; const hashAlg: string; const salt: string; iterationCount: Integer; outputKeyBitLen: Integer; const encoding: string): string;
begin
  Result := CkToStr(CkCrypt2_Pbkdf1(FHandle, PAnsiChar(StrToCk(password)), PAnsiChar(StrToCk(charset)), PAnsiChar(StrToCk(hashAlg)), PAnsiChar(StrToCk(salt)), iterationCount, outputKeyBitLen, PAnsiChar(StrToCk(encoding))));
end;

function TCrypt2.Pbkdf2(const password: string; const charset: string; const hashAlg: string; const salt: string; iterationCount: Integer; outputKeyBitLen: Integer; const encoding: string): string;
begin
  Result := CkToStr(CkCrypt2_Pbkdf2(FHandle, PAnsiChar(StrToCk(password)), PAnsiChar(StrToCk(charset)), PAnsiChar(StrToCk(hashAlg)), PAnsiChar(StrToCk(salt)), iterationCount, outputKeyBitLen, PAnsiChar(StrToCk(encoding))));
end;

procedure TCrypt2.RandomizeIV;
begin
  CkCrypt2_RandomizeIV(FHandle);
end;

function TCrypt2.ReEncode(const encodedData: string; const fromEncoding: string; const toEncoding: string): string;
begin
  Result := CkToStr(CkCrypt2_ReEncode(FHandle, PAnsiChar(StrToCk(encodedData)), PAnsiChar(StrToCk(fromEncoding)), PAnsiChar(StrToCk(toEncoding))));
end;

function TCrypt2.SetDecryptCert(cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_SetDecryptCert(FHandle, cert.Handle));
end;

function TCrypt2.SetDecryptCert2(cert: TChilkatBase; key: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_SetDecryptCert2(FHandle, cert.Handle, key.Handle));
end;

function TCrypt2.SetEncodedAad(const aadStr: string; const encoding: string): Boolean;
begin
  Result := Boolean(CkCrypt2_SetEncodedAad(FHandle, PAnsiChar(StrToCk(aadStr)), PAnsiChar(StrToCk(encoding))));
end;

function TCrypt2.SetEncodedAuthTag(const authTagStr: string; const encoding: string): Boolean;
begin
  Result := Boolean(CkCrypt2_SetEncodedAuthTag(FHandle, PAnsiChar(StrToCk(authTagStr)), PAnsiChar(StrToCk(encoding))));
end;

procedure TCrypt2.SetEncodedIV(const ivStr: string; const encoding: string);
begin
  CkCrypt2_SetEncodedIV(FHandle, PAnsiChar(StrToCk(ivStr)), PAnsiChar(StrToCk(encoding)));
end;

procedure TCrypt2.SetEncodedKey(const keyStr: string; const encoding: string);
begin
  CkCrypt2_SetEncodedKey(FHandle, PAnsiChar(StrToCk(keyStr)), PAnsiChar(StrToCk(encoding)));
end;

procedure TCrypt2.SetEncodedSalt(const saltStr: string; const encoding: string);
begin
  CkCrypt2_SetEncodedSalt(FHandle, PAnsiChar(StrToCk(saltStr)), PAnsiChar(StrToCk(encoding)));
end;

function TCrypt2.SetEncryptCert(cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_SetEncryptCert(FHandle, cert.Handle));
end;

procedure TCrypt2.SetIV(pByteData: Pointer; szByteData: LongWord);
begin
  CkCrypt2_SetIV(FHandle, pByteData, szByteData);
end;

function TCrypt2.SetMacKeyEncoded(const key: string; const encoding: string): Boolean;
begin
  Result := Boolean(CkCrypt2_SetMacKeyEncoded(FHandle, PAnsiChar(StrToCk(key)), PAnsiChar(StrToCk(encoding))));
end;

function TCrypt2.SetMacKeyString(const key: string): Boolean;
begin
  Result := Boolean(CkCrypt2_SetMacKeyString(FHandle, PAnsiChar(StrToCk(key))));
end;

procedure TCrypt2.SetSecretKey(pByteData: Pointer; szByteData: LongWord);
begin
  CkCrypt2_SetSecretKey(FHandle, pByteData, szByteData);
end;

function TCrypt2.SetSigningCert(cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_SetSigningCert(FHandle, cert.Handle));
end;

function TCrypt2.SetSigningCert2(cert: TChilkatBase; privateKey: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_SetSigningCert2(FHandle, cert.Handle, privateKey.Handle));
end;

function TCrypt2.SetVerifyCert(cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_SetVerifyCert(FHandle, cert.Handle));
end;

function TCrypt2.SignStringENC(const str: string): string;
begin
  Result := CkToStr(CkCrypt2_SignStringENC(FHandle, PAnsiChar(StrToCk(str))));
end;

function TCrypt2.UseCertVault(vault: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_UseCertVault(FHandle, vault.Handle));
end;

function TCrypt2.VerifyP7M(const p7mPath: string; const destPath: string): Boolean;
begin
  Result := Boolean(CkCrypt2_VerifyP7M(FHandle, PAnsiChar(StrToCk(p7mPath)), PAnsiChar(StrToCk(destPath))));
end;

function TCrypt2.VerifyP7S(const originalDataPath: string; const p7sPath: string): Boolean;
begin
  Result := Boolean(CkCrypt2_VerifyP7S(FHandle, PAnsiChar(StrToCk(originalDataPath)), PAnsiChar(StrToCk(p7sPath))));
end;

function TCrypt2.VerifyStringENC(const str: string; const encodedSig: string): Boolean;
begin
  Result := Boolean(CkCrypt2_VerifyStringENC(FHandle, PAnsiChar(StrToCk(str)), PAnsiChar(StrToCk(encodedSig))));
end;

function TCrypt2.BCryptHash(const password: string): string;
begin
  Result := CkToStr(CkCrypt2_BCryptHash(FHandle, PAnsiChar(StrToCk(password))));
end;

function TCrypt2.BCryptVerify(const password: string; const bcryptHash: string): Boolean;
begin
  Result := Boolean(CkCrypt2_BCryptVerify(FHandle, PAnsiChar(StrToCk(password)), PAnsiChar(StrToCk(bcryptHash))));
end;

function TCrypt2.AesKeyWrap(const kek: string; const keyData: string; const encoding: string): string;
begin
  Result := CkToStr(CkCrypt2_AesKeyWrap(FHandle, PAnsiChar(StrToCk(kek)), PAnsiChar(StrToCk(keyData)), PAnsiChar(StrToCk(encoding))));
end;

function TCrypt2.AesKeyUnwrap(const kek: string; const wrappedKeyData: string; const encoding: string): string;
begin
  Result := CkToStr(CkCrypt2_AesKeyUnwrap(FHandle, PAnsiChar(StrToCk(kek)), PAnsiChar(StrToCk(wrappedKeyData)), PAnsiChar(StrToCk(encoding))));
end;

function TCrypt2.HashBdENC(bd: TChilkatBase): string;
begin
  Result := CkToStr(CkCrypt2_HashBdENC(FHandle, bd.Handle));
end;

function TCrypt2.MacBdENC(bd: TChilkatBase): string;
begin
  Result := CkToStr(CkCrypt2_MacBdENC(FHandle, bd.Handle));
end;

function TCrypt2.EncryptBd(bd: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_EncryptBd(FHandle, bd.Handle));
end;

function TCrypt2.DecryptBd(bd: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_DecryptBd(FHandle, bd.Handle));
end;

function TCrypt2.EncryptSb(sbIn: TChilkatBase; bdOut: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_EncryptSb(FHandle, sbIn.Handle, bdOut.Handle));
end;

function TCrypt2.DecryptSb(bdIn: TChilkatBase; sbOut: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_DecryptSb(FHandle, bdIn.Handle, sbOut.Handle));
end;

function TCrypt2.SignBdENC(dataToSign: TChilkatBase): string;
begin
  Result := CkToStr(CkCrypt2_SignBdENC(FHandle, dataToSign.Handle));
end;

function TCrypt2.SignSbENC(sb: TChilkatBase): string;
begin
  Result := CkToStr(CkCrypt2_SignSbENC(FHandle, sb.Handle));
end;

function TCrypt2.OpaqueSignBd(bd: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_OpaqueSignBd(FHandle, bd.Handle));
end;

function TCrypt2.OpaqueVerifyBd(bd: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_OpaqueVerifyBd(FHandle, bd.Handle));
end;

function TCrypt2.VerifyBdENC(data: TChilkatBase; const encodedSig: string): Boolean;
begin
  Result := Boolean(CkCrypt2_VerifyBdENC(FHandle, data.Handle, PAnsiChar(StrToCk(encodedSig))));
end;

function TCrypt2.VerifySbENC(sb: TChilkatBase; const encodedSig: string): Boolean;
begin
  Result := Boolean(CkCrypt2_VerifySbENC(FHandle, sb.Handle, PAnsiChar(StrToCk(encodedSig))));
end;

function TCrypt2.EncryptSecureENC(secureStr: TChilkatBase): string;
begin
  Result := CkToStr(CkCrypt2_EncryptSecureENC(FHandle, secureStr.Handle));
end;

function TCrypt2.DecryptSecureENC(const cipherText: string; secureStr: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_DecryptSecureENC(FHandle, PAnsiChar(StrToCk(cipherText)), secureStr.Handle));
end;

function TCrypt2.GetSignedAttributes(signerIndex: Integer; pkcs7Der: TChilkatBase; sbJson: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_GetSignedAttributes(FHandle, signerIndex, pkcs7Der.Handle, sbJson.Handle));
end;

function TCrypt2.Hotp(const secret: string; const secretEnc: string; const counterHex: string; numDigits: Integer; truncOffset: Integer; const hashAlg: string): string;
begin
  Result := CkToStr(CkCrypt2_Hotp(FHandle, PAnsiChar(StrToCk(secret)), PAnsiChar(StrToCk(secretEnc)), PAnsiChar(StrToCk(counterHex)), numDigits, truncOffset, PAnsiChar(StrToCk(hashAlg))));
end;

function TCrypt2.EncodeInt(value: Integer; numBytes: Integer; littleEndian: Boolean; const encoding: string): string;
begin
  Result := CkToStr(CkCrypt2_EncodeInt(FHandle, value, numBytes, LongBool(littleEndian), PAnsiChar(StrToCk(encoding))));
end;

function TCrypt2.Totp(const secret: string; const secretEnc: string; const t0: string; const tNow: string; tStep: Integer; numDigits: Integer; truncOffset: Integer; const hashAlg: string): string;
begin
  Result := CkToStr(CkCrypt2_Totp(FHandle, PAnsiChar(StrToCk(secret)), PAnsiChar(StrToCk(secretEnc)), PAnsiChar(StrToCk(t0)), PAnsiChar(StrToCk(tNow)), tStep, numDigits, truncOffset, PAnsiChar(StrToCk(hashAlg))));
end;

procedure TCrypt2.SetTsaHttpObj(http: TChilkatBase);
begin
  CkCrypt2_SetTsaHttpObj(FHandle, http.Handle);
end;

function TCrypt2.HashBeginBytes2(pByteData: Pointer; szByteData: LongWord): Boolean;
begin
  Result := Boolean(CkCrypt2_HashBeginBytes2(FHandle, pByteData, szByteData));
end;

function TCrypt2.HashMoreBytes2(pByteData: Pointer; szByteData: LongWord): Boolean;
begin
  Result := Boolean(CkCrypt2_HashMoreBytes2(FHandle, pByteData, szByteData));
end;

function TCrypt2.AddSigningCert(cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_AddSigningCert(FHandle, cert.Handle));
end;

procedure TCrypt2.ClearSigningCerts;
begin
  CkCrypt2_ClearSigningCerts(FHandle);
end;

function TCrypt2.CoSign(bdIn: TChilkatBase; cert: TChilkatBase; bdOut: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_CoSign(FHandle, bdIn.Handle, cert.Handle, bdOut.Handle));
end;

function TCrypt2.SignHashENC(const encodedHash: string; const hashAlg: string; const hashEncoding: string): string;
begin
  Result := CkToStr(CkCrypt2_SignHashENC(FHandle, PAnsiChar(StrToCk(encodedHash)), PAnsiChar(StrToCk(hashAlg)), PAnsiChar(StrToCk(hashEncoding))));
end;

procedure TCrypt2.XtsSetEncodedTweakValue(const tweak: string; const encoding: string);
begin
  CkCrypt2_XtsSetEncodedTweakValue(FHandle, PAnsiChar(StrToCk(tweak)), PAnsiChar(StrToCk(encoding)));
end;

procedure TCrypt2.XtsSetDataUnitNumber(loUint32: LongWord; hiUint32: LongWord);
begin
  CkCrypt2_XtsSetDataUnitNumber(FHandle, loUint32, hiUint32);
end;

procedure TCrypt2.XtsSetEncodedTweakKey(const key: string; const encoding: string);
begin
  CkCrypt2_XtsSetEncodedTweakKey(FHandle, PAnsiChar(StrToCk(key)), PAnsiChar(StrToCk(encoding)));
end;

function TCrypt2.AesKeyWrapWithPadding(const kek: string; const keyData: string; const encoding: string): string;
begin
  Result := CkToStr(CkCrypt2_AesKeyWrapWithPadding(FHandle, PAnsiChar(StrToCk(kek)), PAnsiChar(StrToCk(keyData)), PAnsiChar(StrToCk(encoding))));
end;

function TCrypt2.AesKeyUnwrapWithPadding(const kek: string; const wrappedKeyData: string; const encoding: string): string;
begin
  Result := CkToStr(CkCrypt2_AesKeyUnwrapWithPadding(FHandle, PAnsiChar(StrToCk(kek)), PAnsiChar(StrToCk(wrappedKeyData)), PAnsiChar(StrToCk(encoding))));
end;

procedure TCrypt2.GetLastJsonData(json: TChilkatBase);
begin
  CkCrypt2_GetLastJsonData(FHandle, json.Handle);
end;

function TCrypt2.LastDecryptCert(cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_LastDecryptCert(FHandle, cert.Handle));
end;

function TCrypt2.LastSignerCert(index: Integer; cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_LastSignerCert(FHandle, index, cert.Handle));
end;

function TCrypt2.AddPfxSourceBd(bd: TChilkatBase; const password: string): Boolean;
begin
  Result := Boolean(CkCrypt2_AddPfxSourceBd(FHandle, bd.Handle, PAnsiChar(StrToCk(password))));
end;

function TCrypt2.CrcBd(const crcAlg: string; bd: TChilkatBase): LongWord;
begin
  Result := CkCrypt2_CrcBd(FHandle, PAnsiChar(StrToCk(crcAlg)), bd.Handle);
end;

function TCrypt2.HashChunkBd(firstChunk: Boolean; bd: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_HashChunkBd(FHandle, LongBool(firstChunk), bd.Handle));
end;

function TCrypt2.Argon2DeriveKey(const password: string; const json: string; bdKey: TChilkatBase): Boolean;
begin
  Result := Boolean(CkCrypt2_Argon2DeriveKey(FHandle, PAnsiChar(StrToCk(password)), PAnsiChar(StrToCk(json)), bdKey.Handle));
end;

function TCrypt2.Argon2HashPassword(const password: string; const json: string): string;
begin
  Result := CkToStr(CkCrypt2_Argon2HashPassword(FHandle, PAnsiChar(StrToCk(password)), PAnsiChar(StrToCk(json))));
end;

function TCrypt2.Argon2VerifyPassword(const password: string; const json: string; const phcHash: string): Integer;
begin
  Result := CkCrypt2_Argon2VerifyPassword(FHandle, PAnsiChar(StrToCk(password)), PAnsiChar(StrToCk(json)), PAnsiChar(StrToCk(phcHash)));
end;

initialization
  Chilkat_GetProcedureAddress(CkCrypt2_Create,  'CkCrypt2_Create');
  Chilkat_GetProcedureAddress(CkCrypt2_Dispose, 'CkCrypt2_Dispose');
  Chilkat_GetProcedureAddress(CkCrypt2_SetAbortCheckCallback, 'CkCrypt2_SetAbortCheckCallback');
  Chilkat_GetProcedureAddress(CkCrypt2_SetPercentDoneCallback, 'CkCrypt2_SetPercentDoneCallback');
  Chilkat_GetProcedureAddress(CkCrypt2_SetProgressInfoCallback, 'CkCrypt2_SetProgressInfoCallback');
  Chilkat_GetProcedureAddress(CkCrypt2_get_LastErrorHtml, 'CkCrypt2_get_LastErrorHtml');
  Chilkat_GetProcedureAddress(CkCrypt2_get_LastErrorText, 'CkCrypt2_get_LastErrorText');
  Chilkat_GetProcedureAddress(CkCrypt2_get_LastErrorXml, 'CkCrypt2_get_LastErrorXml');
  Chilkat_GetProcedureAddress(CkCrypt2_get_Version, 'CkCrypt2_get_Version');
  Chilkat_GetProcedureAddress(CkCrypt2_get_DebugLogFilePath, 'CkCrypt2_get_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkCrypt2_put_DebugLogFilePath, 'CkCrypt2_put_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkCrypt2_get_VerboseLogging, 'CkCrypt2_get_VerboseLogging');
  Chilkat_GetProcedureAddress(CkCrypt2_put_VerboseLogging, 'CkCrypt2_put_VerboseLogging');
  Chilkat_GetProcedureAddress(CkCrypt2_get_LastMethodSuccess, 'CkCrypt2_get_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkCrypt2_put_LastMethodSuccess, 'CkCrypt2_put_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkCrypt2_get_AbortCurrent, 'CkCrypt2_get_AbortCurrent');
  Chilkat_GetProcedureAddress(CkCrypt2_put_AbortCurrent, 'CkCrypt2_put_AbortCurrent');
  Chilkat_GetProcedureAddress(CkCrypt2_get_BlockSize, 'CkCrypt2_get_BlockSize');
  Chilkat_GetProcedureAddress(CkCrypt2_get_CadesEnabled, 'CkCrypt2_get_CadesEnabled');
  Chilkat_GetProcedureAddress(CkCrypt2_put_CadesEnabled, 'CkCrypt2_put_CadesEnabled');
  Chilkat_GetProcedureAddress(CkCrypt2_get_CadesSigPolicyHash, 'CkCrypt2_get_CadesSigPolicyHash');
  Chilkat_GetProcedureAddress(CkCrypt2_put_CadesSigPolicyHash, 'CkCrypt2_put_CadesSigPolicyHash');
  Chilkat_GetProcedureAddress(CkCrypt2_get_CadesSigPolicyId, 'CkCrypt2_get_CadesSigPolicyId');
  Chilkat_GetProcedureAddress(CkCrypt2_put_CadesSigPolicyId, 'CkCrypt2_put_CadesSigPolicyId');
  Chilkat_GetProcedureAddress(CkCrypt2_get_CadesSigPolicyUri, 'CkCrypt2_get_CadesSigPolicyUri');
  Chilkat_GetProcedureAddress(CkCrypt2_put_CadesSigPolicyUri, 'CkCrypt2_put_CadesSigPolicyUri');
  Chilkat_GetProcedureAddress(CkCrypt2_get_Charset, 'CkCrypt2_get_Charset');
  Chilkat_GetProcedureAddress(CkCrypt2_put_Charset, 'CkCrypt2_put_Charset');
  Chilkat_GetProcedureAddress(CkCrypt2_get_CipherMode, 'CkCrypt2_get_CipherMode');
  Chilkat_GetProcedureAddress(CkCrypt2_put_CipherMode, 'CkCrypt2_put_CipherMode');
  Chilkat_GetProcedureAddress(CkCrypt2_get_CryptAlgorithm, 'CkCrypt2_get_CryptAlgorithm');
  Chilkat_GetProcedureAddress(CkCrypt2_put_CryptAlgorithm, 'CkCrypt2_put_CryptAlgorithm');
  Chilkat_GetProcedureAddress(CkCrypt2_get_EncodingMode, 'CkCrypt2_get_EncodingMode');
  Chilkat_GetProcedureAddress(CkCrypt2_put_EncodingMode, 'CkCrypt2_put_EncodingMode');
  Chilkat_GetProcedureAddress(CkCrypt2_get_FirstChunk, 'CkCrypt2_get_FirstChunk');
  Chilkat_GetProcedureAddress(CkCrypt2_put_FirstChunk, 'CkCrypt2_put_FirstChunk');
  Chilkat_GetProcedureAddress(CkCrypt2_get_HashAlgorithm, 'CkCrypt2_get_HashAlgorithm');
  Chilkat_GetProcedureAddress(CkCrypt2_put_HashAlgorithm, 'CkCrypt2_put_HashAlgorithm');
  Chilkat_GetProcedureAddress(CkCrypt2_get_HavalRounds, 'CkCrypt2_get_HavalRounds');
  Chilkat_GetProcedureAddress(CkCrypt2_put_HavalRounds, 'CkCrypt2_put_HavalRounds');
  Chilkat_GetProcedureAddress(CkCrypt2_get_HeartbeatMs, 'CkCrypt2_get_HeartbeatMs');
  Chilkat_GetProcedureAddress(CkCrypt2_put_HeartbeatMs, 'CkCrypt2_put_HeartbeatMs');
  Chilkat_GetProcedureAddress(CkCrypt2_get_IV, 'CkCrypt2_get_IV');
  Chilkat_GetProcedureAddress(CkCrypt2_put_IV, 'CkCrypt2_put_IV');
  Chilkat_GetProcedureAddress(CkCrypt2_get_IncludeCertChain, 'CkCrypt2_get_IncludeCertChain');
  Chilkat_GetProcedureAddress(CkCrypt2_put_IncludeCertChain, 'CkCrypt2_put_IncludeCertChain');
  Chilkat_GetProcedureAddress(CkCrypt2_get_InitialCount, 'CkCrypt2_get_InitialCount');
  Chilkat_GetProcedureAddress(CkCrypt2_put_InitialCount, 'CkCrypt2_put_InitialCount');
  Chilkat_GetProcedureAddress(CkCrypt2_get_IterationCount, 'CkCrypt2_get_IterationCount');
  Chilkat_GetProcedureAddress(CkCrypt2_put_IterationCount, 'CkCrypt2_put_IterationCount');
  Chilkat_GetProcedureAddress(CkCrypt2_get_KeyLength, 'CkCrypt2_get_KeyLength');
  Chilkat_GetProcedureAddress(CkCrypt2_put_KeyLength, 'CkCrypt2_put_KeyLength');
  Chilkat_GetProcedureAddress(CkCrypt2_get_LastChunk, 'CkCrypt2_get_LastChunk');
  Chilkat_GetProcedureAddress(CkCrypt2_put_LastChunk, 'CkCrypt2_put_LastChunk');
  Chilkat_GetProcedureAddress(CkCrypt2_get_MacAlgorithm, 'CkCrypt2_get_MacAlgorithm');
  Chilkat_GetProcedureAddress(CkCrypt2_put_MacAlgorithm, 'CkCrypt2_put_MacAlgorithm');
  Chilkat_GetProcedureAddress(CkCrypt2_get_NumSignerCerts, 'CkCrypt2_get_NumSignerCerts');
  Chilkat_GetProcedureAddress(CkCrypt2_get_PaddingScheme, 'CkCrypt2_get_PaddingScheme');
  Chilkat_GetProcedureAddress(CkCrypt2_put_PaddingScheme, 'CkCrypt2_put_PaddingScheme');
  Chilkat_GetProcedureAddress(CkCrypt2_get_PbesAlgorithm, 'CkCrypt2_get_PbesAlgorithm');
  Chilkat_GetProcedureAddress(CkCrypt2_put_PbesAlgorithm, 'CkCrypt2_put_PbesAlgorithm');
  Chilkat_GetProcedureAddress(CkCrypt2_get_PbesPassword, 'CkCrypt2_get_PbesPassword');
  Chilkat_GetProcedureAddress(CkCrypt2_put_PbesPassword, 'CkCrypt2_put_PbesPassword');
  Chilkat_GetProcedureAddress(CkCrypt2_get_Pkcs7CryptAlg, 'CkCrypt2_get_Pkcs7CryptAlg');
  Chilkat_GetProcedureAddress(CkCrypt2_put_Pkcs7CryptAlg, 'CkCrypt2_put_Pkcs7CryptAlg');
  Chilkat_GetProcedureAddress(CkCrypt2_get_Rc2EffectiveKeyLength, 'CkCrypt2_get_Rc2EffectiveKeyLength');
  Chilkat_GetProcedureAddress(CkCrypt2_put_Rc2EffectiveKeyLength, 'CkCrypt2_put_Rc2EffectiveKeyLength');
  Chilkat_GetProcedureAddress(CkCrypt2_get_Salt, 'CkCrypt2_get_Salt');
  Chilkat_GetProcedureAddress(CkCrypt2_put_Salt, 'CkCrypt2_put_Salt');
  Chilkat_GetProcedureAddress(CkCrypt2_get_SecretKey, 'CkCrypt2_get_SecretKey');
  Chilkat_GetProcedureAddress(CkCrypt2_put_SecretKey, 'CkCrypt2_put_SecretKey');
  Chilkat_GetProcedureAddress(CkCrypt2_get_UuFilename, 'CkCrypt2_get_UuFilename');
  Chilkat_GetProcedureAddress(CkCrypt2_put_UuFilename, 'CkCrypt2_put_UuFilename');
  Chilkat_GetProcedureAddress(CkCrypt2_get_UuMode, 'CkCrypt2_get_UuMode');
  Chilkat_GetProcedureAddress(CkCrypt2_put_UuMode, 'CkCrypt2_put_UuMode');
  Chilkat_GetProcedureAddress(CkCrypt2_get_BCryptWorkFactor, 'CkCrypt2_get_BCryptWorkFactor');
  Chilkat_GetProcedureAddress(CkCrypt2_put_BCryptWorkFactor, 'CkCrypt2_put_BCryptWorkFactor');
  Chilkat_GetProcedureAddress(CkCrypt2_get_SigningAlg, 'CkCrypt2_get_SigningAlg');
  Chilkat_GetProcedureAddress(CkCrypt2_put_SigningAlg, 'CkCrypt2_put_SigningAlg');
  Chilkat_GetProcedureAddress(CkCrypt2_get_OaepHash, 'CkCrypt2_get_OaepHash');
  Chilkat_GetProcedureAddress(CkCrypt2_put_OaepHash, 'CkCrypt2_put_OaepHash');
  Chilkat_GetProcedureAddress(CkCrypt2_get_OaepPadding, 'CkCrypt2_get_OaepPadding');
  Chilkat_GetProcedureAddress(CkCrypt2_put_OaepPadding, 'CkCrypt2_put_OaepPadding');
  Chilkat_GetProcedureAddress(CkCrypt2_get_OaepMgfHash, 'CkCrypt2_get_OaepMgfHash');
  Chilkat_GetProcedureAddress(CkCrypt2_put_OaepMgfHash, 'CkCrypt2_put_OaepMgfHash');
  Chilkat_GetProcedureAddress(CkCrypt2_get_SigningAttributes, 'CkCrypt2_get_SigningAttributes');
  Chilkat_GetProcedureAddress(CkCrypt2_put_SigningAttributes, 'CkCrypt2_put_SigningAttributes');
  Chilkat_GetProcedureAddress(CkCrypt2_get_CmsOptions, 'CkCrypt2_get_CmsOptions');
  Chilkat_GetProcedureAddress(CkCrypt2_put_CmsOptions, 'CkCrypt2_put_CmsOptions');
  Chilkat_GetProcedureAddress(CkCrypt2_get_UncommonOptions, 'CkCrypt2_get_UncommonOptions');
  Chilkat_GetProcedureAddress(CkCrypt2_put_UncommonOptions, 'CkCrypt2_put_UncommonOptions');
  Chilkat_GetProcedureAddress(CkCrypt2_AddEncryptCert, 'CkCrypt2_AddEncryptCert');
  Chilkat_GetProcedureAddress(CkCrypt2_AddPfxSourceFile, 'CkCrypt2_AddPfxSourceFile');
  Chilkat_GetProcedureAddress(CkCrypt2_CkDecryptFile, 'CkCrypt2_CkDecryptFile');
  Chilkat_GetProcedureAddress(CkCrypt2_CkEncryptFile, 'CkCrypt2_CkEncryptFile');
  Chilkat_GetProcedureAddress(CkCrypt2_ClearEncryptCerts, 'CkCrypt2_ClearEncryptCerts');
  Chilkat_GetProcedureAddress(CkCrypt2_CrcFile, 'CkCrypt2_CrcFile');
  Chilkat_GetProcedureAddress(CkCrypt2_CreateP7M, 'CkCrypt2_CreateP7M');
  Chilkat_GetProcedureAddress(CkCrypt2_CreateP7S, 'CkCrypt2_CreateP7S');
  Chilkat_GetProcedureAddress(CkCrypt2_DecodeString, 'CkCrypt2_DecodeString');
  Chilkat_GetProcedureAddress(CkCrypt2_DecryptEncoded, 'CkCrypt2_DecryptEncoded');
  Chilkat_GetProcedureAddress(CkCrypt2_DecryptStringENC, 'CkCrypt2_DecryptStringENC');
  Chilkat_GetProcedureAddress(CkCrypt2_EncodeBytes, 'CkCrypt2_EncodeBytes');
  Chilkat_GetProcedureAddress(CkCrypt2_EncodeString, 'CkCrypt2_EncodeString');
  Chilkat_GetProcedureAddress(CkCrypt2_EncryptEncoded, 'CkCrypt2_EncryptEncoded');
  Chilkat_GetProcedureAddress(CkCrypt2_EncryptStringENC, 'CkCrypt2_EncryptStringENC');
  Chilkat_GetProcedureAddress(CkCrypt2_GenRandomBytesENC, 'CkCrypt2_GenRandomBytesENC');
  Chilkat_GetProcedureAddress(CkCrypt2_GenerateUuid, 'CkCrypt2_GenerateUuid');
  Chilkat_GetProcedureAddress(CkCrypt2_GetEncodedAuthTag, 'CkCrypt2_GetEncodedAuthTag');
  Chilkat_GetProcedureAddress(CkCrypt2_GetEncodedIV, 'CkCrypt2_GetEncodedIV');
  Chilkat_GetProcedureAddress(CkCrypt2_GetSignatureSigningTimeStr, 'CkCrypt2_GetSignatureSigningTimeStr');
  Chilkat_GetProcedureAddress(CkCrypt2_HasSignatureSigningTime, 'CkCrypt2_HasSignatureSigningTime');
  Chilkat_GetProcedureAddress(CkCrypt2_HashBeginString, 'CkCrypt2_HashBeginString');
  Chilkat_GetProcedureAddress(CkCrypt2_HashFileENC, 'CkCrypt2_HashFileENC');
  Chilkat_GetProcedureAddress(CkCrypt2_HashFinalENC, 'CkCrypt2_HashFinalENC');
  Chilkat_GetProcedureAddress(CkCrypt2_HashMoreString, 'CkCrypt2_HashMoreString');
  Chilkat_GetProcedureAddress(CkCrypt2_HashStringENC, 'CkCrypt2_HashStringENC');
  Chilkat_GetProcedureAddress(CkCrypt2_MacStringENC, 'CkCrypt2_MacStringENC');
  Chilkat_GetProcedureAddress(CkCrypt2_MySqlAesDecrypt, 'CkCrypt2_MySqlAesDecrypt');
  Chilkat_GetProcedureAddress(CkCrypt2_MySqlAesEncrypt, 'CkCrypt2_MySqlAesEncrypt');
  Chilkat_GetProcedureAddress(CkCrypt2_OpaqueSignStringENC, 'CkCrypt2_OpaqueSignStringENC');
  Chilkat_GetProcedureAddress(CkCrypt2_OpaqueVerifyStringENC, 'CkCrypt2_OpaqueVerifyStringENC');
  Chilkat_GetProcedureAddress(CkCrypt2_Pbkdf1, 'CkCrypt2_Pbkdf1');
  Chilkat_GetProcedureAddress(CkCrypt2_Pbkdf2, 'CkCrypt2_Pbkdf2');
  Chilkat_GetProcedureAddress(CkCrypt2_RandomizeIV, 'CkCrypt2_RandomizeIV');
  Chilkat_GetProcedureAddress(CkCrypt2_ReEncode, 'CkCrypt2_ReEncode');
  Chilkat_GetProcedureAddress(CkCrypt2_SetDecryptCert, 'CkCrypt2_SetDecryptCert');
  Chilkat_GetProcedureAddress(CkCrypt2_SetDecryptCert2, 'CkCrypt2_SetDecryptCert2');
  Chilkat_GetProcedureAddress(CkCrypt2_SetEncodedAad, 'CkCrypt2_SetEncodedAad');
  Chilkat_GetProcedureAddress(CkCrypt2_SetEncodedAuthTag, 'CkCrypt2_SetEncodedAuthTag');
  Chilkat_GetProcedureAddress(CkCrypt2_SetEncodedIV, 'CkCrypt2_SetEncodedIV');
  Chilkat_GetProcedureAddress(CkCrypt2_SetEncodedKey, 'CkCrypt2_SetEncodedKey');
  Chilkat_GetProcedureAddress(CkCrypt2_SetEncodedSalt, 'CkCrypt2_SetEncodedSalt');
  Chilkat_GetProcedureAddress(CkCrypt2_SetEncryptCert, 'CkCrypt2_SetEncryptCert');
  Chilkat_GetProcedureAddress(CkCrypt2_SetIV, 'CkCrypt2_SetIV');
  Chilkat_GetProcedureAddress(CkCrypt2_SetMacKeyEncoded, 'CkCrypt2_SetMacKeyEncoded');
  Chilkat_GetProcedureAddress(CkCrypt2_SetMacKeyString, 'CkCrypt2_SetMacKeyString');
  Chilkat_GetProcedureAddress(CkCrypt2_SetSecretKey, 'CkCrypt2_SetSecretKey');
  Chilkat_GetProcedureAddress(CkCrypt2_SetSigningCert, 'CkCrypt2_SetSigningCert');
  Chilkat_GetProcedureAddress(CkCrypt2_SetSigningCert2, 'CkCrypt2_SetSigningCert2');
  Chilkat_GetProcedureAddress(CkCrypt2_SetVerifyCert, 'CkCrypt2_SetVerifyCert');
  Chilkat_GetProcedureAddress(CkCrypt2_SignStringENC, 'CkCrypt2_SignStringENC');
  Chilkat_GetProcedureAddress(CkCrypt2_UseCertVault, 'CkCrypt2_UseCertVault');
  Chilkat_GetProcedureAddress(CkCrypt2_VerifyP7M, 'CkCrypt2_VerifyP7M');
  Chilkat_GetProcedureAddress(CkCrypt2_VerifyP7S, 'CkCrypt2_VerifyP7S');
  Chilkat_GetProcedureAddress(CkCrypt2_VerifyStringENC, 'CkCrypt2_VerifyStringENC');
  Chilkat_GetProcedureAddress(CkCrypt2_BCryptHash, 'CkCrypt2_BCryptHash');
  Chilkat_GetProcedureAddress(CkCrypt2_BCryptVerify, 'CkCrypt2_BCryptVerify');
  Chilkat_GetProcedureAddress(CkCrypt2_AesKeyWrap, 'CkCrypt2_AesKeyWrap');
  Chilkat_GetProcedureAddress(CkCrypt2_AesKeyUnwrap, 'CkCrypt2_AesKeyUnwrap');
  Chilkat_GetProcedureAddress(CkCrypt2_HashBdENC, 'CkCrypt2_HashBdENC');
  Chilkat_GetProcedureAddress(CkCrypt2_MacBdENC, 'CkCrypt2_MacBdENC');
  Chilkat_GetProcedureAddress(CkCrypt2_EncryptBd, 'CkCrypt2_EncryptBd');
  Chilkat_GetProcedureAddress(CkCrypt2_DecryptBd, 'CkCrypt2_DecryptBd');
  Chilkat_GetProcedureAddress(CkCrypt2_EncryptSb, 'CkCrypt2_EncryptSb');
  Chilkat_GetProcedureAddress(CkCrypt2_DecryptSb, 'CkCrypt2_DecryptSb');
  Chilkat_GetProcedureAddress(CkCrypt2_SignBdENC, 'CkCrypt2_SignBdENC');
  Chilkat_GetProcedureAddress(CkCrypt2_SignSbENC, 'CkCrypt2_SignSbENC');
  Chilkat_GetProcedureAddress(CkCrypt2_OpaqueSignBd, 'CkCrypt2_OpaqueSignBd');
  Chilkat_GetProcedureAddress(CkCrypt2_OpaqueVerifyBd, 'CkCrypt2_OpaqueVerifyBd');
  Chilkat_GetProcedureAddress(CkCrypt2_VerifyBdENC, 'CkCrypt2_VerifyBdENC');
  Chilkat_GetProcedureAddress(CkCrypt2_VerifySbENC, 'CkCrypt2_VerifySbENC');
  Chilkat_GetProcedureAddress(CkCrypt2_EncryptSecureENC, 'CkCrypt2_EncryptSecureENC');
  Chilkat_GetProcedureAddress(CkCrypt2_DecryptSecureENC, 'CkCrypt2_DecryptSecureENC');
  Chilkat_GetProcedureAddress(CkCrypt2_GetSignedAttributes, 'CkCrypt2_GetSignedAttributes');
  Chilkat_GetProcedureAddress(CkCrypt2_Hotp, 'CkCrypt2_Hotp');
  Chilkat_GetProcedureAddress(CkCrypt2_EncodeInt, 'CkCrypt2_EncodeInt');
  Chilkat_GetProcedureAddress(CkCrypt2_Totp, 'CkCrypt2_Totp');
  Chilkat_GetProcedureAddress(CkCrypt2_SetTsaHttpObj, 'CkCrypt2_SetTsaHttpObj');
  Chilkat_GetProcedureAddress(CkCrypt2_HashBeginBytes2, 'CkCrypt2_HashBeginBytes2');
  Chilkat_GetProcedureAddress(CkCrypt2_HashMoreBytes2, 'CkCrypt2_HashMoreBytes2');
  Chilkat_GetProcedureAddress(CkCrypt2_AddSigningCert, 'CkCrypt2_AddSigningCert');
  Chilkat_GetProcedureAddress(CkCrypt2_ClearSigningCerts, 'CkCrypt2_ClearSigningCerts');
  Chilkat_GetProcedureAddress(CkCrypt2_CoSign, 'CkCrypt2_CoSign');
  Chilkat_GetProcedureAddress(CkCrypt2_SignHashENC, 'CkCrypt2_SignHashENC');
  Chilkat_GetProcedureAddress(CkCrypt2_XtsSetEncodedTweakValue, 'CkCrypt2_XtsSetEncodedTweakValue');
  Chilkat_GetProcedureAddress(CkCrypt2_XtsSetDataUnitNumber, 'CkCrypt2_XtsSetDataUnitNumber');
  Chilkat_GetProcedureAddress(CkCrypt2_XtsSetEncodedTweakKey, 'CkCrypt2_XtsSetEncodedTweakKey');
  Chilkat_GetProcedureAddress(CkCrypt2_AesKeyWrapWithPadding, 'CkCrypt2_AesKeyWrapWithPadding');
  Chilkat_GetProcedureAddress(CkCrypt2_AesKeyUnwrapWithPadding, 'CkCrypt2_AesKeyUnwrapWithPadding');
  Chilkat_GetProcedureAddress(CkCrypt2_GetLastJsonData, 'CkCrypt2_GetLastJsonData');
  Chilkat_GetProcedureAddress(CkCrypt2_LastDecryptCert, 'CkCrypt2_LastDecryptCert');
  Chilkat_GetProcedureAddress(CkCrypt2_LastSignerCert, 'CkCrypt2_LastSignerCert');
  Chilkat_GetProcedureAddress(CkCrypt2_AddPfxSourceBd, 'CkCrypt2_AddPfxSourceBd');
  Chilkat_GetProcedureAddress(CkCrypt2_CrcBd, 'CkCrypt2_CrcBd');
  Chilkat_GetProcedureAddress(CkCrypt2_HashChunkBd, 'CkCrypt2_HashChunkBd');
  Chilkat_GetProcedureAddress(CkCrypt2_Argon2DeriveKey, 'CkCrypt2_Argon2DeriveKey');
  Chilkat_GetProcedureAddress(CkCrypt2_Argon2HashPassword, 'CkCrypt2_Argon2HashPassword');
  Chilkat_GetProcedureAddress(CkCrypt2_Argon2VerifyPassword, 'CkCrypt2_Argon2VerifyPassword');

end.
