mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2025-08-13 19:35:34 +00:00
wip: migrate to node-forge
This commit is contained in:
@@ -126,12 +126,15 @@ module.exports = (xml, keys) => ({
|
||||
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 modulusBuffer = Buffer.from(modulus, 'base64');
|
||||
|
||||
const mod = new BN(Buffer.from(modulus, 'base64'), 2).toBuffer('be', modulusBuffer.length);
|
||||
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,
|
||||
modulus,
|
||||
exponent,
|
||||
};
|
||||
}
|
||||
|
||||
return bankKeys;
|
||||
|
Reference in New Issue
Block a user