I would like to know if I can use the iPhone's secure element to store a pair of keys. I need to store them in the safest emplacement, and I can't think of a better one than the secure element.
Asked
Active
Viewed 1,138 times
3
-
You probably mean the secure enclave. The secure element just handles payments and is not accessible to developers. – lxgr Jun 02 '16 at 15:34
-
No I meant the secure element, but as you said it's not accessible. – Zakaria XPI Jun 09 '16 at 09:39
2 Answers
3
You can do this by setting kSecAttrTokenID
to kSecAttrTokenIDSecureEnclave
when generating the key. According to the documentation (which consists of some comments in SecItem.h
), the only kinds of keys the secure enclave can store are elliptic curve secp256r1 keys. You can't put RSA keys there, for example.
Wim Lewis
- 271
- 1
- 3
-
Thank you very much Wim for your help, I think that I'll stick with the keychain for my app. – Zakaria XPI Dec 30 '15 at 09:56
2
The secure element is not exposed to developers, and likely requires a custom entitlement in the App Store / App review process that isn't given out
makerofthings7
- 50,090
- 54
- 250
- 536
-
Thank you for your help Cristo, I spent too much time searching in Apple's documentation but in vain. I just needed a confirmation before giving up. – Zakaria XPI Dec 30 '15 at 09:57
-
My answer is incorrect. Please see the answer about kSecAttrTokenIDSecureEnclave. – makerofthings7 Dec 30 '15 at 11:21