<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.10.0"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecTrustedApplicationSetData(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecTrustedApplicationSetData"
  },
  "title" : "SecTrustedApplicationSetData(_:_:)"
}
-->

# SecTrustedApplicationSetData(_:_:)

Sets the data of a given trusted app instance.

```
func SecTrustedApplicationSetData(_ appRef: SecTrustedApplication, _ data: CFData) -> OSStatus
```

## Parameters

`appRef`

A trusted application object.

`data`

A reference to the data to set in the trusted application.

## Return Value

A result code. See [Security Framework Result Codes](/documentation/Security/security-framework-result-codes).

## Discussion

If you use the [`SecTrustedApplicationCopyData(_:_:)`](/documentation/Security/SecTrustedApplicationCopyData(_:_:)) method to extract the data from a trusted app instance for storage or transmission, you can use the [`SecTrustedApplicationSetData(_:_:)`](/documentation/Security/SecTrustedApplicationSetData(_:_:)) method to insert that data into a new trusted app. Doing so creates an object that identifies the same app as the original trusted app instance.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)