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

# SecTrustCopyAnchorCertificates(_:)

Retrieves the anchor (root) certificates stored by macOS.

```
func SecTrustCopyAnchorCertificates(_ anchors: UnsafeMutablePointer<CFArray?>) -> OSStatus
```

## Parameters

`anchors`

On return, points to an array of certificate objects for trusted anchor (root) certificates, which is the default set of anchors for the caller. In Objective-C, call the <doc://com.apple.documentation/documentation/CoreFoundation/CFRelease> function to release the <doc://com.apple.documentation/documentation/CoreFoundation/CFArray> object when you are finished with it.

## Return Value

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

## Discussion

This function retrieves the certificates in the system’s store of anchor certificates (see [`SecTrustSetAnchorCertificates(_:_:)`](/documentation/Security/SecTrustSetAnchorCertificates(_:_:))). You can use the [`SecCertificate`](/documentation/Security/SecCertificate) objects retrieved by this function as input to other functions of this API, such as [`SecTrustCreateWithCertificates(_:_:_:)`](/documentation/Security/SecTrustCreateWithCertificates(_:_:_:)).

It is safe to call this function concurrently on two or more threads as long as it is not used to get values from a trust management object that is simultaneously being changed by another function. For example, you can call this function on two threads at the same time, but not if you are simultaneously calling the [`SecTrustSetAnchorCertificates(_:_:)`](/documentation/Security/SecTrustSetAnchorCertificates(_:_:)) function for the same trust management object on another thread.

## See Also

[`SecTrustSetAnchorCertificates(_:_:)`](/documentation/Security/SecTrustSetAnchorCertificates(_:_:))

Sets the anchor certificates used when evaluating a trust management object.



---

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)