(Perl) 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.
use chilkat();
$cert = chilkat::CkCert->new();
# ------------------------------------------------------------------------
# The ExportPublicKey method is deprecated:
# publickeyObj is a PublicKey
$publickeyObj = $cert->ExportPublicKey();
if ($cert->get_LastMethodSuccess() == 0) {
print $cert->lastErrorText() . "\r\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.
$publickeyOut = chilkat::CkPublicKey->new();
$success = $cert->GetPublicKey($publickeyOut);
if ($success == 0) {
print $cert->lastErrorText() . "\r\n";
exit;
}
|