(Perl) Transition from Cert.ExportPrivateKey to Cert.GetPrivateKey
Provides instructions for replacing deprecated ExportPrivateKey method calls with GetPrivateKey. Note: This example requires Chilkat v11.0.0 or greater.
use chilkat();
$cert = chilkat::CkCert->new();
# ------------------------------------------------------------------------
# The ExportPrivateKey method is deprecated:
# privatekeyObj is a PrivateKey
$privatekeyObj = $cert->ExportPrivateKey();
if ($cert->get_LastMethodSuccess() == 0) {
print $cert->lastErrorText() . "\r\n";
exit;
}
# ...
# ...
# ------------------------------------------------------------------------
# Do the equivalent using GetPrivateKey.
# Your application creates a new, empty PrivateKey object which is passed
# in the last argument and filled upon success.
$privatekeyOut = chilkat::CkPrivateKey->new();
$success = $cert->GetPrivateKey($privatekeyOut);
if ($success == 0) {
print $cert->lastErrorText() . "\r\n";
exit;
}
|