When bumping to macOS12/iOS12.2 in #101342 we got a new warning about this API being deprecated.
From @filipnavara
The SecTrustGetCertificateAtIndex deprecation would need a new code path to use SecTrustCopyCertificateChain. To make that efficient we would likely need to rewrite the managed -> native interface.