<!--
{
  "availability" : [
    "macOS: 10.2.0 - 10.7.0"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecTrustGetCssmResultCode",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecTrustGetCssmResultCode"
  },
  "title" : "SecTrustGetCssmResultCode"
}
-->

# SecTrustGetCssmResultCode

Retrieves the CSSM result code from the most recent trust evaluation for a trust management object.

```
OSStatus SecTrustGetCssmResultCode(SecTrustRef trust, OSStatus *resultCode);
```

## Parameters

`trust`

The trust management object for which you wish to retrieve a result code.

`resultCode`

On return, the CSSM result code produced by the most recent call to the [`SecTrustEvaluate(_:_:)`](/documentation/Security/SecTrustEvaluate(_:_:)) function for the trust management object specified in the `trust` parameter.  The value of this parameter is undefined if `SecTrustEvaluate` has not been called.

## Return Value

A result code. See [Security Framework Result Codes](/documentation/Security/security-framework-result-codes). Returns [`errSecTrustNotAvailable`](/documentation/Security/errSecTrustNotAvailable) if the [`SecTrustEvaluate(_:_:)`](/documentation/Security/SecTrustEvaluate(_:_:)) function has not been called for the specified trust.

## Discussion

Whereas the [`SecTrustEvaluate(_:_:)`](/documentation/Security/SecTrustEvaluate(_:_:)) function returns one of the Security Framework result codes (see [Certificate, Key, and Trust Services](/documentation/Security/certificate-key-and-trust-services)), the `SecTrustGetCssmResultCode` function returns the CSSM result code as enumerated in `Security.framework/cssmerr.h`. Call this function to get a more specific reason for a failure than provided by `SecTrustEvaluate`. Other functions that might be of interest are the [`SecTrustGetTrustResult(_:_:)`](/documentation/Security/SecTrustGetTrustResult(_:_:)) function, which returns detailed results for each certificate in the certificate chain, and the [`SecTrustGetCssmResult`](/documentation/Security/SecTrustGetCssmResult) function, which returns the results in a format that can be passed directly to CSSM functions.

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 [`SecTrustSetVerifyDate(_:_:)`](/documentation/Security/SecTrustSetVerifyDate(_:_:)) function for the same trust management object on another thread.

## See Also

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

Returns the result code from the most recent trust 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)