Function SecStaticCodeCreateWithPath

Source
pub unsafe extern "C-unwind" fn SecStaticCodeCreateWithPath(
    path: &CFURL,
    flags: SecCSFlags,
    static_code: NonNull<*const SecStaticCode>,
) -> i32
Available on crate features SecStaticCode and CSCommon only.
Expand description

Given a path to a file system object, create a SecStaticCode object representing the code at that location, if possible. Such a SecStaticCode is not inherently linked to running code in the system.

It is possible to create a SecStaticCode object from an unsigned code object. Most uses of such an object will return the errSecCSUnsigned error. However, SecCodeCopyPath and SecCodeCopySigningInformation can be safely applied to such objects.

Parameter path: A path to a location in the file system. Only file:// URLs are currently supported. For bundles, pass a URL to the root directory of the bundle. For single files, pass a URL to the file. If you pass a URL to the main executable of a bundle, the bundle as a whole will be generally recognized. Caution: Paths containing embedded // or /../ within a bundle’s directory may cause the bundle to be misconstrued. If you expect to submit such paths, first clean them with realpath(3) or equivalent.

Parameter flags: Optional flags. Pass kSecCSDefaultFlags for standard behavior.

Parameter staticCode: On successful return, contains a reference to the StaticCode object representing the code at path. Unchanged on error.

Returns: Upon success, errSecSuccess. Upon error, an OSStatus value documented in CSCommon.h or certain other Security framework headers.