update dependencies

This commit is contained in:
Vladislav Hristov
2018-06-04 15:30:33 +03:00
parent 8492d94054
commit 90f51544b7
2 changed files with 5 additions and 6 deletions

View File

@@ -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');
}