various modular fixes

This commit is contained in:
AngelPashov
2018-06-01 16:16:43 +03:00
parent f207254238
commit 8492d94054
23 changed files with 605 additions and 612 deletions

View File

@@ -3,48 +3,58 @@
const GenericOrder = require('./GenericOrder');
module.exports = class C52 extends GenericOrder {
constructor (client, from, to) {
constructor(client, from, to) {
super(client);
this._from = from;
this._to = to;
this._to = to;
this._schema.header = {
"@" : { authenticate: true },
'@': {
authenticate: true,
},
static: {
HostID : this.hostId,
Nonce : this.nonce(),
HostID: this.hostId,
Nonce: this.nonce(),
Timestamp: this.timestamp(),
PartnerID: this.partnerId,
UserID : this.userId,
Product : {
"@": { Language: "de" },
"#": this.productString,
UserID: this.userId,
Product: {
'@': {
Language: 'de',
},
'#': this.productString,
},
OrderDetails: {
OrderType : "C52",
OrderAttribute : "DZHNN",
OrderType: 'C52',
OrderAttribute: 'DZHNN',
StandardOrderParams: {
DateRange: {
Start: this._from,
End : this._to
}
End: this._to,
},
},
},
BankPubKeyDigests: {
Authentication: {
"@": { Version: "X002", Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" },
"#": this.client.bankX().publicDigest()
'@': {
Version: 'X002',
Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256',
},
'#': this.client.bankX().publicDigest(),
},
Encryption: {
"@": { Version: "E002", Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" },
"#": this.client.bankE().publicDigest()
}
'@': {
Version: 'E002',
Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256',
},
'#': this.client.bankE().publicDigest(),
},
},
SecurityMedium: "0000"
SecurityMedium: '0000',
},
mutable: {
TransactionPhase: "Initialisation"
}
TransactionPhase: 'Initialisation',
},
};
};
}
};

View File

