---
title: "CMSDecoderCopyContent(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/cmsdecodercopycontent(_:_:)"
---

# CMSDecoderCopyContent(_:_:)

Obtains the message content, if any.

## Declaration

```swift
func CMSDecoderCopyContent(_ cmsDecoder: CMSDecoder, _ contentOut: UnsafeMutablePointer<CFData?>) -> OSStatus
```

## Parameters

- `cmsDecoder`: The CMSDecoder reference returned by the CMSDecoderCreate function.
- `contentOut`: On return, points to the message’s content. Returns NULL if the content is detached. You must use the CFRelease function to free this reference when you are finished using it.

## Return Value

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

## Discussion

Discussion If the message has detached content, you are responsible for retrieving the content. In that case, you use the CMSDecoderSetDetachedContent(_:_:) function to tell the decoder the location of the content. You cannot call this function until after you have called the CMSDecoderFinalizeMessage function.

## See Also

### Related Documentation

- [CMSEncoderSetHasDetachedContent(_:_:)](security/cmsencodersethasdetachedcontent(_:_:).md)
- [CMSDecoderSetDetachedContent(_:_:)](security/cmsdecodersetdetachedcontent(_:_:).md)
- [CMSDecoderCreate(_:)](security/cmsdecodercreate(_:).md)
- [CMSDecoderFinalizeMessage(_:)](security/cmsdecoderfinalizemessage(_:).md)
