The principle of iOS App signing

 

Because there are small changes in the steps, here we re-list the whole process again without any fuss:

1. Generate a pair of public and private keys on your Mac development machine, here called public key L and private key L. L:Local

2. Apple itself has a fixed pair of public and private keys. Like the AppStore example above, the private key is in Apple's background, and the public key is on each iOS device. It is called public key A and private key A here. A: Apple

3. Send the public key L to the Apple backend, and use the private key A in the Apple backend to sign the public key L. Get a piece of data that contains the public key L and its signature, and call this data a certificate.

4. Apply for an AppID in the Apple background, configure the device ID list and the permissions that can be used by the APP, and add the certificate in step 3. The data is signed with the private key A, and the data and the signature are combined to form a Provisioning Profile file, download to the local Mac development machine.

5. During development, after compiling an APP, use the local private key L to sign the APP, and at the same time package the Provisioning Profile file obtained in step 4 into the APP, the file name is embedded.mobileprovision, and install the APP to on the phone.

6. During installation, the iOS system obtains a certificate and uses the built-in public key A to verify whether the digital signature of embedded.mobileprovision is correct, and the certificate signature inside will be checked again.

7. After ensuring that the data in embedded.mobileprovision is authorized by Apple, you can take out the data inside and do various verifications, including verifying the APP signature with the public key L, verifying whether the device ID is on the ID list, and whether the AppID corresponds to above, whether the permission switch corresponds to the Entitlements in the APP, etc.

The process of developer certificate from signing to certification is roughly like this, and some details such as certificate validity period/certificate type will not be elaborated.

 

 

http://www.cocoachina.com/ios/20170602/19427.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324890899&siteId=291194637