Function

SecRequirementCopyString

Converts a code requirement object into text form.

Declaration

OSStatus SecRequirementCopyString(SecRequirementRef requirement, SecCSFlags flags, CFStringRef  _Nullable *text);

Parameters

requirement

A valid code requirement object.

flags

Optional flags; see SecCSFlags for possible values. Pass kSecCSDefaultFlags for standard behavior.

text

On return, a text representation of the code requirement.

Return Value

Discussion

If you use the SecRequirementCreateWithString or SecRequirementCreateWithStringAndErrors function to create a code requirement object from a text string and later use the SecRequirementCopyString function to convert the object back to a string, the reconstituted text may differ in formatting, contain different source comments, and perform its validation functions in different order from the original. However, it is guaranteed that that the reconstituted text is functionally identical to the original. That is, recompiling the text using SecRequirementCreateWithString will produce a code requirement object that behaves identically to the first one you created.

See Also

Code Requirements as Text

SecRequirementCreateWithString

Creates a code requirement object by compiling a valid text representation of a code requirement.

SecRequirementCreateWithStringAndErrors

Creates a code requirement object by compiling a valid text representation of a code requirement and returns detailed error information in the case of failure.