<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/CMSEncoderCopyRecipients(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@CMSEncoderCopyRecipients"
  },
  "title" : "CMSEncoderCopyRecipients(_:_:)"
}
-->

# CMSEncoderCopyRecipients(_:_:)

Obtains the array of recipients specified with the `CMSEncoderAddRecipients` function.

```
func CMSEncoderCopyRecipients(_ cmsEncoder: CMSEncoder, _ recipientsOut: UnsafeMutablePointer<CFArray?>) -> OSStatus
```

## Parameters

`cmsEncoder`

The CMSEncoder reference returned by the [`CMSEncoderCreate(_:)`](/documentation/Security/CMSEncoderCreate(_:)) function.

`recipientsOut`

On return, points to an array of certificate objects of type [`SecCertificate`](/documentation/Security/SecCertificate) of the recipients of the message. If the [`CMSEncoderAddRecipients(_:_:)`](/documentation/Security/CMSEncoderAddRecipients(_:_:)) function has not been called for this message, this function returns a `NULL` array. You must use the <doc://com.apple.documentation/documentation/CoreFoundation/CFRelease> function to free this reference when you are finished using it.

## Return Value

A result code. See [Security Framework Result Codes](/documentation/Security/security-framework-result-codes).

## See Also

[`CMSEncoderCreate(_:)`](/documentation/Security/CMSEncoderCreate(_:))

Creates a CMSEncoder reference.

[`CMSEncoderAddRecipients(_:_:)`](/documentation/Security/CMSEncoderAddRecipients(_:_:))

Specifies a message is to be encrypted and specifies the recipients of the message.



---

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)