You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The latest release of JSON for Modern C++ - a header-only C++ library that aims to promote JSON to a first-class data type in C++11 - now supports CBOR as (de)serialization format.
Do you plan to implement any of the parts of CBOR where the generic data model extends that of JSON? E.g., byte strings, non-text-string map keys, tags, simple values beyond null/false/true?
It would be nice to use your library to implement COSE and CWTs.
Currently, there is no support beyond JSON planned. We allow any JSON value to be serialized to CBOR and to deserialized them again. There was some discussion regarding byte strings, but we decided not to implement different encoding schemes.
COSE is CBOR Object Signing and Encryption (as with JOSE, but benefitting from the more extensive generic data model of CBOR). CWTs are JWTs using COSE. COSE is pretty much done in the IETF (RFC soon; see https://tools.ietf.org/html/draft-ietf-cose-msg-24 for now); CWTs still require a little bit of work. These structures are the basis of secure low-resource IoT.
Activity
cabo commentedon Apr 6, 2017
Thank you for the pointer!
Do you plan to implement any of the parts of CBOR where the generic data model extends that of JSON? E.g., byte strings, non-text-string map keys, tags, simple values beyond null/false/true?
It would be nice to use your library to implement COSE and CWTs.
nlohmann commentedon Apr 6, 2017
Currently, there is no support beyond JSON planned. We allow any JSON value to be serialized to CBOR and to deserialized them again. There was some discussion regarding byte strings, but we decided not to implement different encoding schemes.
May I ask what COSE and CWTs are?
cabo commentedon Apr 6, 2017
COSE is CBOR Object Signing and Encryption (as with JOSE, but benefitting from the more extensive generic data model of CBOR). CWTs are JWTs using COSE. COSE is pretty much done in the IETF (RFC soon; see https://tools.ietf.org/html/draft-ietf-cose-msg-24 for now); CWTs still require a little bit of work. These structures are the basis of secure low-resource IoT.
cabo commentedon Apr 11, 2017
In any case, please tell me if the text linking to your implementation is correct or something should be added/removed.
nlohmann commentedon Apr 12, 2017
You could link to https://github.com/nlohmann/json when mentioning the name "JSON for Modern C++" and to https://github.com/nlohmann/json#binary-formats-cbor-and-messagepack with the "Details" button.
cabo commentedon Apr 12, 2017
Good idea; done.
nlohmann commentedon Apr 12, 2017
Thanks a lot!