@@ -1,10 +1,47 @@
'use strict';
// const randHex = require('../../lib/utils').randHex;
const crypto = require("crypto");
const crypto = require('crypto');
const js2xmlparser = require('js2xmlparser');
const consts = require('../consts');
const consts = require('../consts');
const authSignature = () => {
return {
'ds:SignedInfo': {
'ds:CanonicalizationMethod': {
'@': {
Algorithm:
'http://www.w3.org/TR/2001/REC-xml-c14n-20010315',
},
},
'ds:SignatureMethod': {
'@': {
Algorithm:
'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256',
},
},
'ds:Reference': {
'@': { URI: "#xpointer(//*[@authenticate='true'])" },
'ds:Transforms': {
'ds:Transform': {
'@': {
Algorithm:
'http://www.w3.org/TR/2001/REC-xml-c14n-20010315',
},
},
},
'ds:DigestMethod': {
'@': {
Algorithm:
'http://www.w3.org/2001/04/xmlenc#sha256',
},
},
'ds:DigestValue': {},
},
},
'ds:SignatureValue': {},
};
};
module.exports = class GenericOrder {
constructor(client) {
this.client = client;
@@ -18,67 +55,29 @@ module.exports = class GenericOrder {
this.xmlOptions = {
declaration: {
include: true,
encoding: "utf-8"
encoding: 'utf-8',
},
format: {
doubleQuotes: true,
indent: '',
newline: '',
pretty: true
}
pretty: true,
},
};
this._schema = {
"@": {
"xmlns:ds": "http://www.w3.org/2000/09/xmldsig#",
xmlns: "urn:org:ebics:H004",
Version: "H004",
Revision: "1"
'@': {
'xmlns:ds': 'http://www.w3.org/2000/09/xmldsig#',
xmlns: 'urn:org:ebics:H004',
Version: 'H004',
Revision: '1',
},
header: {},
AuthSignature: this.authSignature(),
AuthSignature: authSignature(),
body: {}
};
}
authSignature() {
return {
"ds:SignedInfo": {
"ds:CanonicalizationMethod": {
"@": {
Algorithm:
"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
}
},
"ds:SignatureMethod": {
"@": {
Algorithm:
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
}
},
"ds:Reference": {
"@": { URI: "#xpointer(//*[@authenticate='true'])" },
"ds:Transforms": {
"ds:Transform": {
"@": {
Algorithm:
"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
}
}
},
"ds:DigestMethod": {
"@": {
Algorithm:
"http://www.w3.org/2001/04/xmlenc#sha256"
}
},
"ds:DigestValue": {}
}
},
"ds:SignatureValue": {}
body: {},
};
}
@@ -86,92 +85,94 @@ module.exports = class GenericOrder {
return this._schema;
}
get productString() {
static get productString() {
return consts.productString;
}
nonce() {
static nonce() {
return crypto.randomBytes(16).toString('hex');
}
timestamp() {
// TODO: remove eslint-disable-line
timestamp() { // eslint-disable-line
return new Date().toISOString();
}
root() {
return "ebicsRequest";
root() { // eslint-disable-line class-methods-use-this
return 'ebicsRequest';
}
toReceiptXML() {
const xmlObj = {
"@": {
"xmlns:ds": "http://www.w3.org/2000/09/xmldsig#",
xmlns: "urn:org:ebics:H004",
Version: "H004",
Revision: "1"
'@': {
'xmlns:ds': 'http://www.w3.org/2000/09/xmldsig#',
xmlns: 'urn:org:ebics:H004',
Version: 'H004',
Revision: '1',
},
header: {
"@": { authenticate: true },
'@': { authenticate: true },
static: {
HostID: this.hostId,
TransactionID: this.transactionId
TransactionID: this.transactionId,
},
mutable: {
TransactionPhase: 'Receipt',
}
},
},
AuthSignature: this.authSignature(),
body: {
TransferReceipt: {
"@": { authenticate: true },
ReceiptCode: 0
}
}
'@': { authenticate: true },
ReceiptCode: 0,
},
},
};
return js2xmlparser.parse(this.root(), xmlObj, this.xmlOptions);
}
toTransferXML(){
toTransferXML() {
const xmlObj = {
"@": {
"xmlns:ds": "http://www.w3.org/2000/09/xmldsig#",
xmlns: "urn:org:ebics:H004",
Version: "H004",
Revision: "1"
'@': {
'xmlns:ds': 'http://www.w3.org/2000/09/xmldsig#',
xmlns: 'urn:org:ebics:H004',
Version: 'H004',
Revision: '1',
},
header: {
"@": { authenticate: true },
'@': { authenticate: true },
static: {
HostID: this.hostId,
TransactionID: this.transactionId
TransactionID: this.transactionId,
},
mutable: {
TransactionPhase: 'Transfer',
SegmentNumber: {
"@": { lastSegment: true },
"#": 1
}
}
'@': { lastSegment: true },
'#': 1,
},
},
},
AuthSignature: this.authSignature(),
body: {
DataTransfer: {
OrderData: this.encryptedOrderData()
}
}
OrderData: this.encryptedOrderData(),
},
},
};
return js2xmlparser.parse(this.root(), xmlObj, this.xmlOptions);
}
encryptedOrderData() {
encryptedOrderData() { // eslint-disable-line class-methods-use-this
return null;
}
toXML() {

View File

@@ -1,79 +1,79 @@
'use strict';
const zlib = require('zlib');
const crypto = require("crypto");
const crypto = require('crypto');
const js2xmlparser = require('js2xmlparser');
const GenericOrder = require('./GenericOrder');
const pad = (d) => {
const dLen = d.length;
const len = 16 * (Math.trunc(dLen / 16) + 1);
return Buffer.concat([d, Buffer.from(Buffer.from([0]).toString().repeat(len - dLen - 1)), Buffer.from([len - dLen])]);
};
module.exports = class GenericUploadOrder extends GenericOrder {
constructor(client, document) {
super(client);
this._document = document;
this._key = crypto.randomBytes(16);
this._document = document;
this._key = crypto.randomBytes(16);
this._schema.body = {
DataTransfer: {
DataEncryptionInfo: {
"@": { authenticate: true },
'@': { authenticate: true },
EncryptionPubKeyDigest: {
"@": { Version: "E002", Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" },
"#": this.client.bankE().publicDigest()
'@': { Version: 'E002', Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256' },
'#': this.client.bankE().publicDigest(),
},
TransactionKey: this.client.bankE().publicEncrypt(this._key).toString('base64'),
},
SignatureData: {
"@": { authenticate: true },
"#": this.encryptedOrderSignature()
}
}
'@': { authenticate: true },
'#': this.encryptedOrderSignature(),
},
},
};
};
}
orderSignature() {
const xmlObj = {
"@": {
xmlns: "http://www.ebics.org/S001",
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"xsi:schemaLocation": "http://www.ebics.org/S001 http://www.ebics.org/S001/ebics_signature.xsd"
'@': {
xmlns: 'http://www.ebics.org/S001',
'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:schemaLocation': 'http://www.ebics.org/S001 http://www.ebics.org/S001/ebics_signature.xsd',
},
OrderSignatureData: {
SignatureVersion: "A006",
SignatureVersion: 'A006',
SignatureValue: this.signatureValue(),
PartnerID: this.partnerId,
UserID: this.userId
}
UserID: this.userId,
},
};
return js2xmlparser.parse('UserSignatureData', xmlObj, this.xmlOptions);
};
}
signatureValue() {
const digested = crypto.createHash('sha256').update(this._document.replace(/\n|\r/g, "")).digest();
const digested = crypto.createHash('sha256').update(this._document.replace(/\n|\r/g, '')).digest();
return this.client.a().sign(digested);
};
}
encryptedOrderData() {
const dst = zlib.deflateSync(this._document.replace(/\r|\n/g, ""));
const cipher = crypto.createCipheriv('aes-128-cbc', this._key, Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,])).setAutoPadding(false);
const dst = zlib.deflateSync(this._document.replace(/\r|\n/g, ''));
const cipher = crypto.createCipheriv('aes-128-cbc', this._key, Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])).setAutoPadding(false);
return Buffer.concat([cipher.update(this._pad(dst)), cipher.final()]).toString('base64');
return Buffer.concat([cipher.update(pad(dst)), cipher.final()]).toString('base64');
}
encryptedOrderSignature() {
const dst = zlib.deflateSync(this.orderSignature());
const cipher = crypto.createCipheriv('aes-128-cbc', this._key, Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,])).setAutoPadding(false);
encryptedOrderSignature() {
const dst = zlib.deflateSync(this.orderSignature());
const cipher = crypto.createCipheriv('aes-128-cbc', this._key, Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])).setAutoPadding(false);
return Buffer.concat([cipher.update(this._pad(dst)), cipher.final()]).toString('base64');
};
_pad(d) {
const dLen = d.length;
const len = 16 * ( Math.trunc(dLen / 16) + 1 );
return Buffer.concat([d, Buffer.from(Buffer.from([0]).toString().repeat(len - dLen - 1)), Buffer.from([len-dLen])]);
return Buffer.concat([cipher.update(pad(dst)), cipher.final()]).toString('base64');
}
};

