Deleting keychain items of speicific app when device lock is removed

Is there a way , to delete the keychain items of a app when device lock (touchId/ passcode ) is removed .

We are unable to access the keychain as the device lock is removed , so would like to know if there is a way we can invalidate this .

Answered by DTS Engineer in 718237022

I need to clarify your goal here. First up, you wrote:

Deleting keychain items of speicific app

Is the app in question an app you’re building? Or are you looking to manipulate the keychain of apps from other third-party developers?

We are unable to access the keychain as the device lock is removed

I don’t understand this. The keychain APIs work just fine if there’s no device passcode. In what way are you unable to access the keychain?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

I need to clarify your goal here. First up, you wrote:

Deleting keychain items of speicific app

Is the app in question an app you’re building? Or are you looking to manipulate the keychain of apps from other third-party developers?

We are unable to access the keychain as the device lock is removed

I don’t understand this. The keychain APIs work just fine if there’s no device passcode. In what way are you unable to access the keychain?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

We are trying to delete keychain items of our APP

You are correct , we can access keychain items without having passcode but we can specify the access requirement for that

but while storing Keys we specify

kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly

this requires passcode to access that item , by this it has to auto delete the items when device passcode is removed , but thats not happening

Deleting keychain items of speicific app when device lock is removed
 
 
Q