From 294c8904c232159aa76781ae7f033f27077ae60b Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Sat, 2 Mar 2019 01:34:11 +0100 Subject: [PATCH] crypto: keyObject.asymmetricKeySize API Expose the size of asymetric keys of crypto key object from the crypto module added in v11.6.0 (#24234) --- doc/api/crypto.md | 9 +++++++++ lib/internal/crypto/keys.js | 6 ++++++ src/node_crypto.cc | 13 +++++++++++++ src/node_crypto.h | 4 ++++ test/parallel/test-crypto-key-objects.js | 3 +++ test/parallel/test-crypto-keygen.js | 4 ++++ 6 files changed, 39 insertions(+) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 72d4bc78df9dde..f8c471d64e64ac 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1121,6 +1121,15 @@ exposes different functions. Most applications should consider using the new `KeyObject` API instead of passing keys as strings or `Buffer`s due to improved security features. +### keyObject.asymmetricKeySize + +* {number} + +For asymmetric keys, this property represents the size of the embedded key in +bytes. This property is `undefined` for symmetric keys. + ### keyObject.asymmetricKeyType