Function SecCodeCheckValidity

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

Performs dynamic validation of the given SecCode object. The call obtains and verifies the signature on the code object. It checks the validity of only those sealed components required to establish identity. It checks the SecCode’s dynamic validity status as reported by its host. It ensures that the SecCode’s host is in turn valid. Finally, it validates the code against a SecRequirement if one is given. The call succeeds if all these conditions are satisfactory. It fails otherwise.

This call is secure against attempts to modify the file system source of the SecCode.

Parameter code: The code object to be validated.

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

Parameter requirement: An optional code requirement specifying additional conditions the code object must satisfy to be considered valid. If NULL, no additional requirements are imposed.

Returns: If validation passes, errSecSuccess. If validation fails, an OSStatus value documented in CSCommon.h or certain other Security framework headers.