(Objective-C) Transition from Cert.GetCertChain to Cert.BuildCertChain
Provides instructions for replacing deprecated GetCertChain method calls with BuildCertChain. Note: This example requires Chilkat v11.0.0 or greater.
#import <CkoCert.h>
#import <CkoCertChain.h>
CkoCert *cert = [[CkoCert alloc] init];
// ------------------------------------------------------------------------
// The GetCertChain method is deprecated:
CkoCertChain *certchainObj = [cert GetCertChain];
if (cert.LastMethodSuccess == NO) {
NSLog(@"%@",cert.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using BuildCertChain.
// Your application creates a new, empty CertChain object which is passed
// in the last argument and filled upon success.
CkoCertChain *certchainOut = [[CkoCertChain alloc] init];
BOOL success = [cert BuildCertChain: certchainOut];
if (success == NO) {
NSLog(@"%@",cert.LastErrorText);
return;
}
|