Re: [pyasn1-users] Asn1Item.hasValue()/.isValue
Brought to you by:
elie
From: Sergey M. <sta...@st...> - 2017-04-11 08:40:20
|
Greetings! *** Ilya Etingof <il...@gl...> [2017-04-11 00:32]: >How about this: what if we make pyasn1 decoders building a map of asn1_object -> original_substrate so that once decoder is done you could >lookup original DER encoding (possibly in form of TLV for convenience) from which given asn1_object was recovered? >[...] >WDYT? I really very like that suggestion of that kind of object map! It will solve all problems above. Moreover in our projects several times we were in need of entities DER representation of what was received, to skip decode-then-encode procedure -- so it could also increase performance in some projects. I will be very grateful to see those changes! >So we assume that `sq[“certificates”] is None` is an indication of absent SET OF substrate for the "certificates” field. That assumption >may fail if there is any other field beyond the “certificates” one (which may not be the case here). When that “next-to-certificates” field gets >initialized, “certificates” would be initialized as well thus failing our assumption. This may happen if “certificates” is optional (so it’s not >present in the encoding) but “next-to-certificates” is present. Ah, I see. Thanks for the explanation. Seems that I have got badly wrong assumptions. Good to hear about that pitfall! -- Sergey Matveev (http://www.stargrave.org/) OpenPGP: CF60 E89A 5923 1E76 E263 6422 AE1A 8109 E498 57EF |