---
title: "SecRequirementCreateWithData(_:_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/secrequirementcreatewithdata(_:_:_:)"
---

# SecRequirementCreateWithData(_:_:_:)

Creates a code requirement object from the binary form of a code requirement.

## Declaration

```swift
func SecRequirementCreateWithData(_ data: CFData, _ flags: SecCSFlags, _ requirement: UnsafeMutablePointer<SecRequirement?>) -> OSStatus
```

## Parameters

- `data`: A binary blob created earlier from a valid code requirement object by calling the doc://com.apple.security/documentation/Security/SecRequirementCopyData(_:_:_:) function.
- `flags`: Optional flags; see doc://com.apple.security/documentation/Security/SecCSFlags for possible values. Pass doc://com.apple.security/documentation/Security/SecCSFlags/kSecCSDefaultFlags for standard behavior.
- `requirement`: On return, contains a code requirement object that behaves identically to the one from which the data blob was obtained.

## Return Value

Return Value A result code. See Code Signing Services Result Codes.

## Discussion

Discussion You can use the SecRequirementCopyData(_:_:_:) function to convert a code requirement object to a binary blob, and store the blob in any form you wish. When you are ready to use the code requirement in another function call, you can use the SecRequirementCreateWithData(_:_:_:) function to convert it back to a code requirement object.
