So this is how I used to do it
a) Create trusted app object of the app that is creating the ACL using
SecTrustedApplicationCreateFromPath
b) Then I would create a trusted app object that would grant access to all Microsoft-approved apps.
- create requirement using "SecRequirementCreateWithString" using pre-determined code sign requirement
- SecTrustedApplicationCreateFromRequirement("com.microsoft", requirement, &trustedApplicationRef);
c) Then add object from 1) and 2) in the array and create final accessRef using below API
SecAccessCreate((CFStringRef)accessLabel, (__bridge CFArrayRef)allTrustedApps, accessrefs);
Because SecTrustedApplicationCreateFromPath is deprecated and soon to be gone,
I was hoping to explore an alternative approach where
create login keychain first - since by default it still adds the creating app into the ACL
Then use above approach that I initially shared to add a new ACL containing the new trusted app ref object that was created from code sign requirement, and then append it to the existing access ref object for this login keychain object.
Topic:
Privacy & Security
SubTopic:
General
Tags: