Joobik Player - iTunes Video Playlists on iPhone and iPad

Saturday, August 14, 2010

Howto use the Keychain in iPhone SDK to store and retrieve secure Data

This blog post has moved to joobik.com.

5 comments:

  1. Hi
    I am trying to create, store and later retrieve private and public key pair in iPhone. And also create CSR. How can I store it in keychain and later refer to the same key to load?

    ReplyDelete
  2. You could modify the KeyChainItemWrapper so it handles Keys instead of passwords. Replace kSecClassGenericPassword in the code with kSecClassKey. Be aware, that the number of attributes supprted by keys is different from the ones supported by passwords. So you cannot use kSecAttrGeneric to store the key identifier. You might use kSecAttrApplicationLabel. An overview of supported attribute types per keychain item class can be found here: http://developer.apple.com/iphone/library/documentation/Security/Reference/keychainservices/Reference/reference.html

    ReplyDelete
  3. Hi,

    I am trying to add RSA public key to key chain.But am getting an error while adding

    "errSecInteractionNotAllowed"..

    How can I get rid of this error??

    Regards,
    Syam

    ReplyDelete
  4. This is great info!
    Thanks a lot for this!

    -Ken

    ReplyDelete
  5. Thank you! I had been searching the internet and read the Apple documentation. I was pretty unclear about the whole thing. Your article helped a lot! Thanks!

    ReplyDelete