0

I have a custom ASN1 specification as a .asn file that defines a complex data structure. What I essentially want to do is, to decode strings that have been encoded with this specification to a data structure that i can then use within my flutter application. I am currently building a Linux desktop app.

I already succeeded in doing this with python, as there is the asn1tools library which makes it easy to compile these .asn specifications and then use the output of that compiler to decode said strings. I havent found anything similar though other than the asn1lib for flutter. But in there I cannot really find anything that makes it possible to just throw in an asn1 file, get some kind of parser out if it and then decode strings with this parser.

Is it even possible to do this within flutter itself?

Would be nice if someone could help.

Krypton
  • 9
  • 2
  • No, you'll have to use the primitives in the asn library and interpret the specification manually. It's not difficult and there's a bunch of example code in other packages that parse stuff in asn - e.g. certificates. You'd look in the x509 package for that. To find other packages that use asn look for the dependencies here: https://pub.dev/packages?q=dependency%3Aasn1lib – Richard Heap Apr 19 '23 at 22:52
  • I think I am also lacking a general understanding of how data is parsed with custom specifications. Could you give a broad step by step on how this is done? – Krypton Apr 20 '23 at 07:30
  • Check out resources like https://luca.ntop.org/Teaching/Appunti/asn1.html and keep this online parser handy https://lapo.it/asn1js/ – Richard Heap Apr 20 '23 at 13:19

0 Answers0