---
title: "SecKeychainItemCopyAccess(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/seckeychainitemcopyaccess(_:_:)"
---

# SecKeychainItemCopyAccess(_:_:)

Retrieves the access of a given keychain item.

## Declaration

```swift
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

Return Value A result code. See Security Framework Result Codes.

## Discussion

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