mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2024-11-22 14:12:07 +00:00
16 lines
436 B
JavaScript
16 lines
436 B
JavaScript
'use strict';
|
|
|
|
const H004Signer = require('../versions/H004/Signer');
|
|
|
|
const H004Serializer = require('../versions/H004/OrderSerializer');
|
|
|
|
module.exports = class XMLSign {
|
|
static sign(order) {
|
|
const { keys } = order;
|
|
|
|
if (order.version.toUpperCase() === 'H004') return new H004Signer(H004Serializer.serialize(order).toXML(), keys).digest().sign().toXML();
|
|
|
|
throw Error('Error from XMLSign class: Invalid version number');
|
|
}
|
|
};
|