---
title: "SecCertificateCopyCommonName(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/seccertificatecopycommonname(_:_:)"
---

# SecCertificateCopyCommonName(_:_:)

Retrieves the common name of the subject of a certificate.

## Declaration

```swift
func SecCertificateCopyCommonName(_ certificate: SecCertificate, _ commonName: UnsafeMutablePointer<CFString?>) -> OSStatus
```

## Parameters

- `certificate`: The certificate object from which to retrieve the common name.
- `commonName`: On return, points to the common name. In Objective-C, call the doc://com.apple.documentation/documentation/CoreFoundation/CFRelease function to release this object when you are finished with it.

## Return Value

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