gws-client 1.2.5 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +8 -14
- package/dist/index.es.js +324 -317
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
1
|
+
var be = Object.defineProperty, xe = Object.defineProperties;
|
|
2
2
|
var $e = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var ae = Object.getOwnPropertySymbols;
|
|
4
4
|
var Te = Object.prototype.hasOwnProperty, Me = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var J = (s, e, t) => e in s ?
|
|
5
|
+
var J = (s, e, t) => e in s ? be(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, m = (s, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
7
|
Te.call(e, t) && J(s, t, e[t]);
|
|
8
8
|
if (ae)
|
|
@@ -10,7 +10,7 @@ var J = (s, e, t) => e in s ? Ne(s, e, { enumerable: !0, configurable: !0, writa
|
|
|
10
10
|
Me.call(e, t) && J(s, t, e[t]);
|
|
11
11
|
return s;
|
|
12
12
|
}, v = (s, e) => xe(s, $e(e));
|
|
13
|
-
var
|
|
13
|
+
var r = (s, e, t) => J(s, typeof e != "symbol" ? e + "" : e, t);
|
|
14
14
|
var c = (s, e, t) => new Promise((n, i) => {
|
|
15
15
|
var a = (d) => {
|
|
16
16
|
try {
|
|
@@ -18,25 +18,25 @@ var c = (s, e, t) => new Promise((n, i) => {
|
|
|
18
18
|
} catch (u) {
|
|
19
19
|
i(u);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, o = (d) => {
|
|
22
22
|
try {
|
|
23
23
|
l(t.throw(d));
|
|
24
24
|
} catch (u) {
|
|
25
25
|
i(u);
|
|
26
26
|
}
|
|
27
|
-
}, l = (d) => d.done ? n(d.value) : Promise.resolve(d.value).then(a,
|
|
27
|
+
}, l = (d) => d.done ? n(d.value) : Promise.resolve(d.value).then(a, o);
|
|
28
28
|
l((t = t.apply(s, e)).next());
|
|
29
29
|
});
|
|
30
30
|
const Oe = window.location.href.includes("https") ? "wss://localhost:19528" : "ws://localhost:9527", re = "1", oe = "2", Fe = "1", Ge = "2", Ve = "3";
|
|
31
31
|
var Ie = /* @__PURE__ */ ((s) => (s.MIN = "0", s.LOW = "1", s.MIDDLE = "2", s.HIGH = "3", s))(Ie || {});
|
|
32
|
-
const
|
|
32
|
+
const _ = {
|
|
33
33
|
LEVEL_1: 1,
|
|
34
34
|
LEVEL_2: 2,
|
|
35
35
|
LEVEL_3: 4
|
|
36
36
|
}, Ze = {
|
|
37
|
-
OPEN:
|
|
38
|
-
INTERNAL:
|
|
39
|
-
OMP:
|
|
37
|
+
OPEN: _.LEVEL_1,
|
|
38
|
+
INTERNAL: _.LEVEL_2 | _.LEVEL_1,
|
|
39
|
+
OMP: _.LEVEL_3 | _.LEVEL_2 | _.LEVEL_1
|
|
40
40
|
}, He = "00000001", q = "NO_SEAL_AVAILABLE", Ue = "CERTIFICATE_NOT_FOUND", je = "CLIENT_CONNECTION_FAILED", Ke = "ACCESS_DENIED", ce = [
|
|
41
41
|
{
|
|
42
42
|
oid: "1.2.86.21.1.3",
|
|
@@ -61,42 +61,42 @@ function Re() {
|
|
|
61
61
|
for (var s = [], e = [], t = typeof Uint8Array != "undefined" ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i = 0, a = n.length; i < a; ++i)
|
|
62
62
|
s[i] = n[i], e[n.charCodeAt(i)] = i;
|
|
63
63
|
e[45] = 62, e[95] = 63;
|
|
64
|
-
function
|
|
64
|
+
function o(y) {
|
|
65
65
|
var g = y.length;
|
|
66
66
|
if (g % 4 > 0)
|
|
67
67
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
var f =
|
|
71
|
-
return [
|
|
68
|
+
var E = y.indexOf("=");
|
|
69
|
+
E === -1 && (E = g);
|
|
70
|
+
var f = E === g ? 0 : 4 - E % 4;
|
|
71
|
+
return [E, f];
|
|
72
72
|
}
|
|
73
73
|
function l(y) {
|
|
74
|
-
var g =
|
|
75
|
-
return (
|
|
74
|
+
var g = o(y), E = g[0], f = g[1];
|
|
75
|
+
return (E + f) * 3 / 4 - f;
|
|
76
76
|
}
|
|
77
|
-
function d(y, g,
|
|
78
|
-
return (g +
|
|
77
|
+
function d(y, g, E) {
|
|
78
|
+
return (g + E) * 3 / 4 - E;
|
|
79
79
|
}
|
|
80
80
|
function u(y) {
|
|
81
|
-
var g,
|
|
81
|
+
var g, E = o(y), f = E[0], S = E[1], k = new t(d(y, f, S)), p = 0, P = S > 0 ? f - 4 : f, I;
|
|
82
82
|
for (I = 0; I < P; I += 4)
|
|
83
|
-
g = e[y.charCodeAt(I)] << 18 | e[y.charCodeAt(I + 1)] << 12 | e[y.charCodeAt(I + 2)] << 6 | e[y.charCodeAt(I + 3)], k[
|
|
84
|
-
return S === 2 && (g = e[y.charCodeAt(I)] << 2 | e[y.charCodeAt(I + 1)] >> 4, k[
|
|
83
|
+
g = e[y.charCodeAt(I)] << 18 | e[y.charCodeAt(I + 1)] << 12 | e[y.charCodeAt(I + 2)] << 6 | e[y.charCodeAt(I + 3)], k[p++] = g >> 16 & 255, k[p++] = g >> 8 & 255, k[p++] = g & 255;
|
|
84
|
+
return S === 2 && (g = e[y.charCodeAt(I)] << 2 | e[y.charCodeAt(I + 1)] >> 4, k[p++] = g & 255), S === 1 && (g = e[y.charCodeAt(I)] << 10 | e[y.charCodeAt(I + 1)] << 4 | e[y.charCodeAt(I + 2)] >> 2, k[p++] = g >> 8 & 255, k[p++] = g & 255), k;
|
|
85
85
|
}
|
|
86
86
|
function C(y) {
|
|
87
87
|
return s[y >> 18 & 63] + s[y >> 12 & 63] + s[y >> 6 & 63] + s[y & 63];
|
|
88
88
|
}
|
|
89
|
-
function h(y, g,
|
|
90
|
-
for (var f, S = [], k = g; k <
|
|
89
|
+
function h(y, g, E) {
|
|
90
|
+
for (var f, S = [], k = g; k < E; k += 3)
|
|
91
91
|
f = (y[k] << 16 & 16711680) + (y[k + 1] << 8 & 65280) + (y[k + 2] & 255), S.push(C(f));
|
|
92
92
|
return S.join("");
|
|
93
93
|
}
|
|
94
94
|
function w(y) {
|
|
95
|
-
for (var g,
|
|
96
|
-
S.push(h(y,
|
|
97
|
-
return f === 1 ? (g = y[
|
|
95
|
+
for (var g, E = y.length, f = E % 3, S = [], k = 16383, p = 0, P = E - f; p < P; p += k)
|
|
96
|
+
S.push(h(y, p, p + k > P ? P : p + k));
|
|
97
|
+
return f === 1 ? (g = y[E - 1], S.push(
|
|
98
98
|
s[g >> 2] + s[g << 4 & 63] + "=="
|
|
99
|
-
)) : f === 2 && (g = (y[
|
|
99
|
+
)) : f === 2 && (g = (y[E - 2] << 8) + y[E - 1], S.push(
|
|
100
100
|
s[g >> 10] + s[g >> 4 & 63] + s[g << 2 & 63] + "="
|
|
101
101
|
)), S.join("");
|
|
102
102
|
}
|
|
@@ -106,7 +106,7 @@ var Ye = Re();
|
|
|
106
106
|
const ue = /* @__PURE__ */ ze(Ye);
|
|
107
107
|
class Qe {
|
|
108
108
|
constructor() {
|
|
109
|
-
|
|
109
|
+
r(this, "deps", /* @__PURE__ */ new Map());
|
|
110
110
|
}
|
|
111
111
|
on(e, t) {
|
|
112
112
|
this.deps.set(e, t);
|
|
@@ -154,11 +154,11 @@ function Xe(s) {
|
|
|
154
154
|
}
|
|
155
155
|
function et(s, e, t, n) {
|
|
156
156
|
if (s) {
|
|
157
|
-
const i =
|
|
157
|
+
const i = _e(s, e, t, n);
|
|
158
158
|
return s[0](i);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function _e(s, e, t, n) {
|
|
162
162
|
return s[1] && n ? qe(t.ctx.slice(), s[1](n(e))) : t.ctx;
|
|
163
163
|
}
|
|
164
164
|
function tt(s, e, t, n) {
|
|
@@ -167,8 +167,8 @@ function tt(s, e, t, n) {
|
|
|
167
167
|
if (e.dirty === void 0)
|
|
168
168
|
return i;
|
|
169
169
|
if (typeof i == "object") {
|
|
170
|
-
const a = [],
|
|
171
|
-
for (let l = 0; l <
|
|
170
|
+
const a = [], o = Math.max(e.dirty.length, i.length);
|
|
171
|
+
for (let l = 0; l < o; l += 1)
|
|
172
172
|
a[l] = e.dirty[l] | i[l];
|
|
173
173
|
return a;
|
|
174
174
|
}
|
|
@@ -178,8 +178,8 @@ function tt(s, e, t, n) {
|
|
|
178
178
|
}
|
|
179
179
|
function nt(s, e, t, n, i, a) {
|
|
180
180
|
if (i) {
|
|
181
|
-
const
|
|
182
|
-
s.p(
|
|
181
|
+
const o = _e(e, t, n, a);
|
|
182
|
+
s.p(o, i);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
function st(s) {
|
|
@@ -203,7 +203,7 @@ function W(s, e, t) {
|
|
|
203
203
|
function j(s) {
|
|
204
204
|
s.parentNode && s.parentNode.removeChild(s);
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function pe(s, e) {
|
|
207
207
|
for (let t = 0; t < s.length; t += 1)
|
|
208
208
|
s[t] && s[t].d(e);
|
|
209
209
|
}
|
|
@@ -250,21 +250,21 @@ function ne(s) {
|
|
|
250
250
|
M.push(s);
|
|
251
251
|
}
|
|
252
252
|
const X = /* @__PURE__ */ new Set();
|
|
253
|
-
let
|
|
253
|
+
let b = 0;
|
|
254
254
|
function Le() {
|
|
255
|
-
if (
|
|
255
|
+
if (b !== 0)
|
|
256
256
|
return;
|
|
257
257
|
const s = se;
|
|
258
258
|
do {
|
|
259
259
|
try {
|
|
260
|
-
for (;
|
|
261
|
-
const e = x[
|
|
262
|
-
|
|
260
|
+
for (; b < x.length; ) {
|
|
261
|
+
const e = x[b];
|
|
262
|
+
b++, Z(e), ct(e.$$);
|
|
263
263
|
}
|
|
264
264
|
} catch (e) {
|
|
265
|
-
throw x.length = 0,
|
|
265
|
+
throw x.length = 0, b = 0, e;
|
|
266
266
|
}
|
|
267
|
-
for (Z(null), x.length = 0,
|
|
267
|
+
for (Z(null), x.length = 0, b = 0; ye.length; ) ye.pop()();
|
|
268
268
|
for (let e = 0; e < M.length; e += 1) {
|
|
269
269
|
const t = M[e];
|
|
270
270
|
X.has(t) || (X.add(t), t());
|
|
@@ -319,7 +319,7 @@ function Pe(s, e) {
|
|
|
319
319
|
function ht(s, e) {
|
|
320
320
|
s.$$.dirty[0] === -1 && (x.push(s), ot(), s.$$.dirty.fill(0)), s.$$.dirty[e / 31 | 0] |= 1 << e % 31;
|
|
321
321
|
}
|
|
322
|
-
function Ae(s, e, t, n, i, a,
|
|
322
|
+
function Ae(s, e, t, n, i, a, o = null, l = [-1]) {
|
|
323
323
|
const d = se;
|
|
324
324
|
Z(s);
|
|
325
325
|
const u = s.$$ = {
|
|
@@ -343,7 +343,7 @@ function Ae(s, e, t, n, i, a, r = null, l = [-1]) {
|
|
|
343
343
|
skip_bound: !1,
|
|
344
344
|
root: e.target || d.$$.root
|
|
345
345
|
};
|
|
346
|
-
|
|
346
|
+
o && o(u.root);
|
|
347
347
|
let C = !1;
|
|
348
348
|
if (u.ctx = t ? t(s, e.props || {}, (h, w, ...y) => {
|
|
349
349
|
const g = y.length ? y[0] : w;
|
|
@@ -358,7 +358,7 @@ function Ae(s, e, t, n, i, a, r = null, l = [-1]) {
|
|
|
358
358
|
}
|
|
359
359
|
Z(d);
|
|
360
360
|
}
|
|
361
|
-
class
|
|
361
|
+
class Ne {
|
|
362
362
|
constructor() {
|
|
363
363
|
de(this, "$$"), de(this, "$$set");
|
|
364
364
|
}
|
|
@@ -395,13 +395,13 @@ function yt(s) {
|
|
|
395
395
|
let e, t, n, i = (
|
|
396
396
|
/*title*/
|
|
397
397
|
(s[1] || "标题") + ""
|
|
398
|
-
), a,
|
|
398
|
+
), a, o, l, d, u, C, h = (
|
|
399
399
|
/*cancelText*/
|
|
400
400
|
(s[4] || "取消") + ""
|
|
401
|
-
), w, y, g,
|
|
401
|
+
), w, y, g, E = (
|
|
402
402
|
/*okText*/
|
|
403
403
|
(s[5] || "确认") + ""
|
|
404
|
-
), f, S, k,
|
|
404
|
+
), f, S, k, p;
|
|
405
405
|
const P = (
|
|
406
406
|
/*#slots*/
|
|
407
407
|
s[8].default
|
|
@@ -414,15 +414,15 @@ function yt(s) {
|
|
|
414
414
|
);
|
|
415
415
|
return {
|
|
416
416
|
c() {
|
|
417
|
-
e = A("div"), t = A("div"), n = A("div"), a = T(i),
|
|
417
|
+
e = A("div"), t = A("div"), n = A("div"), a = T(i), o = K(), l = A("div"), I && I.c(), d = K(), u = A("div"), C = A("button"), w = T(h), y = K(), g = A("button"), f = T(E), B(n, "class", "model-title svelte-16iv9d0"), B(l, "class", "slot svelte-16iv9d0"), B(C, "class", "modal-btn svelte-16iv9d0"), B(g, "class", "modal-btn success svelte-16iv9d0"), Y(
|
|
418
418
|
g,
|
|
419
419
|
"background-color",
|
|
420
420
|
/*theme*/
|
|
421
421
|
s[6]
|
|
422
422
|
), B(u, "class", "modal-footer svelte-16iv9d0"), B(t, "class", "modal-content svelte-16iv9d0"), B(e, "class", "modal-background modal-visible svelte-16iv9d0");
|
|
423
423
|
},
|
|
424
|
-
m(D,
|
|
425
|
-
W(D, e,
|
|
424
|
+
m(D, N) {
|
|
425
|
+
W(D, e, N), L(e, t), L(t, n), L(n, a), L(t, o), L(t, l), I && I.m(l, null), L(t, d), L(t, u), L(u, C), L(C, w), L(u, y), L(u, g), L(g, f), S = !0, k || (p = [
|
|
426
426
|
F(C, "click", function() {
|
|
427
427
|
V(
|
|
428
428
|
/*onCancel*/
|
|
@@ -444,10 +444,10 @@ function yt(s) {
|
|
|
444
444
|
})
|
|
445
445
|
], k = !0);
|
|
446
446
|
},
|
|
447
|
-
p(D, [
|
|
448
|
-
s = D, (!S ||
|
|
447
|
+
p(D, [N]) {
|
|
448
|
+
s = D, (!S || N & /*title*/
|
|
449
449
|
2) && i !== (i = /*title*/
|
|
450
|
-
(s[1] || "标题") + "") && z(a, i), I && I.p && (!S ||
|
|
450
|
+
(s[1] || "标题") + "") && z(a, i), I && I.p && (!S || N & /*$$scope*/
|
|
451
451
|
128) && nt(
|
|
452
452
|
I,
|
|
453
453
|
P,
|
|
@@ -458,18 +458,18 @@ function yt(s) {
|
|
|
458
458
|
P,
|
|
459
459
|
/*$$scope*/
|
|
460
460
|
s[7],
|
|
461
|
-
|
|
461
|
+
N,
|
|
462
462
|
null
|
|
463
463
|
) : st(
|
|
464
464
|
/*$$scope*/
|
|
465
465
|
s[7]
|
|
466
466
|
),
|
|
467
467
|
null
|
|
468
|
-
), (!S ||
|
|
468
|
+
), (!S || N & /*cancelText*/
|
|
469
469
|
16) && h !== (h = /*cancelText*/
|
|
470
|
-
(s[4] || "取消") + "") && z(w, h), (!S ||
|
|
471
|
-
32) &&
|
|
472
|
-
(s[5] || "确认") + "") && z(f,
|
|
470
|
+
(s[4] || "取消") + "") && z(w, h), (!S || N & /*okText*/
|
|
471
|
+
32) && E !== (E = /*okText*/
|
|
472
|
+
(s[5] || "确认") + "") && z(f, E), (!S || N & /*theme*/
|
|
473
473
|
64) && Y(
|
|
474
474
|
g,
|
|
475
475
|
"background-color",
|
|
@@ -484,18 +484,18 @@ function yt(s) {
|
|
|
484
484
|
De(I, D), S = !1;
|
|
485
485
|
},
|
|
486
486
|
d(D) {
|
|
487
|
-
D && j(e), I && I.d(D), k = !1, U(
|
|
487
|
+
D && j(e), I && I.d(D), k = !1, U(p);
|
|
488
488
|
}
|
|
489
489
|
};
|
|
490
490
|
}
|
|
491
491
|
const Ct = (s) => s.stopPropagation();
|
|
492
492
|
function ft(s, e, t) {
|
|
493
|
-
let { $$slots: n = {}, $$scope: i } = e, { onCancel: a } = e, { title:
|
|
493
|
+
let { $$slots: n = {}, $$scope: i } = e, { onCancel: a } = e, { title: o } = e, { onOk: l } = e, { onClose: d } = e, { cancelText: u } = e, { okText: C } = e, { theme: h } = e;
|
|
494
494
|
return s.$$set = (w) => {
|
|
495
|
-
"onCancel" in w && t(0, a = w.onCancel), "title" in w && t(1,
|
|
496
|
-
}, [a,
|
|
495
|
+
"onCancel" in w && t(0, a = w.onCancel), "title" in w && t(1, o = w.title), "onOk" in w && t(2, l = w.onOk), "onClose" in w && t(3, d = w.onClose), "cancelText" in w && t(4, u = w.cancelText), "okText" in w && t(5, C = w.okText), "theme" in w && t(6, h = w.theme), "$$scope" in w && t(7, i = w.$$scope);
|
|
496
|
+
}, [a, o, l, d, u, C, h, i, n];
|
|
497
497
|
}
|
|
498
|
-
class wt extends
|
|
498
|
+
class wt extends Ne {
|
|
499
499
|
constructor(e) {
|
|
500
500
|
super(), Ae(this, e, ft, yt, ve, {
|
|
501
501
|
onCancel: 0,
|
|
@@ -566,12 +566,12 @@ function me(s) {
|
|
|
566
566
|
};
|
|
567
567
|
}
|
|
568
568
|
function Ee(s) {
|
|
569
|
-
let e, t, n, i, a,
|
|
569
|
+
let e, t, n, i, a, o = Q(
|
|
570
570
|
/*columns*/
|
|
571
571
|
s[1]
|
|
572
572
|
), l = [];
|
|
573
|
-
for (let u = 0; u <
|
|
574
|
-
l[u] = me(we(s,
|
|
573
|
+
for (let u = 0; u < o.length; u += 1)
|
|
574
|
+
l[u] = me(we(s, o, u));
|
|
575
575
|
function d() {
|
|
576
576
|
return (
|
|
577
577
|
/*click_handler*/
|
|
@@ -600,18 +600,18 @@ function Ee(s) {
|
|
|
600
600
|
p(u, C) {
|
|
601
601
|
if (s = u, C & /*columns, data*/
|
|
602
602
|
3) {
|
|
603
|
-
|
|
603
|
+
o = Q(
|
|
604
604
|
/*columns*/
|
|
605
605
|
s[1]
|
|
606
606
|
);
|
|
607
607
|
let h;
|
|
608
|
-
for (h = 0; h <
|
|
609
|
-
const w = we(s,
|
|
608
|
+
for (h = 0; h < o.length; h += 1) {
|
|
609
|
+
const w = we(s, o, h);
|
|
610
610
|
l[h] ? l[h].p(w, C) : (l[h] = me(w), l[h].c(), l[h].m(e, t));
|
|
611
611
|
}
|
|
612
612
|
for (; h < l.length; h += 1)
|
|
613
613
|
l[h].d(1);
|
|
614
|
-
l.length =
|
|
614
|
+
l.length = o.length;
|
|
615
615
|
}
|
|
616
616
|
C & /*selectedIndex*/
|
|
617
617
|
128 && n !== (n = ge(`cert-item ${/*index*/
|
|
@@ -620,7 +620,7 @@ function Ee(s) {
|
|
|
620
620
|
s[7] ? "cert-item-selected" : ""}`) + " svelte-1kh75ag") && B(e, "class", n);
|
|
621
621
|
},
|
|
622
622
|
d(u) {
|
|
623
|
-
u && j(e),
|
|
623
|
+
u && j(e), pe(l, u), i = !1, a();
|
|
624
624
|
}
|
|
625
625
|
};
|
|
626
626
|
}
|
|
@@ -638,8 +638,8 @@ function mt(s) {
|
|
|
638
638
|
e = it();
|
|
639
639
|
},
|
|
640
640
|
m(i, a) {
|
|
641
|
-
for (let
|
|
642
|
-
n[
|
|
641
|
+
for (let o = 0; o < n.length; o += 1)
|
|
642
|
+
n[o] && n[o].m(i, a);
|
|
643
643
|
W(i, e, a);
|
|
644
644
|
},
|
|
645
645
|
p(i, a) {
|
|
@@ -649,18 +649,18 @@ function mt(s) {
|
|
|
649
649
|
/*data*/
|
|
650
650
|
i[0]
|
|
651
651
|
);
|
|
652
|
-
let
|
|
653
|
-
for (
|
|
654
|
-
const l = fe(i, t,
|
|
655
|
-
n[
|
|
652
|
+
let o;
|
|
653
|
+
for (o = 0; o < t.length; o += 1) {
|
|
654
|
+
const l = fe(i, t, o);
|
|
655
|
+
n[o] ? n[o].p(l, a) : (n[o] = Ee(l), n[o].c(), n[o].m(e.parentNode, e));
|
|
656
656
|
}
|
|
657
|
-
for (;
|
|
658
|
-
n[
|
|
657
|
+
for (; o < n.length; o += 1)
|
|
658
|
+
n[o].d(1);
|
|
659
659
|
n.length = t.length;
|
|
660
660
|
}
|
|
661
661
|
},
|
|
662
662
|
d(i) {
|
|
663
|
-
i && j(e),
|
|
663
|
+
i && j(e), pe(n, i);
|
|
664
664
|
}
|
|
665
665
|
};
|
|
666
666
|
}
|
|
@@ -733,14 +733,14 @@ function Et(s) {
|
|
|
733
733
|
};
|
|
734
734
|
}
|
|
735
735
|
function St(s, e, t) {
|
|
736
|
-
let { data: n = [] } = e, { columns: i = [] } = e, { onCancel: a } = e, { onOk:
|
|
736
|
+
let { data: n = [] } = e, { columns: i = [] } = e, { onCancel: a } = e, { onOk: o } = e, { onClose: l } = e, { cancelText: d = "" } = e, { okText: u = "" } = e, { theme: C = "#409eff" } = e, { title: h = "" } = e, w = 0;
|
|
737
737
|
const y = () => {
|
|
738
738
|
a(`${h}失败`), l == null || l();
|
|
739
739
|
}, g = () => {
|
|
740
|
-
|
|
741
|
-
},
|
|
740
|
+
o == null || o(n[w]), l == null || l();
|
|
741
|
+
}, E = (f) => t(7, w = f);
|
|
742
742
|
return s.$$set = (f) => {
|
|
743
|
-
"data" in f && t(0, n = f.data), "columns" in f && t(1, i = f.columns), "onCancel" in f && t(10, a = f.onCancel), "onOk" in f && t(11,
|
|
743
|
+
"data" in f && t(0, n = f.data), "columns" in f && t(1, i = f.columns), "onCancel" in f && t(10, a = f.onCancel), "onOk" in f && t(11, o = f.onOk), "onClose" in f && t(2, l = f.onClose), "cancelText" in f && t(3, d = f.cancelText), "okText" in f && t(4, u = f.okText), "theme" in f && t(5, C = f.theme), "title" in f && t(6, h = f.title);
|
|
744
744
|
}, [
|
|
745
745
|
n,
|
|
746
746
|
i,
|
|
@@ -753,11 +753,11 @@ function St(s, e, t) {
|
|
|
753
753
|
y,
|
|
754
754
|
g,
|
|
755
755
|
a,
|
|
756
|
-
|
|
757
|
-
|
|
756
|
+
o,
|
|
757
|
+
E
|
|
758
758
|
];
|
|
759
759
|
}
|
|
760
|
-
class It extends
|
|
760
|
+
class It extends Ne {
|
|
761
761
|
constructor(e) {
|
|
762
762
|
super(), Ae(this, e, St, Et, ve, {
|
|
763
763
|
data: 0,
|
|
@@ -774,11 +774,11 @@ class It extends be {
|
|
|
774
774
|
}
|
|
775
775
|
class kt {
|
|
776
776
|
constructor() {
|
|
777
|
-
|
|
778
|
-
|
|
777
|
+
r(this, "modalInstance", { current: null });
|
|
778
|
+
r(this, "open", (e) => new Promise((t, n) => {
|
|
779
779
|
this.modalInstance.current = new It({
|
|
780
780
|
target: document.body,
|
|
781
|
-
props: v(
|
|
781
|
+
props: v(m({}, e), {
|
|
782
782
|
onCancel: (i) => {
|
|
783
783
|
n({
|
|
784
784
|
code: -1,
|
|
@@ -794,7 +794,7 @@ class kt {
|
|
|
794
794
|
})
|
|
795
795
|
});
|
|
796
796
|
}));
|
|
797
|
-
|
|
797
|
+
r(this, "close", () => {
|
|
798
798
|
setTimeout(() => {
|
|
799
799
|
var e;
|
|
800
800
|
(e = this.modalInstance.current) == null || e.$destroy();
|
|
@@ -810,19 +810,19 @@ function vt(s = 32, e = !0, t = 0) {
|
|
|
810
810
|
else {
|
|
811
811
|
let a;
|
|
812
812
|
i[8] = i[13] = i[18] = i[23] = "-", i[14] = "4";
|
|
813
|
-
for (let
|
|
814
|
-
i[
|
|
813
|
+
for (let o = 0; o < 36; o++)
|
|
814
|
+
i[o] || (a = 0 | Math.random() * 16, i[o] = n[o === 19 ? a & 3 | 8 : a]);
|
|
815
815
|
}
|
|
816
816
|
return e ? (i.shift(), `u${i.join("")}`) : i.join("");
|
|
817
817
|
}
|
|
818
|
-
const
|
|
818
|
+
const _t = [
|
|
819
819
|
{
|
|
820
820
|
key: "CN"
|
|
821
821
|
},
|
|
822
822
|
{
|
|
823
823
|
format: (s) => `${s.DevClass}(${s.sn})`
|
|
824
824
|
}
|
|
825
|
-
],
|
|
825
|
+
], pt = [
|
|
826
826
|
{
|
|
827
827
|
key: "SealId"
|
|
828
828
|
},
|
|
@@ -846,25 +846,25 @@ const pt = [
|
|
|
846
846
|
];
|
|
847
847
|
class Dt {
|
|
848
848
|
constructor(e) {
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
849
|
+
r(this, "socketInstance", null);
|
|
850
|
+
r(this, "eventBus", new Qe());
|
|
851
|
+
r(this, "scene");
|
|
852
|
+
r(this, "isRememberPin", !1);
|
|
853
|
+
r(this, "pinPolicy");
|
|
854
|
+
r(this, "socketConfig", null);
|
|
855
|
+
r(this, "isConnecting", !1);
|
|
856
|
+
r(this, "messageQueue", []);
|
|
857
|
+
r(this, "getSocketReadyState", () => {
|
|
858
858
|
var e;
|
|
859
859
|
return (e = this.socketInstance) == null ? void 0 : e.readyState;
|
|
860
860
|
});
|
|
861
|
-
|
|
861
|
+
r(this, "destroy", () => {
|
|
862
862
|
var e;
|
|
863
863
|
(e = this.socketInstance) == null || e.close();
|
|
864
864
|
});
|
|
865
|
-
|
|
865
|
+
r(this, "sendMessage", (e, t, n) => new Promise((i, a) => {
|
|
866
866
|
var l;
|
|
867
|
-
const
|
|
867
|
+
const o = () => {
|
|
868
868
|
var h, w;
|
|
869
869
|
if (((h = this.socketInstance) == null ? void 0 : h.readyState) !== WebSocket.OPEN) {
|
|
870
870
|
a({
|
|
@@ -890,72 +890,72 @@ class Dt {
|
|
|
890
890
|
return;
|
|
891
891
|
}
|
|
892
892
|
if (((l = this.socketInstance) == null ? void 0 : l.readyState) === WebSocket.OPEN) {
|
|
893
|
-
|
|
893
|
+
o();
|
|
894
894
|
return;
|
|
895
895
|
}
|
|
896
|
-
this.messageQueue.push(
|
|
896
|
+
this.messageQueue.push(o), this.isConnecting || this.initSocket(this.socketConfig);
|
|
897
897
|
}));
|
|
898
|
-
|
|
898
|
+
r(this, "flushMsgQueue", () => {
|
|
899
899
|
var e;
|
|
900
900
|
(e = this.messageQueue) == null || e.forEach((t) => t()), this.messageQueue = [];
|
|
901
901
|
});
|
|
902
|
-
|
|
903
|
-
var t, n, i, a,
|
|
902
|
+
r(this, "handleEventData", (e) => c(this, null, function* () {
|
|
903
|
+
var t, n, i, a, o, l, d, u;
|
|
904
904
|
if (e.data instanceof Blob) {
|
|
905
905
|
const C = yield e.data.arrayBuffer(), y = new TextDecoder(
|
|
906
906
|
navigator.userAgent.includes("Windows") ? "gbk" : "utf-8"
|
|
907
|
-
).decode(C).replace(/\\(?!(["\\\/bfnrtu]))/g, ""), g = JSON.parse(y),
|
|
907
|
+
).decode(C).replace(/\\(?!(["\\\/bfnrtu]))/g, ""), g = JSON.parse(y), E = {
|
|
908
908
|
success: (t = g.result) == null ? void 0 : t.success,
|
|
909
909
|
msg: (n = g.result) == null ? void 0 : n.msg,
|
|
910
910
|
errCode: (i = g.result) == null ? void 0 : i.errCode,
|
|
911
911
|
data: g.data,
|
|
912
912
|
type: (a = g.result) == null ? void 0 : a.event
|
|
913
|
-
}, f = (
|
|
914
|
-
S ? this.eventBus.emit(S,
|
|
913
|
+
}, f = (o = g.result) == null ? void 0 : o.function, S = (l = g.result) == null ? void 0 : l.msgid;
|
|
914
|
+
S ? this.eventBus.emit(S, E) : this.eventBus.emit(f, E), (u = (d = this.socketConfig) == null ? void 0 : d.onMessage) == null || u.call(d, E);
|
|
915
915
|
}
|
|
916
916
|
}));
|
|
917
|
-
|
|
917
|
+
r(this, "base64Encode", (e) => {
|
|
918
918
|
const t = new TextEncoder().encode(e);
|
|
919
919
|
return ue.fromByteArray(t);
|
|
920
920
|
});
|
|
921
|
-
|
|
921
|
+
r(this, "base64Decode", (e) => {
|
|
922
922
|
const t = ue.toByteArray(e);
|
|
923
923
|
return new TextDecoder().decode(t);
|
|
924
924
|
});
|
|
925
|
-
|
|
925
|
+
r(this, "changeIsRememberPin", (e) => c(this, null, function* () {
|
|
926
926
|
this.isRememberPin = e;
|
|
927
927
|
}));
|
|
928
|
-
|
|
928
|
+
r(this, "changePinPolicy", (e) => c(this, null, function* () {
|
|
929
929
|
this.pinPolicy = e;
|
|
930
930
|
}));
|
|
931
|
-
|
|
931
|
+
r(this, "checkCertIsLogin", (e) => c(this, null, function* () {
|
|
932
932
|
return yield this.sendMessage("GZCA_IsLogin", e);
|
|
933
933
|
}));
|
|
934
|
-
|
|
934
|
+
r(this, "addUkeyEvents", () => c(this, null, function* () {
|
|
935
935
|
this.sendMessage("GZCA_WaitForDevEvent", {
|
|
936
936
|
Type: He
|
|
937
937
|
}), this.eventBus.on(
|
|
938
938
|
"GZCA_OnDeviceChange",
|
|
939
939
|
(e) => {
|
|
940
940
|
var t, n, i;
|
|
941
|
-
(i = (t = this.socketConfig) == null ? void 0 : t.onUkeyChange) == null || i.call(t, v(
|
|
941
|
+
(i = (t = this.socketConfig) == null ? void 0 : t.onUkeyChange) == null || i.call(t, v(m({}, e), {
|
|
942
942
|
data: (n = e.data) == null ? void 0 : n[0]
|
|
943
943
|
}));
|
|
944
944
|
}
|
|
945
945
|
);
|
|
946
946
|
}));
|
|
947
|
-
|
|
947
|
+
r(this, "ensureCertLogin", (e) => c(this, null, function* () {
|
|
948
948
|
const t = yield this.checkCertIsLogin({
|
|
949
|
-
ContainerName: e
|
|
949
|
+
ContainerName: e.ContainerName
|
|
950
950
|
});
|
|
951
951
|
t != null && t[0].isLogin || (yield this.sendMessage("GZCA_Login", {
|
|
952
|
-
ContainerName: e,
|
|
952
|
+
ContainerName: e.ContainerName,
|
|
953
953
|
IsLogin: "N",
|
|
954
954
|
UserPin: "123456",
|
|
955
955
|
PinPolicy: this.pinPolicy
|
|
956
956
|
}));
|
|
957
957
|
}));
|
|
958
|
-
|
|
958
|
+
r(this, "verifyPin", (e) => c(this, null, function* () {
|
|
959
959
|
var t;
|
|
960
960
|
yield this.sendMessage("GZCA_Login", {
|
|
961
961
|
ContainerName: e.ContainerName,
|
|
@@ -964,198 +964,199 @@ class Dt {
|
|
|
964
964
|
PinPolicy: this.pinPolicy
|
|
965
965
|
});
|
|
966
966
|
}));
|
|
967
|
-
|
|
967
|
+
r(this, "getCert", (e, t, n) => c(this, null, function* () {
|
|
968
968
|
const i = t != null ? t : yield this.chooseCert(e);
|
|
969
|
-
return this.isRememberPin && n && (yield this.
|
|
969
|
+
return this.isRememberPin && n && (yield this.ensureCertLogin({
|
|
970
|
+
ContainerName: i.ContainerName
|
|
971
|
+
})), i;
|
|
970
972
|
}));
|
|
971
|
-
|
|
973
|
+
r(this, "chooseCert", (e) => c(this, null, function* () {
|
|
972
974
|
var i;
|
|
973
975
|
const t = yield this.getCertList(e);
|
|
974
976
|
return t != null && t.length ? (t == null ? void 0 : t.length) === 1 ? t[0] : yield G.open({
|
|
975
977
|
title: "选择证书",
|
|
976
978
|
data: t,
|
|
977
|
-
columns:
|
|
979
|
+
columns: _t,
|
|
978
980
|
theme: (i = this.socketConfig) == null ? void 0 : i.theme
|
|
979
981
|
}) : Promise.reject({
|
|
980
982
|
errCode: Ue,
|
|
981
983
|
msg: "暂无证书"
|
|
982
984
|
});
|
|
983
985
|
}));
|
|
984
|
-
|
|
986
|
+
r(this, "getCertList", (e) => c(this, null, function* () {
|
|
985
987
|
return yield this.sendMessage(
|
|
986
988
|
"GZCA_GetCertList",
|
|
987
989
|
e
|
|
988
990
|
);
|
|
989
991
|
}));
|
|
990
|
-
|
|
991
|
-
return yield this.sendMessage("GZCA_Pkcs1SignData",
|
|
992
|
+
r(this, "pkcs1Sign", (e) => c(this, null, function* () {
|
|
993
|
+
return yield this.sendMessage("GZCA_Pkcs1SignData", m({
|
|
992
994
|
IsLogin: this.getIsLogin(),
|
|
993
995
|
PinPolicy: this.pinPolicy
|
|
994
996
|
}, e != null ? e : {}));
|
|
995
997
|
}));
|
|
996
|
-
|
|
997
|
-
return yield this.sendMessage("GZCA_Pkcs1SignDataEx",
|
|
998
|
+
r(this, "pkcs1Base64Sign", (e) => c(this, null, function* () {
|
|
999
|
+
return yield this.sendMessage("GZCA_Pkcs1SignDataEx", m({
|
|
998
1000
|
IsLogin: this.getIsLogin(),
|
|
999
1001
|
PinPolicy: this.pinPolicy
|
|
1000
1002
|
}, e != null ? e : {}));
|
|
1001
1003
|
}));
|
|
1002
|
-
|
|
1003
|
-
return yield this.sendMessage("GZCA_BatchPkcs1SignDataEx",
|
|
1004
|
+
r(this, "batchPkcs1Base64Sign", (e) => c(this, null, function* () {
|
|
1005
|
+
return yield this.sendMessage("GZCA_BatchPkcs1SignDataEx", m({
|
|
1004
1006
|
IsLogin: this.getIsLogin(),
|
|
1005
1007
|
PinPolicy: this.pinPolicy
|
|
1006
1008
|
}, e != null ? e : {}));
|
|
1007
1009
|
}));
|
|
1008
|
-
|
|
1010
|
+
r(this, "pkcs1VerifySignature", (e) => c(this, null, function* () {
|
|
1009
1011
|
return yield this.sendMessage("GZCA_Pkcs1VerifySign", e);
|
|
1010
1012
|
}));
|
|
1011
|
-
|
|
1013
|
+
r(this, "pkcs1Base64VerifySignature", (e) => c(this, null, function* () {
|
|
1012
1014
|
return yield this.sendMessage("GZCA_Pkcs1VerifySignEx", e);
|
|
1013
1015
|
}));
|
|
1014
|
-
|
|
1016
|
+
r(this, "getSealList", (e) => c(this, null, function* () {
|
|
1015
1017
|
return yield this.sendMessage(
|
|
1016
1018
|
"GZCA_EnumSeals",
|
|
1017
|
-
|
|
1019
|
+
m({
|
|
1018
1020
|
IsLogin: this.getIsLogin()
|
|
1019
1021
|
}, e != null ? e : {}),
|
|
1020
|
-
|
|
1022
|
+
_.LEVEL_2
|
|
1021
1023
|
);
|
|
1022
1024
|
}));
|
|
1023
|
-
|
|
1025
|
+
r(this, "writeSeal", (e) => c(this, null, function* () {
|
|
1024
1026
|
return yield this.sendMessage(
|
|
1025
1027
|
"GZCA_WriteSeal",
|
|
1026
|
-
|
|
1028
|
+
m({
|
|
1027
1029
|
IsLogin: this.getIsLogin()
|
|
1028
1030
|
}, e != null ? e : {}),
|
|
1029
|
-
|
|
1031
|
+
_.LEVEL_2
|
|
1030
1032
|
);
|
|
1031
1033
|
}));
|
|
1032
|
-
|
|
1034
|
+
r(this, "deleteSeal", (e) => c(this, null, function* () {
|
|
1033
1035
|
return yield this.sendMessage(
|
|
1034
1036
|
"GZCA_DeleteSeal",
|
|
1035
|
-
|
|
1037
|
+
m({
|
|
1036
1038
|
IsLogin: this.getIsLogin()
|
|
1037
1039
|
}, e != null ? e : {}),
|
|
1038
|
-
|
|
1040
|
+
_.LEVEL_2
|
|
1039
1041
|
);
|
|
1040
1042
|
}));
|
|
1041
|
-
|
|
1043
|
+
r(this, "getSealInfo", (e) => c(this, null, function* () {
|
|
1042
1044
|
return yield this.sendMessage(
|
|
1043
1045
|
"GZCA_ReadSeal",
|
|
1044
|
-
|
|
1046
|
+
m({
|
|
1045
1047
|
IsLogin: this.getIsLogin()
|
|
1046
1048
|
}, e != null ? e : {}),
|
|
1047
|
-
|
|
1049
|
+
_.LEVEL_2
|
|
1048
1050
|
);
|
|
1049
1051
|
}));
|
|
1050
|
-
|
|
1052
|
+
r(this, "getTPSealList", (e) => c(this, null, function* () {
|
|
1051
1053
|
return yield this.sendMessage(
|
|
1052
1054
|
"GZCA_GetSealPicList",
|
|
1053
|
-
|
|
1055
|
+
m({
|
|
1054
1056
|
IsLogin: this.getIsLogin()
|
|
1055
1057
|
}, e != null ? e : {}),
|
|
1056
|
-
|
|
1058
|
+
_.LEVEL_2
|
|
1057
1059
|
);
|
|
1058
1060
|
}));
|
|
1059
|
-
|
|
1060
|
-
var n;
|
|
1061
|
+
r(this, "getTPSealPic", (e) => c(this, null, function* () {
|
|
1061
1062
|
return yield this.sendMessage(
|
|
1062
1063
|
"GZCA_GetSealPicData",
|
|
1063
|
-
|
|
1064
|
-
IsLogin:
|
|
1064
|
+
m({
|
|
1065
|
+
IsLogin: this.getIsLogin()
|
|
1065
1066
|
}, e != null ? e : {}),
|
|
1066
|
-
|
|
1067
|
+
_.LEVEL_2
|
|
1067
1068
|
);
|
|
1068
1069
|
}));
|
|
1069
|
-
|
|
1070
|
+
r(this, "sm2SignPreprocess1", (e) => c(this, null, function* () {
|
|
1070
1071
|
return yield this.sendMessage("GZCA_PrepareSm2SignStep1", e);
|
|
1071
1072
|
}));
|
|
1072
|
-
|
|
1073
|
+
r(this, "sm2SignPreprocess2", (e) => c(this, null, function* () {
|
|
1073
1074
|
return yield this.sendMessage("GZCA_PrepareSm2SignStep2", e);
|
|
1074
1075
|
}));
|
|
1075
|
-
|
|
1076
|
-
return yield this.sendMessage("GZCA_Pkcs1SignDataForHash",
|
|
1076
|
+
r(this, "pkcs1HashSign", (e) => c(this, null, function* () {
|
|
1077
|
+
return yield this.sendMessage("GZCA_Pkcs1SignDataForHash", m({
|
|
1077
1078
|
IsLogin: this.getIsLogin(),
|
|
1078
1079
|
PinPolicy: this.pinPolicy
|
|
1079
1080
|
}, e != null ? e : {}));
|
|
1080
1081
|
}));
|
|
1081
|
-
|
|
1082
|
+
r(this, "pkcs1HashVerifySignature", (e) => c(this, null, function* () {
|
|
1082
1083
|
return yield this.sendMessage("GZCA_Pkcs1VerifySignForHash", e);
|
|
1083
1084
|
}));
|
|
1084
|
-
|
|
1085
|
-
return yield this.sendMessage("GZCA_Pkcs7SignData",
|
|
1085
|
+
r(this, "pkcs7Sign", (e) => c(this, null, function* () {
|
|
1086
|
+
return yield this.sendMessage("GZCA_Pkcs7SignData", m({
|
|
1086
1087
|
IsLogin: this.getIsLogin(),
|
|
1087
1088
|
IsAuthAttr: "Y",
|
|
1088
1089
|
PinPolicy: this.pinPolicy
|
|
1089
1090
|
}, e != null ? e : {}));
|
|
1090
1091
|
}));
|
|
1091
|
-
|
|
1092
|
+
r(this, "pkcs7VerifySignature", (e) => c(this, null, function* () {
|
|
1092
1093
|
return yield this.sendMessage("GZCA_Pkcs7VerifySign", e);
|
|
1093
1094
|
}));
|
|
1094
|
-
|
|
1095
|
+
r(this, "sm3Hash", (e) => c(this, null, function* () {
|
|
1095
1096
|
return yield this.sendMessage("GZCA_HashData", e);
|
|
1096
1097
|
}));
|
|
1097
|
-
|
|
1098
|
+
r(this, "sm3HexHash", (e) => c(this, null, function* () {
|
|
1098
1099
|
return yield this.sendMessage("GZCA_HashDataEx", e);
|
|
1099
1100
|
}));
|
|
1100
|
-
|
|
1101
|
+
r(this, "sm3FileHash", (e) => c(this, null, function* () {
|
|
1101
1102
|
return yield this.sendMessage("GZCA_HashFile", e);
|
|
1102
1103
|
}));
|
|
1103
|
-
|
|
1104
|
+
r(this, "sm3HashEncryption", (e) => c(this, null, function* () {
|
|
1104
1105
|
return yield this.sendMessage("GZCA_HMac", e);
|
|
1105
1106
|
}));
|
|
1106
|
-
|
|
1107
|
+
r(this, "pkcs7Encryption", (e) => c(this, null, function* () {
|
|
1107
1108
|
return yield this.sendMessage("GZCA_Pkcs7EncryptData", e);
|
|
1108
1109
|
}));
|
|
1109
|
-
|
|
1110
|
-
return yield this.sendMessage("GZCA_Pkcs7DecryptData",
|
|
1110
|
+
r(this, "pkcs7Decryption", (e) => c(this, null, function* () {
|
|
1111
|
+
return yield this.sendMessage("GZCA_Pkcs7DecryptData", m({
|
|
1111
1112
|
IsLogin: this.getIsLogin()
|
|
1112
1113
|
}, e != null ? e : {}));
|
|
1113
1114
|
}));
|
|
1114
|
-
|
|
1115
|
+
r(this, "pkcs7FileEncryption", (e) => c(this, null, function* () {
|
|
1115
1116
|
return yield this.sendMessage("GZCA_EnvelopeSealFileEx_qyzc", e);
|
|
1116
1117
|
}));
|
|
1117
|
-
|
|
1118
|
-
return yield this.sendMessage("GZCA_EnvelopeOpenFileEx_qyzc",
|
|
1118
|
+
r(this, "pkcs7FileDecryption", (e) => c(this, null, function* () {
|
|
1119
|
+
return yield this.sendMessage("GZCA_EnvelopeOpenFileEx_qyzc", m({
|
|
1119
1120
|
IsLogin: this.getIsLogin()
|
|
1120
1121
|
}, e != null ? e : {}));
|
|
1121
1122
|
}));
|
|
1122
|
-
|
|
1123
|
+
r(this, "asymmetricEncryption", (e) => c(this, null, function* () {
|
|
1123
1124
|
return yield this.sendMessage("GZCA_AsymEncryptData", e);
|
|
1124
1125
|
}));
|
|
1125
|
-
|
|
1126
|
-
return yield this.sendMessage("GZCA_AsymDecryptData",
|
|
1126
|
+
r(this, "asymmetricDecryption", (e) => c(this, null, function* () {
|
|
1127
|
+
return yield this.sendMessage("GZCA_AsymDecryptData", m({
|
|
1127
1128
|
IsLogin: this.getIsLogin()
|
|
1128
1129
|
}, e != null ? e : {}));
|
|
1129
1130
|
}));
|
|
1130
|
-
|
|
1131
|
+
r(this, "sm4Encryption", (e) => c(this, null, function* () {
|
|
1131
1132
|
return yield this.sendMessage("GZCA_EncryptDataEx", e);
|
|
1132
1133
|
}));
|
|
1133
|
-
|
|
1134
|
+
r(this, "sm4Decryption", (e) => c(this, null, function* () {
|
|
1134
1135
|
return yield this.sendMessage("GZCA_DecryptDataEx", e);
|
|
1135
1136
|
}));
|
|
1136
|
-
|
|
1137
|
+
r(this, "getCertInfo", (e) => c(this, null, function* () {
|
|
1137
1138
|
return yield this.sendMessage("GZCA_GetCertInfo", e);
|
|
1138
1139
|
}));
|
|
1139
|
-
|
|
1140
|
+
r(this, "getCertInfoByOid", (e) => c(this, null, function* () {
|
|
1140
1141
|
return yield this.sendMessage("GZCA_GetCertInfoByOid", e);
|
|
1141
1142
|
}));
|
|
1142
|
-
|
|
1143
|
+
r(this, "getSealVendor", (e) => c(this, null, function* () {
|
|
1143
1144
|
return yield this.sendMessage(
|
|
1144
1145
|
"GZCA_GetSealIssuer",
|
|
1145
1146
|
e,
|
|
1146
|
-
|
|
1147
|
+
_.LEVEL_2
|
|
1147
1148
|
);
|
|
1148
1149
|
}));
|
|
1149
|
-
|
|
1150
|
+
r(this, "deleteAllSealByVendor", (e) => c(this, null, function* () {
|
|
1150
1151
|
return yield this.sendMessage(
|
|
1151
1152
|
"GZCA_ClearSeal",
|
|
1152
|
-
|
|
1153
|
+
m({
|
|
1153
1154
|
IsLogin: this.getIsLogin()
|
|
1154
1155
|
}, e != null ? e : {}),
|
|
1155
|
-
|
|
1156
|
+
_.LEVEL_2
|
|
1156
1157
|
);
|
|
1157
1158
|
}));
|
|
1158
|
-
|
|
1159
|
+
r(this, "applyCert", (e) => c(this, null, function* () {
|
|
1159
1160
|
return yield this.sendMessage(
|
|
1160
1161
|
"GZCA_ApplyCert",
|
|
1161
1162
|
{
|
|
@@ -1165,28 +1166,28 @@ class Dt {
|
|
|
1165
1166
|
type: e.type,
|
|
1166
1167
|
url: e.url
|
|
1167
1168
|
},
|
|
1168
|
-
|
|
1169
|
+
_.LEVEL_3
|
|
1169
1170
|
);
|
|
1170
1171
|
}));
|
|
1171
|
-
|
|
1172
|
+
r(this, "resetPin", (e) => c(this, null, function* () {
|
|
1172
1173
|
return yield this.sendMessage(
|
|
1173
1174
|
"GZCA_UnblockUserPin",
|
|
1174
|
-
|
|
1175
|
-
|
|
1175
|
+
m({}, e != null ? e : {}),
|
|
1176
|
+
_.LEVEL_3
|
|
1176
1177
|
);
|
|
1177
1178
|
}));
|
|
1178
|
-
|
|
1179
|
+
r(this, "getUKeyList", () => c(this, null, function* () {
|
|
1179
1180
|
return yield this.sendMessage(
|
|
1180
1181
|
"GetUKeyList",
|
|
1181
1182
|
void 0,
|
|
1182
|
-
|
|
1183
|
+
_.LEVEL_3
|
|
1183
1184
|
);
|
|
1184
1185
|
}));
|
|
1185
|
-
|
|
1186
|
+
r(this, "getUKeyInfo", (e) => c(this, null, function* () {
|
|
1186
1187
|
return yield this.sendMessage(
|
|
1187
1188
|
"GetUKeyID",
|
|
1188
1189
|
e != null ? e : {},
|
|
1189
|
-
|
|
1190
|
+
_.LEVEL_3
|
|
1190
1191
|
);
|
|
1191
1192
|
}));
|
|
1192
1193
|
var t, n, i;
|
|
@@ -1214,30 +1215,30 @@ class Dt {
|
|
|
1214
1215
|
}
|
|
1215
1216
|
const $ = class $ {
|
|
1216
1217
|
constructor(e) {
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
this.gwsConfig = e != null ? e : {}, this.coreInstance = new Dt(v(
|
|
1218
|
+
r(this, "coreInstance", null);
|
|
1219
|
+
r(this, "gwsConfig", {});
|
|
1220
|
+
r(this, "createGwsCore", (e) => {
|
|
1221
|
+
this.gwsConfig = e != null ? e : {}, this.coreInstance = new Dt(v(m({}, e != null ? e : {}), {
|
|
1221
1222
|
url: Oe
|
|
1222
1223
|
}));
|
|
1223
1224
|
});
|
|
1224
|
-
|
|
1225
|
+
r(this, "appendCertBase64", (e, t = !0) => c(this, null, function* () {
|
|
1225
1226
|
if (e.CertB64) return e;
|
|
1226
1227
|
const n = t ? yield this.getSignatureCert() : yield this.getEncryptionCert();
|
|
1227
|
-
return v(
|
|
1228
|
+
return v(m({}, e != null ? e : {}), { CertB64: n == null ? void 0 : n.CertB64 });
|
|
1228
1229
|
}));
|
|
1229
|
-
|
|
1230
|
+
r(this, "destroy", () => {
|
|
1230
1231
|
var e;
|
|
1231
1232
|
(e = this.coreInstance) == null || e.destroy(), this.coreInstance = null;
|
|
1232
1233
|
});
|
|
1233
|
-
|
|
1234
|
+
r(this, "restart", (e) => {
|
|
1234
1235
|
this.coreInstance && this.destroy(), this.gwsConfig = e != null ? e : this.gwsConfig, this.createGwsCore(e);
|
|
1235
1236
|
});
|
|
1236
|
-
|
|
1237
|
+
r(this, "getSocketReadyState", () => {
|
|
1237
1238
|
var e;
|
|
1238
1239
|
return (e = this.coreInstance) == null ? void 0 : e.getSocketReadyState();
|
|
1239
1240
|
});
|
|
1240
|
-
|
|
1241
|
+
r(this, "verifyPin", (e, t) => c(this, null, function* () {
|
|
1241
1242
|
var i, a;
|
|
1242
1243
|
const n = yield this.getSignatureCert(t);
|
|
1243
1244
|
return (a = this.coreInstance) == null ? void 0 : a.verifyPin({
|
|
@@ -1245,7 +1246,14 @@ const $ = class $ {
|
|
|
1245
1246
|
UserPin: e == null ? void 0 : e.UserPin
|
|
1246
1247
|
});
|
|
1247
1248
|
}));
|
|
1248
|
-
|
|
1249
|
+
r(this, "ensureCertLogin", (e) => c(this, null, function* () {
|
|
1250
|
+
var i, a;
|
|
1251
|
+
const t = yield this.getSignatureCert(e);
|
|
1252
|
+
return yield (a = this.coreInstance) == null ? void 0 : a.ensureCertLogin({
|
|
1253
|
+
ContainerName: (i = t == null ? void 0 : t.ContainerName) != null ? i : ""
|
|
1254
|
+
});
|
|
1255
|
+
}));
|
|
1256
|
+
r(this, "getSignatureCert", (e, t = !0) => c(this, null, function* () {
|
|
1249
1257
|
var i;
|
|
1250
1258
|
return yield (i = this.coreInstance) == null ? void 0 : i.getCert(
|
|
1251
1259
|
{ CertType: re },
|
|
@@ -1253,13 +1261,13 @@ const $ = class $ {
|
|
|
1253
1261
|
t
|
|
1254
1262
|
);
|
|
1255
1263
|
}));
|
|
1256
|
-
|
|
1264
|
+
r(this, "getSignatureCertList", () => c(this, null, function* () {
|
|
1257
1265
|
var t;
|
|
1258
1266
|
return yield (t = this.coreInstance) == null ? void 0 : t.getCertList({
|
|
1259
1267
|
CertType: re
|
|
1260
1268
|
});
|
|
1261
1269
|
}));
|
|
1262
|
-
|
|
1270
|
+
r(this, "getEncryptionCert", (e, t = !0) => c(this, null, function* () {
|
|
1263
1271
|
var i;
|
|
1264
1272
|
return yield (i = this.coreInstance) == null ? void 0 : i.getCert(
|
|
1265
1273
|
{ CertType: oe },
|
|
@@ -1267,82 +1275,82 @@ const $ = class $ {
|
|
|
1267
1275
|
t
|
|
1268
1276
|
);
|
|
1269
1277
|
}));
|
|
1270
|
-
|
|
1278
|
+
r(this, "getEncryptionCertList", () => c(this, null, function* () {
|
|
1271
1279
|
var t;
|
|
1272
1280
|
return yield (t = this.coreInstance) == null ? void 0 : t.getCertList({
|
|
1273
1281
|
CertType: oe
|
|
1274
1282
|
});
|
|
1275
1283
|
}));
|
|
1276
|
-
|
|
1284
|
+
r(this, "base64Encode", (e) => {
|
|
1277
1285
|
var t;
|
|
1278
1286
|
return (t = this.coreInstance) == null ? void 0 : t.base64Encode(e.Data);
|
|
1279
1287
|
});
|
|
1280
|
-
|
|
1288
|
+
r(this, "base64Decode", (e) => {
|
|
1281
1289
|
var t;
|
|
1282
1290
|
return (t = this.coreInstance) == null ? void 0 : t.base64Decode(e.DataB64);
|
|
1283
1291
|
});
|
|
1284
|
-
|
|
1292
|
+
r(this, "changeIsRememberPin", (e) => {
|
|
1285
1293
|
var t;
|
|
1286
1294
|
(t = this.coreInstance) == null || t.changeIsRememberPin(e);
|
|
1287
1295
|
});
|
|
1288
|
-
|
|
1296
|
+
r(this, "changePinPolicy", (e) => {
|
|
1289
1297
|
var t;
|
|
1290
1298
|
(t = this.coreInstance) == null || t.changePinPolicy(e);
|
|
1291
1299
|
});
|
|
1292
|
-
|
|
1293
|
-
var a,
|
|
1294
|
-
const n = yield this.getSignatureCert(t), i = yield (
|
|
1300
|
+
r(this, "pkcs1Sign", (e, t) => c(this, null, function* () {
|
|
1301
|
+
var a, o, l;
|
|
1302
|
+
const n = yield this.getSignatureCert(t), i = yield (o = this.coreInstance) == null ? void 0 : o.pkcs1Sign(v(m({}, e != null ? e : {}), {
|
|
1295
1303
|
ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : ""
|
|
1296
1304
|
}));
|
|
1297
1305
|
return (l = i == null ? void 0 : i[0]) == null ? void 0 : l.SignData;
|
|
1298
1306
|
}));
|
|
1299
|
-
|
|
1307
|
+
r(this, "pkcs1VerifySignature", (e) => c(this, null, function* () {
|
|
1300
1308
|
var i;
|
|
1301
1309
|
const t = yield this.appendCertBase64(e), n = yield (i = this.coreInstance) == null ? void 0 : i.pkcs1VerifySignature(t);
|
|
1302
1310
|
return Array.isArray(n);
|
|
1303
1311
|
}));
|
|
1304
|
-
|
|
1305
|
-
var
|
|
1306
|
-
const n = yield this.getSignatureCert(t), i = (l = e.DataB64) != null ? l : this.base64Encode({ Data: (
|
|
1312
|
+
r(this, "pkcs1Base64Sign", (e, t) => c(this, null, function* () {
|
|
1313
|
+
var o, l, d, u, C;
|
|
1314
|
+
const n = yield this.getSignatureCert(t), i = (l = e.DataB64) != null ? l : this.base64Encode({ Data: (o = e.Data) != null ? o : "" }), a = yield (u = this.coreInstance) == null ? void 0 : u.pkcs1Base64Sign(v(m({}, e != null ? e : {}), {
|
|
1307
1315
|
ContainerName: (d = n == null ? void 0 : n.ContainerName) != null ? d : "",
|
|
1308
1316
|
DataB64: i
|
|
1309
1317
|
}));
|
|
1310
1318
|
return (C = a == null ? void 0 : a[0]) == null ? void 0 : C.SignData;
|
|
1311
1319
|
}));
|
|
1312
|
-
|
|
1313
|
-
var C, h, w, y, g,
|
|
1320
|
+
r(this, "batchPkcs1Base64Sign", (e, t) => c(this, null, function* () {
|
|
1321
|
+
var C, h, w, y, g, E;
|
|
1314
1322
|
const n = "|", i = (h = e.DataB64) != null ? h : (C = e.Data) == null ? void 0 : C.map((f) => this.base64Encode({ Data: f })), a = yield this.getSignatureCert(t);
|
|
1315
|
-
let
|
|
1316
|
-
|
|
1323
|
+
let o = "";
|
|
1324
|
+
o = Array.isArray(i) ? i == null ? void 0 : i.map((f, S) => `${S}:${f}`).join(n) : "";
|
|
1317
1325
|
const l = yield (y = this.coreInstance) == null ? void 0 : y.batchPkcs1Base64Sign({
|
|
1318
1326
|
ContainerName: (w = a == null ? void 0 : a.ContainerName) != null ? w : "",
|
|
1319
|
-
DataB64:
|
|
1320
|
-
}), d = (
|
|
1327
|
+
DataB64: o
|
|
1328
|
+
}), d = (E = (g = l == null ? void 0 : l[0]) == null ? void 0 : g.SignData) == null ? void 0 : E.split(n), u = [];
|
|
1321
1329
|
return d.forEach((f) => {
|
|
1322
|
-
const S = f.split(":"), k = Number(S[0]),
|
|
1323
|
-
u[k] =
|
|
1330
|
+
const S = f.split(":"), k = Number(S[0]), p = S[1];
|
|
1331
|
+
u[k] = p;
|
|
1324
1332
|
}), u;
|
|
1325
1333
|
}));
|
|
1326
|
-
|
|
1327
|
-
var a,
|
|
1328
|
-
const t = (
|
|
1334
|
+
r(this, "pkcs1Base64VerifySignature", (e) => c(this, null, function* () {
|
|
1335
|
+
var a, o, l;
|
|
1336
|
+
const t = (o = e.DataB64) != null ? o : this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), n = yield this.appendCertBase64(e);
|
|
1329
1337
|
return !!(yield (l = this.coreInstance) == null ? void 0 : l.pkcs1Base64VerifySignature({
|
|
1330
1338
|
CertB64: n.CertB64,
|
|
1331
1339
|
DataB64: t,
|
|
1332
1340
|
SignData: n.SignData
|
|
1333
1341
|
}));
|
|
1334
1342
|
}));
|
|
1335
|
-
|
|
1336
|
-
var a,
|
|
1343
|
+
r(this, "writeSeal", (e, t) => c(this, null, function* () {
|
|
1344
|
+
var a, o;
|
|
1337
1345
|
const n = yield this.getSignatureCert(t);
|
|
1338
|
-
return !!(yield (
|
|
1346
|
+
return !!(yield (o = this.coreInstance) == null ? void 0 : o.writeSeal(v(m({}, e != null ? e : {}), {
|
|
1339
1347
|
ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : ""
|
|
1340
1348
|
})));
|
|
1341
1349
|
}));
|
|
1342
|
-
|
|
1343
|
-
var
|
|
1350
|
+
r(this, "deleteSeal", (e) => c(this, null, function* () {
|
|
1351
|
+
var o, l, d, u, C;
|
|
1344
1352
|
const t = yield this.getSealList(e);
|
|
1345
|
-
if (!((
|
|
1353
|
+
if (!((o = t == null ? void 0 : t.data) != null && o.length))
|
|
1346
1354
|
return Promise.reject({
|
|
1347
1355
|
errCode: q,
|
|
1348
1356
|
msg: "暂无印章"
|
|
@@ -1358,14 +1366,14 @@ const $ = class $ {
|
|
|
1358
1366
|
SealId: i
|
|
1359
1367
|
}));
|
|
1360
1368
|
}));
|
|
1361
|
-
|
|
1362
|
-
var a,
|
|
1369
|
+
r(this, "deleteSealById", (e, t) => c(this, null, function* () {
|
|
1370
|
+
var a, o;
|
|
1363
1371
|
const n = yield this.getSignatureCert(t);
|
|
1364
|
-
return !!(yield (
|
|
1372
|
+
return !!(yield (o = this.coreInstance) == null ? void 0 : o.deleteSeal(v(m({}, e != null ? e : {}), {
|
|
1365
1373
|
ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : ""
|
|
1366
1374
|
})));
|
|
1367
1375
|
}));
|
|
1368
|
-
|
|
1376
|
+
r(this, "getSealList", (e) => c(this, null, function* () {
|
|
1369
1377
|
var i, a;
|
|
1370
1378
|
const t = yield this.getSignatureCert(e), n = yield (a = this.coreInstance) == null ? void 0 : a.getSealList({
|
|
1371
1379
|
ContainerName: (i = t == null ? void 0 : t.ContainerName) != null ? i : "",
|
|
@@ -1376,15 +1384,15 @@ const $ = class $ {
|
|
|
1376
1384
|
data: n
|
|
1377
1385
|
};
|
|
1378
1386
|
}));
|
|
1379
|
-
|
|
1380
|
-
var a,
|
|
1387
|
+
r(this, "getSealInfo", (e) => c(this, null, function* () {
|
|
1388
|
+
var a, o, l, d, u, C, h;
|
|
1381
1389
|
const t = yield this.getSealList(e);
|
|
1382
1390
|
if (!((a = t == null ? void 0 : t.data) != null && a.length))
|
|
1383
1391
|
return Promise.reject({
|
|
1384
1392
|
errCode: q,
|
|
1385
1393
|
msg: "暂无印章"
|
|
1386
1394
|
});
|
|
1387
|
-
const n = ((
|
|
1395
|
+
const n = ((o = t == null ? void 0 : t.data) == null ? void 0 : o.length) > 1 ? yield G.open({
|
|
1388
1396
|
title: "选择印章",
|
|
1389
1397
|
data: t == null ? void 0 : t.data,
|
|
1390
1398
|
columns: Se,
|
|
@@ -1395,167 +1403,166 @@ const $ = class $ {
|
|
|
1395
1403
|
});
|
|
1396
1404
|
return i == null ? void 0 : i[0];
|
|
1397
1405
|
}));
|
|
1398
|
-
|
|
1399
|
-
var a,
|
|
1406
|
+
r(this, "getTPSealList", (e, t) => c(this, null, function* () {
|
|
1407
|
+
var a, o;
|
|
1400
1408
|
const n = yield this.getSignatureCert(t);
|
|
1401
|
-
return yield (
|
|
1402
|
-
ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : ""
|
|
1403
|
-
|
|
1404
|
-
});
|
|
1409
|
+
return yield (o = this.coreInstance) == null ? void 0 : o.getTPSealList(m({
|
|
1410
|
+
ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : ""
|
|
1411
|
+
}, e != null ? e : {}));
|
|
1405
1412
|
}));
|
|
1406
|
-
|
|
1413
|
+
r(this, "getTPSeal", (e, t) => c(this, null, function* () {
|
|
1407
1414
|
var a;
|
|
1408
1415
|
const n = yield this.getTPSealList(e, t);
|
|
1409
1416
|
return n != null && n.length ? (n == null ? void 0 : n.length) === 1 ? n == null ? void 0 : n[0] : yield G.open({
|
|
1410
1417
|
title: "选择印章",
|
|
1411
1418
|
data: n,
|
|
1412
|
-
columns:
|
|
1419
|
+
columns: pt,
|
|
1413
1420
|
theme: (a = this.gwsConfig) == null ? void 0 : a.theme
|
|
1414
1421
|
}) : Promise.reject({
|
|
1415
1422
|
errCode: q,
|
|
1416
1423
|
msg: "暂无印章"
|
|
1417
1424
|
});
|
|
1418
1425
|
}));
|
|
1419
|
-
|
|
1426
|
+
r(this, "getTPSealPic", (e, t, n) => c(this, null, function* () {
|
|
1420
1427
|
var l, d;
|
|
1421
|
-
const i = yield this.getSignatureCert(t), a = n || (yield this.getTPSeal(e, t)),
|
|
1428
|
+
const i = yield this.getSignatureCert(t), a = n || (yield this.getTPSeal(e, t)), o = yield (d = this.coreInstance) == null ? void 0 : d.getTPSealPic(v(m(m({
|
|
1422
1429
|
ContainerName: (l = i == null ? void 0 : i.ContainerName) != null ? l : ""
|
|
1423
|
-
}, a != null ? a : {}), {
|
|
1430
|
+
}, a != null ? a : {}), e != null ? e : {}), {
|
|
1424
1431
|
FileSize: String(a == null ? void 0 : a.FileSize)
|
|
1425
1432
|
}));
|
|
1426
|
-
return
|
|
1433
|
+
return o == null ? void 0 : o[0];
|
|
1427
1434
|
}));
|
|
1428
|
-
|
|
1435
|
+
r(this, "sm2SignPreprocess1", (e) => c(this, null, function* () {
|
|
1429
1436
|
var i, a;
|
|
1430
1437
|
const t = yield this.appendCertBase64(e), n = yield (i = this.coreInstance) == null ? void 0 : i.sm2SignPreprocess1(t);
|
|
1431
1438
|
return (a = n == null ? void 0 : n[0]) == null ? void 0 : a.Z;
|
|
1432
1439
|
}));
|
|
1433
|
-
|
|
1434
|
-
var a,
|
|
1435
|
-
const t = this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), n = yield this.appendCertBase64(e), i = yield (
|
|
1440
|
+
r(this, "sm2SignPreprocess2", (e) => c(this, null, function* () {
|
|
1441
|
+
var a, o;
|
|
1442
|
+
const t = this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), n = yield this.appendCertBase64(e), i = yield (o = this.coreInstance) == null ? void 0 : o.sm2SignPreprocess2({
|
|
1436
1443
|
CertB64: n.CertB64,
|
|
1437
1444
|
DataB64: t
|
|
1438
1445
|
});
|
|
1439
1446
|
return i == null ? void 0 : i[0].H;
|
|
1440
1447
|
}));
|
|
1441
|
-
|
|
1442
|
-
var a,
|
|
1448
|
+
r(this, "pkcs1HashSign", (e, t) => c(this, null, function* () {
|
|
1449
|
+
var a, o, l, d;
|
|
1443
1450
|
const n = yield this.getSignatureCert(t), i = yield (l = this.coreInstance) == null ? void 0 : l.pkcs1HashSign({
|
|
1444
1451
|
ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : "",
|
|
1445
1452
|
DataB64: e.DataB64,
|
|
1446
|
-
HashAlg: (
|
|
1453
|
+
HashAlg: (o = e.HashAlg) != null ? o : "sm3"
|
|
1447
1454
|
});
|
|
1448
1455
|
return (d = i == null ? void 0 : i[0]) == null ? void 0 : d.SignData;
|
|
1449
1456
|
}));
|
|
1450
|
-
|
|
1457
|
+
r(this, "pkcs1HashVerifySignature", (e) => c(this, null, function* () {
|
|
1451
1458
|
var i, a;
|
|
1452
1459
|
const t = yield this.appendCertBase64(e);
|
|
1453
|
-
return !!(yield (a = this.coreInstance) == null ? void 0 : a.pkcs1HashVerifySignature(v(
|
|
1460
|
+
return !!(yield (a = this.coreInstance) == null ? void 0 : a.pkcs1HashVerifySignature(v(m({}, t), {
|
|
1454
1461
|
HashAlg: (i = t.HashAlg) != null ? i : "sm3"
|
|
1455
1462
|
})));
|
|
1456
1463
|
}));
|
|
1457
|
-
|
|
1458
|
-
var
|
|
1459
|
-
const n = (l = e.DataB64) != null ? l : this.base64Encode({ Data: (
|
|
1464
|
+
r(this, "pkcs7Sign", (e, t) => c(this, null, function* () {
|
|
1465
|
+
var o, l, d, u, C;
|
|
1466
|
+
const n = (l = e.DataB64) != null ? l : this.base64Encode({ Data: (o = e.Data) != null ? o : "" }), i = yield this.getSignatureCert(t), a = yield (u = this.coreInstance) == null ? void 0 : u.pkcs7Sign(v(m({}, e != null ? e : {}), {
|
|
1460
1467
|
ContainerName: (d = i == null ? void 0 : i.ContainerName) != null ? d : "",
|
|
1461
1468
|
DataB64: n
|
|
1462
1469
|
}));
|
|
1463
1470
|
return (C = a == null ? void 0 : a[0]) == null ? void 0 : C.SignData;
|
|
1464
1471
|
}));
|
|
1465
|
-
|
|
1466
|
-
var i, a,
|
|
1472
|
+
r(this, "pkcs7VerifySignature", (e) => c(this, null, function* () {
|
|
1473
|
+
var i, a, o;
|
|
1467
1474
|
const t = (a = e.DataB64) != null ? a : this.base64Encode({ Data: (i = e.Data) != null ? i : "" });
|
|
1468
|
-
return !!(yield (
|
|
1475
|
+
return !!(yield (o = this.coreInstance) == null ? void 0 : o.pkcs7VerifySignature({
|
|
1469
1476
|
DataB64: t,
|
|
1470
1477
|
SignData: e.SignData
|
|
1471
1478
|
}));
|
|
1472
1479
|
}));
|
|
1473
|
-
|
|
1480
|
+
r(this, "sm3Hash", (e) => c(this, null, function* () {
|
|
1474
1481
|
var n, i;
|
|
1475
1482
|
const t = yield (n = this.coreInstance) == null ? void 0 : n.sm3Hash(e);
|
|
1476
1483
|
return (i = t == null ? void 0 : t[0]) == null ? void 0 : i.HashB64;
|
|
1477
1484
|
}));
|
|
1478
|
-
|
|
1485
|
+
r(this, "sm3HexHash", (e) => c(this, null, function* () {
|
|
1479
1486
|
var n, i;
|
|
1480
1487
|
const t = yield (n = this.coreInstance) == null ? void 0 : n.sm3HexHash(e);
|
|
1481
1488
|
return (i = t == null ? void 0 : t[0]) == null ? void 0 : i.HashB64;
|
|
1482
1489
|
}));
|
|
1483
|
-
|
|
1490
|
+
r(this, "sm3FileHash", (e) => c(this, null, function* () {
|
|
1484
1491
|
var n, i;
|
|
1485
1492
|
const t = yield (n = this.coreInstance) == null ? void 0 : n.sm3FileHash(e);
|
|
1486
1493
|
return (i = t == null ? void 0 : t[0]) == null ? void 0 : i.HashB64;
|
|
1487
1494
|
}));
|
|
1488
|
-
|
|
1489
|
-
var a,
|
|
1490
|
-
const t = (
|
|
1495
|
+
r(this, "sm3HashEncryption", (e) => c(this, null, function* () {
|
|
1496
|
+
var a, o, l, d, u, C;
|
|
1497
|
+
const t = (o = e.DataB64) != null ? o : this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), n = (d = e.KeyB64) != null ? d : this.base64Encode({ Data: (l = e.Key) != null ? l : "" }), i = yield (u = this.coreInstance) == null ? void 0 : u.sm3HashEncryption({
|
|
1491
1498
|
dataB64: t,
|
|
1492
1499
|
keyB64: n,
|
|
1493
1500
|
alg: "sm3"
|
|
1494
1501
|
});
|
|
1495
1502
|
return (C = i == null ? void 0 : i[0]) == null ? void 0 : C.DataB64;
|
|
1496
1503
|
}));
|
|
1497
|
-
|
|
1498
|
-
var i, a,
|
|
1504
|
+
r(this, "pkcs7Encryption", (e) => c(this, null, function* () {
|
|
1505
|
+
var i, a, o, l;
|
|
1499
1506
|
if (!e.CertB64List) {
|
|
1500
1507
|
const d = yield this.getEncryptionCert();
|
|
1501
1508
|
e.CertB64List = d == null ? void 0 : d.CertB64;
|
|
1502
1509
|
}
|
|
1503
|
-
const t = (a = e.DataB64) != null ? a : this.base64Encode({ Data: (i = e.Data) != null ? i : "" }), n = yield (
|
|
1510
|
+
const t = (a = e.DataB64) != null ? a : this.base64Encode({ Data: (i = e.Data) != null ? i : "" }), n = yield (o = this.coreInstance) == null ? void 0 : o.pkcs7Encryption({
|
|
1504
1511
|
DataB64: t,
|
|
1505
1512
|
CertB64List: e.CertB64List
|
|
1506
1513
|
});
|
|
1507
1514
|
return (l = n == null ? void 0 : n[0]) == null ? void 0 : l.DataB64;
|
|
1508
1515
|
}));
|
|
1509
|
-
|
|
1510
|
-
var a,
|
|
1511
|
-
const t = yield this.getEncryptionCert(), n = yield (a = this.coreInstance) == null ? void 0 : a.pkcs7Decryption(v(
|
|
1516
|
+
r(this, "pkcs7Decryption", (e) => c(this, null, function* () {
|
|
1517
|
+
var a, o;
|
|
1518
|
+
const t = yield this.getEncryptionCert(), n = yield (a = this.coreInstance) == null ? void 0 : a.pkcs7Decryption(v(m({}, e != null ? e : {}), {
|
|
1512
1519
|
ContainerName: t == null ? void 0 : t.ContainerName
|
|
1513
|
-
})), i = (
|
|
1520
|
+
})), i = (o = n == null ? void 0 : n[0]) == null ? void 0 : o.DataB64;
|
|
1514
1521
|
return e.shouldDecodeBase64 ? this.base64Decode({ DataB64: i }) : i;
|
|
1515
1522
|
}));
|
|
1516
|
-
|
|
1523
|
+
r(this, "pkcs7FileEncryption", (e) => c(this, null, function* () {
|
|
1517
1524
|
var i, a;
|
|
1518
1525
|
const t = yield this.appendCertBase64(e, !1), n = yield (i = this.coreInstance) == null ? void 0 : i.pkcs7FileEncryption(t);
|
|
1519
1526
|
return (a = n == null ? void 0 : n[0]) == null ? void 0 : a.DataB64;
|
|
1520
1527
|
}));
|
|
1521
|
-
|
|
1522
|
-
var i, a,
|
|
1528
|
+
r(this, "pkcs7FileDecryption", (e) => c(this, null, function* () {
|
|
1529
|
+
var i, a, o;
|
|
1523
1530
|
const t = yield this.getEncryptionCert(), n = yield (a = this.coreInstance) == null ? void 0 : a.pkcs7FileDecryption({
|
|
1524
1531
|
SrcFile: e.SrcFile,
|
|
1525
1532
|
DstFile: (i = e.DstFile) != null ? i : e.SrcFile.slice(0, -4),
|
|
1526
1533
|
ContainerName: t == null ? void 0 : t.ContainerName
|
|
1527
1534
|
});
|
|
1528
|
-
return (
|
|
1535
|
+
return (o = n == null ? void 0 : n[0]) == null ? void 0 : o.DataB64;
|
|
1529
1536
|
}));
|
|
1530
|
-
|
|
1537
|
+
r(this, "asymmetricEncryption", (e) => c(this, null, function* () {
|
|
1531
1538
|
var i, a;
|
|
1532
1539
|
const t = yield this.appendCertBase64(e, !1), n = yield (i = this.coreInstance) == null ? void 0 : i.asymmetricEncryption(t);
|
|
1533
1540
|
return (a = n == null ? void 0 : n[0]) == null ? void 0 : a.Data;
|
|
1534
1541
|
}));
|
|
1535
|
-
|
|
1536
|
-
var a,
|
|
1537
|
-
const n = yield this.getEncryptionCert(t), i = yield (a = this.coreInstance) == null ? void 0 : a.asymmetricDecryption(v(
|
|
1542
|
+
r(this, "asymmetricDecryption", (e, t) => c(this, null, function* () {
|
|
1543
|
+
var a, o;
|
|
1544
|
+
const n = yield this.getEncryptionCert(t), i = yield (a = this.coreInstance) == null ? void 0 : a.asymmetricDecryption(v(m({}, e != null ? e : {}), {
|
|
1538
1545
|
ContainerName: n == null ? void 0 : n.ContainerName
|
|
1539
1546
|
}));
|
|
1540
|
-
return (
|
|
1547
|
+
return (o = i == null ? void 0 : i[0]) == null ? void 0 : o.Data;
|
|
1541
1548
|
}));
|
|
1542
|
-
|
|
1549
|
+
r(this, "sm4Encryption", (e) => c(this, null, function* () {
|
|
1543
1550
|
var n;
|
|
1544
1551
|
const t = yield (n = this.coreInstance) == null ? void 0 : n.sm4Encryption(e);
|
|
1545
1552
|
return t == null ? void 0 : t[0];
|
|
1546
1553
|
}));
|
|
1547
|
-
|
|
1554
|
+
r(this, "sm4Decryption", (e) => c(this, null, function* () {
|
|
1548
1555
|
var n, i;
|
|
1549
1556
|
const t = yield (n = this.coreInstance) == null ? void 0 : n.sm4Decryption(e);
|
|
1550
1557
|
return (i = t == null ? void 0 : t[0]) == null ? void 0 : i.Data;
|
|
1551
1558
|
}));
|
|
1552
|
-
|
|
1553
|
-
var i, a,
|
|
1559
|
+
r(this, "getCertInfo", (e) => c(this, null, function* () {
|
|
1560
|
+
var i, a, o, l, d;
|
|
1554
1561
|
const t = yield (i = this.coreInstance) == null ? void 0 : i.getCertInfo(e), n = (a = t == null ? void 0 : t[0]) != null ? a : {};
|
|
1555
1562
|
for (let u = 0; u < ce.length; u++) {
|
|
1556
1563
|
const C = ce[u];
|
|
1557
1564
|
try {
|
|
1558
|
-
const h = yield (
|
|
1565
|
+
const h = yield (o = this.coreInstance) == null ? void 0 : o.getCertInfoByOid({
|
|
1559
1566
|
Oid: C.oid,
|
|
1560
1567
|
CertB64: e.CertB64
|
|
1561
1568
|
});
|
|
@@ -1566,26 +1573,26 @@ const $ = class $ {
|
|
|
1566
1573
|
}
|
|
1567
1574
|
return n != null && n.idCardNo ? n != null && n.CertSubject.includes("O=") || n.orgCode ? n.certCate = Ge : n.certCate = Fe : n.certCate = Ve, n;
|
|
1568
1575
|
}));
|
|
1569
|
-
|
|
1576
|
+
r(this, "getCertInfoByOid", (e) => c(this, null, function* () {
|
|
1570
1577
|
var n, i;
|
|
1571
|
-
const t = yield (n = this.coreInstance) == null ? void 0 : n.getCertInfoByOid(
|
|
1578
|
+
const t = yield (n = this.coreInstance) == null ? void 0 : n.getCertInfoByOid(m({}, e != null ? e : {}));
|
|
1572
1579
|
return (i = t == null ? void 0 : t[0]) == null ? void 0 : i.OidValue;
|
|
1573
1580
|
}));
|
|
1574
|
-
|
|
1581
|
+
r(this, "getSealVendor", (e) => c(this, null, function* () {
|
|
1575
1582
|
var i;
|
|
1576
1583
|
const t = yield this.getSignatureCert(e), n = yield (i = this.coreInstance) == null ? void 0 : i.getSealVendor({
|
|
1577
1584
|
ContainerName: t == null ? void 0 : t.ContainerName
|
|
1578
1585
|
});
|
|
1579
1586
|
return n == null ? void 0 : n[0];
|
|
1580
1587
|
}));
|
|
1581
|
-
|
|
1588
|
+
r(this, "deleteAllSealByVendor", (e, t) => c(this, null, function* () {
|
|
1582
1589
|
var a;
|
|
1583
|
-
const n = yield this.getSignatureCert(t), i = yield (a = this.coreInstance) == null ? void 0 : a.deleteAllSealByVendor(v(
|
|
1590
|
+
const n = yield this.getSignatureCert(t), i = yield (a = this.coreInstance) == null ? void 0 : a.deleteAllSealByVendor(v(m({}, e != null ? e : {}), {
|
|
1584
1591
|
ContainerName: n == null ? void 0 : n.ContainerName
|
|
1585
1592
|
}));
|
|
1586
1593
|
return i == null ? void 0 : i[0];
|
|
1587
1594
|
}));
|
|
1588
|
-
|
|
1595
|
+
r(this, "getUKey", (e) => c(this, null, function* () {
|
|
1589
1596
|
var i, a;
|
|
1590
1597
|
if (e) return e;
|
|
1591
1598
|
const t = yield (i = this.coreInstance) == null ? void 0 : i.getUKeyList();
|
|
@@ -1596,11 +1603,11 @@ const $ = class $ {
|
|
|
1596
1603
|
theme: (a = this.gwsConfig) == null ? void 0 : a.theme
|
|
1597
1604
|
});
|
|
1598
1605
|
}));
|
|
1599
|
-
|
|
1606
|
+
r(this, "getUKeyList", () => c(this, null, function* () {
|
|
1600
1607
|
var t;
|
|
1601
1608
|
return yield (t = this.coreInstance) == null ? void 0 : t.getUKeyList();
|
|
1602
1609
|
}));
|
|
1603
|
-
|
|
1610
|
+
r(this, "getUKeyInfo", (e) => c(this, null, function* () {
|
|
1604
1611
|
var i;
|
|
1605
1612
|
const t = yield this.getUKey(e), n = yield (i = this.coreInstance) == null ? void 0 : i.getUKeyInfo({
|
|
1606
1613
|
manu: t == null ? void 0 : t.manu,
|
|
@@ -1608,19 +1615,19 @@ const $ = class $ {
|
|
|
1608
1615
|
});
|
|
1609
1616
|
return n == null ? void 0 : n[0];
|
|
1610
1617
|
}));
|
|
1611
|
-
|
|
1612
|
-
var
|
|
1618
|
+
r(this, "applyCert", (e, t) => c(this, null, function* () {
|
|
1619
|
+
var o;
|
|
1613
1620
|
const n = yield this.getUKey(t), i = yield this.getUKeyInfo(n);
|
|
1614
|
-
return yield (
|
|
1621
|
+
return yield (o = this.coreInstance) == null ? void 0 : o.applyCert(v(m({}, e != null ? e : {}), {
|
|
1615
1622
|
manu: i == null ? void 0 : i.manu,
|
|
1616
1623
|
sn: i == null ? void 0 : i.sn,
|
|
1617
1624
|
ContainerName: i == null ? void 0 : i.keyid
|
|
1618
1625
|
}));
|
|
1619
1626
|
}));
|
|
1620
|
-
|
|
1627
|
+
r(this, "resetPin", (e, t) => c(this, null, function* () {
|
|
1621
1628
|
var a;
|
|
1622
1629
|
const n = yield this.getSignatureCert(t);
|
|
1623
|
-
return yield (a = this.coreInstance) == null ? void 0 : a.resetPin(v(
|
|
1630
|
+
return yield (a = this.coreInstance) == null ? void 0 : a.resetPin(v(m({}, e != null ? e : {}), {
|
|
1624
1631
|
manu: n == null ? void 0 : n.manu,
|
|
1625
1632
|
sn: n == null ? void 0 : n.sn,
|
|
1626
1633
|
ContainerName: n == null ? void 0 : n.ContainerName
|
|
@@ -1629,14 +1636,14 @@ const $ = class $ {
|
|
|
1629
1636
|
return $.instance && !(e != null && e.isCreateNew) ? $.instance : (this.createGwsCore(e), $.instance = this, this);
|
|
1630
1637
|
}
|
|
1631
1638
|
};
|
|
1632
|
-
|
|
1639
|
+
r($, "instance", null);
|
|
1633
1640
|
let H = $;
|
|
1634
1641
|
function Pt(s) {
|
|
1635
1642
|
return new Promise((e, t) => {
|
|
1636
1643
|
if (H.instance && !(s != null && s.isCreateNew))
|
|
1637
1644
|
e(H.instance);
|
|
1638
1645
|
else {
|
|
1639
|
-
const n = new H(v(
|
|
1646
|
+
const n = new H(v(m({}, s != null ? s : {}), {
|
|
1640
1647
|
onOpen(i) {
|
|
1641
1648
|
var a;
|
|
1642
1649
|
e(n), (a = s == null ? void 0 : s.onOpen) == null || a.call(s, i);
|