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

Simplify DerUtils::checkAlg

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • None
    • security-libs

      Besides ObjectIdentifier and KnownOIDs, the checkAlg() method also accepts a string as the expected OID argument. One might naïvely believe they can use something like "1.2.3.4" but it's actually meant to be a descriptive name like "Ed25519". A string can be anything and easily confuses users.

      I suggest we do not accept string here. For the few use cases where an input looks like "Ed25519", the caller can pass in either `KnowOIDs.Ed25519` or `KnownOIDs.findMatch("Ed25519")` directly. I also don't intend to reinterpret the string as a raw OID string. In most cases, a literal OID string already has a "known" KnownOIDs value. Otherwise one can always use new `ObjectIdentifier(string)`.

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

              Created:
              Updated:
              Resolved: