---
title: "CMSEncoderSetSignerAlgorithm(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/cmsencodersetsigneralgorithm(_:_:)"
---

# CMSEncoderSetSignerAlgorithm(_:_:)

Sets the digest algorithm to use for the signer.

## Declaration

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

## Parameters

- `cmsEncoder`: The CMSEncoder reference returned by the doc://com.apple.security/documentation/Security/CMSEncoderCreate(_:) function.
- `digestAlgorithm`: A string representing the digest algorithm to use.

## Return Value

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