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

# CMSEncoderAddSigners(_:_:)

Specifies signers of the message.

```
func CMSEncoderAddSigners(_ cmsEncoder: CMSEncoder, _ signerOrArray: CFTypeRef) -> OSStatus
```

## Parameters

`cmsEncoder`

The CMSEncoder reference returned by the `CMSEncoderCreate` function.

`signerOrArray`

The identity object for the identity of one signer, specified as type `SecIdentityRef`, or a `CFArray` of identity objects of type`SecIdentityRef`.

## Return Value

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

## Discussion

Call this function only if the message is to be signed. You can call this function more than once for the same message.

If you do call this function, you must call it before the first call to the [`CMSEncoderUpdateContent(_:_:_:)`](/documentation/Security/CMSEncoderUpdateContent(_:_:_:)) function.

## See Also

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

Feeds content bytes into the encoder.

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

Obtains the array of signers specified with the `CMSEncoderAddSigners` function.

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

Creates a CMSEncoder reference.

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

Obtains the status of a CMS message’s signature.



---

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)