CMSDecoderCopyAllCerts(_:_:)
Obtains an array of all of the certificates in a message.
Declaration
func CMSDecoderCopyAllCerts(_ cmsDecoder: CMSDecoder, _ certsOut: UnsafeMutablePointer<CFArray?>) -> OSStatusParameters
- cmsDecoder:
The CMSDecoder reference returned by the
CMSDecoderCreatefunction. - certsOut:
On return, points to an array of
SecCertificateRefobjects. ReturnsNULLif the message does not contain any certificates (the message was encrypted but not signed); this is not considered an error. You must use theCFReleasefunction to free this reference when you are finished using it.
Return Value
A result code. See Security Framework Result Codes.
Discussion
A CMS message can contain arbitrary sets of certificates other than or in addition to those indicating the identity of signers. You can use this function to retrieve such certificates from a message. If the message was signed, it contains signer certificates. You can use the CMSDecoderGetNumSigners(_:_:) and CMSDecoderCopySignerCert(_:_:_:) functions to retrieve the certificates for a specific signer.
You cannot call this function until after you have called the CMSDecoderFinalizeMessage(_:) function.