8.1. Enabling Security and Protection for Your Apps

Problem

You want to store values in the keychain and enable secure file storage for your app.

Solution

Create a provision profile for your app that has file protection enabled.

Discussion

Provision profiles, as discussed earlier in Recipe 8.0, contain entitlements that dictate to iOS how your app utilizes the security functionalities in the operating system. On iOS Simulator, apps do not get codesigned and, therefore, these concepts will not make sense, but for debugging your app on a device or submitting your app to the App Store, you need to ensure that your app is signed with the correct provision profile, for both the Debug and the Release schemes.

I will show you the steps required to create a valid provision profile for your development, as well as Ad Hoc and the App Store. Follow these steps to create a valid development provision profile (with debugging enabled) for the apps that we are going to be working on in this chapter of the book. We start by creating an App ID:

Note

I am assuming that you have already created valid development and distribution certificates for yourself.

  1. Navigate to the iOS Dev Center and sign in with your username and password.

  2. After you are signed in, find the iOS Developer Program section and choose Certificates, Identifiers & Profiles.

  3. On the lefthand side of the screen, find and navigate to the App IDs section of the portal and press the plus button (+) to create a new App ID.

  4. In the Name section, enter ...

Get iOS 7 Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.