mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2025-08-13 19:35:34 +00:00
Merge pull request #16 from eCollect/feat/handle-unsual-exponent
Feat: handle unsual exponent migrate to node-forge
This commit is contained in:
@@ -127,10 +127,12 @@ module.exports = (xml, keys) => ({
|
||||
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();
|
||||
|
||||
bankKeys[`bank${type}`] = { mod, exp };
|
||||
const mod = Buffer.from(modulus, 'base64');
|
||||
const exp = Buffer.from(exponent, 'base64');
|
||||
bankKeys[`bank${type}`] = {
|
||||
mod,
|
||||
exp,
|
||||
};
|
||||
}
|
||||
|
||||
return bankKeys;
|
||||
|
Reference in New Issue
Block a user