I am trying to read Access Control List of a KeychainItem. I want to modify access for this KeychainItem so that it doesn't prompt for password everytime my app tries for access it. KeychainItem contains private key.
Below the code snippet I am using.
SecAccessRef secaccess;
OSStatus ret = SecKeychainItemCopyAccess(pKeychain, &secaccess);
SecKeychainItemCopyAccess fails with error -25243 (The specified item has no access control ).
I believe every item has access control as per the link https://developer.apple.com/documentation/security/keychain_services/access_control_lists?language=objc
My test program ask for password everytime I run it with options "Always Allow" , "Deny" , "Allow". As per documentation, "Always Allow" option will add access control for the KeychainItem. But If I choose Always Allow option, SecKeychainItemCopyAccess fails with same error in subsequent run also.
Since I am new to MacOS, I am not sure if I am doing it right.
I am trying on MacOS 10.13.4 and 10.12
Thanks.