---
title: "CMSDecoderCopySignerStatus(_:_:_:_:_:_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/cmsdecodercopysignerstatus(_:_:_:_:_:_:_:)"
---

# CMSDecoderCopySignerStatus(_:_:_:_:_:_:_:)

Obtains the status of a CMS message’s signature.

## Declaration

```swift
func CMSDecoderCopySignerStatus(_ cmsDecoder: CMSDecoder, _ signerIndex: Int, _ policyOrArray: CFTypeRef, _ evaluateSecTrust: Bool, _ signerStatusOut: UnsafeMutablePointer<CMSSignerStatus>?, _ secTrustOut: UnsafeMutablePointer<SecTrust?>?, _ certVerifyResultCodeOut: UnsafeMutablePointer<OSStatus>?) -> OSStatus
```

## Parameters

- `cmsDecoder`: The doc://com.apple.security/documentation/Security/CMSDecoder reference returned by the doc://com.apple.security/documentation/Security/CMSDecoderCreate(_:) function.
- `signerIndex`: A number indicating which signer to examine. Signer index numbers start with 0. Use the doc://com.apple.security/documentation/Security/CMSDecoderGetNumSigners(_:_:) function to determine the total number of signers for a message.
- `policyOrArray`: The trust policy or policies to be used to verify the signer’s certificate. You can specify either a single doc://com.apple.security/documentation/Security/SecPolicy instance or a doc://com.apple.documentation/documentation/CoreFoundation/CFArray of doc://com.apple.security/documentation/Security/SecPolicy instances. For more information about policy objects, see doc://com.apple.security/documentation/Security/policies.
- `evaluateSecTrust`: Set to doc://com.apple.documentation/documentation/Swift/true to cause the decoder to call the doc://com.apple.security/documentation/Security/SecTrustEvaluate(_:_:) function to evaluate the doc://com.apple.security/documentation/Security/SecTrust instance created for the evaluation of the signer certificate. Set to doc://com.apple.documentation/documentation/Swift/false if you intend to call the doc://com.apple.security/documentation/Security/SecTrustEvaluate(_:_:) function for the doc://com.apple.security/documentation/Security/SecTrust instance returned by the secTrustOut parameter.
- `signerStatusOut`: If you specify doc://com.apple.documentation/documentation/Swift/true for the evaluateSecTrust parameter, on return this parameter indicates the status of the signature. See doc://com.apple.security/documentation/Security/CMSSignerStatus for possible results. Pass in NULL if you don’t want a value returned.
- `secTrustOut`: On return this parameter points to a doc://com.apple.security/documentation/Security/SecTrust instance. If you specified doc://com.apple.documentation/documentation/Swift/true for the evaluateTrust parameter, this is the trust instance that was used to verify the signer’s certificate. If you specified doc://com.apple.documentation/documentation/Swift/false for the evaluateTrust parameter, you can call the doc://com.apple.security/documentation/Security/SecTrustEvaluate(_:_:) function to evaluate the doc://com.apple.security/documentation/Security/SecTrust instance. Pass NULL if you do not want this instance returned. You must use the doc://com.apple.documentation/documentation/CoreFoundation/CFRelease function to free this reference when you are finished using it.
- `certVerifyResultCodeOut`: If you specify doc://com.apple.documentation/documentation/Swift/true for the evaluateSecTrust parameter, on return this parameter indicates the result of the certificate verification. Pass in NULL if you don’t want a value returned. Some of the most common results returned in this parameter include:

## Return Value

Return Value A result code. See Security Framework Result Codes. A result of errSecSuccess indicates only that the function completed successfully; it does not indicate that the signature is verified or the certificates are valid. See the signerStatusOut and certVerifyResultCodeOut parameters for the verification and certificate validation results.

## Discussion

Discussion You cannot call this function until after you have called the CMSDecoderFinalizeMessage(_:) function. Although the message has been fully decoded when the CMSDecoderFinalizeMessage(_:) function returns with no error, the signature can’t be validated or certificates verified until this function is called. A CMS message can be signed by multiple signers; this function returns the status associated with one signer as specified by the signerIndex parameter. If you both pass in false for the evaluateSecTrust parameter and NULL for the secTrustOut parameter, no evaluation of the signer certificate can occur.

## See Also

### Related Documentation

- [SecTrustEvaluate(_:_:)](security/sectrustevaluate(_:_:).md)
- [CMSDecoderCreate(_:)](security/cmsdecodercreate(_:).md)
- [CMSDecoderFinalizeMessage(_:)](security/cmsdecoderfinalizemessage(_:).md)
