From ce6cd02e580f541a36f0c6a1731558e796c21576 Mon Sep 17 00:00:00 2001 From: Vladislav Hristov Date: Fri, 1 Nov 2019 16:28:04 +0200 Subject: [PATCH] fit: BankLetter.js get key size --- lib/BankLetter.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/BankLetter.js b/lib/BankLetter.js index 1221b22..5c77a3b 100644 --- a/lib/BankLetter.js +++ b/lib/BankLetter.js @@ -13,10 +13,8 @@ const registerHelpers = () => { handlebars.registerHelper('now', () => moment().format('HH:mm:ss')); handlebars.registerHelper('keyExponentBits', k => Buffer.byteLength(k.e()) * 8); - // handlebars.registerHelper('keyExponentBits', k => Buffer.byteLength(new BN(k.key.keyPair.e).toBuffer()) * 8); - handlebars.registerHelper('keyModulusBits', k => k.key.getKeySize()); - // return Buffer.byteLength(new BN(k.key.keyPair.e).toBuffer()) * 8; + handlebars.registerHelper('keyModulusBits', k => k.size()); handlebars.registerHelper('keyExponent', k => k.e('hex')); @@ -24,7 +22,6 @@ const registerHelpers = () => { handlebars.registerHelper('sha256', (k) => { const digest = Buffer.from(Crypto.digestPublicKey(k), 'base64').toString('HEX'); - // const digest = Buffer.from(k.publicDigest(), 'base64').toString('HEX'); return digest.toUpperCase().match(/.{1,2}/g).join(' '); }); };