apple / swift-crypto

Open-source implementation of a substantial portion of the API of Apple CryptoKit suitable for use on Linux platforms.
https://apple.github.io/swift-crypto
Apache License 2.0
1.45k stars 157 forks source link

CBOR decoding and encoding? #227

Open JetForMe opened 6 months ago

JetForMe commented 6 months ago

New API Proposal:CBOR Encoding/Decoding

Motivation:

A lot of WebAuthn and Apple attestation and passkey APIs depend on CBOR encoding of attestation. I think it makes sense to have a thorough and vetted implementation of code to encode and decode the format.

Importance:

As an example, implementing the server side of App Attestation requires decoding a CBOR: https://developer.apple.com/documentation/devicecheck/validating-apps-that-connect-to-your-server

Alternatives

At least one third-party implementation exists, but this seems to me like a reasonable addition to CryptoKit.