A .p8 file is just a PEM-encoded ECDSA private key. Apple uses this format for two unrelated authentication flows: App Store Connect API keys (used to script account operations), and APNs auth keys (used to send push notifications via token-based auth). Despite the same file extension, they are not interchangeable.
App Store Connect API key
Created in App Store Connect under Users and Access > Integrations > App Store Connect API. The download gives you a .p8 plus an issuer ID and key ID. The same three values together let a client mint short-lived JSON Web Tokens that authenticate to the App Store Connect API.
APNs auth key
Created in the Apple Developer portal under Certificates, Identifiers, Profiles > Keys. A single APNs .p8 can sign push tokens for every app in your team, never expires, and replaces the old per-app push certificate workflow.
How it differs from a .p12
- .p12
- Certificate plus matching private key, password-encrypted. Used to sign builds.
- .p8
- Bare private key, no certificate. Used to authenticate API calls (App Store Connect API) or sign short-lived push tokens (APNs).