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

# SecTrustedApplicationCopyData(_:_:)

Retrieves the data of a trusted app instance.

```
func SecTrustedApplicationCopyData(_ appRef: SecTrustedApplication, _ data: UnsafeMutablePointer<CFData?>) -> OSStatus
```

## Parameters

`appRef`

A trusted app from which to retrieve data. Use the [`SecTrustedApplicationCreateFromPath(_:_:)`](/documentation/Security/SecTrustedApplicationCreateFromPath(_:_:)) method to create a trusted app instance.

`data`

On return, points to an opaque data instance. Call the <doc://com.apple.documentation/documentation/CoreFoundation/CFRelease> method to release the data when you are finished using it.

## Return Value

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

## Discussion

The trusted app instance created by the [`SecTrustedApplicationCreateFromPath(_:_:)`](/documentation/Security/SecTrustedApplicationCreateFromPath(_:_:)) method includes data that uniquely identifies the app, such as a cryptographic hash of the app. The operating system uses this data to verify that the app is unaltered since the trusted app instance was created. When an app requests access to an item in the keychain for which it is designated as a trusted app, the operating system checks this data before granting access.

Use the [`SecTrustedApplicationCopyData(_:_:)`](/documentation/Security/SecTrustedApplicationCopyData(_:_:)) function to extract this data from the trusted app instance for storage or for transmission over the network. Use the [`SecTrustedApplicationSetData(_:_:)`](/documentation/Security/SecTrustedApplicationSetData(_:_:)) function to insert that data back into a trusted app instance. Note that this data is opaque: there’s no way to interpret it.

---

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)