---
title: "CMSEncoderCopySupportingCerts(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/cmsencodercopysupportingcerts(_:_:)"
---

# CMSEncoderCopySupportingCerts(_:_:)

Obtains the certificates added to a message with CMSEncoderAddSupportingCerts.

## Declaration

```swift
func CMSEncoderCopySupportingCerts(_ cmsEncoder: CMSEncoder, _ certsOut: UnsafeMutablePointer<CFArray?>) -> OSStatus
```

## Parameters

- `cmsEncoder`: The CMSEncoder reference returned by the CMSEncoderCreate function.
- `certsOut`: On return, points to a CFArray of SecCertificateRef objects. You must use the CFRelease function to free this reference when you are finished using it.

## Return Value

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

## Discussion

Discussion A CMS message can contain arbitrary sets of certificates other than or in addition to those indicating the identity of signers. You can use this function to obtain any such certificates added with the CMSEncoderAddSupportingCerts function.  If CMSEncoderAddSupportingCerts has not been called, this function returns a NULL value for certsOut. Note that this function does not return the signing certificates, if any.

## See Also

### Related Documentation

- [CMSEncoderCreate(_:)](security/cmsencodercreate(_:).md)
- [CMSEncoderAddSupportingCerts(_:_:)](security/cmsencoderaddsupportingcerts(_:_:).md)
