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

# SecKeychainSetSearchList(_:)

Specifies the list of keychains to use in the default keychain search list.

```
func SecKeychainSetSearchList(_ searchList: CFArray) -> OSStatus
```

## Parameters

`searchList`

An array of keychain references (of type [`SecKeychain`](/documentation/Security/SecKeychain)) specifying the list of keychains to use in the default keychain search list. Passing an empty array clears the search list.

## Return Value

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

## Discussion

The default keychain search list is used by several functions; see for example [`SecKeychainSearchCreateFromAttributes`](/documentation/Security/SecKeychainSearchCreateFromAttributes), [`SecKeychainFindInternetPassword(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)`](/documentation/Security/SecKeychainFindInternetPassword(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)), or [`SecKeychainFindGenericPassword(_:_:_:_:_:_:_:_:)`](/documentation/Security/SecKeychainFindGenericPassword(_:_:_:_:_:_:_:_:)). To obtain the current default keychain search list, use the [`SecKeychainCopySearchList(_:)`](/documentation/Security/SecKeychainCopySearchList(_:)) function.

The default keychain search list is displayed as the keychain list in the Keychain Access utility. If you use [`SecKeychainSetSearchList(_:)`](/documentation/Security/SecKeychainSetSearchList(_:)) to change the keychain search list, the list displayed in Keychain Access changes accordingly.

---

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)