I\'m trying to build an HTTPS server in an iOS app, in order to act as a proxy between my web-app and my external server.
I have managed to make an
I will post a separate answer, as comments are not suitable for code sharing.
Here is what I use to import my PKCS12:
CFArrayRef keyref = NULL;
OSStatus sanityChesk = SecPKCS12Import((__bridge CFDataRef)p12Data,
(__bridge CFDictionaryRef)[NSDictionary
dictionaryWithObject:password
forKey:(__bridge id)kSecImportExportPassphrase],
&keyref);
if (sanityChesk != noErr) {
NSLog(@"Error while importing pkcs12 [%d]", sanityChesk);
return nil;
}
NSArray *keystore = (__bridge_transfer NSArray *)keyref;
The complete p12 content will be in the keystore array.