We are connecting to a web service that requires a certificate from a *.pfx. It works fine when the *.pfx is included in the app bundle and extracted from there, as mentioned in this discussion in thread #77694.
The problem is, each device will have a unique certificate that will be pushed to it from an MDM; we don't have a single generic certificate that we can include in the bundle for all devices to use.
For testing, we dragged the *.pfx certificate onto Settings, and it appears under "Configuration Profile", as shown in the attached picture.
Questions:
- Is "Configuration Profile" the iOS equivalent of the Mac Keychain?
- When an MDM pushes a *.pfx certificate onto an iOS device, will it appear under "Configuration Profile"? Or somewhere else? The MDM isn't functional yet so we haven't seen how it works.
- If the answer to #2 is yes, is it possible to access the "Configuration Profile" certificates from within the app? Some articles I've read said this isn't possible due to security--you can only access your app's certificates. If this is true, how will the MDM make the certificates available to our app specifically and not just the device?
Thanks so much for any help,
James T
Let’s start with terminology. A .pfx
file typically contains a digital identity, not just a certificate. When talking about “certificate authentication” I generally use the term mutual TLS to avoid the ongoing ambiguity regarding the word certificate. For more background on this, see TLS for App Developers.
Is "Configuration Profile" the iOS equivalent of the Mac Keychain?
No. These are different things, although they do connect when you use a profile to install certain payloads, specifically:
-
CertificatePKCS12 (
com.apple.security.pkcs12
) for a digital identity -
CertificatePKCS1 (
com.apple.security.pkcs1
) for just a certificate, typically an intermediate certificate
When you install a profile containing one of these payloads the system places the credential into the keychain.
There’s one other relevant payload type, namely, CertificateRoot (com.apple.security.root
) for a trusted anchor. When you install a profile containing one of these payloads the system places the certificate into the trust store [1].
When an MDM pushes a *.pfx
certificatedigital identity onto an iOS device, will it appear under "Configuration Profile"?
Yes. Well, no, but yes. MDM can’t push a digital identity, it can only push configuration profiles. If your MDM system has a UI to push a digital identity, it’s actually pushing a configuration profile with the com.apple.security.pkcs12
payload.
If the answer to #2 is yes, is it possible to access the "Configuration Profile"
certificatesdigital identities from within the app?
No. The credentials in com.apple.security.pkcs12
and com.apple.security.pkcs1
are placed in an Apple keychain access group that’s not available to other apps [2]. See QA1745 Making Certificates and Keys Available To Your App.
Some articles I've read said this isn't possible due to security--you can only access your app's
certificatesdigital identities.
Correct.
If this is true, how will the MDM make the certificates available to our app specifically and not just the device?
This is an ongoing source of grief. See this post for my best suggestion.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] On macOS this is implemented using the keychain. On iOS there’s a separate trust store subsystem.
[2] There’s a limited exception for apps that provide a custom VPN transport the Network Extension provider facility.