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

# CMSDecoderUpdateMessage(_:_:_:)

Feeds raw bytes of the message to be decoded into the decoder.

```
func CMSDecoderUpdateMessage(_ cmsDecoder: CMSDecoder, _ msgBytes: UnsafeRawPointer, _ msgBytesLen: Int) -> OSStatus
```

## Parameters

`cmsDecoder`

The CMSDecoder reference returned by the `CMSDecoderCreate` function.

`msgBytes`

A pointer to the data to be decoded.

`msgBytesLen`

The length of the data, in bytes.

## Return Value

A result code. See [Security Framework Result Codes](/documentation/Security/security-framework-result-codes). Returns [`errSecUnknownFormat`](/documentation/Security/errSecUnknownFormat) upon detection of an improperly formatted CMS message.

## Discussion

This function can be called multiple times. Call the `CMSDecoderFinalizeMessage` function when you have no more data to decode.

## See Also

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

Creates a CMSDecoder reference.



---

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)