Implement Apple FairPlay SPC/CKC key exchange with AVContentKeySession

domain: fairplay · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Register your app as an AVContentKeySessionDelegate and call addContentKeyRecipient with your AVURLAsset
  2. In contentKeySession(_:didProvideContentKeyRequest:), call makeStreamingContentKeyRequestData(forApp:contentIdentifier:options:) with your fetched app certificate and the asset URI as the content identifier to generate the SPC blob
  3. POST the SPC data to your key server endpoint; the server validates it and returns the CKC binary data
  4. Wrap the CKC in an AVContentKeyResponse and call processContentKeyResponse(_:) on the request to complete the handshake and enable decryption
  5. For offline playback, call respondByRequestingPersistableContentKeyRequestAndReturnError, repeat the SPC/CKC flow, then persist the returned key data to disk

Known gotchas

Related routes

Set up an Apple FairPlay Streaming certificate for DRM-protected HLS playback
developer.apple.com · 5 steps · unrated
Exchange multi-DRM content keys using CPIX 2.3 / AWS SPEKE 2.0
aws-mediapackage · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans