Skip to content

crypto: add OID constants for EVP_PKEY_ types

The existence of the constant can be used to check for support for the key types, and the value is useful when encoding/decoding keys using ASN.1.


Follow-on to https://github.com/nodejs/node/pull/26786#issuecomment-478097964, these values might be useful if we move to key type constants, rather than strings like "rsa", etc.

Also, when PRs are backported from master to 11.x that use EVP key types that aren't supported by OpenSSL 1.1.0, it is trivial to ifdef out the C++ code that uses them. It's less trivial to deal with in the tests. Checking openssl version numbers explicitly is fragile (and hard if range checks are required). It will be easier to just test for existence of the define (effectively) from js. I didn't want to expose the NIDs, but the OIDs are useful values (I think).

@tniessen @panva Thoughts?

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading