mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2025-08-13 19:35:34 +00:00
update dependencies
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
Reference in New Issue
Block a user