← Back to context

Comment by johnisgood

4 days ago

Erlang / Elixir has amazing support for ASN.1! I love it.

https://www.erlang.org/doc/apps/asn1/asn1_getting_started.ht...

https://www2.erlang.org/documentation/doc-14/lib/asn1-5.1/do... (https://www2.erlang.org/documentation/doc-14/lib/asn1-5.1/do...)

I am using ASN.1 to communicate between a client (Java / Kotlin) and server (Erlang / Elixir), but unfortunately Java / Kotlin has somewhat of a shitty support for ASN.1 in comparison to Erlang.

Erlang and ASN.1 are from telecom, so it makes sense they have best support

  • I agree, but that does not mean that other languages should have shitty support. It does not mean that it should not either, of course.

I also use ASN.1 but I use C, so I wrote my own implementation of DER.

  • Does it support constraints?

    • It is a C library, and does not implement ASN.1 schema at all, only implements reading/writing the data. The caller is expected to implement most constraints that would be required, although you can limit the size of data being read, and the functions for decoding integers will automatically check that the type is correct (although you can disable type checking) and will limit the values to those that fit in the variable that the decoded value is stored in (e.g. signed 64-bits, unsigned 8-bits, etc), and other functions that decode specific values will also normally check the type (although you can tell it to not check the type).

      1 reply →