Create and add certificate for WiFi programmatically on iOS

Hi, I have a problem with P12 within an iOS ecosystem:

CONTEXT

Company is currently updating the WiFi infrastructure and new requirement is that each device has to have installed certificate / profile in order to be able to connect to it.

We already have an app that manages various certificates and other services within a company so the decision is to implement the flow within the existing app.

SOLUTION
  1. Application generates a key pair and sends the public key to CA.

  2. CA creates the certificate and signs it with provided public key.

  3. Application receives signed certificate and creates p12 (from certificate and private key) that will be imported as profiles in iOS.

PROBLEM

I have implemented the first 2 points without issue, but I’m stuck for quite some time on the 3rd one.

I create p12 file using OpenSSL (and store the file on disk), but I’m basically unable to do anything with it (openURL throws exception that application cannot open file scheme, SecPKCS12Import, ...). I’m a little bit skeptical whether this solution will ever work. 

Could anyone please give me an opinion on this?
  • can the solution ever work?

  • is there any other API that I missed?


Thank you!

I’m a little bit skeptical whether this solution will ever work.

What is the goal of installing the p12? For the system to use it for Wi-Fi authentication?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Create and add certificate for WiFi programmatically on iOS
 
 
Q