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

# CMSEncoderSetSignerAlgorithm(_:_:)

Sets the digest algorithm to use for the signer.

```
func CMSEncoderSetSignerAlgorithm(_ cmsEncoder: CMSEncoder, _ digestAlgorithm: CFString) -> OSStatus
```

## Parameters

`cmsEncoder`

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

`digestAlgorithm`

A string representing the digest algorithm to use.

## Return Value

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

## Discussion

---

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)