From 57908c92aa46aff9e13896eeb42c7a6610d20ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Sun, 17 Mar 2019 01:18:04 +0100 Subject: [PATCH 1/2] crypto: add API to retrieve key type OID --- doc/api/crypto.md | 10 ++++++++++ lib/internal/crypto/keys.js | 6 ++++++ src/node_crypto.cc | 20 ++++++++++++++++++++ src/node_crypto.h | 4 ++++ test/parallel/test-crypto-key-objects.js | 12 ++++++++++-- test/parallel/test-crypto-keygen.js | 4 ++++ 6 files changed, 54 insertions(+), 2 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 1b30633221d895..9de55218d76a36 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1135,6 +1135,16 @@ For asymmetric keys, this property represents the type of the embedded key (`'rsa'`, `'dsa'`, `'ec'`, `'ed25519'`, or `'ed448'`). This property is `undefined` for symmetric keys. +### keyObject.asymmetricKeyTypeOid + +* {string} + +For asymmetric keys, this property represents the numerical representation of +the OID of the type of the embedded key, e.g., `'1.3.101.113'` for `'ed448'`. +This property is `undefined` for symmetric keys. + ### keyObject.export([options])