<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/kSecMatchTrustedOnly",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@kSecMatchTrustedOnly"
  },
  "title" : "kSecMatchTrustedOnly"
}
-->

# kSecMatchTrustedOnly

A key whose value is a Boolean indicating whether untrusted certificates should be returned.

```
let kSecMatchTrustedOnly: CFString
```

## Discussion

The corresponding value is of type <doc://com.apple.documentation/documentation/CoreFoundation/CFBoolean>. If this attribute is provided with a value of <doc://com.apple.documentation/documentation/CoreFoundation/kCFBooleanTrue>, only certificates that can be verified back to a trusted anchor are returned. If this value is <doc://com.apple.documentation/documentation/CoreFoundation/kCFBooleanFalse> or the attribute is not provided, then both trusted and untrusted certificates may be returned.

---

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)