---
title: "CMSDecoderIsContentEncrypted(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/cmsdecoderiscontentencrypted(_:_:)"
---

# CMSDecoderIsContentEncrypted(_:_:)

Determines whether a CMS message was encrypted.

## Declaration

```swift
func CMSDecoderIsContentEncrypted(_ cmsDecoder: CMSDecoder, _ isEncryptedOut: UnsafeMutablePointer<DarwinBoolean>) -> OSStatus
```

## Parameters

- `cmsDecoder`: The CMSDecoder reference returned by the CMSDecoderCreate function.
- `isEncryptedOut`: Returns TRUE if the message was encrypted.

## Return Value

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

## Discussion

Discussion Note that if the message was encrypted and the decoding succeeded (CMSDecoderFinalizeMessage returned noErr), then the message was successfully decrypted. Call CMSDecoderCopyContent(_:_:) to retrieve the decrypted content. You cannot call this function until after you have called the CMSDecoderFinalizeMessage function.

## See Also

### Related Documentation

- [CMSDecoderCreate(_:)](security/cmsdecodercreate(_:).md)
- [CMSEncoderAddRecipients(_:_:)](security/cmsencoderaddrecipients(_:_:).md)
- [CMSDecoderFinalizeMessage(_:)](security/cmsdecoderfinalizemessage(_:).md)
