IOS Certificate and Signature FAQ

Source: Internet
Author: User
Tags reverse dns

 IOS Certificate and Signature FAQCategory: IPhone2012-06-06 19:57 9426 people read reviews (1) favorite reports Iosxcodecryptographyappleiphone Test

Directory (?) [+]

Tutorial:

Here is an article from a full-time iOS developer in Melbourne, Australia . He was a very modern young –adam Eberbach on the forum .

· Bundle identifier

· Provisioning Profiles

· App ID

· Certificate Signing Request

For beginners, it's really hard to figure out what the difference is.

Let's take a look at the mystery, and after reading this article, you should be able to relate these things, you can understand how they work, and can run your app on device successfully.

Of course, this assumes that you are already an iOS developer, have an IDP, and already have some experience with Xcode and iOS development. If you're just starting to learn iOS, you can start by looking at other introductory tutorials.

Well, here we go.

how important are they?

The main meaning of Code signing is that it allows your app to run on your device. Whether it's your own device, your customer, or your consumer on the App Store.

Without code signing, you can only run your app on the emulator, or on a jailbroken machine----of course, that's just not enough for us.

The simulator test is only a preliminary test, the simulator can not replace the real machine debugging, because:

• Real devices are usually slower than simulators

The simulator uses the processor on your Mac, and a real iphone is far from the case. So if you're not really running on your device, you may be ignoring the actual performance issues.

For example, you create a new viewbased application, and then add the following code to the Viewdidload:

