---
title: "SecIdentityCopySystemIdentity(_:_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/secidentitycopysystemidentity(_:_:_:)"
---

# SecIdentityCopySystemIdentity(_:_:_:)

Obtains the system identity associated with a specified domain.

## Declaration

```swift
func SecIdentityCopySystemIdentity(_ domain: CFString, _ idRef: UnsafeMutablePointer<SecIdentity?>, _ actualDomain: UnsafeMutablePointer<CFString?>?) -> OSStatus
```

## Parameters

- `domain`: The domain for which you want to find an identity, typically in reverse DNS notation, such as com.apple.security. You may also pass the values defined in doc://com.apple.security/documentation/Security/system-identity-domains.
- `idRef`: On return, the identity object of the system-wide identity associated with the specified domain. In Objective-C, call the doc://com.apple.documentation/documentation/CoreFoundation/CFRelease function to release this object when you are finished with it.
- `actualDomain`: On return, the actual domain name of the returned identity object is returned here. This may be different from the requested domain. Pass NULL if you do not want this information.

## Return Value

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

## Discussion

Discussion If no system identity exists for the specified domain, a domain specific alternate may be returned instead. This is typically (but not exclusively) the system default identity. (kSecIdentityDomainDefault).
