문제

I'm developing an iPhone application.
The application access some web service that aboug other things should recognize the device ID.

Since UDID is deprecated, I need to call CFUUIDCreate to generate my own UUID for this purpose.

The ID is security-sensitive: all my network communication is encrypted, and I don't want nobody but my certificate-authenticated server to know that UUID.
Besides, I want this identifier to survive re-install.
Using the keychain to store that UUID seems like an obvious solution.

How do I do that?

On the internets, there're some samples how to store user name & password in keychain. I have neither user nor password, just 16 bytes UUID (or a single NSString).

Which kSecClass do I need to use?
Which attributes do I need to set and retrieve?
Which attributes are optional and which are mandatory?

What header/framework defines the CSSM_ALGORITHMS?
The doc mentions cssmtype.h, xcode autocompletion has <Security/cssmtype.h> however the xcode compiler says "file not found".

From the common sense, "Identity" should fit best. The docs however say "an identity is the combination of a private key and a certificate", I have neither of them. Also, I don't see the "key bytes" attribute.

Thanks in advance!

도움이 되었습니까?

해결책

You could use the SSKeychain wrapper. Also check out the answer on this question for some basic usage stuff: How to choose account and service values for SSKeychain

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top