On 27/09/16 22:57, Chris Hanson wrote:
On Sep 27, 2016, at 1:54 PM, Markus Spoettl <ms_li...@shiftoption.com> wrote:
On 27/09/16 22:39, Chris Hanson wrote:
How are you getting the URL that you pass to represent your application?
Could it be that you’re constructing the URL from a relative path when run
from the command line, rather than the full path? (You can’t depend on being
run from any particular working directory.)
Not sure what you mean by URL, I'm merely executing the app's executable from the command line. Assuming
the My.app bundle is located in "~/Projects/My/Debug", I cd into "~/Projects/My" and
execute "./Debug/My.App/Contents/MacOS/My”.
I mean, how are you constructing the SecStaticCodeRef that you pass to
SecStaticCodeCheckValidity()?
OK, here the full code:
CFStringRef reqStr = <some requirements>
SecStaticCodeRef ref = NULL;
SecRequirementRef req = NULL;
CFURLRef bURL = CFBundleCopyBundleURL(CFBundleGetMainBundle());
OSStatus status = SecStaticCodeCreateWithPath(bURL, kSecCSDefaultFlags, &ref);
if ((ref != NULL) && (status == noErr)) {
status = SecRequirementCreateWithString(reqStr, kSecCSDefaultFlags, &req);
if ((req != NULL) && (status == noErr)) {
// this fails
status = SecStaticCodeCheckValidity(ref, kSecCSCheckAllArchitectures, req);
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com