---
title: "SecTrustSettingsImportExternalRepresentation(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/sectrustsettingsimportexternalrepresentation(_:_:)"
---

# SecTrustSettingsImportExternalRepresentation(_:_:)

Imports trust settings into a trust domain.

## Declaration

```swift
func SecTrustSettingsImportExternalRepresentation(_ domain: SecTrustSettingsDomain, _ trustSettings: CFData) -> OSStatus
```

## Parameters

- `domain`: The trust settings domain into which you want to import trust settings. For possible values, see doc://com.apple.security/documentation/Security/SecTrustSettingsDomain.
- `trustSettings`: An external representation of the trust settings (created by the doc://com.apple.security/documentation/Security/SecTrustSettingsCreateExternalRepresentation(_:_:) function) that you want to import.

## Return Value

Return Value A result code. See Security Framework Result Codes.

## Discussion

Discussion Trust settings for a certificate are associated with the hash of the certificate. Whenever the system encounters a certificate with the hash value associated with the trust settings, it applies those trust settings to the certificate. This function allows you to import trust settings in a portable data format that was exported from another machine. You can use this ability, for example, to clone trust settings to all the machines within an enterprise or university.
