---
title: "CMSDecoderSetSearchKeychain(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/cmsdecodersetsearchkeychain(_:_:)"
---

# CMSDecoderSetSearchKeychain(_:_:)

Specifies the keychains to search for intermediate certificates to be used in verifying a signed message’s signer certificates.

## Declaration

```swift
func CMSDecoderSetSearchKeychain(_ cmsDecoder: CMSDecoder, _ keychainOrArray: CFTypeRef) -> OSStatus
```

## Parameters

- `cmsDecoder`: The CMSDecoder reference returned by the CMSDecoderCreate function.
- `keychainOrArray`: Either a single keychain to search, specified as a keychain object (type SecKeychainRef), or a set of keychains specified as a CFArray of keychain objects. If you specify an empty CFArrayRef, no keychains are searched for intermediate certificates.

## Return Value

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

## Discussion

Discussion If you don’t call this function, the decoder uses the default keychain search list to search for intermediate certificates. If you do call this function, you must call it before you call the CMSDecoderCopySignerStatus function.

## See Also

### Related Documentation

- [CMSDecoderCreate(_:)](security/cmsdecodercreate(_:).md)
