#2 corrected bank keys parsing

This commit is contained in:
vasyas
2019-06-27 00:13:44 +03:00
parent c571ef181b
commit 5f0b6cd374
2 changed files with 3 additions and 3 deletions

View File

@@ -124,8 +124,8 @@ module.exports = (xml, keys) => ({
for (let i = 0; i < keyNodes.length; i++) {
const type = lastChild(keyNodes[i].parentNode).textContent;
const modulus = xpath.select("//*[local-name(.)='Modulus']", keyNodes[i])[0].textContent;
const exponent = xpath.select("//*[local-name(.)='Exponent']", keyNodes[i])[0].textContent;
const modulus = xpath.select(".//*[local-name(.)='Modulus']", keyNodes[i])[0].textContent;
const exponent = xpath.select(".//*[local-name(.)='Exponent']", keyNodes[i])[0].textContent;
const mod = new BN(Buffer.from(modulus, 'base64'), 2).toBuffer();
const exp = new BN(Buffer.from(exponent, 'base64')).toNumber();