<!--
{
  "availability" : [
    "macOS: 10.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SecurityInterface",
  "identifier" : "/documentation/SecurityInterface/SFCertificateTrustPanel/runModal(for:message:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Security Interface"
    ],
    "preciseIdentifier" : "c:objc(cs)SFCertificateTrustPanel(im)runModalForTrust:message:"
  },
  "title" : "runModal(for:message:)"
}
-->

# runModal(for:message:)

Displays a modal panel that shows the results of a certificate trust evaluation and that allows the user to edit trust settings.

```
func runModal(for trust: SecTrust!, message: String!) -> Int
```

## Parameters

`trust`

A trust management object. Use the <doc://com.apple.documentation/documentation/Security/SecTrustCreateWithCertificates(_:_:_:)> function (in Security/SecTrust.h) to create the trust management object.

`message`

A message string to display in the panel.

## Discussion

This method returns <doc://com.apple.documentation/documentation/AppKit/NSOKButton> if the default button is clicked, or <doc://com.apple.documentation/documentation/AppKit/NSCancelButton> if the alternate button is clicked.

The user can use this panel to edit trust decisions for the specified certificate or for any of the certificates in the certificate chain. The trust settings are saved when the user clicks the default button. Call `SecTrustGetUserTrust` to obtain the user’s trust settings.

Note that changing the user trust settings does not affect the results of a trust evaluation. Therefore, the trust evaluation shown in the panel (such as “This certificate is not yet valid”) does not change, nor does the result of a call to <doc://com.apple.documentation/documentation/Security/SecTrustGetResult>. It is up to your application to determine how to handle the user’s trust decision.

## See Also

  <doc://com.apple.documentation/documentation/Security/SecTrustGetResult>

  <doc://com.apple.documentation/documentation/Security/SecTrustCreateWithCertificates(_:_:_:)>



---

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)