From b1d2d1aea96c5de48be210e89961347cb6b8b72b Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Sun, 20 Aug 2023 23:29:08 -0700 Subject: [PATCH] Started work on support for loading ECDSA certificates as HTTPS cert. --- certoperations.js | 139 +++++++++++++++++++++++++++++++++++++--------- webserver.js | 2 +- 2 files changed, 113 insertions(+), 28 deletions(-) diff --git a/certoperations.js b/certoperations.js index 21228e21..04364ccb 100644 --- a/certoperations.js +++ b/certoperations.js @@ -634,9 +634,17 @@ module.exports.CertificateOperations = function (parent) { }; // Return the SHA384 hash of the certificate public key - obj.getPublicKeyHashBinary = function (cert) { - var publickey = obj.pki.certificateFromPem(cert).publicKey; - return obj.pki.getPublicKeyFingerprint(publickey, { encoding: 'binary', md: obj.forge.md.sha384.create() }); + obj.getPublicKeyHashBinary = function (pem) { + const { X509Certificate } = require('crypto'); + if (X509Certificate == null) { + // This version of NodeJS (