PHP Requires Chilkat v11.0.0+
PHP
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 PHP Downloads
<?php
use Chilkat2\Cert;
use Chilkat2\PublicKey;
$cert = new Cert();
try {
$cert->LoadFromFile('qa_data/pem/my_cert.pem');
} catch (\Chilkat2\Exception $e) {
echo $e->getMessage(), "\n";
exit;
}
$pubkey = new PublicKey();
$cert->GetPublicKey($pubkey);
// Examine the public key as XML..
echo $pubkey->GetXml(), "\n";