<!--
{
  "availability" : [
    "iOS: 11.3.0 -",
    "iPadOS: 11.3.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.3.0 -",
    "tvOS: 11.3.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecCopyErrorMessageString(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecCopyErrorMessageString"
  },
  "title" : "SecCopyErrorMessageString(_:_:)"
}
-->

# SecCopyErrorMessageString(_:_:)

Returns a string explaining the meaning of a security result code.

```
func SecCopyErrorMessageString(_ status: OSStatus, _ reserved: UnsafeMutableRawPointer?) -> CFString?
```

## Parameters

`status`

A result code of type `OSStatus` returned by a security function. See [Security Framework Result Codes](/documentation/Security/security-framework-result-codes) for a list of codes.

`reserved`

Reserved for future use. Pass `nil` for this parameter.

## Return Value

A human-readable string describing the result, or `nil` if no string is available for the specified result code. In Objective-C, call the <doc://com.apple.documentation/documentation/CoreFoundation/CFRelease> function to release this object when you are finished using it.

---

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)