cyberphone/json-canonicalization

JSON Values are not valid input to go's jsoncanonicalizer.Transform function

beeemT opened this issue · 4 comments

My understanding of RFC 8785 is that JSON values are already JCS compliant.
So for example the JSON string "296e2d2e-0765-4aa1-88da-2034876e7678" is 1. valid JSON and 2. already JCS compliant.

However when trying to transform such a string literal the Transform function returns an error:

"Expected '{' but got '"'"

The go implementation (i have not looked at the others) requires that the input json is either an Array or a Object.
Do I just not understand the RFC correctly or is this just missing in the Transform function ?

Hi @beeemT, you are indeed interpreting the RFC correctly! It is rather my implementations in C#, Java, Go, and Python that are a bit constrained by requiring the input to be an Array or Object.

@cyberphone Ah ok, thanks for clearing that up.
I'm gonna file a PR in the coming days at least for the go implementation.
Also I'm gonna make the go package more idiomatic go if that's ok.

That's fine, I'm sure my go isn't entirely idiomatic :)
At the moment, I'm pretty busy with the next step in this project: https://www.ietf.org/archive/id/draft-jordan-jws-ct-01.html