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) 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-2025 Chilkat Software, Inc. All Rights Reserved.