Function SecCodeCopyDesignatedRequirement

Source
pub unsafe extern "C-unwind" fn SecCodeCopyDesignatedRequirement(
    code: &SecStaticCode,
    flags: SecCSFlags,
    requirement: NonNull<*mut SecRequirement>,
) -> i32
Available on crate features SecCode and CSCommon only.
Expand description

For a given Code or StaticCode object, determines its Designated Code Requirement. The Designated Requirement is the SecRequirement that the code believes should be used to properly identify it in the future.

If the SecCode contains an explicit Designated Requirement, a copy of that is returned. If it does not, a SecRequirement is implicitly constructed from its signing authority and its embedded unique identifier. No Designated Requirement can be obtained from code that is unsigned. Code that is modified after signature, improperly signed, or has become invalid, may or may not yield a Designated Requirement. This call does not validate the SecStaticCode argument.

Parameter code: The Code or StaticCode object to be interrogated. For a Code argument, its StaticCode is processed as per SecCodeCopyStaticCode.

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

Parameter requirement: On successful return, contains a copy of a SecRequirement object representing the code’s Designated Requirement. On error, unchanged.

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