I had this happen to me today. I went into Keychain Access and noticed I had an expired personal developer certificate that was being referenced by our distribution certificate. I also had multiple personal developer certificates that were not expired. All the distribution certificates were showing as "Untrusted" in Keychain.
I deleted the expired personal certificate, then all the distribution certificates came up as "Trusted." I then re-opened Xcode and successfully built an Archive of my current project for distribution on the App Store.
Topic:
Code Signing
SubTopic:
Certificates, Identifiers & Profiles
Tags: