Hello
on MacOS, I use following codes to get the sign of an application
char app_path[PATH_MAX+1] = {0};
uint32_t size = sizeof(app_path);
int ret = _NSGetExecutablePath(app_path, &size);
if (ret)
return -1;
NSString *app_path_str = [[NSString alloc] initWithUTF8String: app_path];
NSURL* url = [NSURL URLWithString:app_path_str];
CFURLRef path = (__bridge CFURLRef)url;
SecStaticCodeRef static_code;
OSStatus status = SecStaticCodeCreateWithPath(path, kSecCSDefaultFlags, &static_code);
and find when the path includes a space char( for example: "/Users/username/Downloads/test A/test.dmg")
SecStaticCodeCreateWithPath will always return -4960(errSecCoreFoundationUnknown?)
and it works well when the path doesn't contain space,
could anyone give some help?
thanks very much