MobDojoStart learning free

iOS Internals · Inside iOS · Lesson 2 of 5

Code Signing & the App Store

See why every iPhone app must carry a signature, and who checks it.

12 min60 XPFree lab

Signed or it doesn't run

In module 1 you followed the chain of trust from the Boot ROM up to the kernel. Once the kernel is running, iOS keeps the chain going with a strict rule: all code that runs on the iPhone must be signed with a certificate issued by Apple.

A code signature is a digital seal attached to an app. It's made with a secret key that only the developer holds, and it covers every byte of the app's code. Change even one byte after signing and the seal no longer matches. A certificate is the ID card that goes with the seal. It says who made the app, and on iOS it has to be issued by Apple.

Getting a certificate isn't anonymous. A developer joins the Apple Developer Program, and Apple verifies who they really are before issuing one. Each developer account gets a Team ID, a 10-character code that's stamped into their certificates.

The checks happen while you use the phone, not just once. When an app launches, iOS checks its signature. It also checks the extra code libraries the app loads. Each one must either come with iOS or carry the same Team ID as the app, so an app can't quietly load code signed by a stranger.

You saw in Android App Security that Android developers sign apps with keys they create themselves. iOS goes a step further, because the certificate must come from Apple. That gives Apple a record of who is behind every app.

Why be so strict? Refusing unsigned code means:

How apps reach your iPhone

Signing proves who made an app. A second layer checks what the app does before it reaches you. There are a few official routes, and every one still requires signing.

Apps outside the App Store in the EU still go through notarization, a baseline review by Apple. It looks for known malware and checks that an app is honest about what it does and doesn't collect private data behind your back. It doesn't apply the App Store's content and business rules. Each marketplace makes its own rules about the rest, and Apple says it can't help with problems such as refunds from those stores.

Here's the safety lesson. Enterprise distribution is meant for employers. If a website or a stranger asks you to install a profile or trust a developer so you can get a free game or app, treat it as a scam.

Test yourself

Can you answer these?

  1. Someone downloads a signed iPhone app, adds a few lines of spyware to it, and tries to run it without re-signing. What happens?
  2. An EU user installs an app from an alternative marketplace instead of the App Store. Which check from Apple has the app still been through?

Answer them in the app to earn 60 XP.

Answer in the app