A working, MIT-licensed reference implementation for verifying Apple App Attest attestations and assertions on Cloudflare Workers using TypeScript.
- Verifies
fmt: apple-appattestattestation objects (fromDCAppAttestService) and subsequent assertions on the server, on the Workers runtime (no Node crypto, no Firebase, no Swift). - Two non-obvious gotchas bite everyone: Apple ships DER-encoded ECDSA signatures but WebCrypto wants IEEE P1363 raw r||s; and
credentialIdis SHA256 of the raw X9.62 uncompressed EC point (65 bytes:0x04 || X || Y), NOT SHA256 of the SPKI DER. - Deps:
@peculiar/x509,@peculiar/asn1-ecc,@peculiar/asn1-schema,cbor-x.josefor issuing your session JWT afterwards.