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

# SecTrustCopyExceptions(_:)

Returns an opaque cookie containing exceptions to trust policies that will allow future evaluations of the current certificate to succeed.

```
func SecTrustCopyExceptions(_ trust: SecTrust) -> CFData?
```

## Parameters

`trust`

The evaluated trust management object whose policies you wish to retrieve.

## Return Value

An opaque cookie. If you pass this cookie to [`SecTrustSetExceptions(_:_:)`](/documentation/Security/SecTrustSetExceptions(_:_:)), that function sets a list of exceptions for future processing of the certificate. Once this list of exceptions are set, a subsequent call to [`SecTrustEvaluateWithError(_:_:)`](/documentation/Security/SecTrustEvaluateWithError(_:_:)) for that certificate will return `true`.

## Discussion

Note: If a new error occurs that did not occur when this function was called originally, the subsequent call to [`SecTrustEvaluateWithError(_:_:)`](/documentation/Security/SecTrustEvaluateWithError(_:_:)) can still fail. For example, if the certificate expires between calling `SecTrustCopyExceptions` and [`SecTrustEvaluateWithError(_:_:)`](/documentation/Security/SecTrustEvaluateWithError(_:_:)), evaluation will fail.

## Discussion

Normally this API should only be called after asking the user how to proceed, and even then, only if the user explicitly tells your application to trust the current certificate chain in spite of the errors presented.

## See Also

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

Sets the policies to use in an evaluation.



---

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)