Any plans to add ASN.1 PER support?

1,018 views
Skip to first unread message

David Wahlstedt

unread,
Jan 11, 2018, 10:50:24 AM1/11/18
to golang-nuts
Hello,
I wonder if there are any plans to add PER encoding/decoding support for ASN.1?
I have looked around, and it seems that there isn't any project supporting this, currently.

Best regards
David

Pat Farrell

unread,
Jan 11, 2018, 2:04:50 PM1/11/18
to golang-nuts
On Thursday, January 11, 2018 at 10:50:24 AM UTC-5, David Wahlstedt wrote:
I wonder if there are any plans to add PER encoding/decoding support for ASN.1?
I have looked around, and it seems that there isn't any project supporting this, currently.

Wow, I haven't heard anyone ask for ASN.1 PER or DER in two decades.
I know it still is listed in the specs, but  ASN.1 was  worse than XML

David Wahlstedt

unread,
Jan 12, 2018, 3:49:46 AM1/12/18
to golang-nuts
ASN.1 is still alive and present in telecom applications. The PER encoding is missing in the go library, unfortunately...

Matt Harden

unread,
Jan 27, 2018, 2:02:18 PM1/27/18
to David Wahlstedt, golang-nuts
It isn't something that is likely to be added to the stdlib. If anything, a library like https://github.com/Logicalis/asn1 might be interested in supporting it / accepting a pull request to add it.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Wahlstedt

unread,
Feb 5, 2018, 4:53:53 AM2/5/18
to golang-nuts
Thanks!

David Wahlstedt

unread,
Feb 19, 2018, 9:15:01 AM2/19/18
to golang-nuts
There is also the following repo, that uses parser generators a la yacc/lex to parse ASN.1 specifications and build abstract syntax trees of those, from which the encoder/coder code can be generated.

Any arguments which one to prefer?
Spontaneously I prefer the link I gave above, since it looks natural to first produce an AST from the given ASN.1 spec, and then proceed from there. I don't see this in the other repo(Logicalis/asn1), but maybe it is there implicitly somehow, although I don't realize it? (I am new to golang, and I have looked deep into this)
/David


Den lördag 27 januari 2018 kl. 20:02:18 UTC+1 skrev Matt Harden:

David Wahlstedt

unread,
Feb 19, 2018, 9:16:48 AM2/19/18
to golang-nuts
Correction of my comment: "looked deep into this" -> "not looked deeply into this" ;-)

andrey mirtchovski

unread,
Feb 19, 2018, 8:54:52 PM2/19/18
to David Wahlstedt, golang-nuts
didn't reply to list, sorry:

> https://github.com/chemikadze/asn1go

i gave it a try. it's a good start (we use asn1c heavily, asn1go is a
good match for our use case) but there seems to be a lot missing.
including a license. i created an issue for that.

it failed to parse our asn.1 on some technicalities (such as "-----"
being a valid comment line) and when those were fixed, it turned out
it doesn't implement CHOICE, as well as other things :(

a good project to put effort behind as it seems the most all-encompassing.

also, have you thought about asn1c and cgo? it is doable, if you know your C :)
Reply all
Reply to author
Forward
0 new messages