explainers-by-googlers / Web-Environment-Integrity

537 stars 103 forks source link

explainer assumes the existence of a base64 encoder #8

Open bakkot opened 1 year ago

bakkot commented 1 year ago

(It's definitely too early to worry about this sort of thing, but I'm opening this issue anyway so I don't forget.)

This section has a code snippet with

console.log(attestation.encode());
"<base-64 encoding of the attestation payload and signature approx 500 bytes; see below for details>"

where attestation is "an ArrayBuffer serialized with CBOR (RFC 8949) and signed using COSE (RFC 9052)".

There's no such .encode method currently in JavaScript, nor any other convenient method to base64 encode an ArrayBuffer.

(It so happens that I am championing an early-stage proposal to add base64 support to JavaScript, though the current design of that proposal puts it on Uint8Array, not on ArrayBuffer. So this issue may end up obsoleted before it would be relevant. But I figured I'd mention it anyway.)

RupertBenWiser commented 1 year ago

This is great! Thanks for bumping this spec proposal.

michaelficarra commented 1 year ago

Update: the base64 proposal is now at stage 2. That means the high-level design of the solution has been agreed upon and we just need to work on the more minor details before it can move to stage 3 and be implemented.

RupertBenWiser commented 1 year ago

I'm going to mark this as a low priority task to follow up on. We have an attestation object currently that has this encode method in our prototyping. We can of course remove that if a base64 method becomes standardized.