iOS: Is it ok to store a RSA private key (use to d

2019-09-07 20:28发布

问题:

I want the user to use their RSA private key via file sharing to store in my App's document directory. It is ok if the user has access to the RSA private key, but I don't want anyone else to have access to it. Is this a good idea and if not how can I get the user's to store his/her RSA private key in my App securely.

回答1:

You need to use the keychain to store sensitive information like private keys.

https://developer.apple.com/library/ios/documentation/Security/Conceptual/cryptoservices/KeyManagementAPIs/KeyManagementAPIs.html

Do not attempt to roll your own solution ... iOS has already done the hard work for you (~properly).

Using the keychain will protect your data from other apps.


If you want to do this for OS X rather that iOS, then take a look at

https://developer.apple.com/library/ios/documentation/Security/Conceptual/keychainServConcepts/03tasks/tasks.html#//apple_ref/doc/uid/TP30000897-CH205-TP9