---
title: "SecKeychainSetAccess(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/seckeychainsetaccess(_:_:)"
---

# SecKeychainSetAccess(_:_:)

Sets the application access for a keychain.

## Declaration

```swift
func SecKeychainSetAccess(_ keychain: SecKeychain?, _ access: SecAccess) -> OSStatus
```

## Parameters

- `keychain`: A reference to the keychain for which to set the access. Pass NULL to specify the default keychain.
- `access`: An access object of type doc://com.apple.security/documentation/Security/SecAccess containing access control lists for the keychain. See doc://com.apple.security/documentation/Security/access-control-lists for more information about creating an access object.

## Return Value

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