C++
C++
Get Certificate Public Key from PEM
See more Certificates Examples
Demonstrates how to load a PEM file containing a certificate and access the public key.Chilkat C++ Downloads
#include <CkCert.h>
#include <CkPublicKey.h>
void ChilkatSample(void)
{
bool success = false;
CkCert cert;
success = cert.LoadFromFile("qa_data/pem/my_cert.pem");
if (success == false) {
std::cout << cert.lastErrorText() << "\r\n";
return;
}
CkPublicKey pubkey;
cert.GetPublicKey(pubkey);
// Examine the public key as XML..
std::cout << pubkey.getXml() << "\r\n";
}