@gerege-systems/eid-mongolia-sdk 0.46.0 → 0.46.1
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/README.md +8 -0
- package/dist/{chunk-4JAA4RON.js → chunk-6H6KBQV4.js} +1 -1
- package/dist/{chunk-ISTWNY6N.js → chunk-BTT7P7GB.js} +26 -20
- package/dist/index.js +1 -1
- package/dist/pades.cjs +26 -20
- package/dist/pades.js +2 -2
- package/dist/validate.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -747,6 +747,14 @@ TSA timestamp-аар өөрөө **2 удаа** дахин оролдоно (ни
|
|
|
747
747
|
оролдохгүй (өмнө нь revoked OCSP-г алгасаад CRL-ээр DSS угсардаг байв). OCSP/CRL-д мөн CertID/олгогч/шинэлэг байдлын
|
|
748
748
|
дүрэм (§ validate).
|
|
749
749
|
|
|
750
|
+
**OCSP/CRL-ийн дараалал (0.46.1).** `complete` нь гинжийн гэрчилгээ бүрийн цуцлалтын нотолгоог үүргээр нь авна:
|
|
751
|
+
гинжийн эхний гэрчилгээ (иргэн, TSA) — эхлээд OCSP (энгийн 10 с-ийн timeout, «timestamp-аас хожуу» дүрэм), дараа нь CRL
|
|
752
|
+
(хоёулаа хүчинтэй бол хоёулаа DSS-д); CA гэрчилгээ (бусад бүх) — эхлээд CRL, хүчинтэй CRL авсан бол тэр гэрчилгээний OCSP
|
|
753
|
+
responder-т хүсэлт **илгээхгүй**, хүчинтэй CRL алга бол л OCSP (10 с). Аль нь ч хүчингүй → `LTV_UNAVAILABLE` (fail-closed),
|
|
754
|
+
олгогчийн гарын үсэгтэй «revoked» (OCSP эсвэл CRL) → `CertificateRevokedError`. Өмнө нь CA гэрчилгээний холболт хүлээж
|
|
755
|
+
аваад хариулдаггүй OCSP responder гарын үсэг бүрийг ~20 с саатуулдаг байв. DSS-д CA гэрчилгээнд зөвхөн CRL орно.
|
|
756
|
+
`validatePdf`-ийн онлайн цуцлалт өөрчлөгдөөгүй (зөвхөн eID-ийн 04/05-ийн гэрчилгээнд, OCSP → CRL).
|
|
757
|
+
|
|
750
758
|
`PadesError.code` (тогтвортой, бүх платформд ижил): `PDF_INVALID`, `PDF_ENCRYPTED`, `PDF_LOCKED` (DocMDP P=1),
|
|
751
759
|
`PDF_TOO_LARGE`, `PDF_TOO_MANY_SIGNATURES`, `PDF_PRIOR_SIGNATURE_INVALID`, `PDF_FOREIGN_SIGNATURE`, `SIGNER_INVALID`,
|
|
752
760
|
`REQUEST_INVALID`, `SIGNATURE_INVALID` (state хэвээр — дахин зуруулж болно), `TSA_UNAVAILABLE`, `LTV_UNAVAILABLE`
|
|
@@ -1397,28 +1397,34 @@ async function collectLTV(f, now, fresh, roots, chains) {
|
|
|
1397
1397
|
let ok = false;
|
|
1398
1398
|
let freshErr;
|
|
1399
1399
|
const fr = i === 0 ? fresh : void 0;
|
|
1400
|
-
for (const
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
der = await f.do("GET", u, "");
|
|
1416
|
-
} catch {
|
|
1400
|
+
for (const step of i === 0 ? ["ocsp", "crl"] : ["crl", "ocsp"]) {
|
|
1401
|
+
if (step === "ocsp") {
|
|
1402
|
+
if (i !== 0 && ok) continue;
|
|
1403
|
+
for (const u of c.ocspServers) {
|
|
1404
|
+
try {
|
|
1405
|
+
const [der, resp] = await fetchOCSP(f, u, c, issuer, now, fr);
|
|
1406
|
+
addTo(d.ocsps, der);
|
|
1407
|
+
if (resp.certificate && !equal(resp.certificate.raw, issuer.raw)) addTo(d.certs, resp.certificate.raw);
|
|
1408
|
+
ok = true;
|
|
1409
|
+
break;
|
|
1410
|
+
} catch (e) {
|
|
1411
|
+
if (e instanceof CertificateRevokedError) throw e;
|
|
1412
|
+
if (e instanceof NotFresh) freshErr = e;
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1417
1415
|
continue;
|
|
1418
1416
|
}
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1417
|
+
for (const u of c.crlDPs) {
|
|
1418
|
+
let der;
|
|
1419
|
+
try {
|
|
1420
|
+
der = await f.do("GET", u, "");
|
|
1421
|
+
} catch {
|
|
1422
|
+
continue;
|
|
1423
|
+
}
|
|
1424
|
+
if (await crlCovers(der, c, issuer, now)) {
|
|
1425
|
+
addTo(d.crls, der);
|
|
1426
|
+
ok = true;
|
|
1427
|
+
}
|
|
1422
1428
|
}
|
|
1423
1429
|
}
|
|
1424
1430
|
if (!ok) {
|
package/dist/index.js
CHANGED
package/dist/pades.cjs
CHANGED
|
@@ -1265,28 +1265,34 @@ async function collectLTV(f, now, fresh, roots, chains) {
|
|
|
1265
1265
|
let ok = false;
|
|
1266
1266
|
let freshErr;
|
|
1267
1267
|
const fr = i === 0 ? fresh : void 0;
|
|
1268
|
-
for (const
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
der2 = await f.do("GET", u, "");
|
|
1284
|
-
} catch {
|
|
1268
|
+
for (const step of i === 0 ? ["ocsp", "crl"] : ["crl", "ocsp"]) {
|
|
1269
|
+
if (step === "ocsp") {
|
|
1270
|
+
if (i !== 0 && ok) continue;
|
|
1271
|
+
for (const u of c.ocspServers) {
|
|
1272
|
+
try {
|
|
1273
|
+
const [der2, resp] = await fetchOCSP(f, u, c, issuer, now, fr);
|
|
1274
|
+
addTo(d.ocsps, der2);
|
|
1275
|
+
if (resp.certificate && !equal(resp.certificate.raw, issuer.raw)) addTo(d.certs, resp.certificate.raw);
|
|
1276
|
+
ok = true;
|
|
1277
|
+
break;
|
|
1278
|
+
} catch (e) {
|
|
1279
|
+
if (e instanceof CertificateRevokedError) throw e;
|
|
1280
|
+
if (e instanceof NotFresh) freshErr = e;
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1285
1283
|
continue;
|
|
1286
1284
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1285
|
+
for (const u of c.crlDPs) {
|
|
1286
|
+
let der2;
|
|
1287
|
+
try {
|
|
1288
|
+
der2 = await f.do("GET", u, "");
|
|
1289
|
+
} catch {
|
|
1290
|
+
continue;
|
|
1291
|
+
}
|
|
1292
|
+
if (await crlCovers(der2, c, issuer, now)) {
|
|
1293
|
+
addTo(d.crls, der2);
|
|
1294
|
+
ok = true;
|
|
1295
|
+
}
|
|
1290
1296
|
}
|
|
1291
1297
|
}
|
|
1292
1298
|
if (!ok) {
|
package/dist/pades.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
visibleRect,
|
|
24
24
|
visibleWidget,
|
|
25
25
|
zlibInflateStrict
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-6H6KBQV4.js";
|
|
27
27
|
import {
|
|
28
28
|
CLAIMED_ROLE_MAX_RUNES,
|
|
29
29
|
CertificateRevokedError,
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
toHex,
|
|
57
57
|
verifyCitizen,
|
|
58
58
|
verifySignedData
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-BTT7P7GB.js";
|
|
60
60
|
import {
|
|
61
61
|
EidError
|
|
62
62
|
} from "./chunk-6AGWRTZG.js";
|
package/dist/validate.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
isBrowser,
|
|
12
12
|
round100,
|
|
13
13
|
visibleWidget
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6H6KBQV4.js";
|
|
15
15
|
import {
|
|
16
16
|
EID_ISSUERS,
|
|
17
17
|
INTERMEDIATES,
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
subtle,
|
|
63
63
|
toHex,
|
|
64
64
|
verifySignature
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-BTT7P7GB.js";
|
|
66
66
|
import {
|
|
67
67
|
EidError
|
|
68
68
|
} from "./chunk-6AGWRTZG.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gerege-systems/eid-mongolia-sdk",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.1",
|
|
4
4
|
"description": "e-ID Mongolia Relying Party SDK — иргэнээр утсаар нь нэвтрэлт ба хууль ёсны цахим гарын үсэг (RP-API v3, Smart-ID нийцтэй).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsup src/index.ts src/browser.ts src/pades.ts src/validate.ts --format esm,cjs --dts --clean && tsup src/button.ts --format esm,cjs --dts --tsconfig tsconfig.button.json && tsup src/convert.ts --format esm --dts --tsconfig tsconfig.button.json",
|
|
52
|
-
"test": "npm run build && node --test --experimental-strip-types test/sdk.test.ts test/portal-gaps.test.ts test/chain.test.ts test/qr.test.ts test/myqr.test.ts test/login.test.ts test/button.test.ts test/sign-gaps.test.ts test/session-start.test.ts test/pades-session.test.ts test/pades-golden.test.ts test/pades-placement.test.ts test/pades-unit.test.ts test/convert.test.ts test/share.test.ts test/validate-golden.test.ts test/validate-revisions.test.ts test/validate-env.test.ts test/pades-revocation.test.ts test/pades-encrypt.test.ts test/pades-objstm.test.ts test/pades-objstm-encrypt.test.ts test/validate-fuzz.test.ts test/pades-lexer-loop.test.ts test/seal.test.ts",
|
|
52
|
+
"test": "npm run build && node --test --experimental-strip-types test/sdk.test.ts test/portal-gaps.test.ts test/chain.test.ts test/qr.test.ts test/myqr.test.ts test/login.test.ts test/button.test.ts test/sign-gaps.test.ts test/session-start.test.ts test/pades-session.test.ts test/pades-golden.test.ts test/pades-placement.test.ts test/pades-unit.test.ts test/convert.test.ts test/share.test.ts test/validate-golden.test.ts test/validate-revisions.test.ts test/validate-env.test.ts test/pades-revocation.test.ts test/pades-ltv-order.test.ts test/pades-encrypt.test.ts test/pades-objstm.test.ts test/pades-objstm-encrypt.test.ts test/validate-fuzz.test.ts test/pades-lexer-loop.test.ts test/seal.test.ts",
|
|
53
53
|
"test:contract": "npm run build && node --experimental-strip-types test/contract.test.ts",
|
|
54
54
|
"lint": "tsc --noEmit && tsc --noEmit -p tsconfig.button.json",
|
|
55
55
|
"golden:check": "node scripts/sync-pades-golden.mjs --check",
|