Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8246797

A convenient method to read OPTIONAL element

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 18
    • Component/s: security-libs
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              weijun Weijun Wang
              Reporter:
              weijun Weijun Wang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: