Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Delphi DLL) Duplicate openssl pkey -in private.pem -pubout -out pubkey.pemHow to output the public part of a private key: Demonstrates how to duplicate this OpenSSL command: openssl pkey -in private.pem -pubout -out pubkey.pem
uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, PrivateKey, PublicKey; ... procedure TForm1.Button1Click(Sender: TObject); var pkey: HCkPrivateKey; success: Boolean; pubKey: HCkPublicKey; begin pkey := CkPrivateKey_Create(); // Load the private key from an PEM file: success := CkPrivateKey_LoadPemFile(pkey,'private.pem'); if (success <> True) then begin Memo1.Lines.Add(CkPrivateKey__lastErrorText(pkey)); Exit; end; pubKey := CkPrivateKey_GetPublicKey(pkey); if (CkPrivateKey_getLastMethodSuccess(pkey) = False) then begin Memo1.Lines.Add(CkPrivateKey__lastErrorText(pkey)); Exit; end; success := CkPublicKey_SavePemFile(pubKey,False,'pubKey.pem'); if (success <> True) then begin Memo1.Lines.Add(CkPublicKey__lastErrorText(pubKey)); CkPublicKey_Dispose(pubKey); Exit; end; Memo1.Lines.Add('Success.'); CkPublicKey_Dispose(pubKey); CkPrivateKey_Dispose(pkey); end; |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.