简体   繁体   中英

iPhone client certificate

I would like to verify that an app I am writing is running on an iPhone. What would be perfect is this: Apple baked an SSL client certificate into each iphone which can be authenticated by a receiving server. I this the case?

I have not started researching this yet, I will update with anything I find.

UPDATE: Here is some Apple documentation on certificates and keychains. So:

In iPhone OS, Keychain Services checks an application's signature before giving it access to a keychain, and lets an application have access only to its own keychain items (with the possible exception of items for which the application has obtained persistent references). In iPhone OS, the user is never asked to authenticate and no Keychain Access utility is provided by Apple.

我认为大多数执行此检测的网站都是通过查看HTTP_USER_AGENT变量来执行此操作的。

A trusted platform module can do something along the lines that you are seeking. It's called remote attestation .

However, acceptance of trusted computing is limited—savvy consumers see it as a way for vendors to continue to exercise control over equipment and data that the consumer owns. Apple's grudging acknowledgment that DRM is stupid, as well as the extra cost of a TPM, would suggest the iPhone doesn't support this .

Pertaining to what Greg mentioned above. You can definitely add a user agent to your header which we did in our application. There's more to the whole http connection code, but here's one way you could add the user agent to your header:

NSMutableURLRequest *request;
NSMutableDictionary *headers;
headers = [[[NSMutableDictionary allocWithZone:[self zone]] init] autorelease];
[headers setValue:@"YourApp/1.0 (iPhone)" forKey:@"User-Agent"];
[request setAllHTTPHeaderFields:headers];

Again, note that this code is only focused on the header bit, so you'll have to implement the complete http solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM