While working on a software protection library for smart card based dongle I realized I need to transfer some tree-like data structures back and forth between client application and code inside the dongle.
Well, when working with web services the technologies like XML-RPC or JSON-RPC are reasonable way to consider. However, that is not the case with embedded devices like smart cards. You need to use some binary formats to optimize memory usage and to achieve good performance.
I guess what I need is to implement some binary data marshaling algorithm. I don't like the idea of reinventing the whole wheel and I pretty sure there are great books, articles and examples on marshalling issues like these.
What would you recommend?
UPD. I am using C and C++ on Linux, but the question is about info on marshalling algorithms in general.
You can look at ASN.1 as a general serialization solution. There are free books and and free implementations: asn1c, a2c, snacc.
But ASN.1 is a huge. Simpler protobuf or xdr can be good enough for your task.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With