Specifies which certificates to include in a signed CMS message.


func CMSEncoderSetCertificateChainMode(_ cmsEncoder: CMSEncoder, _ chainMode: CMSCertificateChainMode) -> OSStatus



The CMSEncoder reference returned by the CMSEncoderCreate function.


A constant that indicates which certificate or certificates to include in the message. See CMSCertificateChainMode.

Return Value


This function is used only for signed messages and is optional. If you don’t call this function, the default, kCMSCertificateChain, is used. In this case the message includes the signer certificate plus all certificates needed to verify the signer certificate, up to but not including the root certificate.

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 CMSEncoderSetHasDetachedContent(CMSEncoder, Bool) -> OSStatus

Specifies whether the signed data is to be separate from 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.

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.