No need to cache derEncoding in org.ietf.jgss.Oid

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: security-libs

      The org.ietf.jgss.Oid class currently keeps a cached byte array (derEncoding) representing the encoding of the OID in addition to the ObjectIdentifier itself. This was originally necessary because ObjectIdentifier used to store only its numerical components, making encoding generation expensive. However, since JDK-4811968, ObjectIdentifier has been reimplemented to store the encoded bytes (without the tag and length) directly. As a result, the extra encoding cache in Oid is no longer needed.

      At the same time, at lines 141+ of GSSNameElement.java and lines 400+ of GSSNameImpl.java, there is no need to convert the Oid to an ObjectIdentifier and write it into a DerOutputStream, you can directory call Oid::getDER to get the oidBytes.

            Assignee:
            Unassigned
            Reporter:
            Weijun Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: