Compare commits

...

216 Commits

Author SHA1 Message Date
nanov
4a09c8e260 feat: bump version 2025-04-03 02:35:18 +03:00
Dimitar Nanov
3e4ea41090
Merge pull request #96 from leMaik/misc-updates
Improve readme, update xml-crypto, fix ci, replace deprecated crypto methods and make add compatibility with NodeJS 22.
2025-04-03 02:30:23 +03:00
Maik Marschner
8dd84444ff Update vulnerable dependencies. 2025-03-26 15:30:03 +01:00
Maik Marschner
e810ce241f Use node-rsa for private pkcs1 decryption. 2025-03-26 15:30:03 +01:00
Maik Marschner
b2ae16b933 Replace createDecipher with createDecipheriv and add a compatibility mode for newer nodejs versions. 2025-03-26 15:30:03 +01:00
Maik Marschner
ac1b554144 Fix tests not running on node 22. 2025-03-26 14:02:45 +01:00
Maik Marschner
bf64593440 Replace libxmljs with xmllint-wasm to fix installation and tests on node 22. 2025-03-26 13:17:45 +01:00
Maik Marschner
138a2a2e6e Remove Node.js 19 from CI and add Node.js 22, update actions versions. 2024-09-25 16:00:46 +02:00
Maik Marschner
aa86eaaffe Fix tests failing due to RSA_PKCS1_PADDING being disabled my default. 2024-09-25 16:00:46 +02:00
Maik Marschner
6cb025f441 Document the initialization process and add a note on how to make this library work in recent Node.js versions. 2024-09-25 16:00:46 +02:00
Maik Marschner
c1b87a9e32 Fix bank letter script not working from the root directory like all other scripts. 2024-09-25 16:00:46 +02:00
Maik Marschner
412c0146db Bump minimum nodejs version to 16 to match xml-crypto. 2024-09-25 16:00:46 +02:00
Maik Marschner
d96b5e650b Update xml-crypto. 2024-09-25 16:00:46 +02:00
nanov
1fbe17846d chore: add leMaik to contributors list 2024-07-25 12:10:39 +03:00
nanov
a07822e953 chore: bump 2024-07-25 12:09:05 +03:00
Dimitar Nanov
c1022e5ca8
Merge pull request #95 from leMaik/fix/fix-response-parsing
Fix response parsing
2024-07-25 12:06:59 +03:00
Maik Marschner
ccaa3f14c9 Fix response parsing. 2024-07-15 14:59:23 +02:00
Dimitar Nanov
388156a2e4
Merge pull request #92 from node-ebics/fix/request
Fix/request
2024-04-30 03:09:13 +03:00
nanov
231830addc chore: bump version 2024-04-30 03:08:25 +03:00
nanov
475fc58289 chore: align licensces between package.json and LICENSE.MD 2024-04-30 03:06:39 +03:00
nanov
ba997d312b fix: correct rock post signature 2024-04-30 03:05:31 +03:00
Dimitar Nanov
bc4b33f7e4
Merge pull request #89 from node-ebics/dependabot/npm_and_yarn/babel/traverse-7.23.2
chore(deps-dev): bump @babel/traverse from 7.13.13 to 7.23.2
2023-10-17 09:11:19 +03:00
dependabot[bot]
b1abf16864
chore(deps-dev): bump @babel/traverse from 7.13.13 to 7.23.2
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.13.13 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-17 02:59:03 +00:00
nanov
fd7bdfe55d t pushMerge branch 'master' of github.com:node-ebics/node-ebics-client 2023-10-11 22:34:00 +03:00
nanov
e41c0bf74d chore(deps): update lock 2023-10-11 22:32:35 +03:00
Dimitar Nanov
36b8d2999c
Update CI.yml 2023-10-11 22:28:23 +03:00
Dimitar Nanov
510654f52e
Update CI.yml 2023-10-11 22:27:08 +03:00
Dimitar Nanov
e251cc0e5b
Merge pull request #88 from node-ebics/update-deps
Update deps
2023-10-11 22:20:43 +03:00
nanov
8da104515c chore: version number 2023-10-11 22:19:58 +03:00
Dimitar Nanov
f3bd654739
Merge pull request #87 from node-ebics/update-deps
Update dependencies, replace deprecated libs
2023-10-11 22:18:47 +03:00
nanov
b6b27516d5 feat: replace <request> with <rock-req> 2023-10-11 22:15:35 +03:00
nanov
a03ec2283f feat: update dependencies 2023-10-11 21:58:26 +03:00
Dimitar Nanov
66bf57f0dc
Merge pull request #75 from get-momo/ci
Add CI
2023-01-06 18:27:36 +02:00
Sonny Piers
3a8dc1da0b chore: Update dev dependency libxmljs
The update is required to run tests on Node.js 18

The massive change to package-lock.json is due to an npm major upgade.

>
> The package-lock.json file was created with an old version of npm,
> so supplemental metadata must be fetched from the registry.
>
> This is a one-time fix-up, please be patient...
>
2022-08-18 15:41:13 +02:00
Sonny Piers
a3ce00eb3e chore: Enable CI
Inspired by
094c36e88e/README.md (matrix-testing)
2022-08-18 15:40:47 +02:00
Dimitar Nanov
e1ded83ea9
Update README.md 2022-08-04 07:00:28 +03:00
Dimitar Nanov
0eccce4754
Update README.md 2022-08-04 06:59:44 +03:00
Dimitar Nanov
7520a56be8
Update LICENSE 2022-08-04 06:58:54 +03:00
nanov
fe0f585b27 changelog 2021-03-30 14:52:21 +03:00
nanov
d0c6d76431 bump version 2021-03-30 14:51:20 +03:00
nanov
936e103c3f fix: crypto check 2021-03-30 14:50:32 +03:00
nanov
9ee2be97c4 chore: changelog 2021-03-30 14:27:22 +03:00
nanov
f9fb6d3dc9 chore: cleanup & bump 2021-03-30 14:26:35 +03:00
nanov
2d580c0d44 merge 2021-03-30 14:24:07 +03:00
nanov
5c8139e1bc bump version 2021-03-30 14:23:52 +03:00
Dimitar Nanov
cecaa782c9
Merge pull request #56 from node-ebics/dependabot/npm_and_yarn/y18n-4.0.1
chore(deps): bump y18n from 4.0.0 to 4.0.1
2021-03-30 14:22:37 +03:00
Dimitar Nanov
3eb997e3df
Merge pull request #53 from Herrie82/herrie/additionalConfigItems
Add additional bank configuration items
2021-03-30 14:22:14 +03:00
nanov
2b35ed072a fix: crypto additional byte check 2021-03-30 14:20:25 +03:00
Herrie
9ef50081ca
Merge branch 'master' into herrie/additionalConfigItems 2021-03-30 11:03:35 +02:00
Herman van Hazendonk
d192e61d29 Add additional bank configuration items
For prettier generation of bank letters and other bits used in examples:

Expand the bank config to include:

* "bankFullName" used in the INI letter's which are sent to the bank.
* "bankShortName" used in the filename for the generated letters and in other places if needed.
* "languageCode" used for determining which template to use for the bank (currently "en" and "de" are supported).
* "storageLocation" can be used to specify a local or network path where to store downloaded files.

* In bankLetter.js: Use the current script folder as output for the bank's letter in HTML format instead of the user/os homedir folder.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2021-03-30 11:02:36 +02:00
dependabot[bot]
0e56947b07
chore(deps): bump y18n from 4.0.0 to 4.0.1
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-30 07:50:28 +00:00
nanov
e6420244dc chore: update deps 2021-03-30 10:36:45 +03:00
Dimitar Nanov
c8220f6d45
Merge pull request #46 from node-ebics/dependabot/npm_and_yarn/xmldom-0.5.0
chore(deps): bump xmldom from 0.3.0 to 0.5.0
2021-03-30 10:29:44 +03:00
nanov
f6dfc73ff2 chore: add https://github.com/Herrie82 to contributors 2021-03-30 09:21:34 +03:00
nanov
6921f8d503 chore: cleanup crypto sign fucntion 2021-03-30 09:20:21 +03:00
Dimitar Nanov
043caedc94
Merge pull request #50 from Herrie82/master
Cryto.js: Nasty workaround for incorrect signature (257 vs 256) and h…
2021-03-30 08:58:35 +03:00
Dimitar Nanov
13f6d03cb2
Merge pull request #51 from Herrie82/herrie/multibank
Examples: Improve config implementation for multibank
2021-03-30 08:53:35 +03:00
Dimitar Nanov
546d371193
Merge pull request #55 from Herrie82/herrie/jpm
README.md: Add J.P. Morgan to tested banks
2021-03-30 08:52:02 +03:00
Herman van Hazendonk
374560b14a README.md: Add J.P. Morgan to tested banks
J.P. Morgan has been tested for their global EBICS channel as well and confirmed to be working.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2021-03-29 14:53:27 +02:00
Herman van Hazendonk
500737dbc7 Remove not needed else statement
Cleanup as per comment
2021-03-29 09:12:23 +02:00
Dimitar Nanov
57a15f0722
Merge pull request #49 from Herrie82/herrie/gazprumm
Add support for Bank GPB AO (Gazprombank Russia)
2021-03-29 09:13:59 +03:00
Dimitar Nanov
bff972f354
Merge pull request #48 from Herrie82/herrie/zipped-camt
Add sample code for zipped CAMT statements
2021-03-29 09:12:36 +03:00
Herman van Hazendonk
de92265c95 Examples: Improve config implementation for multibank.
When using the software with multiple banks, the current config file solution wasn't very flexible. We had some different local implementation at our end. In order to use upstream software directly without any changes, suggesting to merge these changes. For me locally it would mean I can get rid of a lot of local example code which are currently bank and even entity specific and can be made more generic.
This will also allow multiple EBICS connections with the same bank for different entities as well, in case this is needed. In our case we have multiple EBICS connections with the same bank.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2021-03-26 19:57:54 +01:00
Herrie
61581d1af7 Cryto.js: Nasty workaround for incorrect signature (257 vs 256) and hex key length (514 vs 512)
For some unknown reason, the signature gets a length of 257 bytes instead of 256 bytes, and the length of the hex value is 514 bytes instead of 512 bytes.

This works around it, until a proper fix is implemented. The bug seems to be caused by https://github.com/node-ebics/node-ebics-client/blob/master/lib/crypto/Crypto.js#L71 somehow.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2021-03-25 10:07:33 +01:00
Herman van Hazendonk
8af3cb50c5 Add sample code for zipped CAMT statements
Some banks provide zipped CAMT statements, add some example code on how to write these to a file.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2021-03-24 22:14:21 +01:00
Herman van Hazendonk
a628e00b9b Add support for Bank GPB AO (Gazprombank Russia)
Add custom order types (G02, G52, G53, G1R and G1V) and examples for Bank GPB AO (Gazprombank Russia).

Pain.001.001.06 (RUB) - G1R
Pain.001.001.06 (FCY/FX/RLS) - G1V
Pain.002.001.06 - G02
Camt.052.001.05 - G52
Camt.053.001.05 - G53

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2021-03-24 22:13:18 +01:00
dependabot[bot]
b8ec1e228e
chore(deps): bump xmldom from 0.3.0 to 0.5.0
Bumps [xmldom](https://github.com/xmldom/xmldom) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/xmldom/xmldom/releases)
- [Changelog](https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xmldom/xmldom/compare/0.3.0...0.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-13 02:40:29 +00:00
nanov
f027bc4048 chore: adjust ownership 2021-02-05 20:38:38 +02:00
nanov
a998538316 changelog 2021-02-05 20:30:59 +02:00
nanov
b44ff0f44c chore: bump 2021-02-05 20:29:22 +02:00
Dimitar Nanov
2ba095fbdd
Merge pull request #44 from chrwoizi/master
fix high severity vulnerabilities
2021-01-25 16:21:16 +02:00
chrwoizi
c28a6f7f09 fix high severity vulnerabilities 2021-01-21 11:34:37 +01:00
Dimitar Nanov
0585ecd396
Merge pull request #39 from node-ebics/dependabot/npm_and_yarn/lodash-4.17.19
chore(deps): bump lodash from 4.17.15 to 4.17.19
2020-08-05 19:16:34 +03:00
dependabot[bot]
21a46832fc
chore(deps): bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-18 18:01:50 +00:00
nanov
d5a24f9537 chore: fix dev dependencies voulnarbilities 2020-05-09 13:24:00 +03:00
nanov
a9bbdd95c6 chore: changelog 2020-05-09 13:21:16 +03:00
nanov
acd5a1897c v0.1.6 2020-05-09 13:20:30 +03:00
nanov
bd11a410f1 chore: update deps 2020-05-09 13:19:56 +03:00
Dimitar Nanov
4e5d8c2ea5
Merge pull request #34 from node-ebics/dependabot/npm_and_yarn/acorn-7.1.1
chore(deps): bump acorn from 7.1.0 to 7.1.1
2020-05-09 13:12:43 +03:00
dependabot[bot]
f913f95b64
chore(deps): bump acorn from 7.1.0 to 7.1.1
Bumps [acorn](https://github.com/acornjs/acorn) from 7.1.0 to 7.1.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/7.1.0...7.1.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-14 11:26:46 +00:00
nanov
f232b81fc3 README.md adjust build status 2020-03-06 06:57:27 +02:00
nanov
3a18b213d5 v0.1.5 2020-03-06 06:51:37 +02:00
nanov
7053a03286 chore: update deps 2020-03-06 06:47:56 +02:00
nanov
be76a52ae5 chore: adjust samples 2020-03-06 06:43:17 +02:00
Dimitar Nanov
99f0bd9622
Merge pull request #33 from chrwoizi/master
feat: Wait until the keys are generated
2020-03-06 05:44:59 +02:00
chrwoizi
e57316c6cb
Wait until the keys are generated
The initialization method should wait until the key file is written because other methods could use the keys-method after initialization.
2020-02-14 11:46:15 +01:00
nanov
4b0bf0eba6 fix(examples): orders ref 2019-12-30 11:36:11 +02:00
nanov
e060863356 fix keyStoragePath 2019-12-30 11:28:33 +02:00
nanov
fb464078dc fix(examples): bankLetter setup 2019-12-30 11:10:48 +02:00
nanov
3d4c94dff8 fix(examples): serverAddress -> url 2019-12-30 11:07:24 +02:00
nanov
e98a1f8cc3 fix: loadConfig in exmaples 2019-12-30 09:37:19 +02:00
nanov
c5e59414f3 changelog 2019-12-18 16:54:58 +02:00
nanov
5e73d3ce5e bump 2019-12-18 16:53:18 +02:00
nanov
c7e739f767 lock 2019-12-18 16:49:26 +02:00
nanov
478571e447 chore: update deps 2019-12-18 16:49:20 +02:00
nanov
f6dfdf4c40 feat: generalize examples 2019-12-18 16:48:05 +02:00
Dimitar Nanov
fcbf4ca165
Merge pull request #28 from Herrie82/herrie/config
examples: Externalize configuration values and allow for multiple env…
2019-12-18 10:37:02 +02:00
nanov
6187902ae5 chore: transfer to new repository 2019-12-16 14:28:35 +02:00
Dimitar Nanov
65658ab131
Merge pull request #29 from Herrie82/herrie/send-XG1
Add XG1 order type and example
2019-12-13 10:36:30 +02:00
Herrie
d38460011c Add XG1 order type and example
XG1 order type is used for ISO XML 20022 CGI (Common Global Implementation) which should be a unified format that works within a country (irrespective of bank).

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2019-11-29 14:38:46 +01:00
Dimitar Nanov
b9058fac93
Merge pull request #27 from Herrie82/herrie/SupportedBank
README.md: Add Bank GPB International S.A. to supported bank list
2019-11-29 14:14:10 +02:00
Herrie
c3d3decd6a examples: Externalize configuration values and allow for multiple environments
In order to more easily manage testing of various order types as well as production, development etc. environments, externalize this config values.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2019-11-29 13:12:15 +01:00
Herrie
a5b65f815e README.md: Add Bank GPB International S.A. to supported bank list
I was able to test DKI, INI, HAA, HAC, HEV, HVD, STA, VMK, XG1 with Bank GPB International S.A., so I think we're good to add it to the supported bank list.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2019-11-29 11:46:53 +01:00
nanov
5f57a072ea chore: changelog 2019-11-26 18:25:29 +02:00
nanov
f95ecc60b8 chore: changelog 2019-11-26 18:24:35 +02:00
nanov
3873ff49d1 bump version 2019-11-26 18:23:52 +02:00
nanov
9725380edd feat: add C53, C52 and DKI orders 2019-11-26 18:22:09 +02:00
nanov
f2a3d6f067 chore: gitignore 2019-11-26 18:21:56 +02:00
Dimitar Nanov
6d882f56fe
Merge pull request #26 from Herrie82/herrie/DKI
* Add DKI, C52, C53 order types.
* Some examples for STA, VMK, C52, C53, DKI and HKD order types.
* Rename example for HBT into HTD.
2019-11-26 18:15:32 +02:00
nanov
88ba543784 feat: add ebics 061011 error 2019-11-26 18:13:30 +02:00
Herrie
f8c9cc7ba8 Add C52/C53 order types and examples
Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2019-11-25 16:22:39 +01:00
Herrie
0c08d534ff Add examples for MT940 and MT942
Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2019-11-25 16:22:39 +01:00
Herrie
ad7d55ce7c Add example for HKD order type
Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2019-11-25 16:20:59 +01:00
Herrie
c15e19d22f Rename send-hbt-order.js to send-htd-order.js
To reflect the name of the order type correctly.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2019-11-25 16:20:59 +01:00
Herrie
d2473bb81d Add DKI order type
To download Exchange rate files and fix syntax error.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2019-11-25 16:20:59 +01:00
nanov
4e6383e23c chore: add coveralls to travis 2019-11-20 19:46:39 +02:00
nanov
a4a64709f0 chore: update dependencies 2019-11-20 19:40:23 +02:00
nanov
7533a861e5 chore: add coveralls badge 2019-11-20 19:38:57 +02:00
nanov
e56e7f224b test: add coveralls support 2019-11-20 19:37:32 +02:00
nanov
6d73ef77d4 test: add additional tests 2019-11-20 14:42:22 +02:00
nanov
a10a3a8d63 feat: async letter serialization 2019-11-20 14:40:18 +02:00
nanov
67d74cfa00 test: add more tests 2019-11-20 11:12:37 +02:00
nanov
ddd0933c0b chore: add Herrie82 to contributors list 2019-11-19 19:48:05 +02:00
Dimitar Nanov
ea52c71fb2
Merge pull request #24 from Herrie82/herrie/english
feat: Add English template & flexible generation
2019-11-19 19:46:46 +02:00
Dimitar Nanov
ddcd31a5c0
Merge pull request #23 from Herrie82/master
chore: Various fixes for spelling
2019-11-19 19:44:11 +02:00
Herrie
95403cbe6f Bank Letter: Add English template & flexible generation
Allow for both German (de) and English (en) initialization letters.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2019-11-19 16:57:13 +01:00
Herman van Hazendonk
0b9d93f745 Various fixes for spelling
Various minor spelling mistake fixes.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2019-11-19 14:48:26 +01:00
nanov
6ecb256483 tests: start Client tests 2019-11-08 11:24:59 +02:00
nanov
d482b1dde1 chore: update readme 2019-11-07 11:53:09 +02:00
nanov
ecf51680c5 chore: add logo 2019-11-07 11:49:22 +02:00
nanov
9a748fa2bc chore: changelog and files settings 2019-11-07 11:42:37 +02:00
nanov
7355096dfd v0.1.2 2019-11-07 11:37:34 +02:00
nanov
25eedd5071 chore: update package.json 2019-11-07 11:36:04 +02:00
Dimitar Nanov
4182e7956a
Merge pull request #22 from eCollect/release-it
chore: add changelog configoration
2019-11-07 11:35:34 +02:00
nanov
fee2aa4681 chore: add version script 2019-11-07 11:35:11 +02:00
nanov
1f34dcbfb6 add changelog configoration 2019-11-07 11:20:34 +02:00
nanov
3a64d95eb5 chore: add tags 2019-11-07 10:58:38 +02:00
Dimitar Nanov
926d1bca18
Merge pull request #21 from eCollect/feat/drop-bn.js
Closes #17 and #13
2019-11-07 10:52:01 +02:00
nanov
6d601f4186 chore: fix package json syntax 2019-11-07 10:42:11 +02:00
nanov
2d05bf88f9 chore: add contributors to package json 2019-11-07 10:41:43 +02:00
nanov
10e0d602bd chore: update license expression in package.json 2019-11-07 10:38:01 +02:00
nanov
eea0a49130 feat: drop bn.js 2019-11-07 10:37:31 +02:00
nanov
3e95478b3b feat: add nyc and cleanup .gitignore 2019-11-07 10:35:31 +02:00
nanov
4496cbf560 feat: remove toBuffer from number 2019-11-07 10:30:03 +02:00
nanov
0efc46b014 feat add BigNumber tests 2019-11-07 10:27:20 +02:00
nanov
eafe2f9f55 chore: restructure BigNumber 2019-11-07 10:27:08 +02:00
nanov
24afdeb257 chroe: import consts 2019-11-07 10:26:53 +02:00
nanov
34051f0a9f feat: migrate Crypto to own BigNumber 2019-11-07 08:58:52 +02:00
nanov
14779088f1 chore: lint 2019-11-07 08:57:54 +02:00
nanov
aad0bd97c8 feat: implement all needed BigNumber methods 2019-11-07 08:57:44 +02:00
nanov
429e807994 fix number generarion 2019-11-06 17:27:48 +02:00
nanov
bb8d1cfaa0 wip: migrate MFG1 to BigNumber 2019-11-06 17:16:56 +02:00
nanov
cda36bfcb3 wip: implement BigNumber wrapper 2019-11-06 17:16:15 +02:00
Dimitar Nanov
d21d89fb36
Merge pull request #20 from eCollect/feat/drop-moment
Drop moment dependency
2019-11-06 16:55:15 +02:00
nanov
df9c330411 feat: drop moment dependency 2019-11-06 16:52:31 +02:00
nanov
2a17ff6056 chore: write tests for date range 2019-11-06 16:52:20 +02:00
nanov
33ac6ac60f feat: implement date handling and formatting 2019-11-06 16:51:59 +02:00
nanov
e9f7c11bbb v0.1.1 2019-11-05 06:48:24 +02:00
nanov
9aabe933e9 chore: update license 2019-11-05 06:41:31 +02:00
nanov
dc5f52198b v0.1.0 2019-11-05 06:26:02 +02:00
nanov
bb5e551057 chore: cleanup readme 2019-11-05 06:24:39 +02:00
nanov
0a3a4631df update readme 2019-11-05 06:23:45 +02:00
nanov
3ffa323264 chore: commit test keys for tests to pass 2019-11-05 06:22:16 +02:00
nanov
e56dc082d0 chore: add travis config 2019-11-05 06:13:27 +02:00
nanov
0c01420c1e chore: cleanup 2019-11-05 06:09:07 +02:00
nanov
0964992164 chore: drop node-rsa 2019-11-05 06:00:09 +02:00
Dimitar Nanov
5c419630c1
Merge pull request #16 from eCollect/feat/handle-unsual-exponent
Feat: handle unsual exponent migrate to node-forge
2019-11-05 05:58:50 +02:00
Dimitar Nanov
594f2a2623
Merge pull request #15 from eCollect/chore/tests
Add order generation tests and fix linting
2019-11-05 05:55:33 +02:00
nanov
fa557f5e9b feat: tests 2019-11-05 05:54:32 +02:00
nanov
cf16abc843 chire: jsdoc 2019-11-05 05:54:16 +02:00
nanov
c60fed4d58 chore: lint 2019-11-05 05:54:09 +02:00
nanov
9aa2ab7380 chore: lint 2019-11-05 05:53:20 +02:00
nanov
fe2ad67139 chore: update linter 2019-11-05 05:49:07 +02:00
Vladislav Hristov
104ec67f8c chore: add ; at the end of Key.js 2019-11-01 16:52:36 +02:00
Vladislav Hristov
e8a80932e1 fit: key size is now calculated instead of hardcoded 2019-11-01 16:50:39 +02:00
Vladislav Hristov
ce6cd02e58 fit: BankLetter.js get key size 2019-11-01 16:28:04 +02:00
Vladislav Hristov
836ec0ebf3 fit(tests): use new Key in keys test 2019-11-01 13:49:59 +02:00
Vladislav Hristov
59a281c895 feat: use new Key in Keys manager 2019-11-01 13:49:33 +02:00
Vladislav Hristov
61ada747f3 clean: remove modulus and exponent property from bankKeys() 2019-11-01 13:48:51 +02:00
Vladislav Hristov
f15e09840a add: add Key class to manage a single key 2019-11-01 13:44:29 +02:00
nanov
422821fbbd feat: test all H004 orders 2019-11-01 11:27:36 +02:00
nanov
e40f79cee6 feat: prepare order generation tests 2019-11-01 08:13:53 +02:00
Dimitar Nanov
837fdaa08c
Merge pull request #14 from yagop/test/mocha-script
test script run mocha
2019-11-01 05:59:38 +02:00
Yago Perez
361acf89d0 test script run mocha 2019-10-31 21:40:07 +01:00
Vladislav Hristov
4149c01695 wip: migrate to node-forge 2019-10-31 18:57:42 +02:00
Vladislav Hristov
1c1f112ff5 fix: modulus zero byte handling 2019-10-30 10:53:03 +02:00
nanov
1320f6f21d chore: update deps 2019-10-14 14:19:11 +03:00
Vladislav Hristov
0049fffc00 up the version to 0.0.8 2019-10-08 16:10:08 +03:00
Vladislav Hristov
2c9040904a chore: remove console.log statements 2019-10-08 16:09:08 +03:00
Dimitar Nanov
0f6dcf9eb2
Merge pull request #11 from yagop/fix-version
chore: readme maintenance
2019-10-03 09:32:17 +03:00
nanov
ca31edf245 chore: add yagop to contributors 2019-10-03 09:30:49 +03:00
nanov
4464349d0f chore: remove version from readme 2019-10-03 09:29:35 +03:00
Dimitar Nanov
15546df9ea
Merge pull request #10 from yagop/examples
Provide examples
2019-10-03 09:20:29 +03:00
Yago Perez
40467a2c5e
v0.0.35 -> v0.0.7 2019-10-03 00:20:36 +02:00
Yago Perez
eb9fbf5834
Change HBT order text 2019-10-03 00:10:52 +02:00
Yago Perez
166c61aec4
examples/send-hbt-order.js 2019-10-02 23:58:37 +02:00
Yago Perez
5a63e19aab
examples/save-bank-kesy.js 2019-10-02 23:58:35 +02:00
Yago Perez
9e6c318372
keys -> passphrase 2019-10-02 23:58:33 +02:00
Yago Perez
ce6e58b3f3
examples/bankLetter.js 2019-10-02 23:58:29 +02:00
Yago Perez
7dad7c8787
initialize.js 2019-10-02 23:56:51 +02:00
Dimitar Nanov
79f17e1404 bump version 2019-08-02 10:52:48 +03:00
Dimitar Nanov
3ef32c8ce5
Merge pull request #7 from anandsahil/addCAMT53OrderType
* Add Z53 order type
* Create utils container and move dateRange functionality to there
2019-08-01 16:59:25 +03:00
anandsahil
aa761cf7ad move dateRange from constants to utils 2019-08-01 14:14:30 +02:00
anandsahil
5ff3147124 add new order type XZ53 and removed repeated dateRange to consts 2019-08-01 14:00:07 +02:00
anandsahil
01d4634d86 Merge remote-tracking branch 'src/master' 2019-08-01 13:52:51 +02:00
sahil anand
89904afa63
Merge pull request #2 from anandsahil/minorChanges
remove eCollect from constant and minor verbose error handeling
2019-07-25 17:40:29 +02:00
sahil anand
4907524259
Merge pull request #1 from anandsahil/and-XCT-order-type
add iso pain format XCT order type
2019-07-25 17:40:04 +02:00
Dimitar Nanov
c9f52d3bd9 bump 2019-07-24 09:12:06 +03:00
Dimitar Nanov
f5b05ae491
Merge pull request #4 from anandsahil/minorChanges
remove eCollect from constant and minor verbose error handaling
2019-07-24 09:05:14 +03:00
Dimitar Nanov
9f88b048d7
Merge pull request #5 from anandsahil/and-XCT-order-type
add iso pain format XCT order type
2019-07-24 09:04:22 +03:00
anandsahil
d06e92c51c add iso pain format XCT order type 2019-07-22 17:36:38 +02:00
anandsahil
cb2062ae2f remove eCollect from constant and minor verbose error handeling 2019-07-22 17:31:24 +02:00
Dimitar Nanov
07a48e9cc5 0.0.5 2019-06-28 17:12:49 +03:00
Dimitar Nanov
800002701d
Merge pull request #3 from vasyas/master
Fix parsing of the bank keys in the HPB response
2019-06-28 17:09:49 +03:00
vasyas
5f0b6cd374 #2 corrected bank keys parsing 2019-06-27 00:13:44 +03:00
vasyas
c571ef181b tc for bank keys parsing error 2019-06-27 00:10:53 +03:00
100 changed files with 14240 additions and 999 deletions

View File

@ -10,6 +10,9 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.xml]
insert_final_newline = false
[*.json]
indent_size = 2

View File

@ -1,4 +1,5 @@
node_modules/
examples/
build/
static/
config/

View File

@ -1,34 +1,4 @@
{
"extends": "airbnb-base",
"env": {
"node": true
},
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "script",
"ecmaFeatures": {
"modules": false
}
},
"rules": {
"max-len": 0,
"linebreak-style": 0,
"no-plusplus": [
2,
{
"allowForLoopAfterthoughts": true
}
],
"no-continue": 0,
"indent": [2, "tab"],
"no-tabs": 0,
"strict": [2, "safe"],
"curly": [2, "multi", "consistent"],
"import/no-extraneous-dependencies": 0,
"import/no-unresolved": 0,
"no-underscore-dangle": 0,
"no-param-reassign": 0,
"generator-star-spacing": 0,
"jsx-a11y/href-no-hash": "off"
}
"extends": "ecollect-base",
"root": true
}

23
.github/workflows/CI.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 18, 20, 22 ]
name: Node.js ${{ matrix.node }}
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm test

