Hi, 
For once, your definition of type 

Outer1 struct {
One Inner `asn1:"tag:0"`
Two Inner `asn1:"tag:1"`
}
is bad. It should be 
Outer1 struct {
One Inner `asn1:"tag:1"`
Two Inner `asn1:"tag:2"`
}
as it is in the asn1 bytes. 

After the fix, you would get: 

main.Outer1{One:main.Inner{First:1, Second:2}, Two:main.Inner{First:3, 
Second:4}}


Second, i didn't look into the example with asn1.RawValue as the concrete types 
worked, but when using asn1.RawValue, the tags are completely ignored. 

When the decoder encounters the asn1.RawValue in the struct you are decoding 
data into, it will just populate the struct fields (tag, class, 
isCompound...)and move on to the next value.


Regards, 
Maciej

W dniu sobota, 31 marca 2018 23:43:34 UTC+1 użytkownik andrey mirtchovski 
napisał:
>
> I have a piece of valid asn.1 that i'm not able to properly parse with 
> Go's encoding/asn.1. I have distilled the example down to: 
>
> https://play.golang.org/p/YQCVxhEKnJx 
>
> the asn1 code, which i generated with asn1c, is parseable by asn1c and 
> lapo.it: http://lapo.it/asn1js/#A010A106800101810102A206800103810104 
>
> has anyone else encountered similar issues? how did you solve them? 
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to