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

# CMSEncoderSetEncapsulatedContentType

Specifies an object identifier for the encapsulated data of a signed message.

```
OSStatus CMSEncoderSetEncapsulatedContentType(CMSEncoderRef cmsEncoder, const SecAsn1Oid *eContentType);
```

## Parameters

`cmsEncoder`

The CMSEncoder reference returned by the `CMSEncoderCreate` function.

`eContentType`

The object identifier for the encapsulated data in a signed message.

## Return Value

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

## Discussion

In a signed message, the signed data consists of any type of content (referred to as the *encapsulated content*, because it is encapsulated in the signed data) plus the signature values. You can indicate the content type of the encapsulated data by specifying an object identifier (OID) in the `eContentType` parameter of this function. The default value for the OID (used if this function is not called) is `id-data`. This is the normal encapsulated content type for applications such as S/MIME, which uses it to indicate MIME-encoded content. You can pass any value that is meaningful to your application. Examples of CMS OIDs are listed in <http://www.imc.org/ietf-smime/other-smime-oids.asn>.

If you do call this function, you must call it before the first call to the `CMSEncoderUpdateContent` function.

### Special Considerations

Use [`CMSEncoderSetEncapsulatedContentTypeOID(_:_:)`](/documentation/Security/CMSEncoderSetEncapsulatedContentTypeOID(_:_:)) for new development.

## See Also

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

Obtains the object identifier for the encapsulated data of a signed message.

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

Feeds content bytes into the encoder.

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

Creates a CMSEncoder reference.

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

Obtains the object identifier for the encapsulated data of a signed message.



---

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)