-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
None
-
b15
There are many cases we need to deal with OPTIONAL elements in an ASN.1 SEQUENCE. Sometimes we iterate thru all elements and switch/case on each one's tag. You have to make sure the order is correct and there is no duplicates. Sometimes we read a DerValue first, and check if it has the expected tag. You have to pre-read the next DerValue for the next check if the answer is yes. Sometimes we peek at the tag and see if it's the expected one. For all these, you must remember to check if the end of SEQUENCE has arrived all the time and deal with it differently (Is there still non-OPTIONAL fields?). It will nice if we can find a consistent and simple way to deal with this situation.