Deleting all shared keychain items

Hi, I'm trying to clear all keychain items accessible to an iOS app including all shared keychain items. I want to be able to fully reset the keychain so I can test a first time install without having to wipe the whole device.


I've tried using the usual keychain reset spippets from stackoverflow - e.g. https://stackoverflow.com/a/16136513 but this doesn't properly clear out the shared keychain data (i.e. the keychain data that can be shared by multiple apps signed via the same cert) of a 3rd party framework that I'm using.


Is there anything special that is needed to clear out all shared keychain data? Thanks.

Answered by DTS Engineer in 301805022

I’m actually surprised this didn’t work but, if not, the next step would be to make this

SecItemDelete
sequence again, passing in the shared keychain access group via
kSecAttrAccessGroup
.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Accepted Answer

I’m actually surprised this didn’t work but, if not, the next step would be to make this

SecItemDelete
sequence again, passing in the shared keychain access group via
kSecAttrAccessGroup
.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks! Setting the kSecAttrAccessGroup for each group made it work 🙂

Deleting all shared keychain items
 
 
Q