Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Get private certificate into manually created mobileconfig

Hi,
I'm currently writing a script that automatically creates a mobileconfig file for iPhone users that need to connect to an Exchange Server, with certificate authentication.
Unfortunately, I cannot seem to get my Private Certificate into the same format as the same certificate format I see in the mobileconfig file that I created using the iPhone Enterprise Configuration Utility.
My Private certificate is in PFX format. I have tried converting it with OpenSSL to pem format, but it still looks completely different.

Any ideas?

Alan

iPhone 3G(S), iPhone OS 3.1.3

Posted on Mar 30, 2010 12:48 AM

Reply
5 replies

Jun 11, 2010 1:40 AM in response to Alginald99

Hi Alan,

I'm working on the same issue. Till now, it seems that there is no possibility to retrieve a personal certificate with exportable key without using the IPCU.

In IExchangePayload, there is a variable called IdentityData as byte, this is the only variable I don't really use in my deployment.
I presume, it's this variable which will contain the personal certificate.

I hope we'll find a solution or IPCU scripting will be easier to handle with IOS 4.0 to get an easier life to helpdesk

Jun 22, 2010 12:23 AM in response to Alginald99

Hi,
Problem solved !

To export personal certificate with private key, you need to use :
*certutil -f -p "password" -user -exportPFX thumbprintValue savePath*

This creates a pfx file protected by a password with private key
My powershell script uses a small C# function to retrieve the thumbprintValue from personal store and is saved into a variable in powershell.

Then, in the c# code for iPCU, just use :
pc=new X509Certificate2("path ofpfx","password",X509KeyStorageFlafs.Exportable)
and
exchangePayload.IdentityData = pc.Export(X509ContentType.Pfx,"password")
and you got the certificate into iPCU when it starts.

You need to generate yourself the distinguished name for the certificate
and store into exchangePayload.IdentityName
exchangePayload.IdentityPassword must be the same as password given before.

For now, I don't know how to hide or don't open the iPCU, it's a bit annoying, it seems not possible to generate the profil with the "API" without this window.

Another way would be to create directly the XML file.

Get private certificate into manually created mobileconfig

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.