---
title: SecTrustWithErrorCallback
framework: security
role: symbol
role_heading: Type Alias
path: security/sectrustwitherrorcallback
---

# SecTrustWithErrorCallback

A block called with the results of an asynchronous trust evaluation.

## Declaration

```swift
typealias SecTrustWithErrorCallback = (SecTrust, Bool, CFError?) -> Void
```

## Parameters

- `trustRef`: The trust that was evaluated.
- `result`: A Boolean that’s true if the certificate is trusted, or false if not.
- `error`: An error that indicates the reason for trust failure, if applicable.

## Discussion

Discussion Provide a block of this type as the final argument to the SecTrustEvaluateAsyncWithError(_:_:_:) method to receive the result of the trust evaluation. The block provides a pass or fail indicator and an error describing the reason for any failure. In the case of multiple certificate failures, the error contains a code representing the most serious. The localized description indicates the certificate with the most serious problem and the type of error. The underlying error contains a localized description of each certificate in the chain that had an error and all errors found with that certificate.