31
.gitignore vendored
View File

@ -1,14 +1,23 @@
npm-debug.log
node_modules
# mac shit
.DS_Store
*.local.json5
yarn.lock
/project.sublime-workspace
/public/css/style.css.map
/.idea
# nyc test coverage
.nyc_output
coverage/
# Dependency directories
node_modules/
# Optional npm cache directory
.npm
npm-debug.log
# Optional eslint cache
.eslintcache
# vscode
/.vscode
*.pid
/coverage
package-lock.json
*.key
*.html
# Tests temporary
.test_tmp

8
.travis.yml Normal file
View File

@ -0,0 +1,8 @@
language: node_js
node_js:
- "16" # maintance lts
- "17"
- "18" # active lts
- "19"
- "20" # current
after_success: npm run coverage

198
CHANGELOG.md Normal file
View File

@ -0,0 +1,198 @@
### Changelog
#### [v4.2.0]
- feat: update dependencies [`a03ec22`](https://github.com/node-ebics/node-ebics-client/commit/a03ec2283fdd3dcf750c5ed448f0195d92c5c9f0)
- chore: Update dev dependency libxmljs [`3a8dc1d`](https://github.com/node-ebics/node-ebics-client/commit/3a8dc1da0bac20a6f25a687da0a783f3b52d5163)
- feat: replace &lt;request&gt; with &lt;rock-req&gt; [`b6b2751`](https://github.com/node-ebics/node-ebics-client/commit/b6b27516d5854b38dcdbe56f23967001f844e631)
#### [v4.0.0](https://github.com/node-ebics/node-ebics-client/compare/v3.0.0...v0.4.0)
- Add CI [`#75`](https://github.com/node-ebics/node-ebics-client/pull/75)
- feat: update dependencies [`a03ec22`](https://github.com/node-ebics/node-ebics-client/commit/a03ec2283fdd3dcf750c5ed448f0195d92c5c9f0)
- chore: Update dev dependency libxmljs [`3a8dc1d`](https://github.com/node-ebics/node-ebics-client/commit/3a8dc1da0bac20a6f25a687da0a783f3b52d5163)
- feat: replace &lt;request&gt; with &lt;rock-req&gt; [`b6b2751`](https://github.com/node-ebics/node-ebics-client/commit/b6b27516d5854b38dcdbe56f23967001f844e631)
### [v3.0.0](https://github.com/node-ebics/node-ebics-client/compare/v0.2.1...v3.0.0)
> 4 August 2022
- Update LICENSE [`7520a56`](https://github.com/node-ebics/node-ebics-client/commit/7520a56be8ba446d3466c6dc9202b1d65ea3396f)
- changelog [`fe0f585`](https://github.com/node-ebics/node-ebics-client/commit/fe0f585b277c390415841a343aa86d4533997057)
- chore: update license in package.json, bump version [`b46b214`](https://github.com/node-ebics/node-ebics-client/commit/b46b214e57cf1b4e30455da306b26b3a06dc8a5f)
#### [v0.2.1](https://github.com/node-ebics/node-ebics-client/compare/v0.2.0...v0.2.1)
> 30 March 2021
- bump version [`d0c6d76`](https://github.com/node-ebics/node-ebics-client/commit/d0c6d764318470ef66da9be79d8716c17392f16b)
- fix: crypto check [`936e103`](https://github.com/node-ebics/node-ebics-client/commit/936e103c3f36acb697404b4bca4cf2607f3c79e5)
#### [v0.2.0](https://github.com/node-ebics/node-ebics-client/compare/v0.1.7...v0.2.0)
> 30 March 2021
- chore(deps): bump y18n from 4.0.0 to 4.0.1 [`#56`](https://github.com/node-ebics/node-ebics-client/pull/56)
- Add additional bank configuration items [`#53`](https://github.com/node-ebics/node-ebics-client/pull/53)
- chore(deps): bump xmldom from 0.3.0 to 0.5.0 [`#46`](https://github.com/node-ebics/node-ebics-client/pull/46)
- Cryto.js: Nasty workaround for incorrect signature (257 vs 256) and h… [`#50`](https://github.com/node-ebics/node-ebics-client/pull/50)
- Examples: Improve config implementation for multibank [`#51`](https://github.com/node-ebics/node-ebics-client/pull/51)
- README.md: Add J.P. Morgan to tested banks [`#55`](https://github.com/node-ebics/node-ebics-client/pull/55)
- Add support for Bank GPB AO (Gazprombank Russia) [`#49`](https://github.com/node-ebics/node-ebics-client/pull/49)
- Add sample code for zipped CAMT statements [`#48`](https://github.com/node-ebics/node-ebics-client/pull/48)
- chore: changelog [`9ee2be9`](https://github.com/node-ebics/node-ebics-client/commit/9ee2be97c4e7f0921477e3c92c2252c19fb85a7e)
- chore: cleanup & bump [`f9fb6d3`](https://github.com/node-ebics/node-ebics-client/commit/f9fb6d3dc94c27a0c983205ce0ef00e4a18f95ff)
- merge [`2d580c0`](https://github.com/node-ebics/node-ebics-client/commit/2d580c0d443b0ec0d103a94b64c803bfa1dd6b0b)
#### [v0.1.7](https://github.com/node-ebics/node-ebics-client/compare/v0.1.6...v0.1.7)
> 5 February 2021
- fix high severity vulnerabilities [`#44`](https://github.com/node-ebics/node-ebics-client/pull/44)
- chore(deps): bump lodash from 4.17.15 to 4.17.19 [`#39`](https://github.com/node-ebics/node-ebics-client/pull/39)
- chore: fix dev dependencies voulnarbilities [`d5a24f9`](https://github.com/node-ebics/node-ebics-client/commit/d5a24f9537f676ded8d1996928ed7e76b7b9ba3f)
- changelog [`a998538`](https://github.com/node-ebics/node-ebics-client/commit/a998538316c963896c0e7ca76002513f9ea4a01a)
- chore: changelog [`a9bbdd9`](https://github.com/node-ebics/node-ebics-client/commit/a9bbdd95c6ce0fdb9cac5452af6fedb4f04b10cb)
#### [v0.1.6](https://github.com/node-ebics/node-ebics-client/compare/v0.1.4...v0.1.6)
> 9 May 2020
- chore(deps): bump acorn from 7.1.0 to 7.1.1 [`#34`](https://github.com/node-ebics/node-ebics-client/pull/34)
- feat: Wait until the keys are generated [`#33`](https://github.com/node-ebics/node-ebics-client/pull/33)
- chore: update deps [`bd11a41`](https://github.com/node-ebics/node-ebics-client/commit/bd11a410f1d2444cdfdfba965df7be37cedcc14a)
- chore: update deps [`7053a03`](https://github.com/node-ebics/node-ebics-client/commit/7053a03286c700106bb1988fce72338f51ca9a96)
- changelog [`c5e5941`](https://github.com/node-ebics/node-ebics-client/commit/c5e59414f35a9634e12a6b74163f1b7fa6403de5)
#### [v0.1.4](https://github.com/node-ebics/node-ebics-client/compare/v0.1.3...v0.1.4)
> 18 December 2019
- examples: Externalize configuration values and allow for multiple env… [`#28`](https://github.com/node-ebics/node-ebics-client/pull/28)
- Add XG1 order type and example [`#29`](https://github.com/node-ebics/node-ebics-client/pull/29)
- README.md: Add Bank GPB International S.A. to supported bank list [`#27`](https://github.com/node-ebics/node-ebics-client/pull/27)
- feat: generalize examples [`f6dfdf4`](https://github.com/node-ebics/node-ebics-client/commit/f6dfdf4c40621d9d6d9bcd64b8698d614307ea61)
- examples: Externalize configuration values and allow for multiple environments [`c3d3dec`](https://github.com/node-ebics/node-ebics-client/commit/c3d3decd6a17f733b41ea9f24ed5df8b0b7364f6)
- lock [`c7e739f`](https://github.com/node-ebics/node-ebics-client/commit/c7e739f7670856cff5af8fc93a341baf98e01546)
#### [v0.1.3](https://github.com/node-ebics/node-ebics-client/compare/v0.1.2...v0.1.3)
> 26 November 2019
- * Add DKI, C52, C53 order types. [`#26`](https://github.com/node-ebics/node-ebics-client/pull/26)
- feat: Add English template & flexible generation [`#24`](https://github.com/node-ebics/node-ebics-client/pull/24)
- chore: Various fixes for spelling [`#23`](https://github.com/node-ebics/node-ebics-client/pull/23)
- test: add additional tests [`6d73ef7`](https://github.com/node-ebics/node-ebics-client/commit/6d73ef77d4454ff966b733f995b64d6dfd7c18b2)
- test: add more tests [`67d74cf`](https://github.com/node-ebics/node-ebics-client/commit/67d74cfa0060d97c948bb747885eaba26294663b)
- Bank Letter: Add English template & flexible generation [`95403cb`](https://github.com/node-ebics/node-ebics-client/commit/95403cbe6f90c81a696bb589533d713a4ba04873)
#### [v0.1.2](https://github.com/node-ebics/node-ebics-client/compare/v0.1.1...v0.1.2)
> 7 November 2019
- chore: add changelog configoration [`#22`](https://github.com/node-ebics/node-ebics-client/pull/22)
- Closes #17 and #13 [`#21`](https://github.com/node-ebics/node-ebics-client/pull/21)
- Drop moment dependency [`#20`](https://github.com/node-ebics/node-ebics-client/pull/20)
- feat: add nyc and cleanup .gitignore [`3e95478`](https://github.com/node-ebics/node-ebics-client/commit/3e95478b3be719c86f32c7df10c42e46b7518669)
- feat: drop bn.js [`eea0a49`](https://github.com/node-ebics/node-ebics-client/commit/eea0a49130e30c123b110120c69d7b7c19fd12ba)
- add changelog configoration [`1f34dcb`](https://github.com/node-ebics/node-ebics-client/commit/1f34dcbfb6e0febbb93d5356fa36ac57d697a990)
#### [v0.1.1](https://github.com/node-ebics/node-ebics-client/compare/v0.1.0...v0.1.1)
> 7 November 2019
- chore: update license [`9aabe93`](https://github.com/node-ebics/node-ebics-client/commit/9aabe933e91b506ea38820b952ce8e5e58b4c2ff)
#### [v0.1.0](https://github.com/node-ebics/node-ebics-client/compare/v0.0.36...v0.1.0)
> 5 November 2019
- Feat: handle unsual exponent migrate to node-forge [`#16`](https://github.com/node-ebics/node-ebics-client/pull/16)
- Add order generation tests and fix linting [`#15`](https://github.com/node-ebics/node-ebics-client/pull/15)
- test script run mocha [`#14`](https://github.com/node-ebics/node-ebics-client/pull/14)
- chore: readme maintenance [`#11`](https://github.com/node-ebics/node-ebics-client/pull/11)
- Provide examples [`#10`](https://github.com/node-ebics/node-ebics-client/pull/10)
- * Add Z53 order type [`#7`](https://github.com/node-ebics/node-ebics-client/pull/7)
- remove eCollect from constant and minor verbose error handeling [`#2`](https://github.com/node-ebics/node-ebics-client/pull/2)
- add iso pain format XCT order type [`#1`](https://github.com/node-ebics/node-ebics-client/pull/1)
- remove eCollect from constant and minor verbose error handaling [`#4`](https://github.com/node-ebics/node-ebics-client/pull/4)
- add iso pain format XCT order type [`#5`](https://github.com/node-ebics/node-ebics-client/pull/5)
- Fix parsing of the bank keys in the HPB response [`#3`](https://github.com/node-ebics/node-ebics-client/pull/3)
- feat: prepare order generation tests [`e40f79c`](https://github.com/node-ebics/node-ebics-client/commit/e40f79cee68a194272c93f07e763175b213a77a1)
- Major changes. Separating responsibilities. Orders builder, serializer. [`ff9a3a1`](https://github.com/node-ebics/node-ebics-client/commit/ff9a3a16b47d0a25674134c875bfd651995837e4)
- code optimization [`1876360`](https://github.com/node-ebics/node-ebics-client/commit/187636019c290d757aca77d4c14fb4f2519acd38)
#### [v0.0.36](https://github.com/node-ebics/node-ebics-client/compare/v0.0.35...v0.0.36)
> 7 November 2019
- various modular fixes [`8492d94`](https://github.com/node-ebics/node-ebics-client/commit/8492d940542f61b17aa3a2da7de23f6539ffaad5)
#### [v0.0.35](https://github.com/node-ebics/node-ebics-client/compare/v0.0.8...v0.0.35)
> 7 November 2019
#### [v0.0.8](https://github.com/node-ebics/node-ebics-client/compare/v0.0.7...v0.0.8)
> 7 November 2019
- chore: readme maintenance [`#11`](https://github.com/node-ebics/node-ebics-client/pull/11)
- Provide examples [`#10`](https://github.com/node-ebics/node-ebics-client/pull/10)
- initialize.js [`7dad7c8`](https://github.com/node-ebics/node-ebics-client/commit/7dad7c878722be94e03808cef3af38d34019c623)
- examples/bankLetter.js [`ce6e58b`](https://github.com/node-ebics/node-ebics-client/commit/ce6e58b3f33017967e5b26fe15a2c435012b8af6)
- examples/send-hbt-order.js [`166c61a`](https://github.com/node-ebics/node-ebics-client/commit/166c61aec4a247d923de82278271ec02cbef815f)
#### [v0.0.7](https://github.com/node-ebics/node-ebics-client/compare/v0.0.6...v0.0.7)
> 7 November 2019
- * Add Z53 order type [`#7`](https://github.com/node-ebics/node-ebics-client/pull/7)
- remove eCollect from constant and minor verbose error handeling [`#2`](https://github.com/node-ebics/node-ebics-client/pull/2)
- add iso pain format XCT order type [`#1`](https://github.com/node-ebics/node-ebics-client/pull/1)
- add new order type XZ53 and removed repeated dateRange to consts [`5ff3147`](https://github.com/node-ebics/node-ebics-client/commit/5ff314712443c4c8465f46292b010cfedfed8c2e)
- move dateRange from constants to utils [`aa761cf`](https://github.com/node-ebics/node-ebics-client/commit/aa761cf7ad87a271d6e6d9eed40e04eb4376f6c5)
- bump version [`79f17e1`](https://github.com/node-ebics/node-ebics-client/commit/79f17e14045d121c9505eb3118967f5f88ae79e2)
#### [v0.0.6](https://github.com/node-ebics/node-ebics-client/compare/v0.0.5...v0.0.6)
> 7 November 2019
- remove eCollect from constant and minor verbose error handaling [`#4`](https://github.com/node-ebics/node-ebics-client/pull/4)
- add iso pain format XCT order type [`#5`](https://github.com/node-ebics/node-ebics-client/pull/5)
- remove eCollect from constant and minor verbose error handeling [`cb2062a`](https://github.com/node-ebics/node-ebics-client/commit/cb2062ae2fbd8e8881de26561efddad1f272e065)
- bump [`c9f52d3`](https://github.com/node-ebics/node-ebics-client/commit/c9f52d3bd99b9f8761652365b217d9580fa34632)
#### [v0.0.5](https://github.com/node-ebics/node-ebics-client/compare/v0.0.4...v0.0.5)
> 7 November 2019
- Fix parsing of the bank keys in the HPB response [`#3`](https://github.com/node-ebics/node-ebics-client/pull/3)
- tc for bank keys parsing error [`c571ef1`](https://github.com/node-ebics/node-ebics-client/commit/c571ef181bca2e0cbec70bc6df53c706acd6c829)
- #2 corrected bank keys parsing [`5f0b6cd`](https://github.com/node-ebics/node-ebics-client/commit/5f0b6cd3747c4613920d2f71f3c04ce13225d397)
#### [v0.0.4](https://github.com/node-ebics/node-ebics-client/compare/v0.0.3...v0.0.4)
> 3 September 2018
- Major changes. Separating responsibilities. Orders builder, serializer. [`ff9a3a1`](https://github.com/node-ebics/node-ebics-client/commit/ff9a3a16b47d0a25674134c875bfd651995837e4)
- code optimization [`1876360`](https://github.com/node-ebics/node-ebics-client/commit/187636019c290d757aca77d4c14fb4f2519acd38)
- various modular fixes [`8492d94`](https://github.com/node-ebics/node-ebics-client/commit/8492d940542f61b17aa3a2da7de23f6539ffaad5)
#### v0.0.3
> 7 November 2019
- initial commit [`1f947ff`](https://github.com/node-ebics/node-ebics-client/commit/1f947ff1480c522f89fa1f547581b55e2378d920)
- Initial commit [`cd37de3`](https://github.com/node-ebics/node-ebics-client/commit/cd37de3895e32a61798c79ce3a6447e2f269019d)

695
LICENSE
View File

@ -1,674 +1,21 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
MIT License
Copyright (c) 2022 Dimitar Nanov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,24 +1,69 @@
# node-ebics-client v0.0.35
---
<p align="center">
<img src="assets/logo.png" width="300px" height="auto"/>
</p>
<h1 align="center">node-ebics-client</h1>
Pure node.js ( >=8 ) implementation of [EBICS](https://en.wikipedia.org/wiki/Electronic_Banking_Internet_Communication_Standard) ( Electronic Banking Internet Communication ).
<p align="center">
<a href="https://travis-ci.org/node-ebics/node-ebics-client" title="Build Status"><img src="https://travis-ci.org/node-ebics/node-ebics-client.svg?branch=master" alt="Build Status" /></a>
<a href="https://www.npmjs.com/package/ebics-client" title="Build Status">
<img alt="ebics-client" src="https://img.shields.io/npm/v/ebics-client">
</a>
<a href="https://snyk.io/test/github/ecollect/node-ebics-client" title="Known Vulnerabilities">
<img src="https://snyk.io/test/github/ecollect/node-ebics-client/badge.svg" alt="Known Vulnerabilities">
</a>
<a href="/eCollect/node-ebics-client/blob/master/LICENSE" title="GPL-3.0"><img alt="GPL-3.0" src="https://img.shields.io/github/license/eCollect/node-ebics-client"></a>
<a href='https://coveralls.io/github/eCollect/node-ebics-client?branch=master' title="Coverage Status"><img src='https://coveralls.io/repos/github/eCollect/node-ebics-client/badge.svg?branch=master' alt='Coverage Status' /></a>
</p>
The client is aimed to be 100% [ISO 20022](https://www.iso20022.org) compliant, and supports the complete initializations process ( INI, HIA, HPB orders ) and HTML letter generation.
Pure Node.js (>= 16) implementation of [EBICS](https://en.wikipedia.org/wiki/Electronic_Banking_Internet_Communication_Standard) (Electronic Banking Internet Communication).
The client is aimed to be 100% [ISO 20022](https://www.iso20022.org) compliant, and supports the complete initializations process (INI, HIA, HPB orders) and HTML letter generation.
## Usage
For examples on how to use this library, take a look at the [examples](https://github.com/node-ebics/node-ebics-client/tree/master/examples).
### A note on recent Node.js versions
The latest Node.js versions don't support `RSA_PKCS1_PADDING` for private decryption for security reasons, throwing an error like _TypeError: RSA_PKCS1_PADDING is no longer supported for private decryption, this can be reverted with --security-revert=CVE-2023-46809_.
EBICS requires this mode, so in order for this library to work, add the following parameter when starting Node.js: `--security-revert=CVE-2023-46809`
### Initialization
1. Create a configuration (see [example configs](https://github.com/node-ebics/node-ebics-client/tree/master/examples/config)) with the EBICS credentials you received from your bank and name it in this schema: `config.<environment>.<bank>[.<entity>].json` (the entity is optional).
- The fields `url`, `partnerId`, `userId`, `hostId` are provided by your bank.
- The `passphrase` is used to encrypt the keys file, which will be stored at the `storageLocation`.
- The `bankName` and `bankShortName` are used internally for creating files and identifying the bank to you.
- The `languageCode` is used when creating the Initialization Letter and can be either `de`, `en`, or `fr`.
- You can chose any environment, bank and, optionally, entity name. Entities are useful if you have multiple EBICS users for the same bank account.
2. Run `node examples/initialize.js <environment> <bank> [entity]` to generate your key pair and perform the INI and HIA orders (ie. send the public keys to your bank)
The generated keys are stored in the file specified in your config and encrypted with the specified passphrase.
3. Run `node examples/bankLetter.js <environment> <bank> [entity]` to generate the Initialization Letter
4. Print the letter, sign it and send it to your bank. Wait for them to activate your EBICS account.
5. Download the bank keys by running `node examples/save-bank-keys.js <environment> <bank> [entity]`
If all these steps were executed successfully, you can now do all things EBICS, like fetching bank statements by running `node examples/send-sta-order.js <environment> <bank> [entity]`, or actually use this library in your custom banking applications.
## Supported Banks
The client is currently tested and verified to work with the following banks:
* [Credit Suisse (Schweiz) AG](https://www.credit-suisse.com/ch/en.html)
* [Zürcher Kantonalbank](https://www.zkb.ch/en/lg/ew.html)
* [Raiffeisen Schweiz](https://www.raiffeisen.ch/rch/de.html)
- [Credit Suisse (Schweiz) AG](https://www.credit-suisse.com/ch/en.html)
- [Zürcher Kantonalbank](https://www.zkb.ch/en/lg/ew.html)
- [Raiffeisen Schweiz](https://www.raiffeisen.ch/rch/de.html)
- [BW Bank](https://www.bw-bank.de/de/home.html)
- [Bank GPB International S.A.](https://gazprombank.lu/e-banking)
- [Bank GPB AO](https://gazprombank.ru/)
- [J.P. Morgan](https://www.jpmorgan.com/)
## Inspiration
The basic concept of this library was inspired by the [EPICS](https://github.com/railslove/epics) library from the Railslove Team.
## Copyright
Copyright: eCollect AG, 2018.
Copyright: Dimitar Nanov, 2019-2022.
Licensed under the [MIT](LICENSE) license.

BIN
assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

25
changelog-template.hbs Normal file
View File

@ -0,0 +1,25 @@
### Changelog
{{#each releases}}
{{#if href}}
###{{#unless major}}#{{/unless}} [{{title}}]({{href}})
{{else}}
#### {{title}}
{{/if}}
{{#if tag}}
> {{niceDate}}
{{/if}}
{{#if summary}}
{{summary}}
{{/if}}
{{#each merges}}
- {{message}}{{#if href}} [`#{{id}}`]({{href}}){{/if}}
{{/each}}
{{#commit-list commits heading='' message='' exclude='wip: '}}
- {{#if breaking}}**Breaking change:** {{/if}}{{subject}}{{#if href}} [`{{shorthash}}`]({{href}}){{/if}}
{{/commit-list}}
{{/each}}

25
examples/bankLetter.js Executable file
View File

@ -0,0 +1,25 @@
#! /usr/bin/env node
'use strict';
const ebics = require('../index');
const path = require('path');
const fs = require('fs');
const os = require('os');
const config = require('./loadConfig')();
const client = require('./getClient')(config);
const bankName = client.bankName;
const template = fs.readFileSync("./templates/ini_"+client.languageCode+".hbs", { encoding: 'utf8'});
const bankLetterFile = path.join("./", "bankLetter_"+client.bankShortName+"_"+client.languageCode+".html");
const letter = new ebics.BankLetter({ client, bankName, template });
letter.serialize(bankLetterFile)
.then(() => {
console.log('Send your bank the letter (%s)', bankLetterFile);
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,12 @@
{
"url": "https://ebics-test.server",
"partnerId": "EBICS ParnerID Test",
"userId": "MyUserIdTest",
"hostId": "MyHostIdTest",
"passphrase": "MyPasswordTest",
"keyStoragePath": "./keys-test",
"bankName":"Test Bank Full Name",
"bankShortName":"TESTBANKSHORT",
"languageCode":"en",
"storageLocation":"\\\\myserver\\Share\\Folder\\BankName\\Test\\"
}

View File

@ -0,0 +1,12 @@
{
"url": "https://ebics.server",
"partnerId": "EBICS ParnerID Production",
"userId": "MyUserIdProduction",
"hostId": "MyHostIdProduction",
"passphrase": "MyPasswordProduction",
"keyStoragePath": "./keys-prod",
"bankName":"Production Bank Full Name",
"bankShortName":"PRODBANKSHORT",
"languageCode":"en",
"storageLocation":"\\\\myserver\\Share\\Folder\\BankName\\Production\\"
}

View File

@ -0,0 +1,12 @@
{
"url": "https://ebics.server",
"partnerId": "EBICS ParnerID Production",
"userId": "MyUserIdProduction",
"hostId": "MyHostIdProduction",
"passphrase": "MyPasswordProduction",
"keyStoragePath": "./keys-prod",
"bankName":"Production Bank Full Name",
"bankShortName":"PRODBANKSHORT",
"languageCode":"en",
"storageLocation":"\\\\myserver\\Share\\Folder\\BankName\\Production\\"
}

23
examples/getClient.js Normal file
View File

@ -0,0 +1,23 @@
'use strict';
const { Client, fsKeysStorage } = require('../index');
const loadConfig = require('./loadConfig');
module.exports = ({
url,
partnerId,
userId,
hostId,
passphrase,
iv,
keyStoragePath,
} = loadConfig()) => new Client({
url,
partnerId,
userId,
hostId,
passphrase,
iv,
keyStorage: fsKeysStorage(keyStoragePath),
});

27
examples/initialize.js Executable file
View File

@ -0,0 +1,27 @@
#! /usr/bin/env node
'use strict';
const ebics = require('../index');
const client = require('./getClient')();
const { Orders } = require('../index');
// New keys will be generated and saved in ./keys-test
client.send(Orders.INI)
.then((resp) => {
console.log('Response for INI order %j', resp);
return client.send(ebics.Orders.HIA);
})
.then((resp) => {
console.log('Response for HIA order %j', resp);
if (resp.technicalCode !== '000000')
throw new Error('Something might went wrong');
console.log('Public keys should be sent to bank now. See examples/bankLetter.js');
})
.catch((err) => {
console.error(err);
process.exit(1);
});

46
examples/loadConfig.js Normal file
View File

@ -0,0 +1,46 @@
'use strict';
const fs = require('fs');
const path = require('path');
const safeLoadJson = (file) => {
if (!file)
return {};
try {
return JSON.parse(fs.readFileSync(file));
} catch (e) {
console.warn(`Couldn't load ${file} config file.`);
return {};
}
}
const getDefaultEnv = () => {
const [,,parArg] = process.argv;
return parArg || process.env.NODE_ENV;
}
const getBankIdentifier = () => {
const [,,,parArg] = process.argv;
return parArg || "testbank";
}
const getEntityIdentifier = () => {
const [,,,,parArg] = process.argv;
return parArg || ""
}
const loadConfig = (configDirectory = path.join(__dirname, './config'), env = getDefaultEnv(), bank = getBankIdentifier(), entity = getEntityIdentifier()) => {
entity ? console.log(`Loading config from ${configDirectory} with env set to ${env}, bank set to ${bank} and entity set to ${entity}.`) : console.log(`Loading config from ${configDirectory} with env set to ${env} and bank set to ${bank}.`);
global.entity = entity;
const baseConfigFile = path.join(configDirectory, 'config.json');
const envConfigFile = env ? entity ? path.join(configDirectory, `config.${env}.${bank}.${entity}.json`) : path.join(configDirectory, `config.${env}.${bank}.json`) : null;
return {
...safeLoadJson(baseConfigFile),
...safeLoadJson(envConfigFile),
}
}
module.exports = loadConfig;

View File

@ -0,0 +1,22 @@
#! /usr/bin/env node
'use strict';
const client = require('./getClient')();
const { Orders } = require('../index');
// Client keys must be already generated and send by letter.
// The bank should have enabled the user
client.send(Orders.HPB)
.then((resp) => {
console.log('Response for HPB order %j', resp);
if (resp.technicalCode !== '000000')
throw new Error('Something went wrong');
console.log('Received bank keys: %j', resp.bankKeys);
return client.setBankKeys(resp.bankKeys);
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,28 @@
#! /usr/bin/env node
'use strict';
const fs = require('fs');
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
client.send(Orders.C52(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD'
.then((resp) => {
console.log('Response for C52 order %j', resp);
if (resp.technicalCode !== '000000')
throw new Error('Something went wrong');
// Parsing and processing the CAMT052 file should happen somewhere here, ideally after saving it to disk
const data = Buffer.from(resp.orderData);
let distPath = "CAMT052.zip";
const dstZip = fs.createWriteStream(distPath);
dstZip.write(data);
dstZip.end();
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,22 @@
#! /usr/bin/env node
'use strict';
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
client.send(Orders.C52(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD'
.then((resp) => {
console.log('Response for C52 order %j', resp);
if (resp.technicalCode !== '000000')
throw new Error('Something went wrong');
// Parsing and processing the CAMT052 file should happen somewhere here, ideally after saving it to disk
const data = Buffer.from(resp.orderData);
console.log(data.toString('utf8'));
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,28 @@
#! /usr/bin/env node
'use strict';
const fs = require('fs');
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
client.send(Orders.C53(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD'
.then((resp) => {
console.log('Response for C53 order %j', resp);
if (resp.technicalCode !== '000000')
throw new Error('Something went wrong');
// Parsing and processing the CAMT053 file should happen somewhere here, ideally after saving it to disk
const data = Buffer.from(resp.orderData);
let distPath = "CAMT053.zip";
const dstZip = fs.createWriteStream(distPath);
dstZip.write(data);
dstZip.end();
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,22 @@
#! /usr/bin/env node
'use strict';
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
client.send(Orders.C53(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD'
.then((resp) => {
console.log('Response for C53 order %j', resp);
if (resp.technicalCode !== '000000')
throw new Error('Something went wrong');
// Parsing and processing the CAMT053 file should happen somewhere here, ideally after saving it to disk
const data = Buffer.from(resp.orderData);
console.log(data.toString('utf8'));
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,22 @@
#! /usr/bin/env node
'use strict';
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
client.send(Orders.DKI(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD'
.then((resp) => {
console.log('Response for DKI order %j', resp);
if (resp.technicalCode !== '000000')
throw new Error('Something went wrong');
// Processing of the Exchange Rate file should go here, ideally after saving it to disk
const data = Buffer.from(resp.orderData);
console.log(data.toString('utf8'));
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,28 @@
#! /usr/bin/env node
'use strict';
const fs = require('fs');
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
client.send(Orders.G02(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD'
.then((resp) => {
console.log('Response for G02 order %j', resp);
if (resp.technicalCode !== '000000')
throw new Error('Something went wrong');
// Parsing and processing the G02 Pain.002.001.06 file should happen somewhere here, ideally after saving it to disk
const data = Buffer.from(resp.orderData);
let distPath = "G02.zip";
const dstZip = fs.createWriteStream(distPath);
dstZip.write(data);
dstZip.end();
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,20 @@
#! /usr/bin/env node
'use strict';
const fs = require('fs');
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
const paymentFile = fs.readFileSync('RUB_PAYMENT.xml').toString();
client.send(Orders.G1R(paymentFile))
.then((resp) => {
console.log('Response for G1R order %j', resp);
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,20 @@
#! /usr/bin/env node
'use strict';
const fs = require('fs');
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
const paymentFile = fs.readFileSync('FCY_PAYMENT.xml').toString();
client.send(Orders.G1V(paymentFile))
.then((resp) => {
console.log('Response for G1V order %j', resp);
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,28 @@
#! /usr/bin/env node
'use strict';
const fs = require('fs');
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
client.send(Orders.G52(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD'
.then((resp) => {
console.log('Response for G52 order %j', resp);
if (resp.technicalCode !== '000000')
throw new Error('Something went wrong');
// Parsing and processing the CAMT052 file should happen somewhere here, ideally after saving it to disk
const data = Buffer.from(resp.orderData);
let distPath = "CAMT052-G52.zip";
const dstZip = fs.createWriteStream(distPath);
dstZip.write(data);
dstZip.end();
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,28 @@
#! /usr/bin/env node
'use strict';
const fs = require('fs');
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
client.send(Orders.G53(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD'
.then((resp) => {
console.log('Response for G53 order %j', resp);
if (resp.technicalCode !== '000000')
throw new Error('Something went wrong');
// Parsing and processing the CAMT053 file should happen somewhere here, ideally after saving it to disk
const data = Buffer.from(resp.orderData);
let distPath = "CAMT053-G53.zip";
const dstZip = fs.createWriteStream(distPath);
dstZip.write(data);
dstZip.end();
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,21 @@
#! /usr/bin/env node
'use strict';
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
client.send(Orders.HKD)
.then((resp) => {
console.log('Response for HKD order %j', resp);
if (resp.technicalCode !== '000000')
throw new Error('Something went wrong');
const data = Buffer.from(resp.orderData);
console.log(data.toString('utf8'));
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,21 @@
#! /usr/bin/env node
'use strict';
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
client.send(Orders.HTD)
.then((resp) => {
console.log('Response for HTD order %j', resp);
if (resp.technicalCode !== '000000')
throw new Error('Something went wrong');
const data = Buffer.from(resp.orderData);
console.log(data.toString('utf8'));
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,22 @@
#! /usr/bin/env node
'use strict';
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
client.send(Orders.STA(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD'
.then((resp) => {
console.log('Response for STA order %j', resp);
if (resp.technicalCode !== '000000')
throw new Error('Something went wrong');
// Parsing and processing the MT940 file should happen somewhere here, ideally after saving it to disk
const data = Buffer.from(resp.orderData);
console.log(data.toString('utf8'));
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,23 @@
#! /usr/bin/env node
'use strict';
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
client.send(Orders.VMK(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD'
.then((resp) => {
console.log('Response for VMK order %j', resp);
if (resp.technicalCode !== '000000')
throw new Error('Something went wrong');
// Parsing and processing the MT942 file should happen somewhere here, ideally after saving it to disk
const data = Buffer.from(resp.orderData);
console.log(data.toString('utf8'));
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -0,0 +1,21 @@
#! /usr/bin/env node
'use strict';
const ebics = require('../index');
const fs = require('fs');
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
const paymentFile = fs.readFileSync('mytestfile.xml').toString();
client.send(Orders.XG1(paymentFile))
.then((resp) => {
console.log('Response for XG1 order %j', resp);
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@ -2,21 +2,18 @@
const fs = require('fs');
const moment = require('moment');
const handlebars = require('handlebars');
const Crypto = require('./crypto/Crypto');
// const BN = require('bn.js');
const { date } = require('./utils.js');
const registerHelpers = () => {
handlebars.registerHelper('today', () => moment().format('DD.MM.YYYY'));
handlebars.registerHelper('today', () => date.toISODate(Date.now(), false));
handlebars.registerHelper('now', () => moment().format('HH:mm:ss'));
handlebars.registerHelper('now', () => date.toISOTime(Date.now(), false));
handlebars.registerHelper('keyExponentBits', k => Buffer.byteLength(k.e()) * 8);
// handlebars.registerHelper('keyExponentBits', k => Buffer.byteLength(new BN(k.key.keyPair.e).toBuffer()) * 8);
handlebars.registerHelper('keyModulusBits', k => k.key.getKeySize());
// return Buffer.byteLength(new BN(k.key.keyPair.e).toBuffer()) * 8;
handlebars.registerHelper('keyModulusBits', k => k.size());
handlebars.registerHelper('keyExponent', k => k.e('hex'));
@ -24,11 +21,15 @@ const registerHelpers = () => {
handlebars.registerHelper('sha256', (k) => {
const digest = Buffer.from(Crypto.digestPublicKey(k), 'base64').toString('HEX');
// const digest = Buffer.from(k.publicDigest(), 'base64').toString('HEX');
return digest.toUpperCase().match(/.{1,2}/g).join(' ');
});
};
const writeFile = (file, content) => new Promise((resolve, reject) => fs.writeFile(file, content, (err, result) => {
if (err)
return reject(err);
return resolve(result);
}));
module.exports = class BankLetter {
constructor({
client,
@ -60,14 +61,7 @@ module.exports = class BankLetter {
async serialize(path) {
const letter = await this.generate();
try {
fs.writeFileSync(path, letter);
console.log('Data written to file');
} catch (error) {
console.log(error);
throw error;
}
return new Promise(resolve => resolve(true));
await writeFile(path, letter);
return true;
}
};

View File

@ -1,6 +1,6 @@
'use strict';
const $request = require('request');
const rock = require('rock-req');
const constants = require('./consts');
const Keys = require('./keymanagers/Keys');
@ -13,68 +13,119 @@ const response = require('./middleware/response');
const stringifyKeys = (keys) => {
Object.keys(keys).map((key) => {
keys[key] = keys[key] === null ? null : keys[key].toPem();
return key;
});
return JSON.stringify(keys);
};
/**
* Keys persistent object
* @typedef {Object} KeysObject
* @property {string} A006 - PEM representation of the A006 private key
* @property {string} E002 - PEM representation of the E002 private key
* @property {string} X002 - PEM representation of the X002 private key
* @property {string} bankX002 - PEM representation of the bankX002 public key
* @property {string} bankE002 - PEM representation of the bankE002 public key
*/
/**
* Key storage implementation
* @typedef {Object} KeyStorage
* @property {(data: KeysObject):Promise<void>} write - writes the keys to storage
* @property {():Promise<KeysObject>} read - reads the keys from storage
*/
/**
* Client initialization options
* @typedef {Object} EbicClientOptions
* @property {string} url - EBICS URL provided by the bank
* @property {string} partnerId - PARTNERID provided by the bank
* @property {string} hostId - HOSTID provided by the bank
* @property {string} userId - USERID provided by the bank
* @property {string|Buffer} passphrase - passphrase or key for keys encryption
* @property {string|Buffer} iv - Initialization Vector for keys encryption
* @property {KeyStorage} keyStorage - keyStorage implementation
* @property {object} [tracesStorage] - traces (logs) storage implementation
* @property {string} bankName - Full name of the bank to be used in the bank INI letters.
* @property {string} bankShortName - Short name of the bank to be used in folders, filenames etc.
* @property {string} languageCode - Language code to be used in the bank INI letters ("de", "en" and "fr" are currently supported).
* @property {string} storageLocation - Location where to store the files that are downloaded. This can be a network share for example.
*/
module.exports = class Client {
/**
*Creates an instance of Client.
* @param {EbicClientOptions} clientOptions
*/
constructor({
url,
partnerId,
userId,
hostId,
passphrase,
iv,
keyStorage,
tracesStorage,
bankName,
bankShortName,
languageCode,
storageLocation,
}) {
if (!url)
throw new Error('EBICS URL is requierd');
if (!partnerId)
throw new Error('partnerId is requierd');
if (!userId)
throw new Error('userId is requierd');
if (!hostId)
throw new Error('hostId is requierd');
if (!passphrase)
throw new Error('passphrase is requierd');
if (!url) throw new Error('EBICS URL is required');
if (!partnerId) throw new Error('partnerId is required');
if (!userId) throw new Error('userId is required');
if (!hostId) throw new Error('hostId is required');
if (!passphrase) throw new Error('passphrase is required');
if (!keyStorage || typeof keyStorage.read !== 'function' || typeof keyStorage.write !== 'function')
throw new Error('keyStorage implemntation missing or wrong');
if (
!keyStorage
|| typeof keyStorage.read !== 'function'
|| typeof keyStorage.write !== 'function'
)
throw new Error('keyStorage implementation missing or wrong');
this.url = url;
this.partnerId = partnerId;
this.userId = userId;
this.hostId = hostId;
this.keyStorage = keyStorage;
this.keyEncryptor = defaultKeyEncryptor({ passphrase });
this.keyEncryptor = defaultKeyEncryptor({ passphrase, iv });
this.tracesStorage = tracesStorage || null;
this.bankName = bankName || 'Dummy Bank Full Name';
this.bankShortName = bankShortName || 'BANKSHORTCODE';
this.languageCode = languageCode || 'en';
this.storageLocation = storageLocation || null;
}
async send(order) {
const isInObject = ('operation' in order);
const isInObject = 'operation' in order;
if (!isInObject) throw new Error('Operation for the order needed');
if (order.operation.toUpperCase() === constants.orderOperations.ini) return this.initialization(order);
if (order.operation.toUpperCase() === constants.orderOperations.ini)
return this.initialization(order);
const keys = await this.keys();
if (keys === null) throw new Error('No keys provided. Can not send the order or any other order for that matter.');
if (keys === null)
throw new Error(
'No keys provided. Can not send the order or any other order for that matter.',
);
if (order.operation.toUpperCase() === constants.orderOperations.upload) return this.upload(order);
if (order.operation.toUpperCase() === constants.orderOperations.download) return this.download(order);
if (order.operation.toUpperCase() === constants.orderOperations.upload)
return this.upload(order);
if (
order.operation.toUpperCase() === constants.orderOperations.download
)
return this.download(order);
throw new Error('Wrong order operation provided');
}
async initialization(order) {
const keys = await this.keys();
if (keys === null) this._generateKeys();
if (keys === null) await this._generateKeys();
if (this.tracesStorage)
this.tracesStorage.new().ofType('ORDER.INI');
if (this.tracesStorage) this.tracesStorage.new().ofType('ORDER.INI');
const res = await this.ebicsRequest(order);
const xml = res.orderData();
@ -87,7 +138,9 @@ module.exports = class Client {
technicalCode: returnedTechnicalCode,
technicalCodeSymbol: res.technicalSymbol(),
technicalCodeShortText: res.technicalShortText(returnedTechnicalCode),
technicalCodeShortText: res.technicalShortText(
returnedTechnicalCode,
),
technicalCodeMeaning: res.technicalMeaning(returnedTechnicalCode),
businessCode: returnedBusinessCode,
@ -122,7 +175,9 @@ module.exports = class Client {
technicalCode: returnedTechnicalCode,
technicalCodeSymbol: res.technicalSymbol(),
technicalCodeShortText: res.technicalShortText(returnedTechnicalCode),
technicalCodeShortText: res.technicalShortText(
returnedTechnicalCode,
),
technicalCodeMeaning: res.technicalMeaning(returnedTechnicalCode),
businessCode: returnedBusinessCode,
@ -133,8 +188,7 @@ module.exports = class Client {
}
async upload(order) {
if (this.tracesStorage)
this.tracesStorage.new().ofType('ORDER.UPLOAD');
if (this.tracesStorage) this.tracesStorage.new().ofType('ORDER.UPLOAD');
let res = await this.ebicsRequest(order);
const transactionId = res.transactionId();
const orderId = res.orderId();
@ -152,42 +206,60 @@ module.exports = class Client {
return new Promise(async (resolve, reject) => {
const { version } = order;
const keys = await this.keys();
const r = signer.version(version).sign((await serializer.use(order, this)).toXML(), keys.x());
const r = signer
.version(version)
.sign((await serializer.use(order, this)).toXML(), keys.x());
if (this.tracesStorage)
this.tracesStorage.label(`REQUEST.${order.orderDetails.OrderType}`).data(r).persist();
this.tracesStorage
.label(`REQUEST.${order.orderDetails.OrderType}`)
.data(r)
.persist();
$request.post({
rock({
method: 'POST',
url: this.url,
body: r,
headers: { 'content-type': 'text/xml;charset=UTF-8' },
}, (err, res, data) => {
},
(err, res, data) => {
if (err) reject(err);
const ebicsResponse = response.version(version)(data, keys);
const ebicsResponse = response.version(version)(data.toString('utf-8'), keys);
if (this.tracesStorage)
this.tracesStorage.label(`RESPONSE.${order.orderDetails.OrderType}`).connect().data(ebicsResponse.toXML()).persist();
this.tracesStorage
.label(`RESPONSE.${order.orderDetails.OrderType}`)
.connect()
.data(ebicsResponse.toXML())
.persist();
resolve(ebicsResponse);
});
});
}
async signOrder(order) {
const { version } = order;
const keys = await this.keys();
return signer
.version(version)
.sign((await serializer.use(order, this)).toXML(), keys.x());
}
async keys() {
try {
const keysString = await this._readKeys();
return new Keys(JSON.parse(this.keyEncryptor.decrypt(keysString)));
} catch (err) {
return null;
}
}
_generateKeys() {
async _generateKeys() {
const keysObject = Keys.generate();
this._writeKeys(keysObject);
await this._writeKeys(keysObject);
}
async setBankKeys(bankKeys) {
@ -202,6 +274,8 @@ module.exports = class Client {
}
_writeKeys(keysObject) {
return this.keyStorage.write(this.keyEncryptor.encrypt(stringifyKeys(keysObject.keys)));
return this.keyStorage.write(
this.keyEncryptor.encrypt(stringifyKeys(keysObject.keys)),
);
}
};

View File

@ -1,9 +1,8 @@
'use strict';
const packageJson = require('../package.json');
const { version } = require('../package.json');
const name = 'eCollect Node Ebics Client';
const { version } = packageJson;
const name = 'Node Ebics Client';
const orderOperations = {
ini: 'INI',
upload: 'UPLOAD',

66
lib/crypto/BigNumber.js Normal file
View File

@ -0,0 +1,66 @@
'use strict';
const { jsbn: { BigInteger } } = require('node-forge');
class BigNumber {
constructor(value, radix = 10) {
if (value === null || value === undefined)
throw new Error('value is missing.');
this._n = new BigInteger(null);
if (value instanceof BigNumber)
this._n = value._n;
else if (value instanceof BigInteger)
this._n = value;
else if (typeof value === 'number')
this._n.fromInt(value);
else if (typeof value === 'string')
this._n.fromString(value, radix);
else if (Buffer.isBuffer(value))
this._n.fromString(value.toString('hex'), 16);
else if (Array.isArray(value))
this._n.fromString(Buffer.from(value).toString('hex'), 16);
else
throw new TypeError('Unsupported value type.');
}
toBEBuffer(length) {
const arr = this._n.toByteArray();
if (length === undefined)
return Buffer.from(arr);
if (arr.length > length)
throw new Error('Number out of range.');
while (arr.length < length)
arr.unshift(0);
return Buffer.from(arr);
}
toString(radix = 10) {
const result = this._n.toString(radix);
if (radix === 16)
return result.padStart(2, '0');
return result;
}
and(num) {
return new BigNumber(this._n.and(new BigNumber(num)._n));
}
mul(num) {
return new BigNumber(this._n.multiply(new BigNumber(num)._n));
}
mod(num) {
return new BigNumber(this._n.mod(new BigNumber(num)._n));
}
shrn(num) {
return new BigNumber(this._n.shiftRight(new BigNumber(num)._n));
}
}
module.exports = BigNumber;

View File

@ -1,16 +1,16 @@
'use strict';
const crypto = require('crypto');
const NodeRSA = require('node-rsa');
const BN = require('bn.js');
const BigNumber = require('./BigNumber.js');
const mgf1 = require('./MGF1');
const modPow = (base, power, mod) => {
let result = new BN(1);
let result = new BigNumber(1);
while (power > 0) {
result = power.and(new BN(1)) == 1 ? (result.mul(base)).mod(mod) : result; // eslint-disable-line
result = power.and(new BigNumber(1)) == 1 ? (result.mul(base)).mod(mod) : result; // eslint-disable-line
base = (base.mul(base)).mod(mod);
power = power.shrn(1);
}
@ -28,10 +28,13 @@ const emsaPSS = (msg, salt) => {
const dbMask = mgf1.generate(mTickHash, db.length);
const maskedDb = mgf1.xor(db, dbMask);
let maskedDbMsb = mgf1.rjust(new BN(maskedDb.slice(0, 1), 2).toString(2), 8, '0');
let maskedDbMsb = mgf1.rjust(new BigNumber(maskedDb.slice(0, 1)).toString(2), 8, '0');
maskedDbMsb = `0${maskedDbMsb.substr(1)}`;
maskedDb[0] = (new BN(maskedDbMsb, 2).toBuffer())[0]; // eslint-disable-line
// console.log((new BN(maskedDbMsb, 2).toBuffer())[0], new BigNumber(maskedDbMsb, 2).toBuffer()[0]);
// maskedDb[0] = (new BN(maskedDbMsb, 2).toBuffer())[0]; // eslint-disable-line
maskedDb[0] = new BigNumber(maskedDbMsb, 2).toBEBuffer()[0]; // eslint-disable-line
return Buffer.concat([maskedDb, mTickHash, Buffer.from('BC', 'hex')]);
};
@ -52,10 +55,14 @@ module.exports = class Crypto {
}
static privateDecrypt(key, data) {
return crypto.privateDecrypt({
key: key.toPem(),
padding: crypto.constants.RSA_PKCS1_PADDING,
}, data);
const keyRSA = new NodeRSA(
key.toPem(),
'pkcs1-private-pem', {
encryptionScheme: 'pkcs1',
environment: 'browser', // would use the crypto module by default, which blocks pkcs1
},
);
return keyRSA.decrypt(data);
}
static privateSign(key, data, outputEncoding = 'base64') {
@ -65,11 +72,15 @@ module.exports = class Crypto {
}
static sign(key, msg, salt = crypto.randomBytes(32)) {
const base = new BN(emsaPSS(msg, salt));
const power = new BN(key.d());
const mod = new BN(key.n());
const base = new BigNumber(emsaPSS(msg, salt));
const power = new BigNumber(key.d());
const mod = new BigNumber(key.n());
const buffer = modPow(base, power, mod).toBEBuffer();
return (modPow(base, power, mod)).toBuffer().toString('base64');
if (buffer.byteLength === 257 && buffer[0] === 0x00)
return buffer.slice(1).toString('base64');
return buffer.toString('base64');
}
static pad(d) {

View File

@ -1,13 +1,13 @@
'use strict';
const crypto = require('crypto');
const BN = require('bn.js');
const BigNumber = require('./BigNumber.js');
const MFG_LEN = 32;
const divceil = (a, b) => ~~(((a + b) - 1) / b); // eslint-disable-line no-bitwise
const rjust = (string, width, padding) => {
padding = padding || ' ';
const rjust = (string, width, padding = ' ') => {
padding = padding.substr(0, 1);
if (string.length < width)
return padding.repeat(width - string.length) + string;
@ -26,7 +26,7 @@ const i2osp = (x, len) => {
if (x >= 256 ** len)
throw new Error('Integer too large');
return Buffer.from(rjust((Buffer.from((new BN(x)).toArray('be', 4)).toString()).replace(/\x00/gi, ''), len, '\x00')); // eslint-disable-line no-control-regex
return Buffer.from(rjust(new BigNumber(x).toBEBuffer(4).toString().replace(/\x00/gi, ''), len, '\x00')); // eslint-disable-line no-control-regex
};
module.exports = {

View File

@ -0,0 +1,66 @@
'use strict';
const crypto = require('crypto');
const createKeyAndIv = (passphrase) => {
// this generates a 256-bit key and a 128-bit iv for aes-256-cbc
// just like nodejs's deprecated/removed crypto.createCipher would
const a = crypto.createHash('md5').update(passphrase).digest();
const b = crypto
.createHash('md5')
.update(Buffer.concat([a, Buffer.from(passphrase)]))
.digest();
const c = crypto
.createHash('md5')
.update(Buffer.concat([b, Buffer.from(passphrase)]))
.digest();
const bytes = Buffer.concat([a, b, c]);
const key = bytes.subarray(0, 32);
const iv = bytes.subarray(32, 48);
return { key, iv };
};
const encrypt = (data, algorithm, passphrase, iv) => {
let cipher;
if (iv) {
cipher = crypto.createCipheriv(algorithm, passphrase, iv);
} else {
console.warn(
'[Deprecation notice] No IV provided, falling back to legacy key derivation.\n'
+ 'This will be removed in a future major release. You should encrypt your keys with a proper key and IV.',
);
if (crypto.createCipher) {
// nodejs < 22
cipher = crypto.createCipher(algorithm, passphrase);
} else {
const { key, iv: generatedIv } = createKeyAndIv(passphrase);
cipher = crypto.createCipheriv(algorithm, key, generatedIv);
}
}
const encrypted = cipher.update(data, 'utf8', 'hex') + cipher.final('hex');
return Buffer.from(encrypted).toString('base64');
};
const decrypt = (data, algorithm, passphrase, iv) => {
data = Buffer.from(data, 'base64').toString();
let decipher;
if (iv) {
decipher = crypto.createDecipheriv(algorithm, passphrase, iv);
} else {
console.warn(
'[Deprecation notice] No IV provided, falling back to legacy key derivation.\n'
+ 'This will be removed in a future major release. You should re-encrypt your keys with a proper key and IV.',
);
if (crypto.createDecipher) {
// nodejs < 22
decipher = crypto.createDecipher(algorithm, passphrase);
} else {
const { key, iv: generatedIv } = createKeyAndIv(passphrase);
decipher = crypto.createDecipheriv(algorithm, key, generatedIv);
}
}
const decrypted = decipher.update(data, 'hex', 'utf8') + decipher.final('utf8');
return decrypted;
};
module.exports = { encrypt, decrypt };

138
lib/keymanagers/Key.js Normal file
View File

@ -0,0 +1,138 @@
'use strict';
const {
pki: {
rsa,
publicKeyToPem,
privateKeyToPem,
publicKeyFromPem,
privateKeyFromPem,
},
jsbn: {
BigInteger,
},
} = require('node-forge');
const getKeyType = (str) => {
const matches = str.match(/(PRIVATE|PUBLIC) KEY/);
if (!matches)
return null;
return matches[1].toLowerCase();
};
const keyFromPem = (pem) => {
const type = getKeyType(pem);
const isPublic = type === 'public';
const key = isPublic ? publicKeyFromPem(pem) : privateKeyFromPem(pem);
return {
isPublic,
key,
};
};
/**
* Creates a public key from modulus and exponent
* @param {Buffer} mod - the modulus
* @param {Buffer} exp - the exponent
*/
const keyFromModAndExp = (mod, exp) => {
const bnMod = new BigInteger(mod.toString('hex'), 16);
const bnExp = new BigInteger(exp.toString('hex'), 16);
return {
key: rsa.setPublicKey(bnMod, bnExp),
isPublic: true,
};
};
module.exports = class Key {
constructor({
pem = null, mod = null, exp = null, size = 2048,
} = {}) {
// generate new private key
if (!pem && !mod && !exp) {
const keyPair = rsa.generateKeyPair(size);
this.keyIsPublic = false;
this.privateKey = keyPair.privateKey;
this.publicKey = keyPair.publicKey;
return;
}
// new key from pem string
if (pem) {
const { key, isPublic } = keyFromPem(pem);
this.keyIsPublic = isPublic;
this.privateKey = isPublic ? null : key;
this.publicKey = isPublic ? key : null;
return;
}
// new key from mod and exp
if (mod && exp) {
const { key, isPublic } = keyFromModAndExp(mod, exp);
this.keyIsPublic = isPublic;
this.privateKey = isPublic ? null : key;
this.publicKey = isPublic ? key : null;
return;
}
// not good
throw new Error(`Can not create key without ${!mod ? 'modulus' : 'exponent'}.`);
}
static generate(size = 2048) {
return new Key({ size });
}
static importKey({ mod, exp }) {
return new Key({ mod, exp });
}
n(to = 'buff') {
const key = this.keyIsPublic ? this.publicKey : this.privateKey;
const keyN = Buffer.from(key.n.toByteArray());
return to === 'hex' ? keyN.toString('hex', 1) : keyN;
}
e(to = 'buff') {
const key = this.keyIsPublic ? this.publicKey : this.privateKey;
const eKey = Buffer.from(key.e.toByteArray());
return to === 'hex' ? eKey.toString('hex') : eKey;
}
d() {
if (this.keyIsPublic)
throw new Error('Can not get d component out of public key.');
return Buffer.from(this.privateKey.d.toByteArray());
}
isPrivate() {
return !this.keyIsPublic;
}
isPublic() {
return this.keyIsPublic;
}
// eslint-disable-next-line class-methods-use-this
size() {
const keyN = this.n('hex');
const bn = new BigInteger(keyN, 16);
return bn.bitLength();
}
toPem() {
return this.keyIsPublic ? publicKeyToPem(this.publicKey) : privateKeyToPem(this.privateKey);
}
};

View File

@ -1,8 +1,13 @@
'use strict';
const Key = require('./keyRSA');
const Key = require('./Key');
const keyOrNull = key => (key ? Key(key) : null);
const keyOrNull = (key) => {
if (key instanceof Key)
return key;
return key ? new Key({ pem: key }) : null;
};
module.exports = class Keys {
constructor({
@ -25,15 +30,15 @@ module.exports = class Keys {
const keys = {};
Object.keys({ A006: '', X002: '', E002: '' }).forEach((key) => {
keys[key] = Key().generate();
keys[key] = Key.generate(); // Key().generate();
});
return new Keys(keys);
}
setBankKeys(bankKeys) {
this.keys.bankX002 = Key().importKey(bankKeys.bankX002);
this.keys.bankE002 = Key().importKey(bankKeys.bankE002);
this.keys.bankX002 = new Key(bankKeys.bankX002); // Key().importKey(bankKeys.bankX002);
this.keys.bankE002 = new Key(bankKeys.bankE002); // Key().importKey(bankKeys.bankE002);
}
a() {

View File

@ -1,24 +1,8 @@
'use strict';
const crypto = require('crypto');
const { encrypt, decrypt } = require('../crypto/encryptDecrypt');
const Keys = require('./Keys');
const encrypt = (data, algorithm, passphrase) => {
const cipher = crypto.createCipher(algorithm, passphrase);
const encrypted = cipher.update(data, 'utf8', 'hex') + cipher.final('hex');
return Buffer.from(encrypted).toString('base64');
};
const decrypt = (data, algorithm, passphrase) => {
data = (Buffer.from(data, 'base64')).toString();
const decipher = crypto.createDecipher(algorithm, passphrase);
const decrypted = decipher.update(data, 'hex', 'utf8') + decipher.final('utf8');
return decrypted;
};
module.exports = (keysStorage, passphrase, algorithm = 'aes-256-cbc') => {
const storage = keysStorage;
const pass = passphrase;

View File

@ -1,24 +1,9 @@
'use strict';
const crypto = require('crypto');
const { encrypt, decrypt } = require('../crypto/encryptDecrypt');
const encrypt = (data, algorithm, passphrase) => {
const cipher = crypto.createCipher(algorithm, passphrase);
const encrypted = cipher.update(data, 'utf8', 'hex') + cipher.final('hex');
return Buffer.from(encrypted).toString('base64');
};
const decrypt = (data, algorithm, passphrase) => {
data = (Buffer.from(data, 'base64')).toString();
const decipher = crypto.createDecipher(algorithm, passphrase);
const decrypted = decipher.update(data, 'hex', 'utf8') + decipher.final('utf8');
return decrypted;
};
module.exports = ({
passphrase,
algorithm = 'aes-256-cbc',
}) => ({
encrypt: data => encrypt(data, algorithm, passphrase),
module.exports = ({ passphrase, iv, algorithm = 'aes-256-cbc' }) => ({
encrypt: data => encrypt(data, algorithm, passphrase, iv),
decrypt: data => decrypt(data, algorithm, passphrase),
});

View File

@ -1,49 +0,0 @@
'use strict';
const BN = require('bn.js');
const NodeRSA = require('node-rsa');
const keyOrNull = (encodedKey) => {
if (encodedKey === null) return new NodeRSA();
return (encodedKey instanceof NodeRSA) ? encodedKey : new NodeRSA(encodedKey);
};
module.exports = encodedKey => ({
key: keyOrNull(encodedKey),
generate(keySize = 2048) {
return new NodeRSA({ b: keySize });
},
importKey({ mod, exp }) {
this.key = new NodeRSA();
this.key.importKey({ n: mod, e: exp }, 'components-public');
return this;
},
n(to = 'buff') {
const keyN = Buffer.from(this.key.exportKey('components-public').n);
return to === 'hex'
? keyN.toString('hex', 1)
: keyN;
},
e(to = 'buff') {
const eKey = new BN(this.key.exportKey('components-public').e).toBuffer();
return to === 'hex'
? eKey.toString('hex')
: eKey;
},
d() {
return this.key.keyPair.d.toBuffer();
},
toPem() {
return this.key.isPrivate() ? this.key.exportKey('pkcs1-private-pem') : this.key.exportKey('pkcs8-public-pem');
},
});

View File

@ -10,12 +10,12 @@ const errors = {
'011000': {
symbol: 'EBICS_DOWNLOAD_POSTPROCESS_DONE',
short_text: 'Positive acknowledgement received',
meaning: "After receipt of a positive acknowledgement the download task was finished at the server's end and the EBICS transaction ended.",
meaning: "After receipt of a positive acknowledgment the download task was finished at the server's end and the EBICS transaction ended.",
},
'011001': {
symbol: 'EBICS_DOWNLOAD_POSTPROCESS_SKIPPED',
short_text: 'Negative acknowledgement received',
meaning: "After receipt of a negative acknowledgement the transaction was ended at the server's end without finishing the download task",
short_text: 'Negative acknowledgment received',
meaning: "After receipt of a negative acknowledgment the transaction was ended at the server's end without finishing the download task",
},
'011101': {
symbol: 'EBICS_TX_SEGMENT_NUMBER_UNDERRUN',
@ -32,6 +32,11 @@ const errors = {
short_text: 'Authentication signature error',
meaning: 'Verification of the authentication signature was not successful',
},
'061011': {
symbol: 'EBICS_INVALID_HOST_ID',
short_text: 'The transmitted HostID is unknown on the bank side',
meaning: 'The transmitted HostID is unknown on the bank side',
},
'061002': {
symbol: 'EBICS_INVALID_REQUEST',
short_text: 'Message not EBICSconformant',
@ -104,8 +109,8 @@ const errors = {
},
'091102': {
symbol: 'EBICS_TX_ABORT',
short_text: 'Transaction cancelled',
meaning: "The transaction was cancelled at the server's end since recovery of the transaction is not supported or is no longer possible due to the recovery counter being too high",
short_text: 'Transaction canceled',
meaning: "The transaction was canceled at the server's end since recovery of the transaction is not supported or is no longer possible due to the recovery counter being too high",
},
'091103': {
symbol: 'EBICS_TX_MESSAGE_REPLAY',

View File

@ -2,11 +2,10 @@
const zlib = require('zlib');
const crypto = require('crypto');
const BN = require('bn.js');
const Crypto = require('../../crypto/Crypto');
const { DOMParser, XMLSerializer } = require('xmldom');
const { DOMParser, XMLSerializer } = require('@xmldom/xmldom');
const xpath = require('xpath');
const errors = require('./errors');
@ -26,53 +25,79 @@ module.exports = (xml, keys) => ({
isSegmented() {
const select = xpath.useNamespaces({ xmlns: 'urn:org:ebics:H004' });
const node = select('//xmlns:header/xmlns:mutable/xmlns:SegmentNumber', this.doc);
const node = select(
'//xmlns:header/xmlns:mutable/xmlns:SegmentNumber',
this.doc,
);
return !!node.length;
},
isLastSegment() {
const select = xpath.useNamespaces({ xmlns: 'urn:org:ebics:H004' });
const node = select("//xmlns:header/xmlns:mutable/*[@lastSegment='true']", this.doc);
const node = select(
"//xmlns:header/xmlns:mutable/*[@lastSegment='true']",
this.doc,
);
return !!node.length;
},
orderData() {
const orderDataNode = this.doc.getElementsByTagNameNS('urn:org:ebics:H004', 'OrderData');
const orderDataNode = this.doc.getElementsByTagNameNS(
'urn:org:ebics:H004',
'OrderData',
);
if (!orderDataNode.length) return {};
const orderData = orderDataNode[0].textContent;
const decipher = crypto.createDecipheriv('aes-128-cbc', this.transactionKey(), DEFAULT_IV).setAutoPadding(false);
const data = Buffer.from(decipher.update(orderData, 'base64', 'binary') + decipher.final('binary'), 'binary');
const decipher = crypto
.createDecipheriv('aes-128-cbc', this.transactionKey(), DEFAULT_IV)
.setAutoPadding(false);
const data = Buffer.from(
decipher.update(orderData, 'base64', 'binary')
+ decipher.final('binary'),
'binary',
);
return zlib.inflateSync(data);
},
transactionKey() {
const keyNodeText = this.doc.getElementsByTagNameNS('urn:org:ebics:H004', 'TransactionKey')[0].textContent;
return Crypto.privateDecrypt(this.keys.e(), Buffer.from(keyNodeText, 'base64'));
const keyNodeText = this.doc.getElementsByTagNameNS(
'urn:org:ebics:H004',
'TransactionKey',
)[0].textContent;
return Crypto.privateDecrypt(
this.keys.e(),
Buffer.from(keyNodeText, 'base64'),
);
},
transactionId() {
const select = xpath.useNamespaces({ xmlns: 'urn:org:ebics:H004' });
const node = select('//xmlns:header/xmlns:static/xmlns:TransactionID', this.doc);
const node = select(
'//xmlns:header/xmlns:static/xmlns:TransactionID',
this.doc,
);
return node.length ? node[0].textContent : '';
},
orderId() {
const select = xpath.useNamespaces({ xmlns: 'urn:org:ebics:H004' });
const node = select('//xmlns:header/xmlns:mutable/xmlns:OrderID', this.doc);
const node = select(
'.//xmlns:header/xmlns:mutable/xmlns:OrderID',
this.doc,
);
return node.length ? node[0].textContent : '';
},
businessCode() {
const select = xpath.useNamespaces({ xmlns: 'urn:org:ebics:H004' });
const node = select('//xmlns:body/xmlns:ReturnCode', this.doc)
const node = select('//xmlns:body/xmlns:ReturnCode', this.doc);
return node.length ? node[0].textContent : '';
},
@ -91,14 +116,20 @@ module.exports = (xml, keys) => ({
technicalCode() {
const select = xpath.useNamespaces({ xmlns: 'urn:org:ebics:H004' });
const node = select('//xmlns:header/xmlns:mutable/xmlns:ReturnCode', this.doc);
const node = select(
'//xmlns:header/xmlns:mutable/xmlns:ReturnCode',
this.doc,
);
return node.length ? node[0].textContent : '';
},
technicalSymbol() {
const select = xpath.useNamespaces({ xmlns: 'urn:org:ebics:H004' });
const node = select('//xmlns:header/xmlns:mutable/xmlns:ReportText', this.doc);
const node = select(
'//xmlns:header/xmlns:mutable/xmlns:ReportText',
this.doc,
);
return node.length ? node[0].textContent : '';
},
@ -124,13 +155,21 @@ module.exports = (xml, keys) => ({
for (let i = 0; i < keyNodes.length; i++) {
const type = lastChild(keyNodes[i].parentNode).textContent;
const modulus = xpath.select("//*[local-name(.)='Modulus']", keyNodes[i])[0].textContent;
const exponent = xpath.select("//*[local-name(.)='Exponent']", keyNodes[i])[0].textContent;
const modulus = xpath.select(
".//*[local-name(.)='Modulus']",
keyNodes[i],
)[0].textContent;
const exponent = xpath.select(
".//*[local-name(.)='Exponent']",
keyNodes[i],
)[0].textContent;
const mod = new BN(Buffer.from(modulus, 'base64'), 2).toBuffer();
const exp = new BN(Buffer.from(exponent, 'base64')).toNumber();
bankKeys[`bank${type}`] = { mod, exp };
const mod = Buffer.from(modulus, 'base64');
const exp = Buffer.from(exponent, 'base64');
bankKeys[`bank${type}`] = {
mod,
exp,
};
}
return bankKeys;

View File

@ -3,7 +3,6 @@
const js2xmlparser = require('js2xmlparser');
const Crypto = require('../../../crypto/Crypto');
const genericSerializer = require('./generic');
module.exports = {

View File

@ -1,26 +1,32 @@
'use strict';
// const crypto = require('crypto');
const Crypto = require('../../crypto/Crypto');
const { DOMParser, XMLSerializer } = require('xmldom');
const { DOMParser, XMLSerializer } = require('@xmldom/xmldom');
const xpath = require('xpath');
const C14n = require('xml-crypto/lib/c14n-canonicalization').C14nCanonicalization;
const C14n = require('xml-crypto/lib/c14n-canonicalization').C14nCanonicalization;
const digest = (doc) => {
// get the xml node, where the digested value is supposed to be
const nodeDigestValue = doc.getElementsByTagName('ds:DigestValue')[0];
// canonicalize the node that has authenticate='true' attribute
const contentToDigest = xpath.select("//*[@authenticate='true']", doc)
.map(x => new C14n().process(x)).join('');
const contentToDigest = xpath
.select("//*[@authenticate='true']", doc)
.map(x => new C14n().process(x))
.join('');
// fix the canonicalization
const fixedContent = contentToDigest.replace(/xmlns="urn:org:ebics:H004"/g, 'xmlns="urn:org:ebics:H004" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"');
const fixedContent = contentToDigest.replace(
/xmlns="urn:org:ebics:H004"/g,
'xmlns="urn:org:ebics:H004" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"',
);
if (nodeDigestValue)
nodeDigestValue.textContent = Crypto.digestWithHash(fixedContent).toString('base64').trim();
nodeDigestValue.textContent = Crypto.digestWithHash(fixedContent)
.toString('base64')
.trim();
return doc;
};
@ -29,8 +35,15 @@ const sign = (doc, key) => {
const nodeSignatureValue = doc.getElementsByTagName('ds:SignatureValue')[0];
if (nodeSignatureValue) {
const select = xpath.useNamespaces({ ds: 'http://www.w3.org/2000/09/xmldsig#' });
const contentToSign = (new C14n().process(select('//ds:SignedInfo', 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#"');
const select = xpath.useNamespaces({
ds: 'http://www.w3.org/2000/09/xmldsig#',
});
const contentToSign = new C14n()
.process(select('//ds:SignedInfo', 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 = Crypto.privateSign(key, contentToSign); // this.keys.x().key.sign(contentToSign, 'base64');
}

View File

@ -0,0 +1,13 @@
'use strict';
const utils = require('../utils');
module.exports = (start = null, end = null) => ({
version: 'h004',
orderDetails: {
OrderType: 'C52',
OrderAttribute: 'DZHNN',
StandardOrderParams: utils.dateRange(start, end),
},
operation: 'download',
});

View File

@ -0,0 +1,13 @@
'use strict';
const utils = require('../utils');
module.exports = (start = null, end = null) => ({
version: 'h004',
orderDetails: {
OrderType: 'C53',
OrderAttribute: 'DZHNN',
StandardOrderParams: utils.dateRange(start, end),
},
operation: 'download',
});

View File

@ -0,0 +1,13 @@
'use strict';
const utils = require('../utils');
module.exports = (start = null, end = null) => ({
version: 'h004',
orderDetails: {
OrderType: 'DKI',
OrderAttribute: 'DZHNN',
StandardOrderParams: utils.dateRange(start, end),
},
operation: 'download',
});

View File

@ -0,0 +1,13 @@
'use strict';
const utils = require('../utils');
module.exports = (start = null, end = null) => ({
version: 'h004',
orderDetails: {
OrderType: 'G02',
OrderAttribute: 'DZHNN',
StandardOrderParams: utils.dateRange(start, end),
},
operation: 'download',
});

View File

@ -0,0 +1,8 @@
'use strict';
module.exports = document => ({
version: 'h004',
orderDetails: { OrderType: 'G1R', OrderAttribute: 'DZHNN', StandardOrderParams: {} },
operation: 'upload',
document,
});

View File

@ -0,0 +1,8 @@
'use strict';
module.exports = document => ({
version: 'h004',
orderDetails: { OrderType: 'G1V', OrderAttribute: 'DZHNN', StandardOrderParams: {} },
operation: 'upload',
document,
});

View File

@ -0,0 +1,13 @@
'use strict';
const utils = require('../utils');
module.exports = (start = null, end = null) => ({
version: 'h004',
orderDetails: {
OrderType: 'G52',
OrderAttribute: 'DZHNN',
StandardOrderParams: utils.dateRange(start, end),
},
operation: 'download',
});

View File

@ -0,0 +1,13 @@
'use strict';
const utils = require('../utils');
module.exports = (start = null, end = null) => ({
version: 'h004',
orderDetails: {
OrderType: 'G53',
OrderAttribute: 'DZHNN',
StandardOrderParams: utils.dateRange(start, end),
},
operation: 'download',
});

View File

@ -1,23 +1,13 @@
'use strict';
const dateRange = (start, end) => {
if (start && end)
return {
DateRange: {
Start: start,
End: end,
},
};
return {};
};
const utils = require('../utils');
module.exports = (start = null, end = null) => ({
version: 'h004',
orderDetails: {
OrderType: 'HAC',
OrderAttribute: 'DZHNN',
StandardOrderParams: dateRange(start, end),
StandardOrderParams: utils.dateRange(start, end),
},
operation: 'download',
});

View File

@ -1,23 +1,13 @@
'use strict';
const dateRange = (start, end) => {
if (start && end)
return {
DateRange: {
Start: start,
End: end,
},
};
return {};
};
const utils = require('../utils');
module.exports = (start = null, end = null) => ({
version: 'h004',
orderDetails: {
OrderType: 'PTK',
OrderAttribute: 'DZHNN',
StandardOrderParams: dateRange(start, end),
StandardOrderParams: utils.dateRange(start, end),
},
operation: 'download',
});

View File

@ -1,23 +1,13 @@
'use strict';
const dateRange = (start, end) => {
if (start && end)
return {
DateRange: {
Start: start,
End: end,
},
};
return {};
};
const utils = require('../utils');
module.exports = (start = null, end = null) => ({
version: 'h004',
orderDetails: {
OrderType: 'STA',
OrderAttribute: 'DZHNN',
StandardOrderParams: dateRange(start, end),
StandardOrderParams: utils.dateRange(start, end),
},
operation: 'download',
});

View File

@ -1,23 +1,13 @@
'use strict';
const dateRange = (start, end) => {
if (start && end)
return {
DateRange: {
Start: start,
End: end,
},
};
return {};
};
const utils = require('../utils');
module.exports = (start = null, end = null) => ({
version: 'h004',
orderDetails: {
OrderType: 'VMK',
OrderAttribute: 'DZHNN',
StandardOrderParams: dateRange(start, end),
StandardOrderParams: utils.dateRange(start, end),
},
operation: 'download',
});

View File

@ -0,0 +1,8 @@
'use strict';
module.exports = document => ({
version: 'h004',
orderDetails: { OrderType: 'XCT', OrderAttribute: 'OZHNN', StandardOrderParams: {} },
operation: 'upload',
document,
});

View File

@ -0,0 +1,8 @@
'use strict';
module.exports = document => ({
version: 'h004',
orderDetails: { OrderType: 'XG1', OrderAttribute: 'OZHNN', StandardOrderParams: {} },
operation: 'upload',
document,
});

View File

@ -0,0 +1,13 @@
'use strict';
const utils = require('../utils');
module.exports = (start = null, end = null) => ({
version: 'h004',
orderDetails: {
OrderType: 'Z53',
OrderAttribute: 'DZHNN',
StandardOrderParams: utils.dateRange(start, end),
},
operation: 'download',
});

View File

@ -12,6 +12,10 @@ const CDS = require('./CDS');
const CCT = require('./CCT');
const CCS = require('./CCS');
const XE3 = require('./XE3');
const XCT = require('./XCT');
const XG1 = require('./XG1');
const G1V = require('./G1V');
const G1R = require('./G1R');
const STA = require('./STA');
const VMK = require('./VMK');
@ -21,11 +25,19 @@ const HPD = require('./HPD');
const HKD = require('./HKD');
const PTK = require('./PTK');
const HAC = require('./HAC');
const Z53 = require('./Z53');
const DKI = require('./DKI');
const C52 = require('./C52');
const C53 = require('./C53');
const G52 = require('./G52');
const G53 = require('./G53');
const G02 = require('./G02');
module.exports = {
INI,
HIA,
HPB,
Z53,
AZV,
CD1,
@ -35,6 +47,10 @@ module.exports = {
CCT,
CCS,
XE3,
XCT,
XG1,
G1V,
G1R,
STA,
VMK,
@ -44,4 +60,10 @@ module.exports = {
HKD,
PTK,
HAC,
DKI,
C52,
C53,
G52,
G53,
G02,
};

View File

@ -2,11 +2,9 @@
const fs = require('fs');
const uuidv1 = require('uuid/v1');
const { v1: uuidv1 } = require('uuid');
const traceName = (uuid, label, type, ext = 'xml') => {
return `${uuid}_${label}_${type}.${ext}`;
};
const traceName = (uuid, label, type, ext = 'xml') => `${uuid}_${label}_${type}.${ext}`;
module.exports = dir => ({
traceData: '',
@ -58,9 +56,7 @@ module.exports = dir => ({
try {
fs.writeFileSync(path, this.traceData);
console.log("Data written to file");
} catch (error) {
console.log(error);
throw error;
}
},

46
lib/utils.js Normal file
View File

@ -0,0 +1,46 @@
'use strict';
const prefixNumber = (n) => {
if (n < 10)
return `0${n}`;
return n.toString();
};
const date = {
getDateObject(d = Date.now()) {
const dateObject = new Date(d);
// eslint-disable-next-line no-restricted-globals
if (isNaN(dateObject))
throw new Error(`${d} is invalid date.`);
return dateObject;
},
toISODate(d = Date.now(), utc = true) {
const t = date.getDateObject(d);
if (utc)
return `${t.getUTCFullYear()}-${prefixNumber(t.getUTCMonth() + 1)}-${prefixNumber(t.getUTCDate())}`;
return `${t.getFullYear()}-${prefixNumber(t.getMonth() + 1)}-${prefixNumber(t.getDate())}`;
},
toISOTime(d = Date.now(), utc = true) {
const t = date.getDateObject(d);
if (utc)
return `${prefixNumber(t.getUTCHours())}:${prefixNumber(t.getUTCMinutes())}:${prefixNumber(t.getUTCSeconds())}`;
return `${prefixNumber(t.getHours())}:${prefixNumber(t.getMinutes())}:${prefixNumber(t.getSeconds())}`;
},
};
const dateRange = (start, end) => {
if (start && end)
return {
DateRange: {
Start: date.toISODate(start),
End: date.toISODate(end),
},
};
return {};
};
module.exports = {
dateRange,
date,
};

5156
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,38 +1,90 @@
{
"name": "ebics-client",
"version": "0.0.4",
"version": "5.0.0",
"description": "Node.js ISO 20022 Compliant EBICS Client",
"main": "index.js",
"files": [
"lib/**/*",
"templates/**/*"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"lint": "eslint .",
"test": "npm run test:node$(node -v | cut -d '.' -f 1 | cut -c 2-)",
"test:node22": "nyc node ./node_modules/.bin/mocha test/**/*.js",
"test:node20": "nyc node --security-revert=CVE-2023-46809 ./node_modules/.bin/mocha test/**/*.js",
"test:node18": "nyc node --security-revert=CVE-2023-46809 ./node_modules/.bin/mocha test/**/*.js",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"version": "auto-changelog -p -t changelog-template.hbs && git add CHANGELOG.md"
},
"repository": {
"type": "git",
"url": "https://github.com/eCollect/node-ebics-client"
"url": "https://github.com/node-ebics/node-ebics-client"
},
"keywords": [
"EBICS",
"ISO20022",
"nodejs",
"api"
"api",
"banking"
],
"author": "eCollect Sofia Tech Team",
"contributors": [
{
"name": "Dimitar Nanov",
"url": "https://nanov.io",
"email": "dimitar@nanov.io"
},
{
"name": "Vladislav Hristov",
"url": "https://github.com/vladhristov",
"email": "vlad.s.ch@gmail.com"
},
{
"name": "Vasyl Stashuk",
"url": "https://github.com/vasyas"
},
{
"name": "Yago",
"url": "https://github.com/yagop"
},
{
"name": "Herman van Hazendonk",
"email": "github.com@herrie.org"
},
{
"name": "chrwoizi",
"url": "https://github.com/chrwoizi"
},
{
"name": "Herrie",
"url": "https://github.com/Herrie82"
},
{
"name": "Maik Marschner ",
"url": "https://github.com/leMaik"
}
],
"license": "MIT",
"dependencies": {
"bn.js": "^4.11.8",
"handlebars": "^4.0.11",
"js2xmlparser": "^3.0.0",
"moment": "^2.22.1",
"node-rsa": "^0.4.2",
"request": "^2.87.0",
"uuid": "^3.3.2",
"xml-crypto": "^0.10.1",
"xmldom": "^0.1.27",
"xpath": "0.0.27"
"@xmldom/xmldom": "^0.8.10",
"handlebars": "^4.7.8",
"js2xmlparser": "^5.0.0",
"node-forge": "^1.3.1",
"node-rsa": "^1.1.1",
"rock-req": "^5.1.3",
"uuid": "^9.0.1",
"xml-crypto": "^6.0.0",
"xpath": "0.0.32"
},
"devDependencies": {
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.12.0"
"auto-changelog": "^2.4.0",
"chai": "^4.3.10",
"coveralls": "^3.1.1",
"eslint": "^6.7.2",
"eslint-config-ecollect-base": "^0.1.2",
"eslint-plugin-import": "^2.28.1",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"xmllint-wasm": "^4.0.2"
}
}

164
templates/ini_en.hbs Normal file
View File

@ -0,0 +1,164 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta charset="UTF-8" />
<title>EBICS ini</title>
</head>
<body>
<div>
<h2>EBICS-Initialization letter (INI)</h2>
<table>
<tr>
<td>Date</td>
<td>{{ today }}</td>
</tr>
<tr>
<td>Time</td>
<td>{{ now }}</td>
</tr>
<tr>
<td>Recipient</td>
<td>{{ bankName }}</td>
</tr>
<tr>
<td>User ID</td>
<td>{{ userId }}</td>
</tr>
<tr>
<td>Customer ID</td>
<td>{{ partnerId }}</td>
</tr>
</table>
<p>Public authentication key (A006)</p>
<p>Exponent ({{ keyExponentBits A006 }} Bit):</p>
<p>
<code>{{ keyExponent A006 }}</code>
</p>
<p>Modulus ({{ keyModulusBits A006 }} Bit):</p>
<p>
<code>{{ keyModulus A006 }}</code>
</p>
<p>SHA-256 Hash:</p>
<p>
<code>{{ sha256 A006 }}</code>
</p>
<p>I hereby confirm the above public key for my electronic signature.</p>
<br/>
<br/>
<br/>
<br/>
<table>
<tr>
<td>_________________________</td>
<td>_________________________</td>
<td>_________________________</td>
</tr>
<tr>
<td>City/Date</td>
<td>Name/Company</td>
<td>Signature</td>
</tr>
</table>
</div>
<div style="page-break-after:always"></div>
<h2>EBICS-Initialization letter (HIA) - Page 1/2</h2>
<table>
<tr>
<td>Date</td>
<td>{{ today }}</td>
</tr>
<tr>
<td>Time</td>
<td>{{ now }}</td>
</tr>
<tr>
<td>Recipient</td>
<td>{{ bankName }}</td>
</tr>
<tr>
<td>User ID</td>
<td>{{ userId }}</td>
</tr>
<tr>
<td>Customer ID</td>
<td>{{ partnerId }}</td>
</tr>
</table>
<div>
<p>Public Identification Key (X002)</p>
<p>Exponent ({{ keyExponentBits X002 }} Bit):</p>
<p>
<code>{{ keyExponent X002 }}</code>
</p>
<p>Modulus ({{ keyModulusBits X002 }} Bit):</p>
<p>
<code>{{ keyModulus X002 }}</code>
</p>
<p>SHA-256 Hash:</p>
<p>
<code>{{ sha256 X002 }}</code>
</p>
<p> Continuation on Page 2 ...</p>
<div style="page-break-after:always"></div>
<h2>EBICS-Initialization letter (HIA) - Page 2/2</h2>
<table>
<tr>
<td>Date</td>
<td>{{ today }}</td>
</tr>
<tr>
<td>Time</td>
<td>{{ now }}</td>
</tr>
<tr>
<td>Recipient</td>
<td>{{ bankName }}</td>
</tr>
<tr>
<td>User ID</td>
<td>{{ userId }}</td>
</tr>
<tr>
<td>Customer ID</td>
<td>{{ partnerId }}</td>
</tr>
</table>
</div>
<div>
<p>Public Encryption Key (E002)</p>
<p>Exponent ({{ keyExponentBits E002 }} Bit):</p>
<p>
<code>{{ keyExponent E002 }}</code>
</p>
<p>Modulus ({{ keyModulusBits E002 }} Bit):</p>
<p>
<code>{{ keyModulus E002 }}</code>
</p>
<p>SHA-256 Hash:</p>
<p>
<code>{{ sha256 E002 }}</code>
</p>
<p>I hereby confirm the above public keys for my EBICS access.</p>
<br/>
<br/>
<br/>
<br/>
<table>
<tr>
<td>_________________________</td>
<td>_________________________</td>
<td>_________________________</td>
</tr>
<tr>
<td>City/Date</td>
<td>Name/Company</td>
<td>Signature</td>
</tr>
</table>
</div>
</body>
</html>

164
templates/ini_fr.hbs Normal file
View File

@ -0,0 +1,164 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta charset="UTF-8" />
<title>EBICS ini</title>
</head>
<body>
<div>
<h2>Lettre d'initialisation pour clés électroniques bancaires (INI)</h2>
<table>
<tr>
<td>Date</td>
<td>{{ today }}</td>
</tr>
<tr>
<td>Heure</td>
<td>{{ now }}</td>
</tr>
<tr>
<td>Banque</td>
<td>{{ bankName }}</td>
</tr>
<tr>
<td>ID Utilisateur</td>
<td>{{ userId }}</td>
</tr>
<tr>
<td>ID Partenaire</td>
<td>{{ partnerId }}</td>
</tr>
</table>
<p>Clé publique (Public Key) pour la signature électronique (A006)</p>
<p>Exposant ({{ keyExponentBits A006 }} Bit):</p>
<p>
<code>{{ keyExponent A006 }}</code>
</p>
<p>Modulo ({{ keyModulusBits A006 }} Bit):</p>
<p>
<code>{{ keyModulus A006 }}</code>
</p>
<p>Hash (SHA-256):</p>
<p>
<code>{{ sha256 A006 }}</code>
</p>
<p>Je confirme par la présente la clé publique ci-dessus pour ma signature électronique.</p>
<br/>
<br/>
<br/>
<br/>
<table>
<tr>
<td>_________________________</td>
<td>_________________________</td>
<td>_________________________</td>
</tr>
<tr>
<td>Lieu/Date</td>
<td>Nom/Entreprise</td>
<td>Signature</td>
</tr>
</table>
</div>
<div style="page-break-after:always"></div>
<h2>Lettre d'initialisation pour clés électroniques bancaires (HIA) - Page 1/2</h2>
<table>
<tr>
<td>Date</td>
<td>{{ today }}</td>
</tr>
<tr>
<td>Heure</td>
<td>{{ now }}</td>
</tr>
<tr>
<td>Banque</td>
<td>{{ bankName }}</td>
</tr>
<tr>
<td>ID Utilisateur</td>
<td>{{ userId }}</td>
</tr>
<tr>
<td>ID Partenaire</td>
<td>{{ partnerId }}</td>
</tr>
</table>
<div>
<p>Clé d'identification publique (X002)</p>
<p>Exposant ({{ keyExponentBits X002 }} Bit):</p>
<p>
<code>{{ keyExponent X002 }}</code>
</p>
<p>Modulo ({{ keyModulusBits X002 }} Bit):</p>
<p>
<code>{{ keyModulus X002 }}</code>
</p>
<p>Hash (SHA-256):</p>
<p>
<code>{{ sha256 X002 }}</code>
</p>
<p>Suite à la page 2 ...</p>
<div style="page-break-after:always"></div>
<h2>Lettre d'initialisation pour clés électroniques bancaires (HIA) - Page 2/2</h2>
<table>
<tr>
<td>Date</td>
<td>{{ today }}</td>
</tr>
<tr>
<td>Heure</td>
<td>{{ now }}</td>
</tr>
<tr>
<td>Banque</td>
<td>{{ bankName }}</td>
</tr>
<tr>
<td>ID Utilisateur</td>
<td>{{ userId }}</td>
</tr>
<tr>
<td>ID Partenaire</td>
<td>{{ partnerId }}</td>
</tr>
</table>
</div>
<div>
<p>Clé de chiffrement publique (E002)</p>
<p>Exposant ({{ keyExponentBits E002 }} Bit):</p>
<p>
<code>{{ keyExponent E002 }}</code>
</p>
<p>Modulo ({{ keyModulusBits E002 }} Bit):</p>
<p>
<code>{{ keyModulus E002 }}</code>
</p>
<p>Hash (SHA-256):</p>
<p>
<code>{{ sha256 E002 }}</code>
</p>
<p>Je confirme par la présente les clés publiques ci-dessus.</p>
<br/>
<br/>
<br/>
<br/>
<table>
<tr>
<td>_________________________</td>
<td>_________________________</td>
<td>_________________________</td>
</tr>
<tr>
<td>Lieu/Date</td>
<td>Nom/Entreprise</td>
<td>Signature</td>
</tr>
</table>
</div>
</body>
</html>

21
test/fixtures/HPB_response.xml vendored Normal file
View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<ebicsKeyManagementResponse xmlns="urn:org:ebics:H004" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Revision="1" Version="H004" xsi:schemaLocation="urn:org:ebics:H004 ebics_keymgmt_response_H004.xsd">
<header authenticate="true">
<static/>
<mutable>
<ReturnCode>000000</ReturnCode>
<ReportText>[EBICS_OK] OK</ReportText>
</mutable>
</header>
<body>
<DataTransfer>
<DataEncryptionInfo authenticate="true">
<EncryptionPubKeyDigest Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" Version="E002">nuZyAjQoIvH4MwnrCWB82TC/vcNqigpqPtMXwO1Xk9U=</EncryptionPubKeyDigest>
<TransactionKey>QgfTQqhocARTcpcgySGxn5a+uBuFsHCX0oBINQQIfsgMRR+wEZ3zlXQMUm5GUwwOci2wjkRHJ3PoO4Yd0KzDNWiXFuX/9n00bpnNN5MsTCRgDqJRzZrA1jDxWRBVY/sv3l1gS/ERwyWqub456VZ7DYlXlRA8yp5lormoxftpIt6/Cf0ShmhS8qlUkLYSn/8ugQRl1KRTID5ZSXPjDYAIVZ0izVxblaBYXgs6RH9VvP4uKSn4CFYiFp+alo6EcxFNgMVUnfzaEbsPH/aX9Y3tbdWhATBZSxTT8iMoi2ARhz9VB711aavB8vgzcD6jH3ZtIm+sCb3UC3A/KehEn9GjIA==</TransactionKey>
</DataEncryptionInfo>
<OrderData>xlQf5zxlUo4LwjkoDsh926OISQwn6PhpxF3CkZI34EO84tfK25zLbqriXiqwDycl2YjYrQxbj8B4k1auNe86a+JigQOoBBCL8gvsoxO+NlziPNzf8sP99dQSp436q7KOhVm4gz2ZZT3D3O5FSqpOKsQ0fJku7D76beoxqxUT+hD0UxgsGLsbGgNLzHPalnFJctuaZtqQmo24Uk6hOwLrFJoQwUbPEffU5GGARWrZVxGQr5Zw4zrtLlZzP1RXk9JZFnhx00KvKiaoxAQXxXUC0BeDM97tIMEiaRNbO3ne+mHtK8vXzc305X5yR0B6ocwbFAmzGQ/e6Fyy6XPIGsbXoLjJGod6ayIU1SJGx/JRyOU4cLkjJZLUQMyCdJ6bA5uYf1AePUDvUA3tAOd6W0cC7DPAlwcrWhSZkPLIawequyjO39LTkEcmINEigd4i3sCrG4e1k303gyIKUg79kApl46onW2vruN3DwswunI10JGXxqex7ccvd2JvD6Pc8cAH1RMg8FIucYd//Joh1XK+QkRdIZMWKg4/lkoWmgVN7ssMmrtsKE2pNFAsIRfgxd8bB64sHZ3XKSyZKTk4LnWdJHZopP/xTs9a+/G3Kd/sIsy4W4sIKZCWU8NL11YOaqfwxY/rYNMaQzhAmawFfWvt74iisFG81Wv+Ijja/dPFmbk3Mup2Dfnlfu26MDblC8+aiaPHypmPuzREqGjW/9d2vtLQz0IXX3X6H4pFXneSjKlwXlDk1WGuiOvXH4gmXEpfWTX9rq+rUyskwwL8ssW5eeeyJ5W2LhVKQllOi/bvrAL5kyrfDMxvOuFIBLxBf//xE</OrderData>
</DataTransfer>
<ReturnCode authenticate="true">000000</ReturnCode>
<TimestampBankParameter authenticate="true">2016-08-10T16:16:17.512Z</TimestampBankParameter>
</body>
</ebicsKeyManagementResponse>

22
test/fixtures/HPB_response_data.xml vendored Normal file
View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<HPBResponseOrderData xmlns="urn:org:ebics:H004" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xsi:schemaLocation="urn:org:ebics:H004 ebics_orders_H004.xsd">
<AuthenticationPubKeyInfo>
<PubKeyValue>
<ds:RSAKeyValue>
<ds:Modulus>AJWVHQIfP0H1fr5Y7IjSlDmFksqQ+0E+CjzbEeE6r444LCuSXwbGKF6DJqguyX1qGYxjHRvVtdkNa+GNAtlZnmuPeLHPBUOs5Zx9J5JP4JZOcKd/wnRDIasTkg3NrtZ22tjOrWx26VuR6h7dUH2oJRnFDHmbXoCDMxkqJUNr/TM89p5slJ9Oj5+NAaOzm+7AlwbJ95EI/xc2jEfhp+GdF9CYdS/m2AZaAt79y6QDtBSDdAs0OHTgsOIjbjZkptBF/Gkip2sOordjsChRNLHLDcAOWbsg1NVMuhXs1b6+bCVLXQcGhFydYhqvrXB7pFS0++hlyzqGhbZK5cwEe/v8EJk=</ds:Modulus>
<ds:Exponent>AQAB</ds:Exponent>
</ds:RSAKeyValue>
</PubKeyValue>
<AuthenticationVersion>X002</AuthenticationVersion>
</AuthenticationPubKeyInfo>
<EncryptionPubKeyInfo>
<PubKeyValue>
<ds:RSAKeyValue>
<ds:Modulus>AJWVHQIfP0H1fr5Y7IjSlDmFksqQ+0E+CjzbEeE6r444LCuSXwbGKF6DJqguyX1qGYxjHRvVtdkNa+GNAtlZnmuPeLHPBUOs5Zx9J5JP4JZOcKd/wnRDIasTkg3NrtZ22tjOrWx26VuR6h7dUH2oJRnFDHmbXoCDMxkqJUNr/TM89p5slJ9Oj5+NAaOzm+7AlwbJ95EI/xc2jEfhp+GdF9CYdS/m2AZaAt79y6QDtBSDdAs0OHTgsOIjbjZkptBF/Gkip2sOordjsChRNLHLDcAOWbsg1NVMuhXs1b6+bCVLXQcGhFydYhqvrXB7pFS0++hlyzqGhbZK5cwEe/v8EJk=</ds:Modulus>
<ds:Exponent>AQAB</ds:Exponent>
</ds:RSAKeyValue>
</PubKeyValue>
<EncryptionVersion>E002</EncryptionVersion>
</EncryptionPubKeyInfo>
<HostID>CRSISOTB</HostID>
</HPBResponseOrderData>

13
test/fixtures/INI_reposne.xml vendored Normal file
View File

@ -0,0 +1,13 @@
<h004:ebicsKeyManagementResponse xmlns:h004="urn:org:ebics:H004" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:org:ebics:H004 ebics_H004.xsd" Version="H004" Revision="1">
<h004:header authenticate="true">
<h004:static />
<h004:mutable>
<h004:OrderID>B004</h004:OrderID>
<h004:ReturnCode>000000</h004:ReturnCode>
<h004:ReportText>[EBICS_OK] OK</h004:ReportText>
</h004:mutable>
</h004:header>
<h004:body>
<h004:ReturnCode authenticate="true">000000</h004:ReturnCode>
</h004:body>
</h004:ebicsKeyManagementResponse>

164
test/fixtures/Letter_DE.html vendored Normal file
View File

@ -0,0 +1,164 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta charset="UTF-8" />
<title>EBICS ini</title>
</head>
<body>
<div>
<h2>EBICS-Initialisierungsbrief (INI)</h2>
<table>
<tr>
<td>Datum</td>
<td>2019-11-20</td>
</tr>
<tr>
<td>Uhrzeit</td>
<td>14:14:03</td>
</tr>
<tr>
<td>Empfänger</td>
<td>Credit Suisse AG</td>
</tr>
<tr>
<td>User-ID</td>
<td>CRS04381</td>
</tr>
<tr>
<td>Kunden-ID</td>
<td>CRS04381</td>
</tr>
</table>
<p>Öffentlicher Schlüssel für die elektronische Unterschrift (A006)</p>
<p>Exponent (24 Bit):</p>
<p>
<code>010001</code>
</p>
<p>Modulus (2048 Bit):</p>
<p>
<code>AB E6 54 CA EF B8 AD 81 C2 79 74 9C 42 39 82 A7 A4 1C 76 C8 00 69 68 90 79 59 22 DA 6F 1B C6 12 DA B1 32 8F 97 57 D0 71 2F 09 90 63 96 CA 80 00 8B D3 B8 1A D9 D2 91 14 08 84 BA F7 CF 78 6D E6 40 74 7B FF 48 44 9D D6 DE 1D 9A F3 07 F4 48 AC A2 3C E2 2C 79 34 98 59 E3 48 64 EF 9E E2 C4 9C BC CE DA 1E 31 EC 4D 51 85 62 05 6B FC CB 8D B1 09 DF 17 3C 2C 68 D4 C7 3F 15 BF 4C A6 65 E4 D9 A3 CD 3E 3F 1F 20 16 5E A2 27 93 35 86 DE D7 A8 5D 8F E1 0C A5 02 AF C7 7B 51 9C D0 00 5C 2D 46 E8 42 D3 2F 8A 8C 31 C2 ED 61 01 4F B5 B2 E7 3E 11 18 8C D7 83 23 1E D5 24 BE A9 A4 5C 56 8C CC 52 75 E1 15 63 39 90 AB 36 CE 30 1D 3B 50 85 7D CE 7A 72 77 67 77 4C 5E 37 BE 95 31 91 A7 51 A7 BC C6 C6 BD 2B 85 3D 08 29 90 B1 F6 77 2F 23 9F FD 2A 03 03 04 E1 CB F6 66 6A D9 EC B5 66 60 89</code>
</p>
<p>Hash (SHA-256):</p>
<p>
<code>85 F0 4F 8B 97 6A F0 E2 FD 9F 21 2B 0B B3 A2 7A 97 B3 BB 57 B3 1B 55 14 F7 ED B5 CB CD E4 FE 79</code>
</p>
<p>Ich bestätige hiermit den obigen öffentlichen Schlüssel für meine elektronische Unterschrift.</p>
<br/>
<br/>
<br/>
<br/>
<table>
<tr>
<td>_________________________</td>
<td>_________________________</td>
<td>_________________________</td>
</tr>
<tr>
<td>Ort/Datum</td>
<td>Name/Firma</td>
<td>Unterschrift</td>
</tr>
</table>
</div>
<div style="page-break-after:always"></div>
<h2>EBICS-Initialisierungsbrief (HIA) - Seite 1/2</h2>
<table>
<tr>
<td>Datum</td>
<td>2019-11-20</td>
</tr>
<tr>
<td>Uhrzeit</td>
<td>14:14:03</td>
</tr>
<tr>
<td>Empfänger</td>
<td>Credit Suisse AG</td>
</tr>
<tr>
<td>User-ID</td>
<td>CRS04381</td>
</tr>
<tr>
<td>Kunden-ID</td>
<td>CRS04381</td>
</tr>
</table>
<div>
<p>Öffentlicher Authentifikationsschlüssel (X002)</p>
<p>Exponent (24 Bit):</p>
<p>
<code>010001</code>
</p>
<p>Modulus (2048 Bit):</p>
<p>
<code>8A ED FC 0F 2C 86 EA E3 07 D9 0D 75 DD E6 25 4F 20 40 41 43 D6 22 C0 59 A9 38 F6 54 42 74 ED 5C 38 C4 6C 63 F2 0F A2 65 85 D9 58 1A 1E F5 1E C4 9E E3 66 5B 67 6B 37 B0 FA BD 8C FE 12 D3 F0 3A C8 23 22 56 3F 30 B0 FB 70 C5 7B 17 41 15 A8 EE 54 F3 1F AF DE 13 7E 96 38 AF 9B 69 28 22 1F 9A 7C C4 C6 1D 35 59 66 40 81 7F D7 48 DA B9 51 EF A9 0C 96 C5 7A 55 25 66 A5 63 B6 4A 45 F0 97 0F 56 60 18 5B CE 08 A2 7D 87 64 18 A2 4A E1 B3 8E 75 24 3F FC AC 23 A5 33 BF 0C 41 E3 96 B5 D2 54 CA 37 07 40 A9 E3 2B 01 17 A6 21 AE 07 1E 52 0A 00 E1 95 F3 BE BC 19 EA E9 90 48 17 38 60 DE 68 BD 85 36 37 59 14 E0 BC 07 C5 B8 50 0A 87 87 90 13 91 6C 4F 03 2B 40 27 14 2B 7F A9 D7 71 12 57 E5 A9 72 CE 16 B7 7B 5E 7D A2 52 D6 CE 9D 39 DA 44 C0 41 EF 02 37 7B 93 98 CC 35 D8 06 D1 79 57</code>
</p>
<p>Hash (SHA-256):</p>
<p>
<code>F8 3B D7 EB 6F 2B 48 4B 2B 0A BD CA C7 EF F8 56 11 D1 90 32 D6 CC 67 3B 8A 3E 74 F5 F8 B4 E1 AA</code>
</p>
<p> Fortsetzung auf Seite 2 ...</p>
<div style="page-break-after:always"></div>
<h2>EBICS-Initialisierungsbrief (HIA) - Seite 2/2</h2>
<table>
<tr>
<td>Datum</td>
<td>2019-11-20</td>
</tr>
<tr>
<td>Uhrzeit</td>
<td>14:14:03</td>
</tr>
<tr>
<td>Empfänger</td>
<td>Credit Suisse AG</td>
</tr>
<tr>
<td>User-ID</td>
<td>CRS04381</td>
</tr>
<tr>
<td>Kunden-ID</td>
<td>CRS04381</td>
</tr>
</table>
</div>
<div>
<p>Öffentlicher Verschlüsselungsschlüssel (E002)</p>
<p>Exponent (24 Bit):</p>
<p>
<code>010001</code>
</p>
<p>Modulus (2048 Bit):</p>
<p>
<code>93 10 E9 40 2A B1 77 DB 31 C7 EB 13 5A E6 21 FD 6B 18 2B 74 40 67 B1 C9 6D B6 09 4A 1D CD F0 A7 DC 51 A4 53 EF AE 14 0D 9E A0 FB E4 EE D0 2E CF 6C 4C 5E 99 83 F3 A3 8E C3 FE F5 C1 DA E2 E6 52 96 A1 5B 9C 10 2D D1 F1 A2 0F 8E 3E 5D 81 55 DF 19 11 5B 5E 62 DB 95 56 0E 19 4C EF F3 87 50 EB 5F B7 42 3C 5D CB 47 51 81 E7 3F 39 6A 4A CA 6E 29 55 2B 22 14 FE 24 DA 5D DB 0C 99 D2 61 7A FB 40 B7 61 B8 82 89 BE 59 4C 64 92 9A F2 5E 82 62 3A 98 11 61 A3 77 0F 13 38 5D FD 13 BD 9C 4A 96 F9 34 8A 3B 99 4D 25 7B 1B A8 3F 90 F7 6F 9D 09 74 DB 4C B7 27 A3 0B EC 7C 05 E5 F3 1C F7 C2 59 0D 3A 57 86 D5 AD AF 1E CC 84 9F B8 4C DF 8A 35 22 CF D5 B8 12 2B 44 E4 12 BE 26 F7 D7 31 31 31 BB 3D 3C 49 7E C6 AF 44 4D 00 1F FC 04 84 2F 10 8B 2C 78 15 0F 22 46 70 78 2B 25 56 16 36 FB 9F</code>
</p>
<p>Hash (SHA-256):</p>
<p>
<code>9E E6 72 02 34 28 22 F1 F8 33 09 EB 09 60 7C D9 30 BF BD C3 6A 8A 0A 6A 3E D3 17 C0 ED 57 93 D5</code>
</p>
<p>Ich bestätige hiermit die obigen öffentlichen Schlüssel für meinen EBICS-Zugang.</p>
<br/>
<br/>
<br/>
<br/>
<table>
<tr>
<td>_________________________</td>
<td>_________________________</td>
<td>_________________________</td>
</tr>
<tr>
<td>Ort/Datum</td>
<td>Name/Firma</td>
<td>Unterschrift</td>
</tr>
</table>
</div>
</body>
</html>

40
test/fixtures/STA_response_part1.xml vendored Normal file
View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<ebicsResponse xmlns="urn:org:ebics:H004" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:org:ebics:H004 http://www.ebics.org/H004/ebics_response_H004.xsd" Version="H004" Revision="1">
<header authenticate="true">
<static>
<TransactionID>ECD6F062AAEDFA77250526A68CBEC549</TransactionID>
<NumSegments>2</NumSegments>
</static>
<mutable>
<TransactionPhase>Initialisation</TransactionPhase>
<SegmentNumber lastSegment="false">1</SegmentNumber>
<ReturnCode>000000</ReturnCode>
<ReportText>[EBICS_OK] OK</ReportText>
</mutable>
</header>
<AuthSignature>
<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:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>OnY4VczV+1XfplpMS/SCKFWn+FDMge40X8TJ9pA6HEI=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>Qiz8clr/Ym+wLpB8CzTuxKP5rgIR2P4SaX8O4gGZx0Di8Lzd4hsBO3koqIuX11NRZo0RYA5E/IKQCoYLepkcM4QHvLT37YidbrXsTZe6cml/yF8OdyRAcd/9U7AoA9GKENFk4lnBFfZYmM4ADK6wVOCE/ABaOk0NeCDDbxrKA75tfTxwxTvQBfUOHZ87LrZxuQf//L9pzmtI07/7GbsQX8ZceQq40SpBFZn/oRvT/Q38Qu2ZO59MZexJn+BTzlhpfv9fQGF/sgXkdhUkPTEW3nL4j7ehasq3CtySGO2RnEppohEvJ4m07RDtEY3OWyAAZoPFVpvnECM6pOLbIuR40w==</ds:SignatureValue>
</AuthSignature>
<body>
<DataTransfer>
<DataEncryptionInfo authenticate="true">
<EncryptionPubKeyDigest Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" Version="E002">IUW05JB5cuCzRYYa4kIAZ2ehYVrLI3lKvxZvo1uP+ug=</EncryptionPubKeyDigest>
<TransactionKey>CPdd6ODXrCxHWpYrwS/5a3NIZ1R2SDscHHJSONc2I7g8ara7qv5Ra7H03W+336DPQLZQxH+EBRWdE2FQ1vrVTcypK6fkFarmO1dEtQt6Ka89AozC7aQMyp4yGl+zlF+XvFkJXZbRXgoEOPsgcG0xM6nKLXnr1ThYRFOoAasigLDGwqxliyhoR94F9dL7YB8Le/uZeRj78mNp4smkE5ZKKyPhwVx+0IW78YuVCSC2c2qbsMmm4evAvycdpLfuuoG4KVlNMIlvkKeBfMZFELcmeKKm85D2zPYkZ7cqG2IfAAp5qdS6K8P7RY4gtjUhOtP5mi8bZt/ZcjioUmIR9dAMnA==</TransactionKey>
</DataEncryptionInfo>
<OrderData>lJ/v1HvOYAZKTPkxULH4mOcUy01+EaAsxLzCPhtieAo9m5AtU5URdyBVfmclHbtWe3ELb02lR37bChynq0Esqpljxx7CiB+kl/bVs7XkNQQmtGPlh08O7ApJ7AHdKPFFvE+SM2OWpSwUrqJGtmyaU6s+RM66o/3Q0wvKi4y3+Q2jm8nkiWZpPfNt52g4ReE9Ge86o+L+EBOBgZm634L5Z/i6pq908mXBAklPdk1ERdEgWONaOeYYmB70FToplR1gINJEF2CnfAtD/wV+DuQFPDth+EWHqhe3a4xO0d9eJ55ou2QCYOPUC2g/qz1sp7GR74W7P5IWJdmnUEuPFsKJ6OvM+1V8S06jZGDa/QhUGDK8F3G/TMP09W1MsrlQTRr3YQ5H43+pMY7I6Jysze+X9OKZZTTpv4GmYm1USjmraGyMuPF3j9hrlmpttK+1gg2WzytCJO44YsZp9ckls8JNK4bT5uwTuomKZoRgmiIOTcMh4VP7V28TWj2XdF+T6rBFILTvQyXMOzvbe1kLwg2O31JDBdJ8X1fHCYJxKsIrYCSDPz4sha8h7QmHrCSFmjoXb+LUElnbLXZVRkY5/Dc73EM6Es3wAgjwSJK2asRqdqU0PhbS5qpIlgYKsNcb+Wes</OrderData>
</DataTransfer>
<ReturnCode authenticate="true">000000</ReturnCode>
<TimestampBankParameter authenticate="true">2013-12-09T15:14:30.000Z</TimestampBankParameter>
</body>
</ebicsResponse>

40
test/fixtures/STA_response_part2.xml vendored Normal file
View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<ebicsResponse xmlns="urn:org:ebics:H004" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:org:ebics:H004 http://www.ebics.org/H004/ebics_response_H004.xsd" Version="H004" Revision="1">
<header authenticate="true">
<static>
<TransactionID>ECD6F062AAEDFA77250526A68CBEC549</TransactionID>
<NumSegments>1</NumSegments>
</static>
<mutable>
<TransactionPhase>Initialisation</TransactionPhase>
<SegmentNumber lastSegment="true">1</SegmentNumber>
<ReturnCode>000000</ReturnCode>
<ReportText>[EBICS_OK] OK</ReportText>
</mutable>
</header>
<AuthSignature>
<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:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>OnY4VczV+1XfplpMS/SCKFWn+FDMge40X8TJ9pA6HEI=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>Qiz8clr/Ym+wLpB8CzTuxKP5rgIR2P4SaX8O4gGZx0Di8Lzd4hsBO3koqIuX11NRZo0RYA5E/IKQCoYLepkcM4QHvLT37YidbrXsTZe6cml/yF8OdyRAcd/9U7AoA9GKENFk4lnBFfZYmM4ADK6wVOCE/ABaOk0NeCDDbxrKA75tfTxwxTvQBfUOHZ87LrZxuQf//L9pzmtI07/7GbsQX8ZceQq40SpBFZn/oRvT/Q38Qu2ZO59MZexJn+BTzlhpfv9fQGF/sgXkdhUkPTEW3nL4j7ehasq3CtySGO2RnEppohEvJ4m07RDtEY3OWyAAZoPFVpvnECM6pOLbIuR40w==</ds:SignatureValue>
</AuthSignature>
<body>
<DataTransfer>
<DataEncryptionInfo authenticate="true">
<EncryptionPubKeyDigest Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" Version="E002">IUW05JB5cuCzRYYa4kIAZ2ehYVrLI3lKvxZvo1uP+ug=</EncryptionPubKeyDigest>
<TransactionKey>CPdd6ODXrCxHWpYrwS/5a3NIZ1R2SDscHHJSONc2I7g8ara7qv5Ra7H03W+336DPQLZQxH+EBRWdE2FQ1vrVTcypK6fkFarmO1dEtQt6Ka89AozC7aQMyp4yGl+zlF+XvFkJXZbRXgoEOPsgcG0xM6nKLXnr1ThYRFOoAasigLDGwqxliyhoR94F9dL7YB8Le/uZeRj78mNp4smkE5ZKKyPhwVx+0IW78YuVCSC2c2qbsMmm4evAvycdpLfuuoG4KVlNMIlvkKeBfMZFELcmeKKm85D2zPYkZ7cqG2IfAAp5qdS6K8P7RY4gtjUhOtP5mi8bZt/ZcjioUmIR9dAMnA==</TransactionKey>
</DataEncryptionInfo>
<OrderData>lJ/v1HvOYAZKTPkxULH4mOcUy01+EaAsxLzCPhtieAo9m5AtU5URdyBVfmclHbtWe3ELb02lR37bChynq0Esqpljxx7CiB+kl/bVs7XkNQQmtGPlh08O7ApJ7AHdKPFFvE+SM2OWpSwUrqJGtmyaU6s+RM66o/3Q0wvKi4y3+Q2jm8nkiWZpPfNt52g4ReE9Ge86o+L+EBOBgZm634L5Z/i6pq908mXBAklPdk1ERdEgWONaOeYYmB70FToplR1gINJEF2CnfAtD/wV+DuQFPDth+EWHqhe3a4xO0d9eJ55ou2QCYOPUC2g/qz1sp7GR74W7P5IWJdmnUEuPFsKJ6OvM+1V8S06jZGDa/QhUGDK8F3G/TMP09W1MsrlQTRr3YQ5H43+pMY7I6Jysze+X9OKZZTTpv4GmYm1USjmraGyMuPF3j9hrlmpttK+1gg2WzytCJO44YsZp9ckls8JNK4bT5uwTuomKZoRgmiIOTcMh4VP7V28TWj2XdF+T6rBFILTvQyXMOzvbe1kLwg2O31JDBdJ8X1fHCYJxKsIrYCSDPz4sha8h7QmHrCSFmjoXb+LUElnbLXZVRkY5/Dc73EM6Es3wAgjwSJK2asRqdqU0PhbS5qpIlgYKsNcb+Wes</OrderData>
</DataTransfer>
<ReturnCode authenticate="true">000000</ReturnCode>
<TimestampBankParameter authenticate="true">2013-12-09T15:14:30.000Z</TimestampBankParameter>
</body>
</ebicsResponse>

43
test/fixtures/keys.js vendored Normal file
View File

@ -0,0 +1,43 @@
'use strict';
const publicSmallExpPEM = '';
const publicSmallExpMod = '';
const publicSmallExpExp = '';
const publicBigPEM = `-----BEGIN PUBLIC KEY-----
MIIBJDANBgkqhkiG9w0BAQEFAAOCAREAMIIBDAKCAQEAuvqhJ2ptulHGUmYq3BOO
NoIDXOUDrVV3s188wvU3Fj9TcO3yBqWuJ5GMEzRIOfi8Pb4AkJBjjPOR0Taby7+n
7coa2Zm0ZprGzXVM1Gb0aG3BAbDaFbvdF25NLAtkmtKKW/8YfXy89qvy6+UEBdOa
1UTLaR+9Pf63Wa+qu638udSDe3refHdZV1bKUR1UOZ/1iWn5b7aq4vITRPNNWXk5
eG8He2lWzYHg5+yY4ckBooh1K5cMwl5s+Iz24iWtqIlV5EyORbdfGatrNzv6S7Lx
FngEGCL5e97qU1pAcarE9XmrlJ5dHl9LQPaw957AlZuOFpVEE5shXZkSgRYrHv2m
cQIFAQAAAA8=
-----END PUBLIC KEY-----`;
const publicBigModString = 'ALr6oSdqbbpRxlJmKtwTjjaCA1zlA61Vd7NfPML1NxY/U3Dt8galrieRjBM0SDn4vD2+AJCQY4zzkdE2m8u/p+3KGtmZtGaaxs11TNRm9GhtwQGw2hW73RduTSwLZJrSilv/GH18vPar8uvlBAXTmtVEy2kfvT3+t1mvqrut/LnUg3t63nx3WVdWylEdVDmf9Ylp+W+2quLyE0TzTVl5OXhvB3tpVs2B4OfsmOHJAaKIdSuXDMJebPiM9uIlraiJVeRMjkW3Xxmrazc7+kuy8RZ4BBgi+Xve6lNaQHGqxPV5q5SeXR5fS0D2sPeewJWbjhaVRBObIV2ZEoEWKx79pnE=';
const publicBigModBytes = [0, 186, 250, 161, 39, 106, 109, 186, 81, 198, 82, 102, 42, 220, 19, 142, 54, 130, 3, 92, 229, 3, 173, 85, 119, 179, 95, 60, 194, 245, 55, 22, 63, 83, 112, 237, 242, 6, 165, 174, 39, 145, 140, 19, 52, 72, 57, 248, 188, 61, 190, 0, 144, 144, 99, 140, 243, 145, 209, 54, 155, 203, 191, 167, 237, 202, 26, 217, 153, 180, 102, 154, 198, 205, 117, 76, 212, 102, 244, 104, 109, 193, 1, 176, 218, 21, 187, 221, 23, 110, 77, 44, 11, 100, 154, 210, 138, 91, 255, 24, 125, 124, 188, 246, 171, 242, 235, 229, 4, 5, 211, 154, 213, 68, 203, 105, 31, 189, 61, 254, 183, 89, 175, 170, 187, 173, 252, 185, 212, 131, 123, 122, 222, 124, 119, 89, 87, 86, 202, 81, 29, 84, 57, 159, 245, 137, 105, 249, 111, 182, 170, 226, 242, 19, 68, 243, 77, 89, 121, 57, 120, 111, 7, 123, 105, 86, 205, 129, 224, 231, 236, 152, 225, 201, 1, 162, 136, 117, 43, 151, 12, 194, 94, 108, 248, 140, 246, 226, 37, 173, 168, 137, 85, 228, 76, 142, 69, 183, 95, 25, 171, 107, 55, 59, 250, 75, 178, 241, 22, 120, 4, 24, 34, 249, 123, 222, 234, 83, 90, 64, 113, 170, 196, 245, 121, 171, 148, 158, 93, 30, 95, 75, 64, 246, 176, 247, 158, 192, 149, 155, 142, 22, 149, 68, 19, 155, 33, 93, 153, 18, 129, 22, 43, 30, 253, 166, 113];
const publicBigExpString = 'AQAAAA8=';
const publicBigExpBytes = [1, 0, 0, 0, 15];
const pblc = {
big: {
pem: publicBigPEM,
mod: {
bytes: publicBigModBytes,
string: publicBigModString,
},
exp: {
bytes: publicBigExpBytes,
string: publicBigExpString,
},
},
small: {
pem: publicSmallExpPEM,
mod: publicSmallExpMod,
exp: publicSmallExpExp,
},
};
module.exports = {
pblc,
};

118
test/spec/H004.js Normal file
View File

@ -0,0 +1,118 @@
'use strict';
/* eslint-env node, mocha */
const { assert } = require('chai');
const path = require('path');
const fs = require('fs');
const ebics = require('../../');
const xmlLintWasm = require('xmllint-wasm');
const validateXML = (() => {
const xsdDir = path.resolve(__dirname, '../xsd');
const schemaPath = path.resolve(xsdDir, 'ebics_H004.xsd');
const schemaDoc = fs.readFileSync(schemaPath, { encoding: 'utf8' });
const preload = fs
.readdirSync(xsdDir)
.filter(file => file.endsWith('.xsd') && file !== 'ebics_H004.xsd')
.map(file => ({
fileName: file,
contents: fs.readFileSync(path.join(xsdDir, file), {
encoding: 'utf8',
}),
}));
return async (str) => {
const results = await xmlLintWasm.validateXML({
xml: { fileName: 'ebics.xml', contents: str },
schema: [
{
fileName: 'ebics_H004.xsd',
contents: schemaDoc,
},
],
preload,
});
return results.valid;
};
})();
const client = new ebics.Client({
url: 'https://iso20022test.credit-suisse.com/ebicsweb/ebicsweb',
partnerId: 'CRS04381',
userId: 'CRS04381',
hostId: 'CRSISOTB',
passphrase: 'test',
keyStorage: ebics.fsKeysStorage(
path.resolve(__dirname, '../support/TEST_KEYS.key'),
),
});
const { Orders } = ebics;
/*
upload :
const AZV = require('./AZV');
const CD1 = require('./CD1');
const CDB = require('./CDB');
const CDD = require('./CDD');
const CDS = require('./CDS');
const CCT = require('./CCT');
const CCS = require('./CCS');
const XE3 = require('./XE3');
const XCT = require('./XCT');
*/
const uploadBuilder = fn => fn('');
const dateBuilder = fn => fn('2018-01-01', '2019-01-01');
const fnOrders = {
// upload | document
AZV: uploadBuilder,
CD1: uploadBuilder,
CDB: uploadBuilder,
CDD: uploadBuilder,
CDS: uploadBuilder,
CCT: uploadBuilder,
CCS: uploadBuilder,
XE3: uploadBuilder,
XCT: uploadBuilder,
// download
STA: dateBuilder,
VMK: dateBuilder,
HAA: dateBuilder,
HTD: dateBuilder,
HPD: dateBuilder,
HKD: dateBuilder,
PTK: dateBuilder,
HAC: dateBuilder,
Z53: dateBuilder,
DKI: dateBuilder,
C53: dateBuilder,
C52: dateBuilder,
};
const getOrderObject = (name, order) => {
if (typeof order === 'object') return order;
if (fnOrders[name]) return fnOrders[name](order);
return null;
};
describe('H004 order generation', () => {
// eslint-disable-next-line no-restricted-syntax
for (const [name, orderDefinition] of Object.entries(Orders)) {
const order = getOrderObject(name, orderDefinition);
if (!order) continue;
const type = order.orderDetails.OrderType;
const { operation } = order;
it(`[${operation}] ${type} order generation`, async () => {
const signedOrder = await client.signOrder(order);
assert.isTrue(await validateXML(signedOrder));
});
}
});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,49 @@
'use strict';
/* eslint-env node, mocha */
const { assert } = require('chai');
const { join, resolve } = require('path');
const { readFileSync, mkdirSync, existsSync } = require('fs');
const BankLetter = require('../../lib/BankLetter');
const ebics = require('../../');
const client = new ebics.Client({
url: 'https://iso20022test.credit-suisse.com/ebicsweb/ebicsweb',
partnerId: 'CRS04381',
userId: 'CRS04381',
hostId: 'CRSISOTB',
passphrase: 'test',
keyStorage: ebics.fsKeysStorage(resolve(__dirname, '../support/TEST_KEYS.key')),
});
const createDir = (where) => {
try {
mkdirSync(where);
} catch (e) {
if (e.code !== 'EEXIST')
throw e;
}
};
describe('BankLetter', () => {
let bankLetterGenerator = null;
it('creates an instance', () => assert.doesNotThrow(() => {
bankLetterGenerator = new BankLetter({
client,
bankName: 'Credit Suisse AG',
template: readFileSync(join(__dirname, '../../templates/ini_de.hbs'), { encoding: 'utf8' }),
});
}));
it('genrates a letter', async () => assert.doesNotThrow(async () => bankLetterGenerator.generate()));
it('throws with invalid serliazitaion path', async () => bankLetterGenerator.serialize('').catch(e => assert.instanceOf(e, Error)));
it('serliaziers a letter to disk', async () => {
createDir('.test_tmp');
await bankLetterGenerator.serialize('.test_tmp/test_letter.html').then(t => assert.equal(t, true));
assert.equal(existsSync('.test_tmp/test_letter.html'), true);
});
});

47
test/unit/BigNumber.js Normal file
View File

@ -0,0 +1,47 @@
'use strict';
/* eslint-env node, mocha */
const { assert } = require('chai');
const { jsbn: { BigInteger } } = require('node-forge');
const BigNumber = require('../../lib/crypto/BigNumber');
const types = [
{ name: 'BigNumber', value: new BigNumber(11) },
{ name: 'BigInteger', value: new BigInteger('11') },
{ name: 'string with default radix', value: '11' },
{ name: 'string with radix 16', value: '0b', radix: 16 },
{ name: 'Buffer', value: Buffer.from('0b', 'hex') },
{ name: 'Array', value: [11] },
];
describe('BigNumber', () => {
describe('creating an instance', () => {
it('should throw with no value given', () => assert.throws(() => new BigNumber()));
it('should throw wrong value type', () => assert.throws(() => new BigNumber({})));
for (const { name, value, radix } of types) {
let instance;
describe(`out of ${name}`, () => {
it('create instance', () => assert.doesNotThrow(() => {
instance = new BigNumber(value, radix);
}));
it('toString with radix 10', () => assert.equal(instance.toString(), '11'));
it('toString with radix 16', () => assert.equal(instance.toString(16), '0b'));
it('toBEBuffer without length', () => assert.equal(instance.toBEBuffer().toString('hex'), '0b'));
it('toBEBuffer with length', () => assert.equal(instance.toBEBuffer(4).toString('hex'), '0000000b'));
});
}
});
describe('exports', () => {
it('toBEBuffer with too short length should throw', () => assert.throw(() => new BigNumber(837462187362).toBEBuffer(1)));
});
describe('operators', () => {
const num = new BigNumber(1);
it('and', () => assert.equal(num.and(1), 1));
it('mul', () => assert.equal(num.mul(2), 2));
it('mod', () => assert.equal(num.mod(1), 0));
it('shrn', () => assert.equal(num.shrn(1), 0));
});
});

29
test/unit/ClientTest.js Normal file
View File

@ -0,0 +1,29 @@
'use strict';
/* eslint-env node, mocha */
const { assert } = require('chai');
const { Client, fsKeysStorage, tracesStorage } = require('../../index.js');
describe('Client', () => {
describe('instantiating', () => {
it('should throw with no options provided', () => assert.throws(() => new Client()));
it('should throw with no url provided', () => assert.throws(() => new Client({})));
it('should throw with no partnerId provided', () => assert.throws(() => new Client({ url: 'https://myebics.com' })));
it('should throw with no userId provided', () => assert.throws(() => new Client({ url: 'https://myebics.com', partnerId: 'partnerId' })));
it('should throw with no hostId provided', () => assert.throws(() => new Client({ url: 'https://myebics.com', partnerId: 'partnerId', userId: 'userId' })));
it('should throw with no passphrase provided', () => assert.throws(() => new Client({
url: 'https://myebics.com', partnerId: 'partnerId', userId: 'userId', hostId: 'hostId',
})));
it('should throw with no keyStorage provided', () => assert.throws(() => new Client({
url: 'https://myebics.com', partnerId: 'partnerId', userId: 'userId', hostId: 'hostId', passphrase: 'test',
})));
it('should create an isntance without tracesStorage', () => assert.doesNotThrow(() => new Client({
url: 'https://myebics.com', partnerId: 'partnerId', userId: 'userId', hostId: 'hostId', passphrase: 'test', keyStorage: fsKeysStorage('./test.key'),
})));
it('should create an isntance with tracesStorage', () => assert.doesNotThrow(() => new Client({
url: 'https://myebics.com', partnerId: 'partnerId', userId: 'userId', hostId: 'hostId', passphrase: 'test', keyStorage: fsKeysStorage('./test.key'), tracesStorage: tracesStorage('./'),
})));
});
});

92
test/unit/keys.js Normal file
View File

@ -0,0 +1,92 @@
'use strict';
/* eslint-env node, mocha */
const { assert } = require('chai');
const fixtures = require('../fixtures/keys');
// const Key = require('../lib/keymanagers/keyRSA');
const Key = require('../../lib/keymanagers/Key');
const stripWhitespace = str => str.replace(/\s+/g, '');
describe('Keys management', () => {
describe('generates brand new', () => {
const keySize = 2048;
// const newKey = Key().generate(keySize);
const newKey = Key.generate();
it('private key', () => {
assert.isTrue(newKey.isPrivate());
});
it('that has the right key size', () => {
// const newKeySize = newKey.size(); // console.log(newKey.size());
assert(newKey.size(), keySize);
});
});
describe('creates public key from mod and exp', () => {
const { pem, mod, exp } = fixtures.pblc.big;
describe('that are strings', () => {
const m = Buffer.from(mod.string, 'base64');
const e = Buffer.from(exp.string, 'base64');
/* const newKey = Key().importKey({
mod: m, exp: e, modulus: mod.string, exponent: exp.string,
}); */
const newKey = new Key({ mod: m, exp: e });
it('and is really public', () => {
assert.isTrue(newKey.isPublic());
});
it('and has a propper mod in bytes', () => {
assert.deepEqual([...newKey.n()], mod.bytes);
});
it('and has a propper pem string', () => {
assert.equal(stripWhitespace(newKey.toPem()), stripWhitespace(pem));
});
});
describe('that are bytes', () => {
const m = Buffer.from(mod.bytes);
const e = Buffer.from(exp.bytes);
/* const newKey = Key().importKey({
mod: m, exp: e, modulus: mod.string, exponent: exp.string,
}); */
const newKey = new Key({ mod: m, exp: e });
it('and is really public', () => {
assert.isTrue(newKey.isPublic());
});
it('and has a propper mod as a string', () => {
assert.equal(newKey.n().toString('base64'), mod.string);
});
it('and has a propper pem string', () => {
assert.equal(stripWhitespace(newKey.toPem()), stripWhitespace(pem));
});
});
});
describe('creates public key from pem string', () => {
const { pem } = fixtures.pblc.big;
// const newKey = Key(pem);
const newKey = new Key({ pem });
it('and is really public', () => {
assert.isTrue(newKey.isPublic());
});
it('and has a propper(the same) pem string', () => {
/* newKey.pempem = {
modulus: mod.string,
exponent: exp.string,
}; */
assert.equal(stripWhitespace(newKey.toPem()), stripWhitespace(pem));
});
});
});

41
test/unit/middlewares.js Normal file
View File

@ -0,0 +1,41 @@
'use strict';
/* eslint-env node, mocha */
const { assert } = require('chai');
const { resolve } = require('path');
const response = require('../../lib/middleware/response');
const serializer = require('../../lib/middleware/serializer');
const signer = require('../../lib/middleware/signer');
const ebics = require('../../');
const client = new ebics.Client({
url: 'https://iso20022test.credit-suisse.com/ebicsweb/ebicsweb',
partnerId: 'CRS04381',
userId: 'CRS04381',
hostId: 'CRSISOTB',
passphrase: 'test',
keyStorage: ebics.fsKeysStorage(resolve(__dirname, '../support/TEST_KEYS.key')),
});
describe('Middlewares', () => {
describe('Response Middleware', () => {
it('should not throw with supported protocol version', () => assert.doesNotThrow(() => response.version('H004')));
it('should throw with no unsupported protocol version', () => assert.throws(() => response.version('H003')));
});
describe('Signer Middleware', () => {
it('should not throw with supported protocol version', () => assert.doesNotThrow(() => signer.version('H004')));
it('should throw with no unsupported protocol version', () => assert.throws(() => signer.version('H003')));
});
describe('Serializer Middleware', () => {
it('should not throw with supported protocol version and ini operation', () => assert.doesNotThrow(() => serializer.use(ebics.Orders.INI, client)));
it('should not throw with supported protocol version and download operation', () => assert.doesNotThrow(() => serializer.use(ebics.Orders.STA('2018-01-01', '2018-02-01'), client)));
it('should not throw with supported protocol version and upload operation', () => assert.doesNotThrow(() => serializer.use(ebics.Orders.AZV('<xml />'), client)));
it('should throw with no supported protocol version and ', () => assert.throws(() => serializer.use({ version: 'H004', operation: 'unspported' }, client)));
it('should throw with no unuspported protocol version', () => assert.throws(() => serializer.use({ version: 'H003' }, client)));
});
});

111
test/unit/responseParser.js Normal file
View File

@ -0,0 +1,111 @@
'use strict';
/* eslint-env node, mocha */
const { readFileSync } = require('fs');
const { join, resolve } = require('path');
const { assert } = require('chai');
const H004Response = require('../../lib/orders/H004/response');
const ebics = require('../../');
const client = new ebics.Client({
url: 'https://iso20022test.credit-suisse.com/ebicsweb/ebicsweb',
partnerId: 'CRS04381',
userId: 'CRS04381',
hostId: 'CRSISOTB',
passphrase: 'test',
keyStorage: ebics.fsKeysStorage(resolve(__dirname, '../support/TEST_KEYS.key')),
});
const buildResponse = (xmlPath) => {
const response = H004Response('<xml/>', {});
const xml = readFileSync(xmlPath, { encoding: 'utf8' });
response.orderData = () => xml;
return response;
};
const fixtures = {
HPB: async () => H004Response(readFileSync(join(__dirname, '../fixtures/HPB_response.xml'), { encoding: 'utf8' }), await client.keys()),
HPB_DATA: () => buildResponse(join(__dirname, '../fixtures/HPB_response_data.xml')),
INI: () => H004Response(readFileSync(join(__dirname, '../fixtures/INI_reposne.xml'), { encoding: 'utf8' }), client.keys()),
STA_1: () => H004Response(readFileSync(join(__dirname, '../fixtures/STA_response_part1.xml'), { encoding: 'utf8' }), client.keys()),
STA_2: () => H004Response(readFileSync(join(__dirname, '../fixtures/STA_response_part2.xml'), { encoding: 'utf8' }), client.keys()),
x002mod: 'AJWVHQIfP0H1fr5Y7IjSlDmFksqQ+0E+CjzbEeE6r444LCuSXwbGKF6DJqguyX1qGYxjHRvVtdkNa+GNAtlZnmuPeLHPBUOs5Zx9J5JP4JZOcKd/wnRDIasTkg3NrtZ22tjOrWx26VuR6h7dUH2oJRnFDHmbXoCDMxkqJUNr/TM89p5slJ9Oj5+NAaOzm+7AlwbJ95EI/xc2jEfhp+GdF9CYdS/m2AZaAt79y6QDtBSDdAs0OHTgsOIjbjZkptBF/Gkip2sOordjsChRNLHLDcAOWbsg1NVMuhXs1b6+bCVLXQcGhFydYhqvrXB7pFS0++hlyzqGhbZK5cwEe/v8EJk=',
e002mod: 'AJWVHQIfP0H1fr5Y7IjSlDmFksqQ+0E+CjzbEeE6r444LCuSXwbGKF6DJqguyX1qGYxjHRvVtdkNa+GNAtlZnmuPeLHPBUOs5Zx9J5JP4JZOcKd/wnRDIasTkg3NrtZ22tjOrWx26VuR6h7dUH2oJRnFDHmbXoCDMxkqJUNr/TM89p5slJ9Oj5+NAaOzm+7AlwbJ95EI/xc2jEfhp+GdF9CYdS/m2AZaAt79y6QDtBSDdAs0OHTgsOIjbjZkptBF/Gkip2sOordjsChRNLHLDcAOWbsg1NVMuhXs1b6+bCVLXQcGhFydYhqvrXB7pFS0++hlyzqGhbZK5cwEe/v8EJk=',
};
describe('H004 response parsing', () => {
it('parses bank keys', () => {
const response = fixtures.HPB_DATA();
const bankKeys = response.bankKeys();
assert.equal(bankKeys.bankX002.mod.toString('base64'), fixtures.x002mod);
assert.equal(bankKeys.bankE002.mod.toString('base64'), fixtures.e002mod);
});
it('detects unsegmented response', () => {
const response = fixtures.HPB_DATA();
assert.equal(response.isSegmented(), false);
assert.equal(response.isLastSegment(), false);
});
it('detects segmented response', () => {
const responsePart1 = fixtures.STA_1();
const responsePart2 = fixtures.STA_2();
assert.equal(responsePart1.isSegmented(), true);
assert.equal(responsePart1.isLastSegment(), false);
assert.equal(responsePart2.isSegmented(), true);
assert.equal(responsePart2.isLastSegment(), true);
});
it('parses OrderID', () => {
const response = fixtures.INI();
assert.equal(response.orderId(), 'B004');
});
it('parses BuissnessCode', () => {
const response = fixtures.INI();
const code = response.businessCode();
assert.equal(code, '000000');
assert.equal(response.businessSymbol(code), 'EBICS_OK');
assert.equal(response.businessMeaning(code), 'No technical errors occurred during processing of the EBICS request');
assert.equal(response.businessShortText(code), 'OK');
});
it('parses TechnicalCode', () => {
const response = fixtures.INI();
const code = response.technicalCode();
assert.equal(code, '000000');
assert.equal(response.technicalSymbol(code), '[EBICS_OK] OK');
assert.equal(response.technicalMeaning(code), 'No technical errors occurred during processing of the EBICS request');
assert.equal(response.technicalShortText(code), 'OK');
});
it('parses TransactionID', () => {
const response = fixtures.STA_1();
const code = response.transactionId();
assert.equal(code, 'ECD6F062AAEDFA77250526A68CBEC549');
});
it('parses TransactionKey', async () => {
const response = await fixtures.HPB();
const code = response.transactionKey().toString('base64');
assert.equal(code, '2OTepxiy49uayuzZlYFf8Q==');
});
it('parses OrderData', async () => {
const response = await fixtures.HPB();
const orderBuffer = response.orderData();
assert.deepEqual(orderBuffer, readFileSync(join(__dirname, '../fixtures/HPB_response_data.xml')));
});
it('generates XML', async () => {
const response = await fixtures.HPB();
const xmlString = response.toXML().replace('\\n', '\n');
assert.deepEqual(xmlString, readFileSync(join(__dirname, '../fixtures/HPB_response.xml'), { encoding: 'utf8' }));
});
});

29
test/unit/utils.js Normal file
View File

@ -0,0 +1,29 @@
'use strict';
/* eslint-env node, mocha */
const { assert } = require('chai');
const utils = require('../../lib/utils');
describe('utils', () => {
describe('dateRange', () => {
describe('dateRange', () => {
it('should generate empty object with partial parameters', () => {
assert.isEmpty(utils.dateRange());
});
it('should throw with invalid date', () => {
assert.throws(() => utils.dateRange('2018-15-15', '2018-20-20'));
});
it('should work for valid string input', () => {
assert.containsAllDeepKeys(utils.dateRange('2018-01-15', '2018-01-20'), { DateRange: { Start: '2018-01-15', End: '2018-01-20' } });
});
it('should work for Date string input', () => {
assert.containsAllDeepKeys(utils.dateRange(new Date('2018-01-15'), new Date('2018-01-20')), { DateRange: { Start: '2018-01-15', End: '2018-01-20' } });
});
it('should work for timestamp string input', () => {
assert.containsAllDeepKeys(utils.dateRange(new Date('2018-01-15').getTime(), new Date('2018-01-20').getTime()), { DateRange: { Start: '2018-01-15', End: '2018-01-20' } });
});
});
});
});

11
test/xsd/ebics_H004.xsd Executable file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ebics="urn:org:ebics:H004" targetNamespace="urn:org:ebics:H004" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<annotation>
<documentation xml:lang="de">ebics_H004.xsd inkludiert alle Schemadateien des EBICS-Protokolls, um die Eindeutigkeit von Element- und Typnamen im EBCIS Namespace zu erzwingen.</documentation>
<documentation xml:lang="en">ebics_H004.xsd includes all schema files for the EBICS protocol in order to enforce unique element and type names in the EBICS namespace.</documentation>
</annotation>
<include schemaLocation="ebics_request_H004.xsd"/>
<include schemaLocation="ebics_response_H004.xsd"/>
<include schemaLocation="ebics_keymgmt_request_H004.xsd"/>
<include schemaLocation="ebics_keymgmt_response_H004.xsd"/>
</schema>

135
test/xsd/ebics_hev.xsd Executable file
View File

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ebics="http://www.ebics.org/H000" targetNamespace="http://www.ebics.org/H000" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<xs:annotation>
<xs:documentation xml:lang="de">ebics_hev.xsd ist das EBICS-Protokollschema entweder für Anfragen oder Rückmeldungen der Bank zu unterstützten EBICS-Versionen.</xs:documentation>
<xs:documentation xml:lang="en">ebics_hev.xsd is the appropriate EBICS protocol schema either for requests or responses according the EBICS versions supported by a bank.</xs:documentation>
</xs:annotation>
<xs:simpleType name="HostIDType">
<xs:annotation>
<xs:documentation xml:lang="de">Datentyp für die Host-ID.</xs:documentation>
<xs:documentation xml:lang="en">Dataype for Host-ID.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:maxLength value="35"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="OrderTBaseType">
<xs:annotation>
<xs:documentation xml:lang="de">Datentyp für allgemeine Auftragsarten (Grundtyp).</xs:documentation>
<xs:documentation xml:lang="en">Datatype for general order types (basic type).</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:length value="3"/>
<xs:pattern value="HEV"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ReturnCodeType">
<xs:annotation>
<xs:documentation xml:lang="de">Datentyp für Antwortcodes.</xs:documentation>
<xs:documentation xml:lang="en">Datatype for the return code</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:length value="6"/>
<xs:pattern value="\d{6}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ReportTextType">
<xs:annotation>
<xs:documentation xml:lang="de">Datentyp für den Erklärungstext zum Antwortcode.</xs:documentation>
<xs:documentation xml:lang="en">Datatype for report text with respect to the return code</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:normalizedString">
<xs:maxLength value="256"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="VersionNumberType">
<xs:annotation>
<xs:documentation xml:lang="de">Datentyp für eine Versionsnummer</xs:documentation>
<xs:documentation xml:lang="en">Datatype for a release number </xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:length value="5"/>
<xs:pattern value="[0-9]{2}[.][0-9]{2}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ProtocolVersionType">
<xs:annotation>
<xs:documentation xml:lang="de">Datentyp für Versionsnummer des EBICS-schemas</xs:documentation>
<xs:documentation xml:lang="en">Datatype for release-number of the EBICS scheme</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:length value="4"/>
<xs:pattern value="H\d{3}"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="SystemReturnCodeType">
<xs:annotation>
<xs:documentation xml:lang="de">Datentyp für technische Fehler.</xs:documentation>
<xs:documentation xml:lang="en">Datatype for technical error</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="ReturnCode" type="ebics:ReturnCodeType">
<xs:annotation>
<xs:documentation xml:lang="de">Rückmeldung des Ausführungsstatus mit einer eindeutigen Fehlernummer.</xs:documentation>
<xs:documentation xml:lang="en">Confirmation of the carried out status with a unique error code.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ReportText" type="ebics:ReportTextType">
<xs:annotation>
<xs:documentation xml:lang="de">Klartext der Rückmeldung des Ausführungsstatus.</xs:documentation>
<xs:documentation xml:lang="en">Clear text of the response (carried out status).</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="HEVRequestDataType">
<xs:annotation>
<xs:documentation xml:lang="de">Datentyp für die Request-Daten</xs:documentation>
<xs:documentation xml:lang="en">Data type for Request data</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="HostID" type="ebics:HostIDType"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="HEVResponseDataType">
<xs:annotation>
<xs:documentation xml:lang="en">Datentyp für die Response-Daten</xs:documentation>
<xs:documentation xml:lang="en">Data type for Request data</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="SystemReturnCode" type="ebics:SystemReturnCodeType"/>
<xs:element name="VersionNumber" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation xml:lang="de">Von der Bank unterstützte EBICS-Versionen, z.B. 2.4</xs:documentation>
<xs:documentation xml:lang="en">EBICS-releases supported by the bank, e.g. 2.4</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="ebics:VersionNumberType">
<xs:attribute name="ProtocolVersion" type="ebics:ProtocolVersionType" use="required">
<xs:annotation>
<xs:documentation xml:lang="de">der EBICS-Version eindeutig zugeordnete Schema-Version, z.B. H003</xs:documentation>
<xs:documentation xml:lang="en">EBICS-scheme-version, e.g. H003, well-defined for EBICS-release-Version</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:element name="ebicsHEVRequest" type="ebics:HEVRequestDataType">
<xs:annotation>
<xs:documentation xml:lang="de">Requestdaten</xs:documentation>
<xs:documentation xml:lang="en">request data</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ebicsHEVResponse" type="ebics:HEVResponseDataType">
<xs:annotation>
<xs:documentation xml:lang="de">Responsedaten</xs:documentation>
<xs:documentation xml:lang="en">response data</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,543 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Mit XMLSpy v2008 rel. 2 sp2 (http://www.altova.com) von benutzerservice benutzerservice (SIZ GmbH) bearbeitet -->
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ebics="urn:org:ebics:H004" targetNamespace="urn:org:ebics:H004" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<annotation>
<documentation xml:lang="de">ebics_keymgmt_request_H004.xsd ist das EBICS-Protokollschema für Schlüsselmanagement-Anfragen (HIA, HPB, HSA, INI).</documentation>
</annotation>
<import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd">
<annotation>
<documentation xml:lang="de">XML-Signature.</documentation>
</annotation>
</import>
<include schemaLocation="ebics_types_H004.xsd"/>
<include schemaLocation="ebics_orders_H004.xsd"/>
<complexType name="StaticHeaderBaseType" abstract="true">
<annotation>
<documentation xml:lang="de">Datentyp für den statischen EBICS-Header (allgemein).</documentation>
</annotation>
<sequence>
<element name="HostID" type="ebics:HostIDType">
<annotation>
<documentation xml:lang="de">Hostname des Banksystems.</documentation>
</annotation>
</element>
<element name="Nonce" type="ebics:NonceType" minOccurs="0">
<annotation>
<documentation xml:lang="de">Zufallswert; damit wird die Initialisierungsnachricht des Clients einzigartig; nur anzugeben, falls Authentifikationssignatur vorhanden.</documentation>
</annotation>
</element>
<element name="Timestamp" type="ebics:TimestampType" minOccurs="0">
<annotation>
<documentation xml:lang="de">aktueller Zeitstempel zur Begrenzung der serverseitigen Nonce-Speicherung; nur anzugeben, falls Authentifikationssignatur vorhanden.</documentation>
</annotation>
</element>
<element name="PartnerID" type="ebics:PartnerIDType">
<annotation>
<documentation xml:lang="de">Kunden-ID des serverseitig administrierten Kunden.</documentation>
</annotation>
</element>
<element name="UserID" type="ebics:UserIDType">
<annotation>
<documentation xml:lang="de">Teilnehmer-ID des serverseitig zu diesem Kunden administrierten Teilnehmers.</documentation>
</annotation>
</element>
<element name="SystemID" type="ebics:UserIDType" minOccurs="0">
<annotation>
<documentation xml:lang="de">technische User-ID für Multi-User-Systeme.</documentation>
</annotation>
</element>
<element name="Product" type="ebics:ProductElementType" nillable="true" minOccurs="0">
<annotation>
<documentation xml:lang="de">Kennung des Kundenprodukts bzw. Herstellerkennung oder Name.</documentation>
</annotation>
</element>
<element name="OrderDetails" type="ebics:OrderDetailsType">
<annotation>
<documentation xml:lang="de">Auftragsdetails.</documentation>
</annotation>
</element>
<element name="SecurityMedium" type="ebics:SecurityMediumType">
<annotation>
<documentation xml:lang="de">Angabe des Sicherheitsmediums, das der Kunde verwendet.</documentation>
</annotation>
</element>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="OrderDetailsType" abstract="true">
<annotation>
<documentation xml:lang="de">Datentyp für OrderDetails im statischen EBICS-Header (allgemein).</documentation>
</annotation>
<sequence>
<element name="OrderType" type="ebics:OrderTBaseType">
<annotation>
<documentation xml:lang="de">Auftragsart.</documentation>
</annotation>
</element>
<element name="OrderAttribute" type="ebics:OrderAttributeBaseType">
<annotation>
<documentation xml:lang="de">Auftragsattribut.</documentation>
</annotation>
</element>
</sequence>
</complexType>
<complexType name="ProductElementType">
<annotation>
<documentation xml:lang="de">Datentyp für Element mit Kennung des Kundenprodukts bzw. Herstellerkennung oder Name.</documentation>
</annotation>
<simpleContent>
<extension base="ebics:ProductType">
<attribute name="Language" type="ebics:LanguageType" use="required">
<annotation>
<documentation xml:lang="de">Sprachkennzeichen der Kundenproduktversion (gemäß ISO 639).</documentation>
</annotation>
</attribute>
<attribute name="InstituteID" type="ebics:InstituteIDType" use="optional">
<annotation>
<documentation xml:lang="de">Kennung des Herausgebers des Kundenprodukts bzw. des betreuenden Kreditinstituts.</documentation>
</annotation>
</attribute>
</extension>
</simpleContent>
</complexType>
<complexType name="EmptyMutableHeaderType">
<annotation>
<documentation xml:lang="de">Datentyp für den leeren variablen EBICS-Header von Key Managemen Aufträgen.</documentation>
</annotation>
<sequence>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
<element name="ebicsUnsecuredRequest">
<annotation>
<documentation>Anfragestruktur für ungesicherte Auftragsarten HIA (Authentifikations- und Verschlüsselungsschlüssel senden) und INI (bankfachllichen Schlüssel senden).</documentation>
</annotation>
<complexType>
<sequence>
<element name="header">
<annotation>
<documentation xml:lang="de">enthält die technischen Transaktionsdaten.</documentation>
</annotation>
<complexType>
<sequence>
<element name="static" type="ebics:UnsecuredRequestStaticHeaderType">
<annotation>
<documentation xml:lang="de">enhält alle festen Headereinträge.</documentation>
</annotation>
</element>
<element name="mutable" type="ebics:EmptyMutableHeaderType">
<annotation>
<documentation xml:lang="de">enthält alle variablen Headereinträge.</documentation>
</annotation>
</element>
</sequence>
<attributeGroup ref="ebics:AuthenticationMarker"/>
</complexType>
</element>
<element name="body">
<annotation>
<documentation xml:lang="de">enthält die Auftragsdaten.</documentation>
</annotation>
<complexType>
<sequence>
<annotation>
<documentation xml:lang="de"/>
</annotation>
<element name="DataTransfer">
<annotation>
<documentation xml:lang="de">Transfer von Auftragsdaten.</documentation>
</annotation>
<complexType>
<sequence>
<element name="OrderData">
<annotation>
<documentation xml:lang="de">enthält Auftragsdaten.</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="ebics:OrderDataType">
<anyAttribute namespace="##targetNamespace" processContents="lax"/>
</extension>
</simpleContent>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
<attributeGroup ref="ebics:VersionAttrGroup"/>
</complexType>
</element>
<complexType name="UnsecuredRequestStaticHeaderType">
<annotation>
<documentation xml:lang="de">Datentyp für den statischen EBICS-Header bei ungesicherten Sendeauftragsarten (Aufträge HIA und INI): kein Nonce, kein Timestamp, keine EU-Datei, keine X001 Authentifizierung, keine Verschlüsselung, keine Digests der öffentlichen Bankschlüssel, Nutzdaten komprimiert, Auftragsattribut DZNNN</documentation>
</annotation>
<complexContent>
<restriction base="ebics:StaticHeaderBaseType">
<sequence>
<element name="HostID" type="ebics:HostIDType">
<annotation>
<documentation xml:lang="de">Hostname des Banksystems.</documentation>
</annotation>
</element>
<element name="Nonce" type="ebics:NonceType" minOccurs="0" maxOccurs="0">
<annotation>
<documentation xml:lang="de">Zufallswert; damit wird die Initialisierungsnachricht des Clients einzigartig; nicht anzugeben für ebicsUnsecuredRequest.</documentation>
</annotation>
</element>
<element name="Timestamp" type="ebics:TimestampType" minOccurs="0" maxOccurs="0">
<annotation>
<documentation xml:lang="de">aktueller Zeitstempel zur Begrenzung der serverseitigen Nonce-Speicherung; nicht anzugeben für ebicsUnsecuredRequest.</documentation>
</annotation>
</element>
<element name="PartnerID" type="ebics:PartnerIDType">
<annotation>
<documentation xml:lang="de">Kunden-ID des serverseitig administrierten Kunden.</documentation>
</annotation>
</element>
<element name="UserID" type="ebics:UserIDType">
<annotation>
<documentation xml:lang="de">Teilnehmer-ID des serverseitig zu diesem Kunden administrierten Teilnehmers.</documentation>
</annotation>
</element>
<element name="SystemID" type="ebics:UserIDType" minOccurs="0">
<annotation>
<documentation xml:lang="de">technische User-ID für Multi-User-Systeme.</documentation>
</annotation>
</element>
<element name="Product" type="ebics:ProductElementType" nillable="true" minOccurs="0">
<annotation>
<documentation xml:lang="de">Kennung des Kundenprodukts bzw. Herstellerkennung oder Name.</documentation>
</annotation>
</element>
<element name="OrderDetails" type="ebics:UnsecuredReqOrderDetailsType">
<annotation>
<documentation xml:lang="de">Auftragsdetails.</documentation>
</annotation>
</element>
<element name="SecurityMedium" type="ebics:SecurityMediumType">
<annotation>
<documentation xml:lang="de">Angabe des Sicherheitsmediums, das der Kunde verwendet.</documentation>
</annotation>
</element>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</restriction>
</complexContent>
</complexType>
<complexType name="UnsecuredReqOrderDetailsType">
<annotation>
<documentation xml:lang="de">Datentyp für OrderDetails im statischen EBICS-Header von ebicsUnsecuredRequest.</documentation>
</annotation>
<complexContent>
<restriction base="ebics:OrderDetailsType">
<sequence>
<element name="OrderType" type="ebics:OrderTBaseType">
<annotation>
<documentation xml:lang="de">Auftragsart.</documentation>
</annotation>
</element>
<element name="OrderAttribute" type="ebics:OrderAttributeBaseType" fixed="DZNNN">
<annotation>
<documentation xml:lang="de">Auftragsattribut: DZNNN.</documentation>
</annotation>
</element>
</sequence>
</restriction>
</complexContent>
</complexType>
<element name="ebicsNoPubKeyDigestsRequest">
<annotation>
<documentation>Anfragestruktur für Auftragsarten ohne Übertragung der Digests der öffentlichen Bankschlüssel (HPB Bankschlüssel abholen).</documentation>
</annotation>
<complexType>
<sequence>
<element name="header">
<annotation>
<documentation xml:lang="de">enthält die technischen Transaktionsdaten.</documentation>
</annotation>
<complexType>
<sequence>
<element name="static" type="ebics:NoPubKeyDigestsRequestStaticHeaderType">
<annotation>
<documentation xml:lang="de">enhält alle festen Headereinträge.</documentation>
</annotation>
</element>
<element name="mutable" type="ebics:EmptyMutableHeaderType">
<annotation>
<documentation xml:lang="de">enthält alle variablen Headereinträge.</documentation>
</annotation>
</element>
</sequence>
<attributeGroup ref="ebics:AuthenticationMarker"/>
</complexType>
</element>
<element ref="ebics:AuthSignature">
<annotation>
<documentation xml:lang="de">Authentifikationssignatur.</documentation>
</annotation>
</element>
<element name="body">
<annotation>
<documentation xml:lang="de">enthält optionale Zertifikate (vorgesehen).</documentation>
</annotation>
<complexType>
<sequence>
<annotation>
<documentation xml:lang="de"/>
</annotation>
<element ref="ds:X509Data" minOccurs="0" maxOccurs="0">
<annotation>
<documentation xml:lang="de">X.509-Daten des Teilnehmers.</documentation>
</annotation>
</element>
</sequence>
</complexType>
</element>
</sequence>
<attributeGroup ref="ebics:VersionAttrGroup"/>
</complexType>
</element>
<complexType name="NoPubKeyDigestsRequestStaticHeaderType">
<annotation>
<documentation xml:lang="de">Datentyp für den statischen EBICS-Header bei Aufträgen ohne Übertragung der Digests der Bankschlüssel (Auftrag HBP): keine Digests der öffentlichen Bankschlüssel, keine EU-Datei, keine Nutzdaten, OrderId optional!, Nonce, Timestamp, X001 Authentifizierung, Auftragsattribut DZHNN</documentation>
</annotation>
<complexContent>
<restriction base="ebics:StaticHeaderBaseType">
<sequence>
<element name="HostID" type="ebics:HostIDType">
<annotation>
<documentation xml:lang="de">Hostname des Banksystems.</documentation>
</annotation>
</element>
<element name="Nonce" type="ebics:NonceType">
<annotation>
<documentation xml:lang="de">Zufallswert; damit wird die Initialisierungsnachricht des Clients einzigartig.</documentation>
</annotation>
</element>
<element name="Timestamp" type="ebics:TimestampType">
<annotation>
<documentation xml:lang="de">aktueller Zeitstempel zur Begrenzung der serverseitigen Nonce-Speicherung.</documentation>
</annotation>
</element>
<element name="PartnerID" type="ebics:PartnerIDType">
<annotation>
<documentation xml:lang="de">Kunden-ID des serverseitig administrierten Kunden.</documentation>
</annotation>
</element>
<element name="UserID" type="ebics:UserIDType">
<annotation>
<documentation xml:lang="de">Teilnehmer-ID des serverseitig zu diesem Kunden administrierten Teilnehmers.</documentation>
</annotation>
</element>
<element name="SystemID" type="ebics:UserIDType" minOccurs="0">
<annotation>
<documentation xml:lang="de">technische User-ID für Multi-User-Systeme.</documentation>
</annotation>
</element>
<element name="Product" type="ebics:ProductElementType" nillable="true" minOccurs="0">
<annotation>
<documentation xml:lang="de">Kennung des Kundenprodukts bzw. Herstellerkennung oder Name.</documentation>
</annotation>
</element>
<element name="OrderDetails" type="ebics:NoPubKeyDigestsReqOrderDetailsType">
<annotation>
<documentation xml:lang="de">Auftragsdetails.</documentation>
</annotation>
</element>
<element name="SecurityMedium" type="ebics:SecurityMediumType">
<annotation>
<documentation xml:lang="de">Angabe des Sicherheitsmediums, das der Kunde verwendet.</documentation>
</annotation>
</element>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</restriction>
</complexContent>
</complexType>
<complexType name="NoPubKeyDigestsReqOrderDetailsType">
<annotation>
<documentation xml:lang="de">Datentyp für OrderDetails im statischen EBICS-Header von ebicsNoPubKeyDigestsRequest.</documentation>
</annotation>
<complexContent>
<restriction base="ebics:OrderDetailsType">
<sequence>
<element name="OrderType" type="ebics:OrderTBaseType">
<annotation>
<documentation xml:lang="de">Auftragsart.</documentation>
</annotation>
</element>
<element name="OrderAttribute" type="ebics:OrderAttributeBaseType" fixed="DZHNN">
<annotation>
<documentation xml:lang="de">Auftragsattribut: DZHNN.</documentation>
</annotation>
</element>
</sequence>
</restriction>
</complexContent>
</complexType>
<element name="ebicsUnsignedRequest">
<annotation>
<documentation xml:lang="en">The structure for uploads contains order data and the ESs, but without an authentication signature and data digest of bank keys.</documentation>
<documentation>Anfragestruktur für Sendeaufträge mit EU-Datei und Nutzdaten aber ohne Authentifizierungssignatur und Digests der Bankschlüssel.</documentation>
</annotation>
<complexType>
<sequence>
<element name="header">
<annotation>
<documentation xml:lang="en">Contains technical transaction data.</documentation>
<documentation xml:lang="de">enthält die technischen Transaktionsdaten.</documentation>
</annotation>
<complexType>
<sequence>
<element name="static" type="ebics:UnsignedRequestStaticHeaderType">
<annotation>
<documentation xml:lang="en">Contains all fixed header entries.</documentation>
<documentation xml:lang="de">enhält alle festen Headereinträge.</documentation>
</annotation>
</element>
<element name="mutable" type="ebics:EmptyMutableHeaderType">
<annotation>
<documentation xml:lang="en">Contains all mutable header entries.</documentation>
<documentation xml:lang="de">enthält alle variablen Headereinträge.</documentation>
</annotation>
</element>
</sequence>
<attributeGroup ref="ebics:AuthenticationMarker"/>
</complexType>
</element>
<element name="body">
<annotation>
<documentation xml:lang="en">Contains the order data and the ESs.</documentation>
<documentation xml:lang="de">enthält die Auftragsdaten und EUs.</documentation>
</annotation>
<complexType>
<sequence>
<annotation>
<documentation xml:lang="de"/>
</annotation>
<element name="DataTransfer">
<annotation>
<documentation xml:lang="en">Transfer of order data and the ESs.</documentation>
<documentation xml:lang="de">Transfer von Auftragsdaten und EUs.</documentation>
</annotation>
<complexType>
<sequence>
<element name="SignatureData">
<annotation>
<documentation xml:lang="en">Contains the ESs.</documentation>
<documentation xml:lang="de">enthält Signaturdaten (EUs).</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="ebics:SignatureDataType">
<attributeGroup ref="ebics:AuthenticationMarker"/>
</extension>
</simpleContent>
</complexType>
</element>
<element name="OrderData">
<annotation>
<documentation xml:lang="en">Contains the order data</documentation>
<documentation xml:lang="de">enthält Auftragsdaten.</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="ebics:OrderDataType">
<anyAttribute namespace="##targetNamespace" processContents="lax"/>
</extension>
</simpleContent>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
<attributeGroup ref="ebics:VersionAttrGroup"/>
</complexType>
</element>
<complexType name="UnsignedRequestStaticHeaderType">
<annotation>
<documentation xml:lang="de">Datentyp für den statischen EBICS-Header für ebicsUnsignedRequest.Datentyp für den statischen EBICS-Header bei Aufträgen ohne Authentifizierungssignatur (Auftrag HSA): keine X001 Authentifizierung, keine Digests der öffentlichen Bankschlüssel, EU-Datei, Nutzdaten, Nonce, Timestamp, OrderId, Auftragsattribut OZNNN</documentation>
</annotation>
<complexContent>
<restriction base="ebics:StaticHeaderBaseType">
<sequence>
<element name="HostID" type="ebics:HostIDType">
<annotation>
<documentation xml:lang="de">Hostname des Banksystems.</documentation>
</annotation>
</element>
<element name="Nonce" type="ebics:NonceType" minOccurs="0" maxOccurs="0">
<annotation>
<documentation xml:lang="de">Zufallswert; damit wird die Initialisierungsnachricht des Clients einzigartig; nicht anzugeben bei ebicsUnsignedRequest.</documentation>
</annotation>
</element>
<element name="Timestamp" type="ebics:TimestampType" minOccurs="0" maxOccurs="0">
<annotation>
<documentation xml:lang="de">aktueller Zeitstempel zur Begrenzung der serverseitigen Nonce-Speicherung; nicht anzugeben bei ebicsUnsignedRequest.</documentation>
</annotation>
</element>
<element name="PartnerID" type="ebics:PartnerIDType">
<annotation>
<documentation xml:lang="de">Kunden-ID des serverseitig administrierten Kunden.</documentation>
</annotation>
</element>
<element name="UserID" type="ebics:UserIDType">
<annotation>
<documentation xml:lang="de">Teilnehmer-ID des serverseitig zu diesem Kunden administrierten Teilnehmers.</documentation>
</annotation>
</element>
<element name="SystemID" type="ebics:UserIDType" minOccurs="0">
<annotation>
<documentation xml:lang="de">technische User-ID für Multi-User-Systeme.</documentation>
</annotation>
</element>
<element name="Product" type="ebics:ProductElementType" nillable="true" minOccurs="0">
<annotation>
<documentation xml:lang="de">Kennung des Kundenprodukts bzw. Herstellerkennung oder Name.</documentation>
</annotation>
</element>
<element name="OrderDetails" type="ebics:UnsignedReqOrderDetailsType">
<annotation>
<documentation xml:lang="de">Auftragsdetails.</documentation>
</annotation>
</element>
<element name="SecurityMedium" type="ebics:SecurityMediumType">
<annotation>
<documentation xml:lang="de">Angabe des Sicherheitsmediums, das der Kunde verwendet.</documentation>
</annotation>
</element>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</restriction>
</complexContent>
</complexType>
<complexType name="UnsignedReqOrderDetailsType">
<annotation>
<documentation xml:lang="de">Datentyp für OrderDetails im statischen EBICS-Header von ebicsUnsignedRequest.</documentation>
</annotation>
<complexContent>
<restriction base="ebics:OrderDetailsType">
<sequence>
<element name="OrderType" type="ebics:OrderTBaseType">
<annotation>
<documentation xml:lang="de">Auftragsart.</documentation>
</annotation>
</element>
<element name="OrderAttribute" type="ebics:OrderAttributeBaseType" fixed="OZNNN">
<annotation>
<documentation xml:lang="de">Auftragsattribut: OZNNN.</documentation>
</annotation>
</element>
</sequence>
</restriction>
</complexContent>
</complexType>
</schema>

View File

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Mit XMLSpy v2008 rel. 2 sp2 (http://www.altova.com) von benutzerservice benutzerservice (SIZ GmbH) bearbeitet -->
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ebics="urn:org:ebics:H004" targetNamespace="urn:org:ebics:H004" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<annotation>
<documentation xml:lang="de">ebics_keymgmt_response_H004.xsd ist das EBICS-Protokollschema für Schlüsselmanagement-Antwortnachrichten (HIA, HPB, HSA, INI).</documentation>
</annotation>
<import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd">
<annotation>
<documentation xml:lang="de">XML-Signature.</documentation>
</annotation>
</import>
<include schemaLocation="ebics_types_H004.xsd"/>
<include schemaLocation="ebics_orders_H004.xsd"/>
<element name="ebicsKeyManagementResponse">
<annotation>
<documentation xml:lang="de">Electronic Banking Internet Communication Standard des Zentralen Kreditausschusses (ZKA): Multibankfähige Schnittstelle zur internetbasierten Kommunikation.</documentation>
</annotation>
<complexType>
<sequence>
<element name="header">
<annotation>
<documentation xml:lang="de">enthält die technischen Transaktionsdaten.</documentation>
</annotation>
<complexType>
<sequence>
<element name="static">
<annotation>
<documentation xml:lang="de">enhält alle festen Headereinträge.</documentation>
</annotation>
<complexType>
<sequence/>
</complexType>
</element>
<element name="mutable" type="ebics:KeyMgmntResponseMutableHeaderType">
<annotation>
<documentation xml:lang="de">enthält alle variablen Headereinträge.</documentation>
</annotation>
</element>
</sequence>
<attributeGroup ref="ebics:AuthenticationMarker"/>
</complexType>
</element>
<element name="body">
<annotation>
<documentation xml:lang="de">enthält die Auftragsdaten und den fachlichen ReturnCode.</documentation>
</annotation>
<complexType>
<sequence>
<element name="DataTransfer" minOccurs="0">
<annotation>
<documentation xml:lang="de">Transfer von Auftragsdaten; nur bei Download anzugeben (HPB).</documentation>
</annotation>
<complexType>
<sequence>
<element name="DataEncryptionInfo">
<annotation>
<documentation xml:lang="de">Informationen zur Verschlüsselung der Auftragsdaten</documentation>
</annotation>
<complexType>
<complexContent>
<extension base="ebics:DataEncryptionInfoType">
<attributeGroup ref="ebics:AuthenticationMarker"/>
</extension>
</complexContent>
</complexType>
</element>
<element name="OrderData">
<annotation>
<documentation xml:lang="de">enthält Auftragsdaten.</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="ebics:OrderDataType">
<anyAttribute namespace="##targetNamespace" processContents="lax"/>
</extension>
</simpleContent>
</complexType>
</element>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
</element>
<element name="ReturnCode">
<annotation>
<documentation xml:lang="de">Antwortcode für den vorangegangenen Transfer.</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="ebics:ReturnCodeType">
<attributeGroup ref="ebics:AuthenticationMarker"/>
</extension>
</simpleContent>
</complexType>
</element>
<element name="TimestampBankParameter" minOccurs="0">
<annotation>
<documentation xml:lang="de">Zeitstempel der letzten Aktualisierung der Bankparameter; nur in der Initialisierungsphase anzugeben.</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="ebics:TimestampType">
<attributeGroup ref="ebics:AuthenticationMarker"/>
</extension>
</simpleContent>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
<attributeGroup ref="ebics:VersionAttrGroup"/>
</complexType>
</element>
<complexType name="KeyMgmntResponseMutableHeaderType">
<annotation>
<documentation xml:lang="de">Datentyp für den variablen EBICS-Header.</documentation>
</annotation>
<sequence>
<element name="OrderID" type="ebics:OrderIDType" minOccurs="0">
<annotation>
<documentation xml:lang="de">Auftragsnummer von Sendeaufträgen gemäß DFÜ-Abkommen (used for all key management order types except download order type HPB).</documentation>
</annotation>
</element>
<element name="ReturnCode" type="ebics:ReturnCodeType">
<annotation>
<documentation xml:lang="de">Rückmeldung des Ausführungsstatus mit einer eindeutigen Fehlernummer.</documentation>
</annotation>
</element>
<element name="ReportText" type="ebics:ReportTextType">
<annotation>
<documentation xml:lang="de">Klartext der Rückmeldung des Ausführungsstatus.</documentation>
</annotation>
</element>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
</schema>

1892
test/xsd/ebics_orders_H004.xsd Executable file

File diff suppressed because it is too large Load Diff

355
test/xsd/ebics_request_H004.xsd Executable file
View File

@ -0,0 +1,355 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Mit XMLSpy v2008 rel. 2 (http://www.altova.com) von Sabine Wenzel (SIZ Bonn) bearbeitet -->
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ebics="urn:org:ebics:H004" targetNamespace="urn:org:ebics:H004" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<annotation>
<documentation xml:lang="de">ebics_request_H004.xsd ist das EBICS-Protokollschema für Anfragen.</documentation>
<documentation xml:lang="en">ebics_request_H004.xsd is the appropriate EBICS protocol schema for standard requests.</documentation>
</annotation>
<include schemaLocation="ebics_types_H004.xsd"/>
<include schemaLocation="ebics_orders_H004.xsd"/>
<import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
<element name="ebicsRequest">
<annotation>
<documentation xml:lang="de">Electronic Banking Internet Communication Standard of the EBICS SCRL: Multibankfähige Schnittstelle zur internetbasierten Kommunikation.</documentation>
<documentation xml:lang="en">Electronic Banking Internet Communication Standard der EBICS SCRL: multi-bank capable interface for internet-based communication.</documentation>
</annotation>
<complexType>
<sequence>
<element name="header">
<annotation>
<documentation xml:lang="de">enthält die technischen Transaktionsdaten.</documentation>
<documentation xml:lang="en">contains the transaction-driven data.</documentation>
</annotation>
<complexType>
<sequence>
<element name="static" type="ebics:StaticHeaderType">
<annotation>
<documentation xml:lang="de">enhält alle festen Headereinträge.</documentation>
<documentation xml:lang="en">contains the static header entries.</documentation>
</annotation>
</element>
<element name="mutable" type="ebics:MutableHeaderType">
<annotation>
<documentation xml:lang="de">enthält alle variablen Headereinträge.</documentation>
<documentation xml:lang="en">contains the mutable header entries.</documentation>
</annotation>
</element>
</sequence>
<attributeGroup ref="ebics:AuthenticationMarker"/>
</complexType>
</element>
<element ref="ebics:AuthSignature"/>
<element name="body">
<annotation>
<documentation xml:lang="de">enthält die Auftragsdaten, EU(s) und weitere Nutzdaten.</documentation>
<documentation xml:lang="en">contains order data, order signature(s) and further data referring to the current order.</documentation>
</annotation>
<complexType>
<sequence>
<annotation>
<documentation xml:lang="de"/>
</annotation>
<element ref="ds:X509Data" minOccurs="0" maxOccurs="0">
<annotation>
<documentation xml:lang="de">X.509-Daten des Teilnehmers.</documentation>
<documentation xml:lang="en">X.509 data of the user.</documentation>
</annotation>
</element>
<choice>
<annotation>
<documentation xml:lang="de">Welche Transaktionsphase?</documentation>
<documentation xml:lang="en">Which transaction phase?</documentation>
</annotation>
<sequence>
<annotation>
<documentation xml:lang="de">Initialisierungs- und Transferphase.</documentation>
<documentation xml:lang="en">Initialisation or transfer phase.</documentation>
</annotation>
<element name="PreValidation" minOccurs="0">
<annotation>
<documentation xml:lang="de">Daten zur Vorabprüfung; nur anzugeben in der Initialisierungsphase bei Uploads mit Auftragsattribut OZH (EUs + Auftragsdaten).</documentation>
<documentation xml:lang="en">Data sent for pre-validation; mandatory for initialisation phase during uploads using order attribute OZH (order signature(s) + order data).</documentation>
</annotation>
<complexType>
<complexContent>
<extension base="ebics:PreValidationRequestType">
<attributeGroup ref="ebics:AuthenticationMarker"/>
</extension>
</complexContent>
</complexType>
</element>
<element name="DataTransfer" type="ebics:DataTransferRequestType" minOccurs="0">
<annotation>
<documentation xml:lang="de">Transfer von Signatur- bzw. Auftragsdaten; nur bei Upload anzugeben.</documentation>
<documentation xml:lang="en">Transfer of signature or order data; mandatory for uploads only.</documentation>
</annotation>
</element>
</sequence>
<sequence>
<annotation>
<documentation xml:lang="de">Quittierungsphase nach Download.</documentation>
<documentation xml:lang="en">Receipt phase after download.</documentation>
</annotation>
<element name="TransferReceipt">
<annotation>
<documentation xml:lang="de">Quittierung des Transfers.</documentation>
<documentation xml:lang="en">Receipt of transfer.</documentation>
</annotation>
<complexType>
<complexContent>
<extension base="ebics:TransferReceiptRequestType">
<attributeGroup ref="ebics:AuthenticationMarker"/>
</extension>
</complexContent>
</complexType>
</element>
</sequence>
</choice>
</sequence>
</complexType>
</element>
</sequence>
<attributeGroup ref="ebics:VersionAttrGroup"/>
<anyAttribute namespace="##targetNamespace" processContents="strict"/>
</complexType>
</element>
<complexType name="StaticHeaderType">
<annotation>
<documentation xml:lang="de">Datentyp für den statischen EBICS-Header.</documentation>
<documentation xml:lang="en">Data type for the static EBICS header.</documentation>
</annotation>
<sequence>
<element name="HostID" type="ebics:HostIDType">
<annotation>
<documentation xml:lang="de">Hostname des Banksystems.</documentation>
</annotation>
</element>
<choice>
<annotation>
<documentation xml:lang="de">Transaktionsphase?</documentation>
<documentation xml:lang="en">Transaction phase?</documentation>
</annotation>
<sequence>
<annotation>
<documentation xml:lang="de">Initialisierungsphase.</documentation>
<documentation xml:lang="en">Initialisation phase.</documentation>
</annotation>
<element name="Nonce" type="ebics:NonceType">
<annotation>
<documentation xml:lang="de">Zufallswert; damit wird die Initialisierungsnachricht des Clients einzigartig.</documentation>
<documentation xml:lang="en">Random value, ensures the uniqueness of the client's message during initialisation phase.</documentation>
</annotation>
</element>
<element name="Timestamp" type="ebics:TimestampType">
<annotation>
<documentation xml:lang="de">aktueller Zeitstempel zur Begrenzung der serverseitigen Nonce-Speicherung.</documentation>
<documentation xml:lang="en">current timestamp, used to limit storage space for nonces on the server.</documentation>
</annotation>
</element>
<element name="PartnerID" type="ebics:PartnerIDType">
<annotation>
<documentation xml:lang="de">Kunden-ID des serverseitig administrierten Kunden.</documentation>
<documentation xml:lang="en">ID of the partner = customer, administered on the server.</documentation>
</annotation>
</element>
<element name="UserID" type="ebics:UserIDType">
<annotation>
<documentation xml:lang="de">Teilnehmer-ID des serverseitig zu diesem Kunden administrierten Teilnehmers.</documentation>
<documentation xml:lang="en">ID of the user that is assigned to the given customer, administered on the server.</documentation>
</annotation>
</element>
<element name="SystemID" type="ebics:UserIDType" minOccurs="0">
<annotation>
<documentation xml:lang="de">technische User-ID für Multi-User-Systeme.</documentation>
<documentation xml:lang="en">ID of the system for multi-user systems.</documentation>
</annotation>
</element>
<element name="Product" nillable="true" minOccurs="0">
<annotation>
<documentation xml:lang="de">Kennung des Kundenprodukts bzw. Herstellerkennung oder Name.</documentation>
<documentation xml:lang="en">software ID / manufacturer ID / manufacturer's name of the customer's software package.</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="ebics:ProductType">
<attribute name="Language" type="ebics:LanguageType" use="required">
<annotation>
<documentation xml:lang="de">Sprachkennzeichen der Kundenproduktversion (gemäß ISO 639).</documentation>
<documentation xml:lang="en">Language code of the customer's software package according to ISO 639.</documentation>
</annotation>
</attribute>
<attribute name="InstituteID" type="ebics:InstituteIDType" use="optional">
<annotation>
<documentation xml:lang="de">Kennung des Herausgebers des Kundenprodukts bzw. des betreuenden Kreditinstituts.</documentation>
<documentation xml:lang="en">ID of the manufacturer / financial institute providing support for the customer's software package.</documentation>
</annotation>
</attribute>
</extension>
</simpleContent>
</complexType>
</element>
<element name="OrderDetails" type="ebics:StaticHeaderOrderDetailsType">
<annotation>
<documentation xml:lang="de">Auftragsdetails.</documentation>
<documentation xml:lang="en">order details.</documentation>
</annotation>
</element>
<element name="BankPubKeyDigests">
<annotation>
<documentation xml:lang="de">Hashwerte der erwarteten öffentlichen Schlüssel (Verschlüsselung, Signatur, Authentifikation) des Kreditinstituts.</documentation>
<documentation xml:lang="en">Digest values of the expected public keys (authentication, encryption, signature) owned by the financial institute.</documentation>
</annotation>
<complexType>
<sequence>
<element name="Authentication">
<annotation>
<documentation xml:lang="de">Hashwert des Authentifikationsschlüssels.</documentation>
<documentation xml:lang="en">Digest value of the public authentication key.</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="ebics:PubKeyDigestType">
<attribute name="Version" type="ebics:AuthenticationVersionType" use="required">
<annotation>
<documentation xml:lang="de">Version des Authentifikationsverfahrens.</documentation>
<documentation xml:lang="en">Version of the algorithm used for authentication.</documentation>
</annotation>
</attribute>
</extension>
</simpleContent>
</complexType>
</element>
<element name="Encryption">
<annotation>
<documentation xml:lang="de">Hashwert des Verschlüsselungsschlüssels.</documentation>
<documentation xml:lang="en">Digest value of the public encryption key.</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="ebics:PubKeyDigestType">
<attribute name="Version" type="ebics:EncryptionVersionType" use="required">
<annotation>
<documentation xml:lang="de">Version des Verschlüsselungsverfahrens.</documentation>
<documentation xml:lang="en">Version of the algorithm used for encryption.</documentation>
</annotation>
</attribute>
</extension>
</simpleContent>
</complexType>
</element>
<element name="Signature" minOccurs="0" maxOccurs="0">
<annotation>
<documentation xml:lang="de">Hashwert des Signaturschlüssels.</documentation>
<documentation xml:lang="en">Digest value of the public signature key.</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="ebics:PubKeyDigestType">
<attribute name="Version" type="ebics:SignatureVersionType" use="required">
<annotation>
<documentation xml:lang="de">Version des Signaturverfahrens.</documentation>
<documentation xml:lang="en">Version of the algorithm used for signature creation.</documentation>
</annotation>
</attribute>
</extension>
</simpleContent>
</complexType>
</element>
</sequence>
</complexType>
</element>
<element name="SecurityMedium" type="ebics:SecurityMediumType">
<annotation>
<documentation xml:lang="de">Angabe des Sicherheitsmediums, das der Kunde verwendet.</documentation>
<documentation xml:lang="en">Classification of the security medium used by the customer.</documentation>
</annotation>
</element>
<element name="NumSegments" type="ebics:NumSegmentsType" minOccurs="0">
<annotation>
<documentation xml:lang="de">Gesamtsegmentanzahl für diese Transaktion; nur bei Uploads anzugeben.</documentation>
<documentation xml:lang="en">Total number of segments for this transaction; mandatory for uploads only.</documentation>
</annotation>
</element>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<sequence>
<annotation>
<documentation xml:lang="de">Transfer- und Quittierungsphase.</documentation>
<documentation xml:lang="en">Transfer or receipt phase.</documentation>
</annotation>
<element name="TransactionID" type="ebics:TransactionIDType">
<annotation>
<documentation xml:lang="de">eindeutige, technische Transaktions-ID; wird vom Server vergeben.</documentation>
<documentation xml:lang="en">unique transaction ID, provided by the server.</documentation>
</annotation>
</element>
</sequence>
</choice>
</sequence>
</complexType>
<complexType name="MutableHeaderType">
<annotation>
<documentation xml:lang="de">Datentyp für den variablen EBICS-Header.</documentation>
<documentation xml:lang="en">Data type for the mutable EBICS header.</documentation>
</annotation>
<sequence>
<element name="TransactionPhase" type="ebics:TransactionPhaseType">
<annotation>
<documentation xml:lang="de">Phase, in der sich die Transaktion gerade befindet; wird bei jedem Transaktionsschritt vom Client gesetzt und vom Server übernommen.</documentation>
<documentation xml:lang="en">Current phase of the transaction; this information is provided by the client for each step of the transaction, and the server adopts the setting.</documentation>
</annotation>
</element>
<element name="SegmentNumber" nillable="true" minOccurs="0">
<annotation>
<documentation xml:lang="de">enthält die Nummer des aktuellen Segments, welches gerade übertragen oder angefordert wird; nur anzugeben bei TransactionPhase=Transfer.</documentation>
<documentation xml:lang="en">contains the number of the segment which is currently being transmitted or requested; mandatory for transaction phase 'Transfer' only.</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="ebics:SegmentNumberType">
<attribute name="lastSegment" type="boolean" use="required">
<annotation>
<documentation xml:lang="de">Ist dies das letzte Segment der Übertragung?</documentation>
<documentation xml:lang="en">Is this segment meant to be the last one regarding this transmission?</documentation>
</annotation>
</attribute>
</extension>
</simpleContent>
</complexType>
</element>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="StaticHeaderOrderDetailsType">
<annotation>
<documentation xml:lang="de">Datentyp für Auftragsdetails im statischen EBICS-Header.</documentation>
<documentation xml:lang="en">Data type for order details stored in the static EBICS header.</documentation>
</annotation>
<sequence>
<element name="OrderType">
<annotation>
<documentation xml:lang="de">Auftragsart.</documentation>
<documentation xml:lang="en">type code of the order.</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="ebics:OrderTBaseType"/>
</simpleContent>
</complexType>
</element>
<element name="OrderID" type="ebics:OrderIDType" minOccurs="0">
<annotation>
<documentation xml:lang="de">Auftragsnummer für Sendeaufträge gemäß DFÜ-Abkommen.</documentation>
<documentation xml:lang="en">ID of the (upload) order, formatted in accordance with the document "DFÜ-Abkommen".</documentation>
</annotation>
</element>
<element name="OrderAttribute" type="ebics:OrderAttributeType">
<annotation>
<documentation xml:lang="de">Auftragsattribut.</documentation>
<documentation xml:lang="en">attribute describing the order contents.</documentation>
</annotation>
</element>
<element ref="ebics:OrderParams"/>
</sequence>
</complexType>
</schema>

166
test/xsd/ebics_response_H004.xsd Executable file
View File

@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ebics="urn:org:ebics:H004" targetNamespace="urn:org:ebics:H004" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<annotation>
<documentation xml:lang="de">ebics_response_H004.xsd ist das EBICS-Protokollschema für Antwortnachrichten.</documentation>
<documentation xml:lang="en">ebics_response_H004.xsd is the appropriate EBICS protocol schema for standard responses.</documentation>
</annotation>
<import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd">
<annotation>
<documentation xml:lang="de">XML-Signature.</documentation>
</annotation>
</import>
<include schemaLocation="ebics_types_H004.xsd"/>
<include schemaLocation="ebics_orders_H004.xsd"/>
<element name="ebicsResponse">
<annotation>
<documentation xml:lang="de">Electronic Banking Internet Communication Standard des Zentralen Kreditausschusses (ZKA): Multibankfähige Schnittstelle zur internetbasierten Kommunikation.</documentation>
<documentation xml:lang="en">Electronic Banking Internet Communication Standard of the "Zentraler Kreditausschuss (ZKA)": multi-bank capable interface for internet-based communication.</documentation>
</annotation>
<complexType>
<sequence>
<element name="header">
<annotation>
<documentation xml:lang="de">enthält die technischen Transaktionsdaten.</documentation>
<documentation xml:lang="en">contains the transaction-driven data.</documentation>
</annotation>
<complexType>
<sequence>
<element name="static" type="ebics:ResponseStaticHeaderType">
<annotation>
<documentation xml:lang="de">enhält alle festen Headereinträge.</documentation>
<documentation xml:lang="en">contains the static header entries.</documentation>
</annotation>
</element>
<element name="mutable" type="ebics:ResponseMutableHeaderType">
<annotation>
<documentation xml:lang="de">enthält alle variablen Headereinträge.</documentation>
<documentation xml:lang="en">contains the mutable header entries.</documentation>
</annotation>
</element>
</sequence>
<attributeGroup ref="ebics:AuthenticationMarker"/>
</complexType>
</element>
<element ref="ebics:AuthSignature">
<annotation>
<documentation xml:lang="de">Authentifikationssignatur.</documentation>
<documentation xml:lang="en">Authentication signature.</documentation>
</annotation>
</element>
<element name="body">
<annotation>
<documentation xml:lang="de">enthält die Auftragsdaten, EU(s) und weitere Nutzdaten.</documentation>
<documentation xml:lang="en">contains order data, order signature(s) and further data referring to the current order.</documentation>
</annotation>
<complexType>
<sequence>
<element name="DataTransfer" type="ebics:DataTransferResponseType" minOccurs="0">
<annotation>
<documentation xml:lang="de">Transfer von Auftragsdaten; nur bei Download anzugeben.</documentation>
<documentation xml:lang="en">Transfer of signature or order data; mandatory for downloads only.</documentation>
</annotation>
</element>
<element name="ReturnCode">
<annotation>
<documentation xml:lang="de">fachlicher Antwortcode für den vorangegangenen Request.</documentation>
<documentation xml:lang="en">order-related return code of the previous request.</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="ebics:ReturnCodeType">
<attributeGroup ref="ebics:AuthenticationMarker"/>
</extension>
</simpleContent>
</complexType>
</element>
<element name="TimestampBankParameter" minOccurs="0">
<annotation>
<documentation xml:lang="de">Zeitstempel der letzten Aktualisierung der Bankparameter; nur in der Initialisierungsphase anzugeben.</documentation>
<documentation xml:lang="en">timestamp indicating the latest update of the bank parameters; may be set during initialisation phase only.</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="ebics:TimestampType">
<attributeGroup ref="ebics:AuthenticationMarker"/>
</extension>
</simpleContent>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
<attributeGroup ref="ebics:VersionAttrGroup"/>
<anyAttribute namespace="##targetNamespace" processContents="strict"/>
</complexType>
</element>
<complexType name="ResponseStaticHeaderType">
<annotation>
<documentation xml:lang="de">Datentyp für den statischen EBICS-Header.</documentation>
<documentation xml:lang="en">Data type for the static EBICS header.</documentation>
</annotation>
<sequence>
<element name="TransactionID" type="ebics:TransactionIDType" minOccurs="0">
<annotation>
<documentation xml:lang="de">eindeutige, technische Transaktions-ID; wird vom Server vergeben, falls OrderAttribute entweder gleich "OZHNN" oder gleich "DZHNN" ist und falls tatsächlich eine Transaktion erzeugt wurde.</documentation>
<documentation xml:lang="en">unique transaction ID, provided by the server if and only if the order attribute is set to either "OZHNN" or "DZHNN" and if a transaction has been established actually.</documentation>
</annotation>
</element>
<element name="NumSegments" type="ebics:SegmentNumberType" minOccurs="0">
<annotation>
<documentation xml:lang="de">Gesamtsegmentanzahl für diese Transaktion; nur bei Downloads in der Initialisierungsphase anzugeben.</documentation>
<documentation xml:lang="en">Total number of segments for this transaction; mandatory for downloads in initialisation phase only.</documentation>
</annotation>
</element>
</sequence>
</complexType>
<complexType name="ResponseMutableHeaderType">
<annotation>
<documentation xml:lang="de">Datentyp für den variablen EBICS-Header.</documentation>
<documentation xml:lang="en">Data type for the mutable EBICS header.</documentation>
</annotation>
<sequence>
<element name="TransactionPhase" type="ebics:TransactionPhaseType">
<annotation>
<documentation xml:lang="de">Phase, in der sich die Transaktion gerade befindet; wird bei jedem Transaktionsschritt vom Client gesetzt und vom Server übernommen.</documentation>
<documentation xml:lang="en">Current phase of the transaction; this information is provided by the client for each step of the transaction, and the server adopts the setting.</documentation>
</annotation>
</element>
<element name="SegmentNumber" minOccurs="0">
<annotation>
<documentation xml:lang="de">enthält die Nummer des aktuellen Segments, welches gerade übertragen oder angefordert wird; nur anzugeben bei TransactionPhase=Transfer und (bei Download) TransactionPhase=Initialisation.</documentation>
<documentation xml:lang="en">contains the number of the segment which is currently being transmitted or requested; mandatory for transaction phases 'Transfer' and (for downloads) 'Initialisation' only.</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="ebics:SegmentNumberType">
<attribute name="lastSegment" type="boolean" use="required">
<annotation>
<documentation xml:lang="de">Ist dies das letzte Segment der Übertragung?</documentation>
</annotation>
</attribute>
</extension>
</simpleContent>
</complexType>
</element>
<element name="OrderID" type="ebics:OrderIDType" minOccurs="0">
<annotation>
<documentation xml:lang="de">Auftragsnummer von Sendeaufträgen gemäß DFÜ-Abkommen.</documentation>
</annotation>
</element>
<element name="ReturnCode" type="ebics:ReturnCodeType">
<annotation>
<documentation xml:lang="de">Rückmeldung des technischen Status mit einer eindeutigen Fehlernummer.</documentation>
<documentation xml:lang="en">Return code indicating the technical status.</documentation>
</annotation>
</element>
<element name="ReportText" type="ebics:ReportTextType">
<annotation>
<documentation xml:lang="de">Klartext der Rückmeldung des technischen Status.</documentation>
<documentation xml:lang="en">Textual interpretation of the returned technical status code.</documentation>
</annotation>
</element>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
</schema>

217
test/xsd/ebics_signature.xsd Executable file
View File

@ -0,0 +1,217 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:esig="http://www.ebics.org/S001" targetNamespace="http://www.ebics.org/S001" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
<annotation>
<documentation xml:lang="de">ebics_signature enthält Typdefinitionen für elektronische Unterschriften der Versionen A004, A005, A006 und folgende.</documentation>
<documentation xml:lang="en">ebics_EU contains type definitions for electronic signatures: versions A005, A006 and et sqq.</documentation>
</annotation>
<!-- Elementdefinitionen für die EU. Die XML-Klartext-Struktur wird im EBICS-Signaturdatenkontext binär interpretiert.-->
<element name="EBICSSignatureData" abstract="true">
<annotation>
<documentation xml:lang="de">XML-Strukturen für bankfachliche Elektronische Unterschriften (EUs).</documentation>
<documentation xml:lang="en">contains the digital signatures.</documentation>
</annotation>
</element>
<element name="UserSignatureData" type="esig:UserSignatureDataSigBookType" substitutionGroup="esig:EBICSSignatureData">
<annotation>
<documentation xml:lang="de">enthält die EUs der Teilnehmer.</documentation>
<documentation xml:lang="en">contains the digital signatures.</documentation>
</annotation>
</element>
<complexType name="UserSignatureDataSigBookType">
<annotation>
<documentation xml:lang="de">Datentyp für Signaturdaten des Teilnehmers beim EU-Transfer.</documentation>
<documentation xml:lang="en">Data type for digital signature data transferred using EBICS.</documentation>
</annotation>
<sequence>
<choice maxOccurs="unbounded">
<element name="OrderSignature">
<annotation>
<documentation xml:lang="de">bankfachliche Elektronische Unterschrift oder Transportunterschrift (Binärformat).</documentation>
<documentation xml:lang="en">Digital signature (either autorising an order or applied for transportation), binary format.</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="esig:OrderSignatureType">
<attribute name="PartnerID" use="required">
<annotation>
<documentation xml:lang="de">Kunden-ID des Unterzeichners.</documentation>
<documentation xml:lang="en">Customer ID of the signer.</documentation>
</annotation>
</attribute>
</extension>
</simpleContent>
</complexType>
</element>
<element name="OrderSignatureData" type="esig:OrderSignatureDataType">
<annotation>
<documentation xml:lang="de">bankfachliche Elektronische Unterschrift oder Transportunterschrift (strukturiertes Format).</documentation>
<documentation xml:lang="en">Digital signature (either autorising an order or applied for transportation), structured format.</documentation>
</annotation>
</element>
</choice>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
<simpleType name="OrderSignatureType">
<annotation>
<documentation xml:lang="de">Datentyp für kryptographische Unterschriften.</documentation>
</annotation>
<restriction base="base64Binary"/>
</simpleType>
<element name="OrderSignatureData" type="esig:OrderSignatureDataType">
<annotation>
<documentation xml:lang="de">bankfachliche Elektronische Unterschrift oder Transportunterschrift (strukturiertes Format).</documentation>
<documentation xml:lang="en">Digital signature (either autorising an order or applied for transportation), structured format.</documentation>
</annotation>
</element>
<complexType name="OrderSignatureDataType">
<annotation>
<documentation xml:lang="de">Datentyp für bankfachliche Elektronische Unterschrift oder Transportunterschrift (strukturiertes Format).</documentation>
<documentation xml:lang="en">Data type according for a digital signature (either autorising an order or applied for transportation), structured format.</documentation>
</annotation>
<sequence>
<element name="SignatureVersion" type="esig:SignatureVersionType">
<annotation>
<documentation xml:lang="de">Version des Signaturverfahrens.</documentation>
<documentation xml:lang="en">Version of the algorithm used for signature creation.</documentation>
</annotation>
</element>
<element name="SignatureValue" type="base64Binary">
<annotation>
<documentation xml:lang="de">Digitale Signatur.</documentation>
<documentation xml:lang="en">Digital signature.</documentation>
</annotation>
</element>
<element name="PartnerID" type="esig:PartnerIDType">
<annotation>
<documentation xml:lang="de">Kunden-ID des Unterzeichners.</documentation>
<documentation xml:lang="en">Customer ID of the signer.</documentation>
</annotation>
</element>
<element name="UserID" type="esig:UserIDType">
<annotation>
<documentation xml:lang="de">Teilnehmer-ID.</documentation>
<documentation xml:lang="en">User ID.</documentation>
</annotation>
</element>
<element ref="ds:X509Data" minOccurs="0">
<annotation>
<documentation xml:lang="de">Parameter zur X.509-Funktionalität</documentation>
<documentation xml:lang="en">Parameter for X509Data</documentation>
</annotation>
</element>
</sequence>
</complexType>
<simpleType name="PartnerIDType">
<annotation>
<documentation xml:lang="de">Datentyp für eine Kunden-ID.</documentation>
</annotation>
<restriction base="token">
<maxLength value="35"/>
</restriction>
</simpleType>
<simpleType name="UserIDType">
<annotation>
<documentation xml:lang="de">Datentyp für eine Teilnehmer-ID.</documentation>
</annotation>
<restriction base="token">
<maxLength value="35"/>
</restriction>
</simpleType>
<simpleType name="SignatureVersionType">
<annotation>
<documentation xml:lang="de">Datentyp für Versionsnummern zur Elektronischen Unterschrift (EU).</documentation>
</annotation>
<restriction base="token">
<length value="4"/>
<pattern value="A\d{3}"/>
</restriction>
</simpleType>
<!-- Definitionen für die Uebertragung von oeffentlichen Signierschlüsseln. z.B. ueber EBICS mit INI, PUB, HCS.-->
<element name="SignaturePubKeyOrderData" type="esig:SignaturePubKeyOrderDataType">
<annotation>
<documentation xml:lang="de">Element für Public Key Dateien unabhängig von der Auftragsart / Geschäftsvorfall.</documentation>
</annotation>
</element>
<complexType name="SignaturePubKeyOrderDataType">
<annotation>
<documentation xml:lang="de">Datentyp für Public Key Dateien unabhängig von der Auftragsart / Geschäftsvorfall.</documentation>
</annotation>
<sequence>
<element name="SignaturePubKeyInfo" type="esig:SignaturePubKeyInfoType">
<annotation>
<documentation xml:lang="de">öffentlicher Signaturschlüssel.</documentation>
</annotation>
</element>
<element name="PartnerID" type="esig:PartnerIDType">
<annotation>
<documentation xml:lang="de">Kunden-ID.</documentation>
</annotation>
</element>
<element name="UserID" type="esig:UserIDType">
<annotation>
<documentation xml:lang="de">Teilnehmer-ID.</documentation>
</annotation>
</element>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
<element name="SignaturePubKeyInfo" type="esig:SignaturePubKeyInfoType">
<annotation>
<documentation xml:lang="de">öffentlicher Signaturschlüssel.</documentation>
</annotation>
</element>
<complexType name="SignaturePubKeyInfoType">
<annotation>
<documentation xml:lang="de">Datentyp für öffentliche bankfachliche Schlüssel.</documentation>
</annotation>
<complexContent>
<extension base="esig:PubKeyInfoType">
<sequence>
<element name="SignatureVersion" type="esig:SignatureVersionType">
<annotation>
<documentation xml:lang="de">Version des EU-Signaturverfahrens.</documentation>
</annotation>
</element>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="PubKeyInfoType">
<annotation>
<documentation xml:lang="de">Datentyp für die Darstellung eines öffentlichen RSA-Schlüssels als Exponent-Modulus-Kombination oder als X509-Zertifikat.</documentation>
</annotation>
<sequence>
<sequence>
<element ref="ds:X509Data" minOccurs="0"/>
<element name="PubKeyValue" type="esig:PubKeyValueType">
<annotation>
<documentation xml:lang="de">Darstellung als Exponent-Modulus-Kombination.</documentation>
</annotation>
</element>
</sequence>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="PubKeyValueType">
<annotation>
<documentation xml:lang="de">Datentyp für die Exponent-Modulus-Darstellung eines öffentlichen RSA-Schlüssels.</documentation>
</annotation>
<sequence>
<element ref="ds:RSAKeyValue"/>
<element name="TimeStamp" type="esig:TimestampType" minOccurs="0">
<annotation>
<documentation xml:lang="de">Zeitpunkt der Generierung des Schlüssels.</documentation>
</annotation>
</element>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
<simpleType name="TimestampType">
<annotation>
<documentation xml:lang="de">Datentyp für Zeitstempel.</documentation>
</annotation>
<restriction base="dateTime"/>
</simpleType>
</schema>

2426
test/xsd/ebics_types_H004.xsd Executable file

File diff suppressed because it is too large Load Diff

7
test/xsd/test.xsd Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ebics="urn:org:ebics:H004" targetNamespace="urn:org:ebics:H004" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<annotation>
<documentation xml:lang="de">ebics_H004.xsd inkludiert alle Schemadateien des EBICS-Protokolls, um die Eindeutigkeit von Element- und Typnamen im EBCIS Namespace zu erzwingen.</documentation>
<documentation xml:lang="en">ebics_H004.xsd includes all schema files for the EBICS protocol in order to enforce unique element and type names in the EBICS namespace.</documentation>
</annotation>
</schema>

318
test/xsd/xmldsig-core-schema.xsd Executable file
View File

@ -0,0 +1,318 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE schema
PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"
[
<!ATTLIST schema
xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
<!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
<!ENTITY % p ''>
<!ENTITY % s ''>
]>
<!-- Schema for XML Signatures
http://www.w3.org/2000/09/xmldsig#
$Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
Copyright 2001 The Internet Society and W3C (Massachusetts Institute
of Technology, Institut National de Recherche en Informatique et en
Automatique, Keio University). All Rights Reserved.
http://www.w3.org/Consortium/Legal/
This document is governed by the W3C Software License [1] as described
in the FAQ [2].
[1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
[2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
targetNamespace="http://www.w3.org/2000/09/xmldsig#"
version="0.1" elementFormDefault="qualified">
<!-- Basic Types Defined for Signatures -->
<simpleType name="CryptoBinary">
<restriction base="base64Binary">
</restriction>
</simpleType>
<!-- Start Signature -->
<element name="Signature" type="ds:SignatureType"/>
<complexType name="SignatureType">
<sequence>
<element ref="ds:SignedInfo"/>
<element ref="ds:SignatureValue"/>
<element ref="ds:KeyInfo" minOccurs="0"/>
<element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="Id" type="ID" use="optional"/>
</complexType>
<element name="SignatureValue" type="ds:SignatureValueType"/>
<complexType name="SignatureValueType">
<simpleContent>
<extension base="base64Binary">
<attribute name="Id" type="ID" use="optional"/>
</extension>
</simpleContent>
</complexType>
<!-- Start SignedInfo -->
<element name="SignedInfo" type="ds:SignedInfoType"/>
<complexType name="SignedInfoType">
<sequence>
<element ref="ds:CanonicalizationMethod"/>
<element ref="ds:SignatureMethod"/>
<element ref="ds:Reference" maxOccurs="unbounded"/>
</sequence>
<attribute name="Id" type="ID" use="optional"/>
</complexType>
<element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
<complexType name="CanonicalizationMethodType" mixed="true">
<sequence>
<any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
<!-- (0,unbounded) elements from (1,1) namespace -->
</sequence>
<attribute name="Algorithm" type="anyURI" use="required"/>
</complexType>
<element name="SignatureMethod" type="ds:SignatureMethodType"/>
<complexType name="SignatureMethodType" mixed="true">
<sequence>
<element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
<any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
<!-- (0,unbounded) elements from (1,1) external namespace -->
</sequence>
<attribute name="Algorithm" type="anyURI" use="required"/>
</complexType>
<!-- Start Reference -->
<element name="Reference" type="ds:ReferenceType"/>
<complexType name="ReferenceType">
<sequence>
<element ref="ds:Transforms" minOccurs="0"/>
<element ref="ds:DigestMethod"/>
<element ref="ds:DigestValue"/>
</sequence>
<attribute name="Id" type="ID" use="optional"/>
<attribute name="URI" type="anyURI" use="optional"/>
<attribute name="Type" type="anyURI" use="optional"/>
</complexType>
<element name="Transforms" type="ds:TransformsType"/>
<complexType name="TransformsType">
<sequence>
<element ref="ds:Transform" maxOccurs="unbounded"/>
</sequence>
</complexType>
<element name="Transform" type="ds:TransformType"/>
<complexType name="TransformType" mixed="true">
<choice minOccurs="0" maxOccurs="unbounded">
<any namespace="##other" processContents="lax"/>
<!-- (1,1) elements from (0,unbounded) namespaces -->
<element name="XPath" type="string"/>
</choice>
<attribute name="Algorithm" type="anyURI" use="required"/>
</complexType>
<!-- End Reference -->
<element name="DigestMethod" type="ds:DigestMethodType"/>
<complexType name="DigestMethodType" mixed="true">
<sequence>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="Algorithm" type="anyURI" use="required"/>
</complexType>
<element name="DigestValue" type="ds:DigestValueType"/>
<simpleType name="DigestValueType">
<restriction base="base64Binary"/>
</simpleType>
<!-- End SignedInfo -->
<!-- Start KeyInfo -->
<element name="KeyInfo" type="ds:KeyInfoType"/>
<complexType name="KeyInfoType" mixed="true">
<choice maxOccurs="unbounded">
<element ref="ds:KeyName"/>
<element ref="ds:KeyValue"/>
<element ref="ds:RetrievalMethod"/>
<element ref="ds:X509Data"/>
<element ref="ds:PGPData"/>
<element ref="ds:SPKIData"/>
<element ref="ds:MgmtData"/>
<any processContents="lax" namespace="##other"/>
<!-- (1,1) elements from (0,unbounded) namespaces -->
</choice>
<attribute name="Id" type="ID" use="optional"/>
</complexType>
<element name="KeyName" type="string"/>
<element name="MgmtData" type="string"/>
<element name="KeyValue" type="ds:KeyValueType"/>
<complexType name="KeyValueType" mixed="true">
<choice>
<element ref="ds:DSAKeyValue"/>
<element ref="ds:RSAKeyValue"/>
<any namespace="##other" processContents="lax"/>
</choice>
</complexType>
<element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
<complexType name="RetrievalMethodType">
<sequence>
<element ref="ds:Transforms" minOccurs="0"/>
</sequence>
<attribute name="URI" type="anyURI"/>
<attribute name="Type" type="anyURI" use="optional"/>
</complexType>
<!-- Start X509Data -->
<element name="X509Data" type="ds:X509DataType"/>
<complexType name="X509DataType">
<sequence maxOccurs="unbounded">
<choice>
<element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
<element name="X509SKI" type="base64Binary"/>
<element name="X509SubjectName" type="string"/>
<element name="X509Certificate" type="base64Binary"/>
<element name="X509CRL" type="base64Binary"/>
<any namespace="##other" processContents="lax"/>
</choice>
</sequence>
</complexType>
<complexType name="X509IssuerSerialType">
<sequence>
<element name="X509IssuerName" type="string"/>
<element name="X509SerialNumber" type="integer"/>
</sequence>
</complexType>
<!-- End X509Data -->
<!-- Begin PGPData -->
<element name="PGPData" type="ds:PGPDataType"/>
<complexType name="PGPDataType">
<choice>
<sequence>
<element name="PGPKeyID" type="base64Binary"/>
<element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
<any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</sequence>
<sequence>
<element name="PGPKeyPacket" type="base64Binary"/>
<any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</sequence>
</choice>
</complexType>
<!-- End PGPData -->
<!-- Begin SPKIData -->
<element name="SPKIData" type="ds:SPKIDataType"/>
<complexType name="SPKIDataType">
<sequence maxOccurs="unbounded">
<element name="SPKISexp" type="base64Binary"/>
<any namespace="##other" processContents="lax" minOccurs="0"/>
</sequence>
</complexType>
<!-- End SPKIData -->
<!-- End KeyInfo -->
<!-- Start Object (Manifest, SignatureProperty) -->
<element name="Object" type="ds:ObjectType"/>
<complexType name="ObjectType" mixed="true">
<sequence minOccurs="0" maxOccurs="unbounded">
<any namespace="##any" processContents="lax"/>
</sequence>
<attribute name="Id" type="ID" use="optional"/>
<attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
<attribute name="Encoding" type="anyURI" use="optional"/>
</complexType>
<element name="Manifest" type="ds:ManifestType"/>
<complexType name="ManifestType">
<sequence>
<element ref="ds:Reference" maxOccurs="unbounded"/>
</sequence>
<attribute name="Id" type="ID" use="optional"/>
</complexType>
<element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
<complexType name="SignaturePropertiesType">
<sequence>
<element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
</sequence>
<attribute name="Id" type="ID" use="optional"/>
</complexType>
<element name="SignatureProperty" type="ds:SignaturePropertyType"/>
<complexType name="SignaturePropertyType" mixed="true">
<choice maxOccurs="unbounded">
<any namespace="##other" processContents="lax"/>
<!-- (1,1) elements from (1,unbounded) namespaces -->
</choice>
<attribute name="Target" type="anyURI" use="required"/>
<attribute name="Id" type="ID" use="optional"/>
</complexType>
<!-- End Object (Manifest, SignatureProperty) -->
<!-- Start Algorithm Parameters -->
<simpleType name="HMACOutputLengthType">
<restriction base="integer"/>
</simpleType>
<!-- Start KeyValue Element-types -->
<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
<complexType name="DSAKeyValueType">
<sequence>
<sequence minOccurs="0">
<element name="P" type="ds:CryptoBinary"/>
<element name="Q" type="ds:CryptoBinary"/>
</sequence>
<element name="G" type="ds:CryptoBinary" minOccurs="0"/>
<element name="Y" type="ds:CryptoBinary"/>
<element name="J" type="ds:CryptoBinary" minOccurs="0"/>
<sequence minOccurs="0">
<element name="Seed" type="ds:CryptoBinary"/>
<element name="PgenCounter" type="ds:CryptoBinary"/>
</sequence>
</sequence>
</complexType>
<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
<complexType name="RSAKeyValueType">
<sequence>
<element name="Modulus" type="ds:CryptoBinary"/>
<element name="Exponent" type="ds:CryptoBinary"/>
</sequence>
</complexType>
<!-- End KeyValue Element-types -->
<!-- End Signature -->
</schema>