10

I want to be able to install a client certificate (via email, for example) and then use that certificate to authenticate requests sent by my app. I have the feeling that Apple won't allow that kind of access, but can't find any definite answer. Is that true, or is there a way to access client certificates installed on the device from within an app?

Edit: To clarify, this is a native app, not a webapp.

jscs
  • 63,694
  • 13
  • 151
  • 195
kevboh
  • 5,207
  • 5
  • 38
  • 54

2 Answers2

3

Your app can use only what you store in its own keychain (or keychains of other 3rd party apps that share the same provisioning certificate). As for the actual loading we do use openssl (we did write a obj-c wrapper around it) to decode the .p12 that we send to the app.

The certificates loaded in seting->general->profiles are protected in some way only built-in apps (mail, safari) can add stuff there.

Frank
  • 16,476
  • 7
  • 38
  • 51
  • 1
    Will an app that use SafariServices be able to use a client cert, stored in Apple access group, for authentication? – Björn Jan 09 '17 at 11:11
0

To use client certificates in your app you have to implement import of certificate within your app to your app keychain. (note you need to use PKCS#12 certificate format, but you need to register it in your app (search for exported UTIs and Document types) with different extension, other than ".p12", which is already registered by the iOS. I've used .x-p12 in my app) See here: iOS Client Certificates and Mobile Device Management and here: https://developer.apple.com/library/ios/qa/qa1745/_index.html

Community
  • 1
  • 1
Balki
  • 688
  • 6
  • 9