Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Delphi DLL) RSA Import Private KeySee more RSA ExamplesShows how to select/import a private key for RSA signing or decryption.
uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, PrivateKey, Rsa; ... procedure TForm1.Button1Click(Sender: TObject); var privKey: HCkPrivateKey; password: PWideChar; success: Boolean; rsa: HCkRsa; begin privKey := CkPrivateKey_Create(); password := 'secret'; // In all Chilkat methods expecting a path, you pass either absolute or relative paths. success := CkPrivateKey_LoadAnyFormatFile(privKey,'rsaKeys/myTestRsaPrivate.pem',password); if (success = False) then begin Memo1.Lines.Add(CkPrivateKey__lastErrorText(privKey)); Exit; end; rsa := CkRsa_Create(); // Tell the RSA object to use the private key (i.e. import the private key) CkRsa_ImportPrivateKeyObj(rsa,privKey); CkPrivateKey_Dispose(privKey); CkRsa_Dispose(rsa); end; |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.