(PHP ActiveX) Transition from Cert.ExportPublicKey to Cert.GetPublicKey
Provides instructions for replacing deprecated ExportPublicKey method calls with GetPublicKey. Note: This example requires Chilkat v11.0.0 or greater.
<?php
// For versions of Chilkat < 10.0.0, use new COM('Chilkat_9_5_0.Chilkat.Cert')
$cert = new COM("Chilkat.Cert");
// ------------------------------------------------------------------------
// The ExportPublicKey method is deprecated:
// publickeyObj is a Chilkat.PublicKey
$publickeyObj = $cert->ExportPublicKey();
if ($cert->LastMethodSuccess == 0) {
print $cert->LastErrorText . "\n";
exit;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using GetPublicKey.
// Your application creates a new, empty PublicKey object which is passed
// in the last argument and filled upon success.
// For versions of Chilkat < 10.0.0, use new COM('Chilkat_9_5_0.Chilkat.PublicKey')
$publickeyOut = new COM("Chilkat.PublicKey");
$success = $cert->GetPublicKey($publickeyOut);
if ($success == 0) {
print $cert->LastErrorText . "\n";
exit;
}
?>
|