---
title: "CMSEncoderAddSignedAttributes(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/cmsencoderaddsignedattributes(_:_:)"
---

# CMSEncoderAddSignedAttributes(_:_:)

Specifies attributes for a signed message.

## Declaration

```swift
func CMSEncoderAddSignedAttributes(_ cmsEncoder: CMSEncoder, _ signedAttributes: CMSSignedAttributes) -> OSStatus
```

## Parameters

- `cmsEncoder`: The CMSEncoder reference returned by the CMSEncoderCreate function.
- `signedAttributes`: Attribute flags as defined in doc://com.apple.security/documentation/Security/CMSSignedAttributes.

## Return Value

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

## Discussion

Discussion Attributes are optional for signed messages. They are not used for other types of CMS messages.  The use of attributes is described in section 2.5 of the S/MIME 3.1 specification. If you do call this function, you must call it before the first call to the CMSEncoderUpdateContent(_:_:_:) function.

## See Also

### Related Documentation

- [CMSEncoderUpdateContent(_:_:_:)](security/cmsencoderupdatecontent(_:_:_:).md)
- [CMSEncoderCreate(_:)](security/cmsencodercreate(_:).md)
