fit: BankLetter.js get key size

This commit is contained in:
Vladislav Hristov 2019-11-01 16:28:04 +02:00
parent 836ec0ebf3
commit ce6cd02e58

View File

@ -13,10 +13,8 @@ const registerHelpers = () => {
handlebars.registerHelper('now', () => moment().format('HH:mm:ss')); handlebars.registerHelper('now', () => moment().format('HH:mm:ss'));
handlebars.registerHelper('keyExponentBits', k => Buffer.byteLength(k.e()) * 8); 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()); handlebars.registerHelper('keyModulusBits', k => k.size());
// return Buffer.byteLength(new BN(k.key.keyPair.e).toBuffer()) * 8;
handlebars.registerHelper('keyExponent', k => k.e('hex')); handlebars.registerHelper('keyExponent', k => k.e('hex'));
@ -24,7 +22,6 @@ const registerHelpers = () => {
handlebars.registerHelper('sha256', (k) => { handlebars.registerHelper('sha256', (k) => {
const digest = Buffer.from(Crypto.digestPublicKey(k), 'base64').toString('HEX'); 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(' '); return digest.toUpperCase().match(/.{1,2}/g).join(' ');
}); });
}; };