int count = 200000; Nsmutablearray * array = [Nsmutablearray arraywithcapacity:count];for (int i =0; i < count; ++i) {    

The above code can run in 1-2 seconds on the emulator, but it takes about 7 seconds to get to the real machine (like the iphone 3GS).

• Much less memory on the device

Similarly, the simulator uses the memory on your Mac, and a real iphone has much less memory.

In particular, the game usually uses a lot of pictures and consumes a lot of memory. On older machines, a texture image has a maximum size of 24MB, which is the 8bit texture of 1024x1024.

Memory exhaustion is definitely something you don't want to see, because it takes up more than a certain range of memory, and the OS will force you to quit your app, and the app crashes for the user.

• Some APIs are only available on the device

For example, the API for In-app purchase, or the core Animation in instrument. It's all going to be tested on the real machine. (maybe later versions of iOS or Xcode will support it, but real-time testing is a guarantee)

In general, you did not test on the real machine, it is equal to you did not really test finished.

• (Translator Note: Some visual effects seen on the simulator may not be consistent with the real machine)

There are some lazy ways to do this in Xcode:

In the Organizer interface, select devices right-developer profile and you can see a menu like this.

There's a lot of stuff going on in this article.

Here you can sign in your developer account, automatically register your app and run it on your device.

Of course, if this is always useful, this article will be meaningless.

As a developer, you should know more.

Public and private keys private key

Before continuing with the profiling, we will simply parse the public key private key.

There are two kinds of encryption methods in the world: Symmetric cryptography symmetric passwords and asymmetric cryptography asymmetric passwords.

For symmetric passwords, there is only one key. For example, you have a key and a corresponding encrypted message.

Only those who know the key can interpret this information.

For an asymmetric password, there are two key – public and private keys.

For example, you use a private key to encrypt some information, others receive this information can be encrypted by the public key corresponding to the private key. So they can be sure that this information is coming from you (at least you're encrypting it).

This private key is equivalent to a "signature". (you add the secret, you sign the word)

And this is the principle behind code signing in iOS.

Code Signing Objects

The things that are related to code signing are :

Provisioning Profiles,app Ids,udids ...

In this section, we will explain one by one.

I used core data to draw a chart that describes the relationships between these objects.

This is for the developer (development profile), the publisher's diagram will have a small difference.

private key :

After Mac OS X, key is managed by an app called Keychain. you can find it in the application\utilities.

Running keychain, you can see which public and private keys are in your name. Similar to this:

(This is privacy, to be overweight)

If you don't see a list of any keys, don't worry. Keychain will help you create the first time you use the certification.

The key listed here is the basis for your provisioning or code signing.

You must have key to sign code or post your app in the App Store.

What if the key is missing?

You have to do the whole process again – because without the key, your certification is no longer valid, and your provisioning profile generates only error. You'll waste a lot of time, so take good care of it.

If you haven't backed up, I suggest you Export it right away, and save it in a safe place, such as a small partition, by File\export Items. Or use your mobile me account to sync your saves.

have multiple keys?

If you create an account on a different Mac, you will have multiple keys.

This brings up the problem that the authentication generated on machine A will fail on machine B without the private key.

So, you can copy all of your keys to all your Mac machines. (so you don't have to bother)

Or, I'd recommend using only one key.

UDID

UDID (unique Device Identifier) is a unique identifier that distinguishes a physical device.

All your iphone must have a different udid, including your ipad and so on.

Typically, Udid will be a 40-bit hexadecimal string.

The identifier:

If the app doesn't come from the App Store, your code needs to have UDID information to run.

How do you know the udid of the equipment you own? There are several ways.

1 If your device is connected to the Xcode machine, you can see Udid in the Organizer.

2 Friends without Xcode can also, in the itunes summary interface, have serial number (serial numbers) information, click to see.

3 This is the simplest way to download an ad Hoc helper in the App Store.

Certificate Certification

certification, which is your personal developer certification, or more gorgeous: "Apple worldwide Developer Relations Certification Authority Certificate" (This is not translated),

This is essentially some data that represents trust-empowerment.

Get a certification, you need a son. Keychain Access generates a Certificate Signing Request and sends it to Apple. This creates a pair of public-private keys (if not yet).

When Apple receives it, it verifies the information and then creates a certification for you.

App ID

To create a project in XCODE4, you provide information about the Product Name and company identifier.

Product name is a shorter name for your app.

Company identifier, typically a reverse DNS string, for example: Com.mycompanyname

Together, it seems that bundles are Identifier. You'll find it in the info.plist.

For each app you want to publish, you'll need to register your app ID in itunes Developer Center. Such as.

This needs to be consistent with what you set up in Info.plist.  

Provisioning Profile

Put together the things that were mentioned earlier:

· app ID (Unique identifier of the app)

· UDID (unique identity running on a device)

· Certificate (Developer certification)

is the so-called Provisioning profile.

Provisioning profile is imported into device via Xcode or itunes, or packaged into an. IPA file that contains apps and profiles.

You can create your Provisioning profile in the iOS Provisioning Portal.

To create a new one, there are a few steps:

• Name your profile and you'll see it later in Xcode's organizer,BUiD Settings and a few other places

• Choose your certificate

• Select your App ID to be as consistent as in Info.plist.

• Select the device you want to apply to. Usually, I have all my equipment selected.

Signature Signing for personal use

Let's say you already have an app ready to test, and you have an IDP, and you're working on the provisioning profile.

Now that you know the logic of them, if you're new, here's what you're going to do:

1 Check your Public key private key, for later check convenience, a good name it.

2 Use keychain access to create your development certification. Then download the Apple Certification for you, double-click the installation, and then you can see it in the keychain.

3 Downloads "Apple Worldwide Developer Relations Certification Authority Certificate" (WWDR) is also a double-click installation or can be seen in keychain.

4 Check the bundle ID of your project to create a consistent app ID in the provisioning portal.

5 Add the Udid you want in the provisioning portal. (plus all the good)

6 Create provisioning profile for your certificate, specifying your app ID and Udid.

7 Download the profile you just created and drag it into your Xcode organizer.

Then, you can sign your project and let them run on your device.

In Target–build Settings, scroll down to the Code signing section.

Try editing the debug schema, which is suitable for team collaboration:

Select "IPhone Developer" in automatic profileselector and you will see that your certification has been automatically selected.

Everything is done, connect your device, select Debug Build,build & Run in Xcode.

Xcode will put this provisioning profile on your device and run your app.

Original link Address: http://www.cnblogs.com/andyque/archive/2011/08/30/2159086.html

    • Previous iOS multithreading
    • Next one

IOS Certificate and Signature FAQ

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.