3 ms·
> Unfortunately, there are very few good, open source/free ASN.1 (de)serializers out there. I wrote a library to read/write DER, which I have found suitable fo
by zzo38computer 1y ago
> Unfortunately, there are very few good, open source/free ASN.1 (de)serializers out there.
I wrote a library to read/write DER, which I have found suitable for my uses. (Although, I might change or add some things later, and possibly also some things might be removed too if I think they are unnecessary or cause problems.)
https://github.com/zzo38/scorpion/blob/trunk/asn1/asn1.c https://github.com/zzo38/scorpion/blob/trunk/asn1/asn1.c
https://github.com/zzo38/scorpion/blob/trunk/asn1/asn1.h https://github.com/zzo38/scorpion/blob/trunk/asn1/asn1.h
(You can complain about it if there is something that you don't like.)
> In theory you could use ASN.1 DER files the same way you would JSON for human-readable formats. In practice, you're better off picking a different format.
I do use ASN.1 DER for some things, because, in my opinion it is (generally) better than JSON, XML, etc.
> Modern evolutions of ASN.1 like ProtoBuf or Cap'n Proto designed for transmitting data across the network might fit this purpose pretty well, too.
I have found them to be unsuitable, with many problems, and that ASN.1 does them better in my experience.
> On the other hand, using ASN.1 may be a good way to make people trying to reverse engineer your format give up in despair, especially if you start using the quirks ASN.1 DER comes with and change the identifiers.
I am not so sure of this.