Returns a specific certificate from the certificate chain used to evaluate trust.
SDKs
- iOS 2.0+
- macOS 10.7+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Security
Declaration
func SecTrustGetCertificateAtIndex(_ trust: Sec Trust, _ ix: CFIndex) -> Sec Certificate?
Parameters
trust
The trust management object for the certificate that has been evaluated. Use the
Sec
function to create a trust management object and theTrust Create With Certificates(_: _: _:) Sec
function to evaluate the certificate chain.Trust Evaluate With Error(_: _:) ix
The index number of the requested certificate. Index numbers start at 0 for the leaf certificate and end at the anchor (or the last certificate if no anchor was found). Use the
Sec
function to get the total number of certificates in the chain.Trust Get Certificate Count(_:)
Return Value
A certificate object for the requested certificate.
Discussion
Call the Sec
function before calling this function.