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

# CMSDecoderIsContentEncrypted(_:_:)

Determines whether a CMS message was encrypted.

```
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

A result code. See [Security Framework Result Codes](/documentation/Security/security-framework-result-codes).

## Discussion

Note that if the message was encrypted and the decoding succeeded (`CMSDecoderFinalizeMessage` returned `noErr`), then the message was successfully decrypted. Call [`CMSDecoderCopyContent(_:_:)`](/documentation/Security/CMSDecoderCopyContent(_:_:)) to retrieve the decrypted content.

You cannot call this function until after you have called the `CMSDecoderFinalizeMessage` function.

## See Also

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

Creates a CMSDecoder reference.

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

Specifies a message is to be encrypted and specifies the recipients of the message.

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

Indicates that there is no more data to decode.



---

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)