mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2024-12-25 13:51:49 +00:00
update dependencies
This commit is contained in:
parent
8492d94054
commit
90f51544b7
@ -3,7 +3,7 @@
|
||||
const crypto = require('crypto');
|
||||
|
||||
const { DOMParser, XMLSerializer } = require('xmldom');
|
||||
const select = require('xpath.js');
|
||||
const xpath = require('xpath');
|
||||
const C14n = require('xml-crypto/lib/c14n-canonicalization').C14nCanonicalization;
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ module.exports = class Signer {
|
||||
|
||||
// canonicalize the node that has authenticate='true' attribute
|
||||
// const contentToDigest = select(this.doc, '//*[@authenticate="true"]')
|
||||
const contentToDigest = select(this.doc, "//*[@authenticate='true']")
|
||||
const contentToDigest = xpath.select("//*[@authenticate='true']", this.doc)
|
||||
.map(x => new C14n().process(x)).join('');
|
||||
|
||||
console.log('digest', 'contentToDigest', contentToDigest);
|
||||
@ -88,7 +88,8 @@ module.exports = class Signer {
|
||||
|
||||
console.log('sign =>');
|
||||
if (nodeSignatureValue) {
|
||||
const contentToSign = (new C14n().process(select(this.doc, '//ds:SignedInfo')[0])).replace('xmlns:ds="http://www.w3.org/2000/09/xmldsig#"', 'xmlns="urn:org:ebics:H004" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"');
|
||||
const select = xpath.useNamespaces({ ds: 'http://www.w3.org/2000/09/xmldsig#' });
|
||||
const contentToSign = (new C14n().process(select('//ds:SignedInfo', this.doc)[0])).replace('xmlns:ds="http://www.w3.org/2000/09/xmldsig#"', 'xmlns="urn:org:ebics:H004" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"');
|
||||
|
||||
nodeSignatureValue.textContent = this.client.x().key.sign(contentToSign, 'base64');
|
||||
}
|
||||
|
@ -25,11 +25,9 @@
|
||||
"moment": "^2.22.1",
|
||||
"node-rsa": "^0.4.2",
|
||||
"request": "^2.87.0",
|
||||
"xml-c14n": "0.0.6",
|
||||
"xml-crypto": "^0.10.1",
|
||||
"xmldom": "^0.1.27",
|
||||
"xpath": "0.0.27",
|
||||
"xpath.js": "^1.1.0"
|
||||
"xpath": "0.0.27"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^4.19.1",
|
||||
|
Loading…
Reference in New Issue
Block a user