I am diagnosing a trust failure for an archived iOS arm64 app, without changing trust settings or rebuilding speculatively.
Environment: macOS 26.6.2 (25G83), Xcode 27.0 (27A266a), as reported by installed public metadata. The diagnostic is a non-interactive Python helper calling the installed Security/CoreFoundation APIs through a bounded child-process runner in a desktop coding-agent session. This is not an Xcode GUI operation; an effect of the session, keychain/cache, or service access has not been established.
Observed results:
- The app's embedded code CMS supplies three certificates. One explicitly identified signer matches the stored signer receipt in memory. The helper places the signer first, followed by the other supplied certificates.
- It uses SecPolicyCreateWithProperties(kSecPolicyAppleCodeSigning), SecTrustCreateWithCertificates, and SecTrustSetNetworkFetchAllowed(false). The status-returning setup calls succeed. Disabling intermediate fetching does not prove that all OS revocation/cache/network activity is absent.
- One SecTrustEvaluateWithError call returns false. The top-level CFError and its single kCFErrorUnderlyingErrorKey child both report NSOSStatusErrorDomain / -26276. The child has no further underlying-error key. This designated key chain was collected completely; other userInfo and localized descriptions were not collected.
- A prior recorded evaluation returned a chain containing only the signer. The latest diagnostic did not request another evaluated chain. Supplied certificates and the evaluated/trusted chain are distinct observations.
- Separate metadata collection found three distinct supplied certificates within their validity intervals at the observation time. Issuer/subject names matched signer → supplied issuer → third certificate, and the third had equal issuer/subject names. This does not verify issuer signatures, CA purpose, or root trust.
- Existing independent codesign --verify --deep --strict verification exits 1 with CSSMERR_TP_NOT_TRUSTED for arm64; it does not identify the failing certificate. The extraction/trust helper does not validate the CMS/CodeDirectory signature.
The public SecTrust header allows false both for denied trust and for an evaluation that cannot complete. The inspected installed SecBase header defines errSecInternalComponent as -2070 and errSecDecode as -26275; it provided no name for -26276. I am not treating -26276 as either code or as proof of certificate/profile damage, sandbox denial, or trust-service failure.
Questions:
- What supported interpretation or specific conditions explain -26276 on this public Code Signing API path, including the underlying error repeating the same domain/code?
- What smallest independent public field or observation distinguishes policy rejection from evaluation failure while keeping the policy, intermediate-fetch=false, and trust settings unchanged? The underlying key chain supplies no more specific code.
- How should this be interpreted alongside CSSMERR_TP_NOT_TRUSTED from strict verification of an archived iOS app? What specific evidence separates an embedded-signature/signing-input defect from a local trust or evaluation-context failure and justifies a targeted correction?
No certificate names, fingerprints, DER, profile identifiers, account details, private paths, raw payloads, or attachments are included.
Hmmmm, that wasn’t the answer I was expecting.
It seems like you have two goals here:
- Check the app before you submit it to App Store Connect.
- If App Store Complains about an app you submitted, quickly diagnose the issue.
Is that right?
If so, the best tool for the pre-submission check is indeed the Xcode organiser’s Validate App option. You can also automate this using the --validate-app subcommand in altool.
The nice thing about Validate App is that it runs a mini version of the same validation that’s done internally by App Store Connect [1], and thus it’s a solid predictor of success or failure.
The best path forward for your second point is much less clear cut. I probably wouldn’t drop down to the SecCode API for this. You can achieve much the same results using the codesign tool, and that’s an easier and more flexible option for this sort of work.
As a basic check I’d do this:
% codesign -v --deep -strict -vvv /path/to/your.app
You can also do this:
% codesign -d --extract-certificates /path/to/your.app
and then check that the leaf certificate is the one you’re expecting. You could hardwire that check — distribution certificates don’t change very often — or look inside the certificates for the key characteristics that represent an Apple Distribution certificate from your team. Those are documented, albeit cryptically, in the various docs accessible via Apple PKI page.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] To be clear, it’s not the full set of checks done by App Store Connect. Some of those checks can only be done server side.