From a00c3b10514c910f260d87b0898ed7c1f2f7912f Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Wed, 23 Feb 2022 16:32:40 +0100 Subject: [PATCH 01/15] crypto: add KeyObject.prototype.equals method --- doc/api/crypto.md | 11 +++++++ lib/internal/crypto/keys.js | 10 ++++++ src/crypto/crypto_keys.cc | 38 +++++++++++++++++++++++ src/crypto/crypto_keys.h | 1 + test/parallel/test-crypto-key-objects.js | 39 ++++++++++++++++++++++++ 5 files changed, 99 insertions(+) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 470c8f6641839a..f716deb3cae058 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -2082,6 +2082,17 @@ encryption mechanism, PEM-level encryption is not supported when encrypting a PKCS#8 key. See [RFC 5208][] for PKCS#8 encryption and [RFC 1421][] for PKCS#1 and SEC1 encryption. +### `keyObject.equals(otherKeyObject)` + + + +* `otherKeyObject`: {KeyObject} A `KeyObject` with which to + compare `keyObject`. +* Returns: {boolean} `true` or `false` depending on the whether the + keys have exactly the same type, value, and parameters. + ### `keyObject.symmetricKeySize`