(Objective-C) 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.
#import <CkoCert.h>
#import <CkoPublicKey.h>
CkoCert *cert = [[CkoCert alloc] init];
// ------------------------------------------------------------------------
// The ExportPublicKey method is deprecated:
CkoPublicKey *publickeyObj = [cert ExportPublicKey];
if (cert.LastMethodSuccess == NO) {
NSLog(@"%@",cert.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using GetPublicKey.
// Your application creates a new, empty PublicKey object which is passed
// in the last argument and filled upon success.
CkoPublicKey *publickeyOut = [[CkoPublicKey alloc] init];
BOOL success = [cert GetPublicKey: publickeyOut];
if (success == NO) {
NSLog(@"%@",cert.LastErrorText);
return;
}
|