5 ms·
For something that is supposed to be an analog of jq, there is a notable omission from the list of formats: ASN.1.
by userbinator 5y ago
For something that is supposed to be an analog of jq, there is a notable omission from the list of formats: ASN.1.
- naikrovek 5y agonote that the tool linked is for binary files. ASN.1 is text, isn't it?
- stormbrew 5y agoI assume they meant the binary encodings of asn.1 like BER/DER.
- crehn 5y agoAnd tangentially PEM, which is Base64-encoded DER.
- fanf2 5y agoThat’s what I thought until recently, but it turns out that PEM refers to just base64 wrapped with ——BEGIN—— and ——END—— lines, and the encapsulated data does not have to be DER. https://datatracker.ietf.org/doc/html/rfc7468 https://datatracker.ietf.org/doc/html/rfc7468
- dikei 5y agoCan't blame him. ASN.1 is one of the most complicated binary formats, with so many encoding rules that there's no free decoder that can process them all.
- chii 5y agoExcept for interoperability with existing systems, is there any reason why anyone would use this ASN.1 protocol/format? What's it good for?
- IshKebab 5y agoNo. It mostly exists so that people who haven't tried to use it can tell other people that they should have used ASN.1.
- dikei 5y agoIn my opinion, avoid ASN.1 if you can. There's a reason why all the cool companies invented their own serialization formats: Google's Protobuf, Facebook's Thrift, etc.. even when ASN.1 had been an international standard for years: It's too complicated.
- p_l 5y agoThe big part of the reason is combination of NIH with bad reputation mostly related to X503 and such rather than anything else - hard to advocate for it when the main library you can point to is OpenSSL, and most commonly known encoding is DER (which has certain implementation complexity, effectively being sorted BER, which has certain important value in cryptography). Both Protobuf and Thrift evolved from RPC systems that possibly started out too simple for ASN.1, combined with above issue where good tools were probably commercial and expensive (FWIW, my experience also suggests that Thrift is shitty rpc system, compared even to Sun/ONC RPC, but maybe things changed)
- NavinF 5y agoASN.1 is incredibly good for one use case: As a cautionary tale against design by committee.
- mtve 5y agoBER/DER/PEM encodings are mostly quite simple, have very few subtle details.
- dikei 5y agoYeah, those are the easy one. I worked in Telecom, and dealing with unaligned PER is a PITA.
- XAMPPRocky 5y agoShameless plug, but you may be interested in my library (which is MIT/Apache-2.0) that offers decoding from BER/DER/CER all from a single model in code, there's no UPER/APER support at the moment, but it's coming in the next few months. :) https://github.com/XAMPPRocky/rasn https://github.com/XAMPPRocky/rasn
- cryptonector 5y agoYou mean DER, not ASN.1. ASN.1 is just notation for describing data. There are many encoding rules for ASN.1, including ones based on XML and JSON.
- wwader 5y agoHi, here is issue related to this where i explain a bit what would be required https://github.com/wader/fq/issues/20 https://github.com/wader/fq/issues/20 and how protobuf support currently works.