View File

@@ -3,11 +3,11 @@
const GenericOrder = require('./GenericOrder');
module.exports = class HAA extends GenericOrder {
constructor (client) {
constructor(client) {
super(client);
this._schema.header = {
"@": { authenticate: true },
'@': { authenticate: true },
static: {
HostID: this.hostId,
Nonce: this.nonce(),
@@ -15,29 +15,29 @@ module.exports = class HAA extends GenericOrder {
PartnerID: this.partnerId,
UserID: this.userId,
Product: {
"@": { Language: "de" },
"#": this.productString
'@': { Language: 'de' },
'#': this.productString,
},
OrderDetails: {
OrderType: "HAA",
OrderAttribute: "DZHNN",
StandardOrderParams: ""
OrderType: 'HAA',
OrderAttribute: 'DZHNN',
StandardOrderParams: '',
},
BankPubKeyDigests: {
Authentication: {
"@": { Version: "X002", Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" },
"#": this.client.bankX().publicDigest()
'@': { Version: 'X002', Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256' },
'#': this.client.bankX().publicDigest(),
},
Encryption: {
"@": { Version: "E002", Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" },
"#": this.client.bankE().publicDigest()
}
'@': { Version: 'E002', Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256' },
'#': this.client.bankE().publicDigest(),
},
},
SecurityMedium: "0000"
SecurityMedium: '0000',
},
mutable: {
TransactionPhase: "Initialisation"
}
TransactionPhase: 'Initialisation',
},
};
};
}
};

View File

@@ -3,50 +3,50 @@
const GenericOrder = require('./GenericOrder');
module.exports = class HAC extends GenericOrder {
constructor (client, from = null, to = null) {
constructor(client, from = null, to = null) {
super(client);
this._from = from;
this._to = to;
this._to = to;
this._schema.header = {
"@" : { authenticate: true },
'@': { authenticate: true },
static: {
HostID : this.hostId,
Nonce : this.nonce(),
HostID: this.hostId,
Nonce: this.nonce(),
Timestamp: this.timestamp(),
PartnerID: this.partnerId,
UserID : this.userId,
Product : {
"@": { Language: "de" },
"#": this.productString,
UserID: this.userId,
Product: {
'@': { Language: 'de' },
'#': this.productString,
},
OrderDetails: {
OrderType : "HAC",
OrderAttribute : "DZHNN",
OrderType: 'HAC',
OrderAttribute: 'DZHNN',
StandardOrderParams: this._hasDateRange() ? {
DateRange: {
Start: this._from,
End : this._to
}
} : ""
End: this._to,
},
} : '',
},
BankPubKeyDigests: {
Authentication: {
"@": { Version: "X002", Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" },
"#": this.client.bankX().publicDigest()
'@': { Version: 'X002', Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256' },
'#': this.client.bankX().publicDigest(),
},
Encryption: {
"@": { Version: "E002", Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" },
"#": this.client.bankE().publicDigest()
}
'@': { Version: 'E002', Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256' },
'#': this.client.bankE().publicDigest(),
},
},
SecurityMedium: "0000"
SecurityMedium: '0000',
},
mutable: {
TransactionPhase: "Initialisation"
}
TransactionPhase: 'Initialisation',
},
};
};
}
_hasDateRange() {
return this._from && this._to;

View File

@@ -10,76 +10,76 @@ module.exports = class HIA extends GenericOrder {
super(client);
this._schema = {
"@": {
"xmlns:ds": "http://www.w3.org/2000/09/xmldsig#",
xmlns: "urn:org:ebics:H004",
Version: "H004",
Revision: "1"
'@': {
'xmlns:ds': 'http://www.w3.org/2000/09/xmldsig#',
xmlns: 'urn:org:ebics:H004',
Version: 'H004',
Revision: '1',
},
header: {
"@": { authenticate: true },
'@': { authenticate: true },
static: {
HostID: this.hostId,
PartnerID: this.partnerId,
UserID: this.userId,
Product: {
"@": { Language: "de" },
"#": this.productString,
'@': { Language: 'de' },
'#': this.productString,
},
OrderDetails: {
OrderType: "HIA",
OrderAttribute: "DZNNN"
OrderType: 'HIA',
OrderAttribute: 'DZNNN',
},
SecurityMedium: "0000"
SecurityMedium: '0000',
},
mutable: {}
mutable: {},
},
body: {
DataTransfer: {
OrderData: Buffer.from(zlib.deflateSync(this.orderData())).toString('base64')
}
}
OrderData: Buffer.from(zlib.deflateSync(this.orderData())).toString('base64'),
},
},
};
}
root() {
return "ebicsUnsecuredRequest";
};
root() { // eslint-disable-line class-methods-use-this
return 'ebicsUnsecuredRequest';
}
orderData() {
const xmlOrderData = {
"@": {
"xmlns:ds": "http://www.w3.org/2000/09/xmldsig#",
xmlns: "urn:org:ebics:H004"
'@': {
'xmlns:ds': 'http://www.w3.org/2000/09/xmldsig#',
xmlns: 'urn:org:ebics:H004',
},
AuthenticationPubKeyInfo: {
PubKeyValue: {
"ds:RSAKeyValue": {
"ds:Modulus": Buffer.from(this.client.x().n(), 'HEX').toString('base64'),
"ds:Exponent": "AQAB"
'ds:RSAKeyValue': {
'ds:Modulus': Buffer.from(this.client.x().n(), 'HEX').toString('base64'),
'ds:Exponent': 'AQAB',
},
},
AuthenticationVersion: "X002"
AuthenticationVersion: 'X002',
},
EncryptionPubKeyInfo: {
PubKeyValue: {
"ds:RSAKeyValue": {
"ds:Modulus": Buffer.from(this.client.e().n(), 'HEX').toString('base64'),
"ds:Exponent": "AQAB"
'ds:RSAKeyValue': {
'ds:Modulus': Buffer.from(this.client.e().n(), 'HEX').toString('base64'),
'ds:Exponent': 'AQAB',
},
},
EncryptionVersion: "E002"
EncryptionVersion: 'E002',
},
PartnerID: this.partnerId,
UserID: this.userId
UserID: this.userId,
};
return js2xmlparser.parse("HIARequestOrderData", xmlOrderData, this.xmlOptions);
};
return js2xmlparser.parse('HIARequestOrderData', xmlOrderData, this.xmlOptions);
}
toXML() {
return js2xmlparser.parse(this.root(), this._schema, this.xmlOptions);
};
}
};

View File

@@ -3,11 +3,11 @@
const GenericOrder = require('./GenericOrder');
module.exports = class HKD extends GenericOrder {
constructor (client) {
constructor(client) {
super(client);
this._schema.header = {
"@": { authenticate: true },
'@': { authenticate: true },
static: {
HostID: this.hostId,
Nonce: this.nonce(),
@@ -15,29 +15,29 @@ module.exports = class HKD extends GenericOrder {
PartnerID: this.partnerId,
UserID: this.userId,
Product: {
"@": { Language: "de" },
"#": this.productString,
'@': { Language: 'de' },
'#': this.productString,
},
OrderDetails: {
OrderType: "HKD",
OrderAttribute: "DZHNN",
StandardOrderParams: ""
OrderType: 'HKD',
OrderAttribute: 'DZHNN',
StandardOrderParams: '',
},
BankPubKeyDigests: {
Authentication: {
"@": { Version: "X002", Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" },
"#": this.client.bankX().publicDigest()
'@': { Version: 'X002', Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256' },
'#': this.client.bankX().publicDigest(),
},
Encryption: {
"@": { Version: "E002", Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" },
"#": this.client.bankE().publicDigest()
}
'@': { Version: 'E002', Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256' },
'#': this.client.bankE().publicDigest(),
},
},
SecurityMedium: "0000"
SecurityMedium: '0000',
},
mutable: {
TransactionPhase: "Initialisation"
}
TransactionPhase: 'Initialisation',
},
};
};
}
};

View File

@@ -3,11 +3,11 @@
const GenericOrder = require('./GenericOrder');
module.exports = class HPB extends GenericOrder {
constructor (client) {
constructor(client) {
super(client);
this._schema.header = {
"@": { authenticate: true },
'@': { authenticate: true },
static: {
HostID: this.hostId,
Nonce: this.nonce(),
@@ -15,20 +15,20 @@ module.exports = class HPB extends GenericOrder {
PartnerID: this.partnerId,
UserID: this.userId,
Product: {
"@": { Language: "de" },
"#": this.productString,
'@': { Language: 'de' },
'#': this.productString,
},
OrderDetails: {
OrderType: "HPB",
OrderAttribute: "DZHNN"
OrderType: 'HPB',
OrderAttribute: 'DZHNN',
},
SecurityMedium: "0000"
SecurityMedium: '0000',
},
mutable: {}
mutable: {},
};
};
}
root() {
return "ebicsNoPubKeyDigestsRequest";
};
root() { // eslint-disable-line class-methods-use-this
return 'ebicsNoPubKeyDigestsRequest';
}
};

View File

@@ -3,11 +3,11 @@
const GenericOrder = require('./GenericOrder');
module.exports = class HTD extends GenericOrder {
constructor (client) {
constructor(client) {
super(client);
this._schema.header = {
"@": { authenticate: true },
'@': { authenticate: true },
static: {
HostID: this.hostId,
Nonce: this.nonce(),
@@ -15,29 +15,29 @@ module.exports = class HTD extends GenericOrder {
PartnerID: this.partnerId,
UserID: this.userId,
Product: {
"@": { Language: "de" },
"#": this.productString,
'@': { Language: 'de' },
'#': this.productString,
},
OrderDetails: {
OrderType: "HTD",
OrderAttribute: "DZHNN",
StandardOrderParams: ""
OrderType: 'HTD',
OrderAttribute: 'DZHNN',
StandardOrderParams: '',
},
BankPubKeyDigests: {
Authentication: {
"@": { Version: "X002", Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" },
"#": this.client.bankX().publicDigest()
'@': { Version: 'X002', Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256' },
'#': this.client.bankX().publicDigest(),
},
Encryption: {
"@": { Version: "E002", Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" },
"#": this.client.bankE().publicDigest()
}
'@': { Version: 'E002', Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256' },
'#': this.client.bankE().publicDigest(),
},
},
SecurityMedium: "0000"
SecurityMedium: '0000',
},
mutable: {
TransactionPhase: "Initialisation"
}
TransactionPhase: 'Initialisation',
},
};
};
}
};

View File

@@ -6,70 +6,70 @@ const js2xmlparser = require('js2xmlparser');
const GenericOrder = require('./GenericOrder');
module.exports = class INI extends GenericOrder {
constructor (client) {
constructor(client) {
super(client);
this._schema = {
"@": {
"xmlns:ds": "http://www.w3.org/2000/09/xmldsig#",
xmlns: "urn:org:ebics:H004",
Version: "H004",
Revision: "1"
'@': {
'xmlns:ds': 'http://www.w3.org/2000/09/xmldsig#',
xmlns: 'urn:org:ebics:H004',
Version: 'H004',
Revision: '1',
},
header: {
"@": { authenticate: true },
'@': { authenticate: true },
static: {
HostID: this.hostId,
PartnerID: this.partnerId,
UserID: this.userId,
Product: {
"@": { Language: "de" },
"#": this.productString,
'@': { Language: 'de' },
'#': this.productString,
},
OrderDetails: {
OrderType: "INI",
OrderAttribute: "DZNNN"
OrderType: 'INI',
OrderAttribute: 'DZNNN',
},
SecurityMedium: "0000"
SecurityMedium: '0000',
},
mutable: {}
mutable: {},
},
body: {
DataTransfer: {
OrderData: Buffer.from(zlib.deflateSync(this.keySignature())).toString('base64')
}
}
OrderData: Buffer.from(zlib.deflateSync(this.keySignature())).toString('base64'),
},
},
};
}
root() {
return "ebicsUnsecuredRequest";
};
root() { // eslint-disable-line class-methods-use-this
return 'ebicsUnsecuredRequest';
}
keySignature() {
const xmlOrderData = {
"@": {
"xmlns:ds": "http://www.w3.org/2000/09/xmldsig#",
xmlns: "http://www.ebics.org/S001"
'@': {
'xmlns:ds': 'http://www.w3.org/2000/09/xmldsig#',
xmlns: 'http://www.ebics.org/S001',
},
SignaturePubKeyInfo: {
PubKeyValue: {
"ds:RSAKeyValue": {
"ds:Modulus": Buffer.from(this.client.a().n(), 'HEX').toString('base64'),
"ds:Exponent": "AQAB"
'ds:RSAKeyValue': {
'ds:Modulus': Buffer.from(this.client.a().n(), 'HEX').toString('base64'),
'ds:Exponent': 'AQAB',
},
TimeStamp: this.timestamp()
TimeStamp: this.timestamp(),
},
SignatureVersion: "A006"
SignatureVersion: 'A006',
},
PartnerID: this.partnerId,
UserID: this.userId
UserID: this.userId,
};
return js2xmlparser.parse("SignaturePubKeyOrderData", xmlOrderData, this.xmlOptions);
};
return js2xmlparser.parse('SignaturePubKeyOrderData', xmlOrderData, this.xmlOptions);
}
toXML() {
return js2xmlparser.parse(this.root(), this._schema, this.xmlOptions);