Search code examples
ioscode-signingsignsigning

iOS Signing procedure; revoke certificate and upload a new version


I'm new to iOS development and the signing process is somehow confusing.
Let's assume the following scenario:

  1. Someone develops a new iOS application and distribute it through the app store.
  2. Let's assume that, that someone for some reason their current installation of mac OS fried up, he/she now reinstall the OS but he/she didn't made a backup of his private keys (iOS Development and iOS Distribution).
  3. Time pass and that person now wants to push some update.
  4. He now revoke the old certificates and create new ones, signs the app and upload it to the app store.

From the docs

Code signing also allows your app’s signature to be removed and re-signed by a trusted source. For example, you sign your app before uploading it to iTunes Connect, but Apple re-signs it before distributing it to customers

From what understand Apple will remove my sign and sign with their's key.

So the question is:
Is there a problem when you revoke and recreate the iOS distribution certificate as long as you always upload a new version to the app store?


Solution

  • Yep, it's fine for you to revoke and create a new iOS distribution certificate, if you are distributing via the App Store and are not working with any other developers who are relying on that private key / certificate.

    It's more important that you prevent your private key from falling in to the hands of the wrong person. As Apple says here:

    Because the private key is stored locally on your Mac, protect it as you would an account password. Keep a secure backup of your public-private key pair. If the private key is lost, you’ll have to create an entirely new identity to sign code. Worse, if someone else has your private key, that person may be able to impersonate you. In the wrong hands, someone might attempt to distribute an app that contains malicious code. Not only could that cause the app to be rejected, it could also mean your developer credentials could be revoked by Apple.

    If you are distributing Enterprise apps, using enterprise code signing, your private key is more important. If you revoke an Enterprise distribution certificate, your apps in the wild will stop working eventually. (This doesn't happen straight away - it will happen next time the iOS device phones home to check that its provisioning profiles are still valid).