Sample code for 30+ languages & platforms
Objective-C

Load DER encoded X.509 Certificate (.cer, .crt)

See more Certificates Examples

Loads a digital certificate from a binary DER encoded X.509 Certificate (.cer, .crt) and fetches information about the cert.

Chilkat Objective-C Downloads

Objective-C
#import <CkoCert.h>

BOOL success = NO;

CkoCert *cert = [[CkoCert alloc] init];

// LoadFromFile will load virtually any certificate format file.
// It will auto-recognize the format and load appropiately.
success = [cert LoadFromFile: @"/Users/chilkat/testData/cer/chilkat_ssl.cer"];
if (success != YES) {
    NSLog(@"%@",cert.LastErrorText);
    return;
}

// DN = "Distinguished Name"
NSLog(@"%@%@",@"SubjectDN:",cert.SubjectDN);

NSLog(@"%@%@",@"Common Name:",cert.SubjectCN);
NSLog(@"%@%@",@"Issuer Common Name:",cert.IssuerCN);

NSLog(@"%@%@",@"Serial Number:",cert.SerialNumber);