Sample code for 30+ languages & platforms
Objective-C

List Certificates in the Current User Certificate Store (Windows Only)

See more Certificates Examples

This is a Windows-only example to list the certificates in the current-user certificate store (located in the Windows Registry).

Chilkat Objective-C Downloads

Objective-C
#import <CkoCertStore.h>
#import <CkoCert.h>

BOOL success = NO;

//  This is a Windows-only example because it lists the certificates
//  stored in the Windows Current User Certificate Store located in the
//  Windows Registry.

CkoCertStore *certStore = [[CkoCertStore alloc] init];

BOOL readOnly = YES;
success = [certStore OpenCurrentUserStore: readOnly];
if (success == NO) {
    NSLog(@"%@",certStore.LastErrorText);
    return;
}

CkoCert *cert = [[CkoCert alloc] init];
int numCerts = [certStore.NumCertificates intValue];
int i = 0;
while (i < numCerts) {
    [certStore GetCert: [NSNumber numberWithInt: i] cert: cert];
    NSLog(@"%@%@",@"DN = ",cert.SubjectDN);
    NSLog(@"%@%@",@"Email = ",cert.SubjectE);
    i = i + 1;
}