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

# SecKeychainSetAccess(_:_:)

Sets the application access for a keychain.

```
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 [`SecAccess`](/documentation/Security/SecAccess) containing access control lists for the keychain. See [Access Control Lists](/documentation/Security/access-control-lists) for more information about creating an access object.

## Return Value

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

## Discussion

---

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)