ehn-dcc-development / hcert-kotlin

Kotlin multiplatform implementation of the HCERT/DCC specification
Apache License 2.0
25 stars 25 forks source link

Encoding Chain in JS #10

Closed nodh closed 3 years ago

nodh commented 3 years ago

https://github.com/ehn-dcc-development/hcert-kotlin/tree/feature/encoding-js contains some commits, that add code to encode HCERT data on the JS target. It works, but one general problem remains though:

This encodes all keys inside the CWT as Strings, but they should be Integers: https://github.com/ehn-dcc-development/hcert-kotlin/blob/98653be6cf2b76f4cc7bb1f6d438f04ad9b2cf80/src/jsMain/kotlin/ehn/techiop/hcert/kotlin/trust/CwtCreationAdapter.kt#L30

This works around this issue on the decoding side: https://github.com/ehn-dcc-development/hcert-kotlin/blob/98653be6cf2b76f4cc7bb1f6d438f04ad9b2cf80/src/jsMain/kotlin/ehn/techiop/hcert/kotlin/trust/CwtAdapter.kt#L20

So we'll need to find a way, to encode the keys of a map as integers.