Sample code for 30+ languages & platforms
Perl

Transition from Cert.ExportPublicKey to Cert.GetPublicKey

Provides instructions for replacing deprecated ExportPublicKey method calls with GetPublicKey.

Chilkat Perl Downloads

Perl
use chilkat();

$success = 0;

$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;
}