<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecTrustEvaluateAsyncWithError(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecTrustEvaluateAsyncWithError"
  },
  "title" : "SecTrustEvaluateAsyncWithError(_:_:_:)"
}
-->

# SecTrustEvaluateAsyncWithError(_:_:_:)

Evaluates a trust object asynchronously on the specified dispatch queue.

```
func SecTrustEvaluateAsyncWithError(_ trust: SecTrust, _ queue: dispatch_queue_t, _ result: @escaping SecTrustWithErrorCallback) -> OSStatus
```

## Parameters

`trust`

The trust management object to evaluate. A trust management object includes the certificate to be verified plus the policy or policies to be used in evaluating trust. It can optionally also include other certificates to be used in verifying the first certificate. Use the [`SecTrustCreateWithCertificates(_:_:_:)`](/documentation/Security/SecTrustCreateWithCertificates(_:_:_:)) function to create a trust management object.

`queue`

The dispatch queue on which the result block should execute. You must call the method from the same queue.

`result`

A closure that the method calls to report the result of trust evaluation. The method calls the closure exactly once if the method returns [`errSecSuccess`](/documentation/Security/errSecSuccess), and not at all otherwise. The method might call the closure synchronously in some cases, before returning.

## Return Value

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

## Discussion

This method behaves like [`SecTrustEvaluateWithError(_:_:)`](/documentation/Security/SecTrustEvaluateWithError(_:_:)), except that it provides an evaluation by calling the given closure. The method might do this synchronously before returning if the trust instance already contains a result. Otherwise, the method returns immediately, performs the evaluation asynchronously, and calls the closure with the result later.

> Important:
> You must call this method from the same dispatch queue that you specify as the `queue` parameter.

---

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)