Merge branch 'master' into herrie/additionalConfigItems

This commit is contained in:
Herrie
2021-03-30 11:03:35 +02:00
committed by GitHub
18 changed files with 276 additions and 10 deletions

View File

@@ -67,12 +67,16 @@ module.exports = class Crypto {
}
static sign(key, msg, salt = crypto.randomBytes(32)) {
// console.log(key.d());
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)).toBEBuffer().toString('base64');
if (buffer.byteLength !== 257 || buffer[0] === 0x00)
return buffer.slice(1).toString('base64');
// console.log('hex string of key starts with "00" and is 514 bytes long, fixing it to be 512 bytes long by stripping leading "00"');
return buffer.toString('base64');
}
static pad(d) {

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

@@ -14,6 +14,8 @@ 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');
@@ -27,6 +29,9 @@ 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,
@@ -44,6 +49,8 @@ module.exports = {
XE3,
XCT,
XG1,
G1V,
G1R,
STA,
VMK,
@@ -56,4 +63,7 @@ module.exports = {
DKI,
C52,
C53,
G52,
G53,
G02,
};