Is there a way I can purge the keychain for my iphone app? Either a purge command or a listing of all keys so I can delete them myself.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no such thing as purge command.
Anyway since the keychain your application has access to is dedicated for your application only you can easily keep track of what you have written in it and delete it.
You can implement your own purge method that will simply delete one by one all possible data types that you can save in keychain. Below is how I purge all my GenericPassword entries:
So what you need to do is call this method for all possible kSecClass values.
NOTE that different data types would require different dictionary flags to be set.
regards