Specifies whether the signed data is to be separate from the message.


func CMSEncoderSetHasDetachedContent(_ cmsEncoder: CMSEncoder, _ detachedContent: Bool) -> OSStatus



The CMSEncoder reference returned by the CMSEncoderCreate(_:) function.


TRUE if the message should exclude the data to be signed. Prior to calling this function, the encoder defaults to FALSE for this setting, indicating that the message contains the data to be signed.

Return Value


A signed CMS message can optionally be sent separately from the signed data. Set detachedContent to TRUE to indicate that the signed data is to be kept separate from the message.

Encrypted messages, including those that are also signed, cannot use detached content.

If you do call this function, you must call it before the first call to the CMSEncoderUpdateContent(_:_:_:) function.

See Also

Message Creation

func CMSEncoderAddRecipients(CMSEncoder, CFTypeRef) -> OSStatus

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

func CMSEncoderSetEncapsulatedContentTypeOID(CMSEncoder, CFTypeRef) -> OSStatus

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

struct CMSSignedAttributes

Optional attributes you can add to a signed message.

func CMSEncoderSetCertificateChainMode(CMSEncoder, CMSCertificateChainMode) -> OSStatus

Specifies which certificates to include in a signed CMS message.

enum CMSCertificateChainMode

Constants that can be set to specify what certificates to include in a signed message.

func CMSEncoderSetSignerAlgorithm(CMSEncoder, CFString) -> OSStatus

Sets the digest algorithm to use for the signer.