Unicode C++
Unicode C++
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 Unicode C++ Downloads
#include <CkPrivateKeyW.h>
#include <CkPublicKeyW.h>
void ChilkatSample(void)
{
bool success = false;
CkPrivateKeyW pkey;
// Load the private key from an PEM file:
success = pkey.LoadPemFile(L"private.pem");
if (success == false) {
wprintf(L"%s\n",pkey.lastErrorText());
return;
}
CkPublicKeyW pubKey;
pkey.ToPublicKey(pubKey);
success = pubKey.SavePemFile(false,L"pubKey.pem");
if (success != true) {
wprintf(L"%s\n",pubKey.lastErrorText());
delete pubKey;
return;
}
wprintf(L"Success.\n");
}