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

# CMSDecoderCopySignerCert(_:_:_:)

Obtains the certificate of the specified signer of a CMS message.

```
func CMSDecoderCopySignerCert(_ cmsDecoder: CMSDecoder, _ signerIndex: Int, _ signerCertOut: UnsafeMutablePointer<SecCertificate?>) -> OSStatus
```

## Parameters

`cmsDecoder`

The CMSDecoder reference returned by the `CMSDecoderCreate` function.

`signerIndex`

A number indicating which signer’s email address to return. Signer index numbers start with 0. Use the [`CMSDecoderGetNumSigners(_:_:)`](/documentation/Security/CMSDecoderGetNumSigners(_:_:)) function to determine the total number of signers for a message.

`signerCertOut`

On return, points to the certificate of the specified signer.

## Return Value

A result code. See [Security Framework Result Codes](/documentation/Security/security-framework-result-codes). Returns [`errSecParam`](/documentation/Security/errSecParam) if the CMS message was not signed or if `signerIndex` is greater than the number of signers of the message minus one (signerIndex > (numSigners – 1)).

## Discussion

You cannot call this function until after you have called the [`CMSDecoderFinalizeMessage(_:)`](/documentation/Security/CMSDecoderFinalizeMessage(_:)) function.

## See Also

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

Creates a CMSDecoder reference.

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

Indicates that there is no more data to decode.



---

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)