-
Bug
-
Resolution: Fixed
-
P4
-
None
-
b18
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)`.
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)`.