Obtains the certificate of the specified signer of a CMS message.


func CMSDecoderCopySignerCert(_ cmsDecoder: CMSDecoder, _ signerIndex: Int, _ signerCertOut: UnsafeMutablePointer<SecCertificate?>) -> OSStatus



The CMSDecoder reference returned by the CMSDecoderCreate function.


A number indicating which signer’s email address to return. Signer index numbers start with 0. Use the CMSDecoderGetNumSigners(_:_:) function to determine the total number of signers for a message.


On return, points to the certificate of the specified signer.

Return Value

A result code. See Security Framework Result Codes. Returns errSecParam if the CMS message was not signed or if signerIndex is greater than the number of signers of the message minus one (signerIndex > (numSigners – 1)).


You cannot call this function until after you have called the CMSDecoderFinalizeMessage(_:) function.

See Also

Signature Verification

func CMSDecoderSetSearchKeychain(CMSDecoder, CFTypeRef) -> OSStatus

Specifies the keychains to search for intermediate certificates to be used in verifying a signed message's signer certificates.

func CMSDecoderCopySignerEmailAddress(CMSDecoder, Int, UnsafeMutablePointer<CFString?>) -> OSStatus

Obtains the email address of the specified signer of a CMS message.

enum CMSSignerStatus

The constants that indicate the status of the signature and signer information in a signed message.