---
title: "CMSDecoderFinalizeMessage(_:)"
framework: security
role: symbol
role_heading: Function
path: "security/cmsdecoderfinalizemessage(_:)"
---

# CMSDecoderFinalizeMessage(_:)

Indicates that there is no more data to decode.

## Declaration

```swift
func CMSDecoderFinalizeMessage(_ cmsDecoder: CMSDecoder) -> OSStatus
```

## Parameters

- `cmsDecoder`: The CMSDecoder reference returned by the CMSDecoderCreate function.

## Return Value

Return Value A result code. See Security Framework Result Codes. Returns errSecUnknownFormat upon detection of an improperly formatted CMS message.

## Discussion

Discussion When you call this function, the decoder finishes decoding the message. If the message was encrypted and this function returns a result code of noErr, the message was successfully decrypted. Call the CMSDecoderCopyContent(_:_:) function to retrieve the message content. Call the CMSDecoderGetNumSigners(_:_:) function to find out if the message was signed and, if so, how many signers there were.

## See Also

### Related Documentation

- [CMSDecoderGetNumSigners(_:_:)](security/cmsdecodergetnumsigners(_:_:).md)
- [CMSDecoderCreate(_:)](security/cmsdecodercreate(_:).md)
- [CMSDecoderCopyContent(_:_:)](security/cmsdecodercopycontent(_:_:).md)
