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

# SecKeychainItemCopyFromPersistentReference(_:_:)

Provides a keychain item reference, given a persistent reference.

```
func SecKeychainItemCopyFromPersistentReference(_ persistentItemRef: CFData, _ itemRef: UnsafeMutablePointer<SecKeychainItem?>) -> OSStatus
```

## Parameters

`persistentItemRef`

A persistent reference for a keychain item.

`itemRef`

On return, a keychain item reference for the item for which you provided a persistent reference. You must call the `CFRelease` function to release this object when you are finished using it.

## Return Value

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

## Discussion

A persistent reference may be stored on disk or passed between processes. You use the [`SecKeychainItemCreatePersistentReference(_:_:)`](/documentation/Security/SecKeychainItemCreatePersistentReference(_:_:)) function to create a persistent reference.

---

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)