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

# SecKeychainItemCopyAccess(_:_:)

Retrieves the access of a given keychain item.

```
func SecKeychainItemCopyAccess(_ itemRef: SecKeychainItem, _ access: UnsafeMutablePointer<SecAccess?>) -> OSStatus
```

## Parameters

`itemRef`

A keychain item.

`access`

On return, points to the keychain item’s access instance. Call the <doc://com.apple.documentation/documentation/CoreFoundation/CFRelease> method to release this access instance when you are finished using it.

## Return Value

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

## Discussion

Use this method to retrieve the access instance from a keychain item. Alternatively, you can look for the [`kSecAttrAccess`](/documentation/Security/kSecAttrAccess) attribute among the keychain item’s attributes when you call the [`SecItemCopyMatching(_:_:)`](/documentation/Security/SecItemCopyMatching(_:_:)) method.

---

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)