---
title: "SecKeychainSetDomainSearchList(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/seckeychainsetdomainsearchlist(_:_:)"
---

# SecKeychainSetDomainSearchList(_:_:)

Sets the keychain search list for a specified preference domain.

## Declaration

```swift
func SecKeychainSetDomainSearchList(_ domain: SecPreferencesDomain, _ searchList: CFArray) -> OSStatus
```

## Parameters

- `domain`: The preference domain for which you wish to set the default keychain search list. See doc://com.apple.security/documentation/Security/SecPreferencesDomainfor possible domain values.
- `searchList`: A pointer to a keychain search list to set in the preference domain.

## Return Value

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

## Discussion

Discussion A preference domain is a set of security-related preferences, such as the default keychain and the current keychain search list. Use this function if you want to set the keychain search list for a specific preference domain. Use the SecKeychainSetSearchList(_:) function if you want to set the keychain search list for the current preference domain. See the SecKeychainSetPreferenceDomain(_:) function for a discussion of current and default preference domains.
