Delphi DLL Requires Chilkat v11.0.0+
Delphi DLL
Duplicate openssl pkey -in private.pem -pubout -out pubkey.pem
See more OpenSSL Examples
How 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
Chilkat Delphi DLL Downloads
var
success: Boolean;
pkey: HCkPrivateKey;
pubKey: HCkPublicKey;
begin
success := False;
pkey := CkPrivateKey_Create();
// Load the private key from an PEM file:
success := CkPrivateKey_LoadPemFile(pkey,'private.pem');
if (success = False) then
begin
Memo1.Lines.Add(CkPrivateKey__lastErrorText(pkey));
Exit;
end;
pubKey := CkPublicKey_Create();
CkPrivateKey_ToPublicKey(pkey,pubKey);
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.');
CkPrivateKey_Dispose(pkey);
CkPublicKey_Dispose(pubKey);