@peculiar/certificates-viewer 3.2.0 → 3.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/cjs/{certification_request-cde57123.js → certification_request-e1997ebf.js} +563 -133
- package/dist/cjs/crl-f1ee43bc.js +312 -0
- package/dist/cjs/{index-ff818d4d.js → download-a97f4cb2.js} +106 -2
- package/dist/cjs/index.cjs.js +1 -3
- package/dist/cjs/l10n-638a7577.js +167 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{peculiar-attribute-certificate-viewer_2.cjs.entry.js → peculiar-attribute-certificate-viewer_3.cjs.entry.js} +123 -21
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +25 -15
- package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +2 -2
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +6 -25
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +6 -8
- package/dist/cjs/peculiar.cjs.js +1 -1
- package/dist/cjs/{public_key-e56dbe52.js → public_key-ba538d77.js} +80 -40
- package/dist/cjs/{x509_certificate-51a97033.js → x509_certificate-42b478d2.js} +13 -7
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +19 -6
- package/dist/collection/components/certificate-viewer/attributes/type_relationship_attribute.js +2 -1
- package/dist/collection/components/certificate-viewer/basic_information.js +3 -1
- package/dist/collection/components/certificate-viewer/extensions/basic_constraints_extension.js +2 -1
- package/dist/collection/components/certificate-viewer/extensions/basic_extension.js +2 -1
- package/dist/collection/components/certificate-viewer/extensions/crl_number_extension.js +19 -0
- package/dist/collection/components/certificate-viewer/extensions/index.js +9 -1
- package/dist/collection/components/certificate-viewer/extensions/issuing_distribution_point_extension.js +27 -0
- package/dist/collection/components/certificate-viewer/extensions/timestamp_extension.js +2 -1
- package/dist/collection/components/certificate-viewer/miscellaneous.js +2 -20
- package/dist/collection/components/certificates-viewer/certificates-viewer.js +2 -3
- package/dist/collection/components/crl-viewer/crl-viewer.js +234 -0
- package/dist/collection/components/crl-viewer/revoked_certificates.js +27 -0
- package/dist/collection/crypto/crl.js +82 -0
- package/dist/collection/crypto/csr.js +7 -0
- package/dist/collection/crypto/extension.js +10 -1
- package/dist/collection/crypto/index.js +1 -0
- package/dist/collection/crypto/x509_attribute_certificate.js +7 -1
- package/dist/collection/crypto/x509_certificate.js +7 -1
- package/dist/collection/locales/en.json +12 -1
- package/dist/collection/utils/download.js +18 -2
- package/dist/collection/utils/index.js +1 -0
- package/dist/collection/utils/validator.js +2 -0
- package/dist/esm/{certification_request-c0674647.js → certification_request-5d982d92.js} +493 -66
- package/dist/esm/crl-f2110716.js +308 -0
- package/dist/esm/{index-0ba131b0.js → download-67ac9120.js} +102 -2
- package/dist/esm/index.js +1 -3
- package/dist/esm/{l10n-ac28fa92.js → l10n-da0dd100.js} +24 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{peculiar-attribute-certificate-viewer_2.entry.js → peculiar-attribute-certificate-viewer_3.entry.js} +113 -12
- package/dist/esm/peculiar-certificate-decoder.entry.js +21 -11
- package/dist/esm/peculiar-certificate-summary_3.entry.js +2 -2
- package/dist/esm/peculiar-certificate-viewer.entry.js +6 -25
- package/dist/esm/peculiar-certificates-viewer.entry.js +6 -8
- package/dist/esm/peculiar.js +1 -1
- package/dist/esm/{public_key-43b2cbf0.js → public_key-0a3091a5.js} +67 -28
- package/dist/esm/{x509_certificate-12f6d344.js → x509_certificate-6b243207.js} +9 -3
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/locales/en.json +12 -1
- package/dist/peculiar/p-34e2d6be.entry.js +11 -0
- package/dist/peculiar/p-35e7a514.js +12 -0
- package/dist/peculiar/p-3aea9dde.js +32 -0
- package/dist/peculiar/{p-38635919.entry.js → p-49ab6f8c.entry.js} +1 -1
- package/dist/peculiar/p-86116b1f.entry.js +4 -0
- package/dist/peculiar/{p-464e0943.js → p-bce2bbe0.js} +9 -9
- package/dist/peculiar/p-ca0c34ca.entry.js +26 -0
- package/dist/peculiar/p-cff9655c.js +18 -0
- package/dist/peculiar/{p-17c4da7b.js → p-db6e24c6.js} +2 -2
- package/dist/peculiar/p-e535a666.entry.js +4 -0
- package/dist/peculiar/p-f8dc3232.js +63 -0
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +3 -3
- package/dist/types/components/certificate-viewer/basic_information.d.ts +2 -0
- package/dist/types/components/certificate-viewer/extensions/crl_number_extension.d.ts +15 -0
- package/dist/types/components/certificate-viewer/extensions/issuing_distribution_point_extension.d.ts +15 -0
- package/dist/types/components/certificate-viewer/miscellaneous.d.ts +2 -2
- package/dist/types/components/certificate-viewer/row.d.ts +1 -1
- package/dist/types/components/crl-viewer/crl-viewer.d.ts +59 -0
- package/dist/types/components/crl-viewer/revoked_certificates.d.ts +14 -0
- package/dist/types/components.d.ts +66 -0
- package/dist/types/crypto/crl.d.ts +28 -0
- package/dist/types/crypto/csr.d.ts +2 -0
- package/dist/types/crypto/extension.d.ts +2 -2
- package/dist/types/crypto/index.d.ts +1 -0
- package/dist/types/crypto/x509_attribute_certificate.d.ts +2 -0
- package/dist/types/crypto/x509_certificate.d.ts +2 -0
- package/dist/types/utils/download.d.ts +10 -2
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/l10n.d.ts +11 -0
- package/dist/types/utils/validator.d.ts +1 -0
- package/package.json +19 -19
- package/dist/cjs/_commonjsHelpers-cb1f949a.js +0 -23
- package/dist/cjs/csr-78378ed0.js +0 -150
- package/dist/cjs/download-6724f3a7.js +0 -79
- package/dist/cjs/l10n-a048a686.js +0 -145
- package/dist/cjs/x509_attribute_certificate-cc325b70.js +0 -87
- package/dist/esm/_commonjsHelpers-bfbd2ad8.js +0 -20
- package/dist/esm/csr-c1b6a176.js +0 -147
- package/dist/esm/download-735fb2eb.js +0 -76
- package/dist/esm/x509_attribute_certificate-a6d4aa15.js +0 -85
- package/dist/peculiar/p-006865d7.js +0 -4
- package/dist/peculiar/p-1ebab45c.js +0 -78
- package/dist/peculiar/p-3f8d1008.entry.js +0 -4
- package/dist/peculiar/p-42da7f97.js +0 -11
- package/dist/peculiar/p-4f4c1d30.js +0 -12
- package/dist/peculiar/p-530afe84.entry.js +0 -11
- package/dist/peculiar/p-6011646e.entry.js +0 -11
- package/dist/peculiar/p-6c510523.js +0 -18
- package/dist/peculiar/p-d0b55fbb.js +0 -4
- package/dist/peculiar/p-d7a13cb4.js +0 -18
- package/dist/peculiar/p-e77d0ccc.entry.js +0 -18
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
require('./l10n-
|
|
8
|
-
const _commonjsHelpers = require('./_commonjsHelpers-cb1f949a.js');
|
|
6
|
+
const download = require('./download-a97f4cb2.js');
|
|
7
|
+
require('./l10n-638a7577.js');
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* @license
|
|
@@ -21,6 +20,8 @@ const isPem = (value) => (/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-
|
|
|
21
20
|
.test(value));
|
|
22
21
|
const isX509Pem = (value) => (/-----BEGIN CERTIFICATE-----([A-Za-z0-9+\/=\s]+)-----END CERTIFICATE-----/
|
|
23
22
|
.test(value));
|
|
23
|
+
const isX509CRLPem = (value) => (/-----BEGIN X509 CRL-----([A-Za-z0-9+\/=\s]+)-----END X509 CRL-----/
|
|
24
|
+
.test(value));
|
|
24
25
|
const isPkcs10Pem = (value) => (/-----BEGIN CERTIFICATE REQUEST-----([A-Za-z0-9+\/=\s]+)-----END CERTIFICATE REQUEST-----/
|
|
25
26
|
.test(value));
|
|
26
27
|
const isX509AttributePem = (value) => (/-----BEGIN ATTRIBUTE CERTIFICATE-----([A-Za-z0-9+\/=\s]+)-----END ATTRIBUTE CERTIFICATE-----/
|
|
@@ -292,7 +293,7 @@ function HexBlock(BaseClass) {
|
|
|
292
293
|
super(...args);
|
|
293
294
|
const params = args[0] || {};
|
|
294
295
|
this.isHexOnly = (_a = params.isHexOnly) !== null && _a !== void 0 ? _a : false;
|
|
295
|
-
this.valueHexView = params.valueHex ?
|
|
296
|
+
this.valueHexView = params.valueHex ? download.build.BufferSourceConverter.toUint8Array(params.valueHex) : EMPTY_VIEW;
|
|
296
297
|
}
|
|
297
298
|
get valueHex() {
|
|
298
299
|
return this.valueHexView.slice().buffer;
|
|
@@ -330,7 +331,7 @@ function HexBlock(BaseClass) {
|
|
|
330
331
|
return {
|
|
331
332
|
...super.toJSON(),
|
|
332
333
|
isHexOnly: this.isHexOnly,
|
|
333
|
-
valueHex:
|
|
334
|
+
valueHex: download.build.Convert.ToHex(this.valueHexView),
|
|
334
335
|
};
|
|
335
336
|
}
|
|
336
337
|
},
|
|
@@ -343,7 +344,7 @@ class LocalBaseBlock {
|
|
|
343
344
|
this.blockLength = blockLength;
|
|
344
345
|
this.error = error;
|
|
345
346
|
this.warnings = warnings;
|
|
346
|
-
this.valueBeforeDecodeView =
|
|
347
|
+
this.valueBeforeDecodeView = download.build.BufferSourceConverter.toUint8Array(valueBeforeDecode);
|
|
347
348
|
}
|
|
348
349
|
static blockName() {
|
|
349
350
|
return this.NAME;
|
|
@@ -360,7 +361,7 @@ class LocalBaseBlock {
|
|
|
360
361
|
blockLength: this.blockLength,
|
|
361
362
|
error: this.error,
|
|
362
363
|
warnings: this.warnings,
|
|
363
|
-
valueBeforeDecode:
|
|
364
|
+
valueBeforeDecode: download.build.Convert.ToHex(this.valueBeforeDecodeView),
|
|
364
365
|
};
|
|
365
366
|
}
|
|
366
367
|
}
|
|
@@ -382,7 +383,7 @@ class LocalIdentificationBlock extends HexBlock(LocalBaseBlock) {
|
|
|
382
383
|
super();
|
|
383
384
|
if (idBlock) {
|
|
384
385
|
this.isHexOnly = (_a = idBlock.isHexOnly) !== null && _a !== void 0 ? _a : false;
|
|
385
|
-
this.valueHexView = idBlock.valueHex ?
|
|
386
|
+
this.valueHexView = idBlock.valueHex ? download.build.BufferSourceConverter.toUint8Array(idBlock.valueHex) : EMPTY_VIEW;
|
|
386
387
|
this.tagClass = (_b = idBlock.tagClass) !== null && _b !== void 0 ? _b : -1;
|
|
387
388
|
this.tagNumber = (_c = idBlock.tagNumber) !== null && _c !== void 0 ? _c : -1;
|
|
388
389
|
this.isConstructed = (_d = idBlock.isConstructed) !== null && _d !== void 0 ? _d : false;
|
|
@@ -448,7 +449,7 @@ class LocalIdentificationBlock extends HexBlock(LocalBaseBlock) {
|
|
|
448
449
|
return retView.buffer;
|
|
449
450
|
}
|
|
450
451
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
451
|
-
const inputView =
|
|
452
|
+
const inputView = download.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
452
453
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
453
454
|
return -1;
|
|
454
455
|
}
|
|
@@ -557,7 +558,7 @@ class LocalLengthBlock extends LocalBaseBlock {
|
|
|
557
558
|
this.length = (_c = lenBlock.length) !== null && _c !== void 0 ? _c : 0;
|
|
558
559
|
}
|
|
559
560
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
560
|
-
const view =
|
|
561
|
+
const view = download.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
561
562
|
if (!checkBufferParams(this, view, inputOffset, inputLength)) {
|
|
562
563
|
return -1;
|
|
563
564
|
}
|
|
@@ -716,10 +717,10 @@ class BaseBlock extends LocalBaseBlock {
|
|
|
716
717
|
if (encoding === "ascii") {
|
|
717
718
|
return this.onAsciiEncoding();
|
|
718
719
|
}
|
|
719
|
-
return
|
|
720
|
+
return download.build.Convert.ToHex(this.toBER());
|
|
720
721
|
}
|
|
721
722
|
onAsciiEncoding() {
|
|
722
|
-
return `${this.constructor.NAME} : ${
|
|
723
|
+
return `${this.constructor.NAME} : ${download.build.Convert.ToHex(this.valueBlock.valueBeforeDecodeView)}`;
|
|
723
724
|
}
|
|
724
725
|
isEqual(other) {
|
|
725
726
|
if (this === other) {
|
|
@@ -1017,7 +1018,7 @@ function fromBER(inputBuffer) {
|
|
|
1017
1018
|
result
|
|
1018
1019
|
};
|
|
1019
1020
|
}
|
|
1020
|
-
return localFromBER(
|
|
1021
|
+
return localFromBER(download.build.BufferSourceConverter.toUint8Array(inputBuffer).slice(), 0, inputBuffer.byteLength);
|
|
1021
1022
|
}
|
|
1022
1023
|
|
|
1023
1024
|
function checkLen(indefiniteLength, length) {
|
|
@@ -1033,7 +1034,7 @@ class LocalConstructedValueBlock extends ValueBlock {
|
|
|
1033
1034
|
this.isIndefiniteForm = isIndefiniteForm;
|
|
1034
1035
|
}
|
|
1035
1036
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
1036
|
-
const view =
|
|
1037
|
+
const view = download.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1037
1038
|
if (!checkBufferParams(this, view, inputOffset, inputLength)) {
|
|
1038
1039
|
return -1;
|
|
1039
1040
|
}
|
|
@@ -1203,7 +1204,7 @@ class LocalBooleanValueBlock extends HexBlock(ValueBlock) {
|
|
|
1203
1204
|
constructor({ value, ...parameters } = {}) {
|
|
1204
1205
|
super(parameters);
|
|
1205
1206
|
if (parameters.valueHex) {
|
|
1206
|
-
this.valueHexView =
|
|
1207
|
+
this.valueHexView = download.build.BufferSourceConverter.toUint8Array(parameters.valueHex);
|
|
1207
1208
|
}
|
|
1208
1209
|
else {
|
|
1209
1210
|
this.valueHexView = new Uint8Array(1);
|
|
@@ -1224,7 +1225,7 @@ class LocalBooleanValueBlock extends HexBlock(ValueBlock) {
|
|
|
1224
1225
|
this.valueHexView[0] = value ? 0xFF : 0x00;
|
|
1225
1226
|
}
|
|
1226
1227
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
1227
|
-
const inputView =
|
|
1228
|
+
const inputView = download.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1228
1229
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
1229
1230
|
return -1;
|
|
1230
1231
|
}
|
|
@@ -1371,7 +1372,7 @@ class OctetString$1 extends BaseBlock {
|
|
|
1371
1372
|
if (this.valueBlock.isConstructed || (this.valueBlock.value && this.valueBlock.value.length)) {
|
|
1372
1373
|
return Constructed.prototype.onAsciiEncoding.call(this);
|
|
1373
1374
|
}
|
|
1374
|
-
return `${this.constructor.NAME} : ${
|
|
1375
|
+
return `${this.constructor.NAME} : ${download.build.Convert.ToHex(this.valueBlock.valueHexView)}`;
|
|
1375
1376
|
}
|
|
1376
1377
|
getValue() {
|
|
1377
1378
|
if (!this.idBlock.isConstructed) {
|
|
@@ -1383,7 +1384,7 @@ class OctetString$1 extends BaseBlock {
|
|
|
1383
1384
|
array.push(content.valueBlock.valueHexView);
|
|
1384
1385
|
}
|
|
1385
1386
|
}
|
|
1386
|
-
return
|
|
1387
|
+
return download.build.BufferSourceConverter.concat(array);
|
|
1387
1388
|
}
|
|
1388
1389
|
}
|
|
1389
1390
|
_a$r = OctetString$1;
|
|
@@ -1431,7 +1432,7 @@ class LocalBitStringValueBlock extends HexBlock(LocalConstructedValueBlock) {
|
|
|
1431
1432
|
}
|
|
1432
1433
|
return resultOffset;
|
|
1433
1434
|
}
|
|
1434
|
-
const inputView =
|
|
1435
|
+
const inputView = download.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1435
1436
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
1436
1437
|
return -1;
|
|
1437
1438
|
}
|
|
@@ -1771,13 +1772,13 @@ class Integer extends BaseBlock {
|
|
|
1771
1772
|
const bigIntValue = BigInt(value);
|
|
1772
1773
|
const writer = new ViewWriter();
|
|
1773
1774
|
const hex = bigIntValue.toString(16).replace(/^-/, "");
|
|
1774
|
-
const view = new Uint8Array(
|
|
1775
|
+
const view = new Uint8Array(download.build.Convert.FromHex(hex));
|
|
1775
1776
|
if (bigIntValue < 0) {
|
|
1776
1777
|
const first = new Uint8Array(view.length + (view[0] & 0x80 ? 1 : 0));
|
|
1777
1778
|
first[0] |= 0x80;
|
|
1778
|
-
const firstInt = BigInt(`0x${
|
|
1779
|
+
const firstInt = BigInt(`0x${download.build.Convert.ToHex(first)}`);
|
|
1779
1780
|
const secondInt = firstInt + bigIntValue;
|
|
1780
|
-
const second =
|
|
1781
|
+
const second = download.build.BufferSourceConverter.toUint8Array(download.build.Convert.FromHex(secondInt.toString(16)));
|
|
1781
1782
|
second[0] |= 0x80;
|
|
1782
1783
|
writer.write(second);
|
|
1783
1784
|
}
|
|
@@ -1838,7 +1839,7 @@ class LocalSidValueBlock extends HexBlock(ValueBlock) {
|
|
|
1838
1839
|
if (!inputLength) {
|
|
1839
1840
|
return inputOffset;
|
|
1840
1841
|
}
|
|
1841
|
-
const inputView =
|
|
1842
|
+
const inputView = download.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1842
1843
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
1843
1844
|
return -1;
|
|
1844
1845
|
}
|
|
@@ -1910,7 +1911,7 @@ class LocalSidValueBlock extends HexBlock(ValueBlock) {
|
|
|
1910
1911
|
toString() {
|
|
1911
1912
|
let result = "";
|
|
1912
1913
|
if (this.isHexOnly)
|
|
1913
|
-
result =
|
|
1914
|
+
result = download.build.Convert.ToHex(this.valueHexView);
|
|
1914
1915
|
else {
|
|
1915
1916
|
if (this.isFirstSid) {
|
|
1916
1917
|
let sidValue = this.valueDec;
|
|
@@ -2107,7 +2108,7 @@ class LocalRelativeSidValueBlock extends HexBlock(LocalBaseBlock) {
|
|
|
2107
2108
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
2108
2109
|
if (inputLength === 0)
|
|
2109
2110
|
return inputOffset;
|
|
2110
|
-
const inputView =
|
|
2111
|
+
const inputView = download.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2111
2112
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength))
|
|
2112
2113
|
return -1;
|
|
2113
2114
|
const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);
|
|
@@ -2165,7 +2166,7 @@ class LocalRelativeSidValueBlock extends HexBlock(LocalBaseBlock) {
|
|
|
2165
2166
|
toString() {
|
|
2166
2167
|
let result = "";
|
|
2167
2168
|
if (this.isHexOnly)
|
|
2168
|
-
result =
|
|
2169
|
+
result = download.build.Convert.ToHex(this.valueHexView);
|
|
2169
2170
|
else {
|
|
2170
2171
|
result = this.valueDec.toString();
|
|
2171
2172
|
}
|
|
@@ -2347,7 +2348,7 @@ class LocalSimpleStringBlock extends BaseStringBlock {
|
|
|
2347
2348
|
super(parameters, LocalSimpleStringValueBlock);
|
|
2348
2349
|
}
|
|
2349
2350
|
fromBuffer(inputBuffer) {
|
|
2350
|
-
this.valueBlock.value = String.fromCharCode.apply(null,
|
|
2351
|
+
this.valueBlock.value = String.fromCharCode.apply(null, download.build.BufferSourceConverter.toUint8Array(inputBuffer));
|
|
2351
2352
|
}
|
|
2352
2353
|
fromString(inputString) {
|
|
2353
2354
|
const strLen = inputString.length;
|
|
@@ -2361,17 +2362,17 @@ LocalSimpleStringBlock.NAME = "SIMPLE STRING";
|
|
|
2361
2362
|
|
|
2362
2363
|
class LocalUtf8StringValueBlock extends LocalSimpleStringBlock {
|
|
2363
2364
|
fromBuffer(inputBuffer) {
|
|
2364
|
-
this.valueBlock.valueHexView =
|
|
2365
|
+
this.valueBlock.valueHexView = download.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2365
2366
|
try {
|
|
2366
|
-
this.valueBlock.value =
|
|
2367
|
+
this.valueBlock.value = download.build.Convert.ToUtf8String(inputBuffer);
|
|
2367
2368
|
}
|
|
2368
2369
|
catch (ex) {
|
|
2369
2370
|
this.warnings.push(`Error during "decodeURIComponent": ${ex}, using raw string`);
|
|
2370
|
-
this.valueBlock.value =
|
|
2371
|
+
this.valueBlock.value = download.build.Convert.ToBinary(inputBuffer);
|
|
2371
2372
|
}
|
|
2372
2373
|
}
|
|
2373
2374
|
fromString(inputString) {
|
|
2374
|
-
this.valueBlock.valueHexView = new Uint8Array(
|
|
2375
|
+
this.valueBlock.valueHexView = new Uint8Array(download.build.Convert.FromUtf8String(inputString));
|
|
2375
2376
|
this.valueBlock.value = inputString;
|
|
2376
2377
|
}
|
|
2377
2378
|
}
|
|
@@ -2393,12 +2394,12 @@ Utf8String.NAME = "UTF8String";
|
|
|
2393
2394
|
|
|
2394
2395
|
class LocalBmpStringValueBlock extends LocalSimpleStringBlock {
|
|
2395
2396
|
fromBuffer(inputBuffer) {
|
|
2396
|
-
this.valueBlock.value =
|
|
2397
|
-
this.valueBlock.valueHexView =
|
|
2397
|
+
this.valueBlock.value = download.build.Convert.ToUtf16String(inputBuffer);
|
|
2398
|
+
this.valueBlock.valueHexView = download.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2398
2399
|
}
|
|
2399
2400
|
fromString(inputString) {
|
|
2400
2401
|
this.valueBlock.value = inputString;
|
|
2401
|
-
this.valueBlock.valueHexView = new Uint8Array(
|
|
2402
|
+
this.valueBlock.valueHexView = new Uint8Array(download.build.Convert.FromUtf16String(inputString));
|
|
2402
2403
|
}
|
|
2403
2404
|
}
|
|
2404
2405
|
LocalBmpStringValueBlock.NAME = "BmpStringValueBlock";
|
|
@@ -2610,7 +2611,7 @@ class UTCTime extends VisibleString {
|
|
|
2610
2611
|
this.idBlock.tagNumber = 23;
|
|
2611
2612
|
}
|
|
2612
2613
|
fromBuffer(inputBuffer) {
|
|
2613
|
-
this.fromString(String.fromCharCode.apply(null,
|
|
2614
|
+
this.fromString(String.fromCharCode.apply(null, download.build.BufferSourceConverter.toUint8Array(inputBuffer)));
|
|
2614
2615
|
}
|
|
2615
2616
|
toBuffer() {
|
|
2616
2617
|
const str = this.toString();
|
|
@@ -2960,17 +2961,17 @@ class Repeated extends Any {
|
|
|
2960
2961
|
|
|
2961
2962
|
class RawData {
|
|
2962
2963
|
constructor({ data = EMPTY_VIEW } = {}) {
|
|
2963
|
-
this.dataView =
|
|
2964
|
+
this.dataView = download.build.BufferSourceConverter.toUint8Array(data);
|
|
2964
2965
|
}
|
|
2965
2966
|
get data() {
|
|
2966
2967
|
return this.dataView.slice().buffer;
|
|
2967
2968
|
}
|
|
2968
2969
|
set data(value) {
|
|
2969
|
-
this.dataView =
|
|
2970
|
+
this.dataView = download.build.BufferSourceConverter.toUint8Array(value);
|
|
2970
2971
|
}
|
|
2971
2972
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
2972
2973
|
const endLength = inputOffset + inputLength;
|
|
2973
|
-
this.dataView =
|
|
2974
|
+
this.dataView = download.build.BufferSourceConverter.toUint8Array(inputBuffer).subarray(inputOffset, endLength);
|
|
2974
2975
|
return endLength;
|
|
2975
2976
|
}
|
|
2976
2977
|
toBER(sizeOnly) {
|
|
@@ -3289,7 +3290,7 @@ function verifySchema(inputBuffer, inputSchema) {
|
|
|
3289
3290
|
result: { error: "Wrong ASN.1 schema type" }
|
|
3290
3291
|
};
|
|
3291
3292
|
}
|
|
3292
|
-
const asn1 = localFromBER(
|
|
3293
|
+
const asn1 = localFromBER(download.build.BufferSourceConverter.toUint8Array(inputBuffer));
|
|
3293
3294
|
if (asn1.offset === -1) {
|
|
3294
3295
|
return {
|
|
3295
3296
|
verified: false,
|
|
@@ -3299,7 +3300,7 @@ function verifySchema(inputBuffer, inputSchema) {
|
|
|
3299
3300
|
return compareSchema(asn1.result, asn1.result, inputSchema);
|
|
3300
3301
|
}
|
|
3301
3302
|
|
|
3302
|
-
const
|
|
3303
|
+
const asn1js = /*#__PURE__*/Object.freeze({
|
|
3303
3304
|
__proto__: null,
|
|
3304
3305
|
Any: Any,
|
|
3305
3306
|
BaseBlock: BaseBlock,
|
|
@@ -3385,7 +3386,7 @@ var AsnPropTypes;
|
|
|
3385
3386
|
})(AsnPropTypes || (AsnPropTypes = {}));
|
|
3386
3387
|
|
|
3387
3388
|
const AsnAnyConverter = {
|
|
3388
|
-
fromASN: (value) => value instanceof Null ? null : value.
|
|
3389
|
+
fromASN: (value) => value instanceof Null ? null : value.valueBeforeDecodeView,
|
|
3389
3390
|
toASN: (value) => {
|
|
3390
3391
|
if (value === null) {
|
|
3391
3392
|
return new Null();
|
|
@@ -3398,21 +3399,21 @@ const AsnAnyConverter = {
|
|
|
3398
3399
|
},
|
|
3399
3400
|
};
|
|
3400
3401
|
const AsnIntegerConverter = {
|
|
3401
|
-
fromASN: (value) => value.valueBlock.
|
|
3402
|
+
fromASN: (value) => value.valueBlock.valueHexView.byteLength >= 4
|
|
3402
3403
|
? value.valueBlock.toString()
|
|
3403
3404
|
: value.valueBlock.valueDec,
|
|
3404
|
-
toASN: (value) => new Integer({ value: value }),
|
|
3405
|
+
toASN: (value) => new Integer({ value: +value }),
|
|
3405
3406
|
};
|
|
3406
3407
|
const AsnEnumeratedConverter = {
|
|
3407
3408
|
fromASN: (value) => value.valueBlock.valueDec,
|
|
3408
3409
|
toASN: (value) => new Enumerated({ value }),
|
|
3409
3410
|
};
|
|
3410
3411
|
const AsnIntegerArrayBufferConverter = {
|
|
3411
|
-
fromASN: (value) => value.valueBlock.
|
|
3412
|
+
fromASN: (value) => value.valueBlock.valueHexView,
|
|
3412
3413
|
toASN: (value) => new Integer({ valueHex: value }),
|
|
3413
3414
|
};
|
|
3414
3415
|
const AsnBitStringConverter = {
|
|
3415
|
-
fromASN: (value) => value.valueBlock.
|
|
3416
|
+
fromASN: (value) => value.valueBlock.valueHexView,
|
|
3416
3417
|
toASN: (value) => new BitString$1({ valueHex: value }),
|
|
3417
3418
|
};
|
|
3418
3419
|
const AsnObjectIdentifierConverter = {
|
|
@@ -3424,7 +3425,7 @@ const AsnBooleanConverter = {
|
|
|
3424
3425
|
toASN: (value) => new Boolean({ value }),
|
|
3425
3426
|
};
|
|
3426
3427
|
const AsnOctetStringConverter = {
|
|
3427
|
-
fromASN: (value) => value.valueBlock.
|
|
3428
|
+
fromASN: (value) => value.valueBlock.valueHexView,
|
|
3428
3429
|
toASN: (value) => new OctetString$1({ valueHex: value }),
|
|
3429
3430
|
};
|
|
3430
3431
|
function createStringConverter(Asn1Type) {
|
|
@@ -3454,8 +3455,8 @@ const AsnGeneralizedTimeConverter = {
|
|
|
3454
3455
|
toASN: (value) => new GeneralizedTime({ valueDate: value }),
|
|
3455
3456
|
};
|
|
3456
3457
|
const AsnNullConverter = {
|
|
3457
|
-
fromASN: (
|
|
3458
|
-
toASN: (
|
|
3458
|
+
fromASN: () => null,
|
|
3459
|
+
toASN: () => {
|
|
3459
3460
|
return new Null();
|
|
3460
3461
|
},
|
|
3461
3462
|
};
|
|
@@ -3518,9 +3519,9 @@ class BitString {
|
|
|
3518
3519
|
if (typeof params === "number") {
|
|
3519
3520
|
this.fromNumber(params);
|
|
3520
3521
|
}
|
|
3521
|
-
else if (
|
|
3522
|
+
else if (download.build.BufferSourceConverter.isBufferSource(params)) {
|
|
3522
3523
|
this.unusedBits = unusedBits;
|
|
3523
|
-
this.value =
|
|
3524
|
+
this.value = download.build.BufferSourceConverter.toArrayBuffer(params);
|
|
3524
3525
|
}
|
|
3525
3526
|
else {
|
|
3526
3527
|
throw TypeError("Unsupported type of 'params' argument for BitString");
|
|
@@ -3574,8 +3575,8 @@ class OctetString {
|
|
|
3574
3575
|
this.buffer = new ArrayBuffer(param);
|
|
3575
3576
|
}
|
|
3576
3577
|
else {
|
|
3577
|
-
if (
|
|
3578
|
-
this.buffer =
|
|
3578
|
+
if (download.build.BufferSourceConverter.isBufferSource(param)) {
|
|
3579
|
+
this.buffer = download.build.BufferSourceConverter.toArrayBuffer(param);
|
|
3579
3580
|
}
|
|
3580
3581
|
else if (Array.isArray(param)) {
|
|
3581
3582
|
this.buffer = new Uint8Array(param);
|
|
@@ -3607,7 +3608,7 @@ class OctetString {
|
|
|
3607
3608
|
}
|
|
3608
3609
|
|
|
3609
3610
|
function isConvertible(target) {
|
|
3610
|
-
if (target && target.prototype) {
|
|
3611
|
+
if (typeof target === "function" && target.prototype) {
|
|
3611
3612
|
if (target.prototype.toASN && target.prototype.fromASN) {
|
|
3612
3613
|
return true;
|
|
3613
3614
|
}
|
|
@@ -3616,7 +3617,7 @@ function isConvertible(target) {
|
|
|
3616
3617
|
}
|
|
3617
3618
|
}
|
|
3618
3619
|
else {
|
|
3619
|
-
return !!(target && target
|
|
3620
|
+
return !!(target && typeof target === "object" && "toASN" in target && "fromASN" in target);
|
|
3620
3621
|
}
|
|
3621
3622
|
}
|
|
3622
3623
|
function isTypeOfArray(target) {
|
|
@@ -3654,11 +3655,13 @@ class AsnSchemaStorage {
|
|
|
3654
3655
|
has(target) {
|
|
3655
3656
|
return this.items.has(target);
|
|
3656
3657
|
}
|
|
3657
|
-
get(target) {
|
|
3658
|
-
var _a, _b, _c;
|
|
3658
|
+
get(target, checkSchema = false) {
|
|
3659
3659
|
const schema = this.items.get(target);
|
|
3660
3660
|
if (!schema) {
|
|
3661
|
-
throw new Error(`Cannot get schema for '${
|
|
3661
|
+
throw new Error(`Cannot get schema for '${target.prototype.constructor.name}' target`);
|
|
3662
|
+
}
|
|
3663
|
+
if (checkSchema && !schema.schema) {
|
|
3664
|
+
throw new Error(`Schema '${target.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);
|
|
3662
3665
|
}
|
|
3663
3666
|
return schema;
|
|
3664
3667
|
}
|
|
@@ -3689,7 +3692,7 @@ class AsnSchemaStorage {
|
|
|
3689
3692
|
let asn1Item;
|
|
3690
3693
|
if (typeof (item.type) === "number") {
|
|
3691
3694
|
const Asn1TypeName = AsnPropTypes[item.type];
|
|
3692
|
-
const Asn1Type =
|
|
3695
|
+
const Asn1Type = asn1js[Asn1TypeName];
|
|
3693
3696
|
if (!Asn1Type) {
|
|
3694
3697
|
throw new Error(`Cannot get ASN1 class by name '${Asn1TypeName}'`);
|
|
3695
3698
|
}
|
|
@@ -3747,9 +3750,9 @@ class AsnSchemaStorage {
|
|
|
3747
3750
|
this.cache(item.type);
|
|
3748
3751
|
const isRepeated = !!item.repeated;
|
|
3749
3752
|
let value = !isRepeated
|
|
3750
|
-
? this.get(item.type).schema
|
|
3753
|
+
? this.get(item.type, true).schema
|
|
3751
3754
|
: asn1Item;
|
|
3752
|
-
value =
|
|
3755
|
+
value = "valueBlock" in value ? value.valueBlock.value : value.value;
|
|
3753
3756
|
asn1Value.push(new Constructed({
|
|
3754
3757
|
name: !isRepeated ? name : "",
|
|
3755
3758
|
optional,
|
|
@@ -3757,7 +3760,7 @@ class AsnSchemaStorage {
|
|
|
3757
3760
|
tagClass: 3,
|
|
3758
3761
|
tagNumber: item.context,
|
|
3759
3762
|
},
|
|
3760
|
-
value,
|
|
3763
|
+
value: value,
|
|
3761
3764
|
}));
|
|
3762
3765
|
}
|
|
3763
3766
|
}
|
|
@@ -3879,15 +3882,19 @@ class AsnParser {
|
|
|
3879
3882
|
}
|
|
3880
3883
|
const res = new target();
|
|
3881
3884
|
if (isTypeOfArray(target)) {
|
|
3882
|
-
if (
|
|
3883
|
-
|
|
3885
|
+
if (!("value" in asn1Schema.valueBlock && Array.isArray(asn1Schema.valueBlock.value))) {
|
|
3886
|
+
throw new Error(`Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.`);
|
|
3887
|
+
}
|
|
3888
|
+
const itemType = schema.itemType;
|
|
3889
|
+
if (typeof itemType === "number") {
|
|
3890
|
+
const converter = defaultConverter(itemType);
|
|
3884
3891
|
if (!converter) {
|
|
3885
3892
|
throw new Error(`Cannot get default converter for array item of ${target.name} ASN1 schema`);
|
|
3886
3893
|
}
|
|
3887
3894
|
return target.from(asn1Schema.valueBlock.value, (element) => converter.fromASN(element));
|
|
3888
3895
|
}
|
|
3889
3896
|
else {
|
|
3890
|
-
return target.from(asn1Schema.valueBlock.value, (element) => this.fromASN(element,
|
|
3897
|
+
return target.from(asn1Schema.valueBlock.value, (element) => this.fromASN(element, itemType));
|
|
3891
3898
|
}
|
|
3892
3899
|
}
|
|
3893
3900
|
for (const key in schema.items) {
|
|
@@ -3896,9 +3903,10 @@ class AsnParser {
|
|
|
3896
3903
|
continue;
|
|
3897
3904
|
}
|
|
3898
3905
|
const schemaItem = schema.items[key];
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3906
|
+
const schemaItemType = schemaItem.type;
|
|
3907
|
+
if (typeof schemaItemType === "number" || isConvertible(schemaItemType)) {
|
|
3908
|
+
const converter = (_a = schemaItem.converter) !== null && _a !== void 0 ? _a : (isConvertible(schemaItemType)
|
|
3909
|
+
? new schemaItemType()
|
|
3902
3910
|
: null);
|
|
3903
3911
|
if (!converter) {
|
|
3904
3912
|
throw new Error("Converter is empty");
|
|
@@ -3910,7 +3918,14 @@ class AsnParser {
|
|
|
3910
3918
|
: Set;
|
|
3911
3919
|
const newItem = new Container();
|
|
3912
3920
|
newItem.valueBlock = asn1SchemaValue.valueBlock;
|
|
3913
|
-
const
|
|
3921
|
+
const newItemAsn = fromBER(newItem.toBER(false));
|
|
3922
|
+
if (newItemAsn.offset === -1) {
|
|
3923
|
+
throw new Error(`Cannot parse the child item. ${newItemAsn.result.error}`);
|
|
3924
|
+
}
|
|
3925
|
+
if (!("value" in newItemAsn.result.valueBlock && Array.isArray(newItemAsn.result.valueBlock.value))) {
|
|
3926
|
+
throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");
|
|
3927
|
+
}
|
|
3928
|
+
const value = newItemAsn.result.valueBlock.value;
|
|
3914
3929
|
res[key] = Array.from(value, (element) => converter.fromASN(element));
|
|
3915
3930
|
}
|
|
3916
3931
|
else {
|
|
@@ -3921,12 +3936,12 @@ class AsnParser {
|
|
|
3921
3936
|
let value = asn1SchemaValue;
|
|
3922
3937
|
if (schemaItem.implicit) {
|
|
3923
3938
|
let newItem;
|
|
3924
|
-
if (isConvertible(
|
|
3925
|
-
newItem = new
|
|
3939
|
+
if (isConvertible(schemaItemType)) {
|
|
3940
|
+
newItem = new schemaItemType().toSchema("");
|
|
3926
3941
|
}
|
|
3927
3942
|
else {
|
|
3928
|
-
const Asn1TypeName = AsnPropTypes[
|
|
3929
|
-
const Asn1Type =
|
|
3943
|
+
const Asn1TypeName = AsnPropTypes[schemaItemType];
|
|
3944
|
+
const Asn1Type = asn1js[Asn1TypeName];
|
|
3930
3945
|
if (!Asn1Type) {
|
|
3931
3946
|
throw new Error(`Cannot get '${Asn1TypeName}' class from asn1js module`);
|
|
3932
3947
|
}
|
|
@@ -3940,10 +3955,13 @@ class AsnParser {
|
|
|
3940
3955
|
}
|
|
3941
3956
|
else {
|
|
3942
3957
|
if (schemaItem.repeated) {
|
|
3943
|
-
|
|
3958
|
+
if (!Array.isArray(asn1SchemaValue)) {
|
|
3959
|
+
throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");
|
|
3960
|
+
}
|
|
3961
|
+
res[key] = Array.from(asn1SchemaValue, (element) => this.fromASN(element, schemaItemType));
|
|
3944
3962
|
}
|
|
3945
3963
|
else {
|
|
3946
|
-
res[key] = this.fromASN(asn1SchemaValue,
|
|
3964
|
+
res[key] = this.fromASN(asn1SchemaValue, schemaItemType);
|
|
3947
3965
|
}
|
|
3948
3966
|
}
|
|
3949
3967
|
}
|
|
@@ -3966,14 +3984,20 @@ class AsnSerializer {
|
|
|
3966
3984
|
return this.toASN(obj).toBER(false);
|
|
3967
3985
|
}
|
|
3968
3986
|
static toASN(obj) {
|
|
3969
|
-
if (obj && isConvertible(obj
|
|
3987
|
+
if (obj && typeof obj === "object" && isConvertible(obj)) {
|
|
3970
3988
|
return obj.toASN();
|
|
3971
3989
|
}
|
|
3990
|
+
if (!(obj && typeof obj === "object")) {
|
|
3991
|
+
throw new TypeError("Parameter 1 should be type of Object.");
|
|
3992
|
+
}
|
|
3972
3993
|
const target = obj.constructor;
|
|
3973
3994
|
const schema = schemaStorage.get(target);
|
|
3974
3995
|
schemaStorage.cache(target);
|
|
3975
3996
|
let asn1Value = [];
|
|
3976
3997
|
if (schema.itemType) {
|
|
3998
|
+
if (!Array.isArray(obj)) {
|
|
3999
|
+
throw new TypeError("Parameter 1 should be type of Array.");
|
|
4000
|
+
}
|
|
3977
4001
|
if (typeof schema.itemType === "number") {
|
|
3978
4002
|
const converter = defaultConverter(schema.itemType);
|
|
3979
4003
|
if (!converter) {
|
|
@@ -3995,13 +4019,13 @@ class AsnSerializer {
|
|
|
3995
4019
|
&& isArrayEqual(this.serialize(schemaItem.defaultValue), this.serialize(objProp)))) {
|
|
3996
4020
|
continue;
|
|
3997
4021
|
}
|
|
3998
|
-
|
|
4022
|
+
const asn1Item = AsnSerializer.toAsnItem(schemaItem, key, target, objProp);
|
|
3999
4023
|
if (typeof schemaItem.context === "number") {
|
|
4000
4024
|
if (schemaItem.implicit) {
|
|
4001
4025
|
if (!schemaItem.repeated
|
|
4002
4026
|
&& (typeof schemaItem.type === "number" || isConvertible(schemaItem.type))) {
|
|
4003
4027
|
const value = {};
|
|
4004
|
-
value.valueHex = asn1Item instanceof Null ? asn1Item.
|
|
4028
|
+
value.valueHex = asn1Item instanceof Null ? asn1Item.valueBeforeDecodeView : asn1Item.valueBlock.toBER();
|
|
4005
4029
|
asn1Value.push(new Primitive({
|
|
4006
4030
|
optional: schemaItem.optional,
|
|
4007
4031
|
idBlock: {
|
|
@@ -4066,6 +4090,9 @@ class AsnSerializer {
|
|
|
4066
4090
|
throw new Error(`Property '${key}' doesn't have converter for type ${AsnPropTypes[schemaItem.type]} in schema '${target.name}'`);
|
|
4067
4091
|
}
|
|
4068
4092
|
if (schemaItem.repeated) {
|
|
4093
|
+
if (!Array.isArray(objProp)) {
|
|
4094
|
+
throw new TypeError("Parameter 'objProp' should be type of Array.");
|
|
4095
|
+
}
|
|
4069
4096
|
const items = Array.from(objProp, (element) => converter.toASN(element));
|
|
4070
4097
|
const Container = schemaItem.repeated === "sequence"
|
|
4071
4098
|
? Sequence
|
|
@@ -4080,6 +4107,9 @@ class AsnSerializer {
|
|
|
4080
4107
|
}
|
|
4081
4108
|
else {
|
|
4082
4109
|
if (schemaItem.repeated) {
|
|
4110
|
+
if (!Array.isArray(objProp)) {
|
|
4111
|
+
throw new TypeError("Parameter 'objProp' should be type of Array.");
|
|
4112
|
+
}
|
|
4083
4113
|
const items = Array.from(objProp, (element) => this.toASN(element));
|
|
4084
4114
|
const Container = schemaItem.repeated === "sequence"
|
|
4085
4115
|
? Sequence
|
|
@@ -4118,8 +4148,8 @@ class AsnConvert {
|
|
|
4118
4148
|
return AsnParser.parse(data, target);
|
|
4119
4149
|
}
|
|
4120
4150
|
static toString(data) {
|
|
4121
|
-
const buf =
|
|
4122
|
-
?
|
|
4151
|
+
const buf = download.build.BufferSourceConverter.isBufferSource(data)
|
|
4152
|
+
? download.build.BufferSourceConverter.toArrayBuffer(data)
|
|
4123
4153
|
: AsnConvert.serialize(data);
|
|
4124
4154
|
const asn = fromBER(buf);
|
|
4125
4155
|
if (asn.offset === -1) {
|
|
@@ -4151,7 +4181,7 @@ function __decorate(decorators, target, key, desc) {
|
|
|
4151
4181
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4152
4182
|
}
|
|
4153
4183
|
|
|
4154
|
-
var ipaddr =
|
|
4184
|
+
var ipaddr = download.createCommonjsModule(function (module) {
|
|
4155
4185
|
(function (root) {
|
|
4156
4186
|
// A list of regular expressions that match arbitrary IPv4 addresses,
|
|
4157
4187
|
// for which a number of weird notations exist.
|
|
@@ -5146,7 +5176,7 @@ var ipaddr = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
5146
5176
|
root.ipaddr = ipaddr;
|
|
5147
5177
|
}
|
|
5148
5178
|
|
|
5149
|
-
}(
|
|
5179
|
+
}(download.commonjsGlobal));
|
|
5150
5180
|
});
|
|
5151
5181
|
|
|
5152
5182
|
class IpConverter {
|
|
@@ -5172,7 +5202,7 @@ class IpConverter {
|
|
|
5172
5202
|
const addr = ipaddr.fromByteArray(Array.from(uint8));
|
|
5173
5203
|
return addr.toString();
|
|
5174
5204
|
}
|
|
5175
|
-
return this.decodeIP(
|
|
5205
|
+
return this.decodeIP(download.build.Convert.ToHex(buf));
|
|
5176
5206
|
}
|
|
5177
5207
|
static fromString(text) {
|
|
5178
5208
|
const addr = ipaddr.parse(text);
|
|
@@ -5214,7 +5244,7 @@ let AttributeValue = class AttributeValue extends DirectoryString {
|
|
|
5214
5244
|
Object.assign(this, params);
|
|
5215
5245
|
}
|
|
5216
5246
|
toString() {
|
|
5217
|
-
return this.ia5String || (this.anyValue ?
|
|
5247
|
+
return this.ia5String || (this.anyValue ? download.build.Convert.ToHex(this.anyValue) : super.toString());
|
|
5218
5248
|
}
|
|
5219
5249
|
};
|
|
5220
5250
|
__decorate([
|
|
@@ -5431,7 +5461,7 @@ exports.DisplayText = class DisplayText {
|
|
|
5431
5461
|
Object.assign(this, params);
|
|
5432
5462
|
}
|
|
5433
5463
|
toString() {
|
|
5434
|
-
return this.ia5String || this.visibleString || this.bmpString || this.utf8String;
|
|
5464
|
+
return this.ia5String || this.visibleString || this.bmpString || this.utf8String || "";
|
|
5435
5465
|
}
|
|
5436
5466
|
};
|
|
5437
5467
|
__decorate([
|
|
@@ -5522,19 +5552,21 @@ exports.CertificatePolicies = CertificatePolicies_1 = __decorate([
|
|
|
5522
5552
|
AsnType({ type: AsnTypeTypes.Sequence, itemType: PolicyInformation })
|
|
5523
5553
|
], exports.CertificatePolicies);
|
|
5524
5554
|
|
|
5525
|
-
|
|
5555
|
+
const id_ce_cRLNumber = `${id_ce}.20`;
|
|
5556
|
+
exports.CRLNumber = class CRLNumber {
|
|
5526
5557
|
constructor(value = 0) {
|
|
5527
5558
|
this.value = value;
|
|
5528
5559
|
}
|
|
5529
5560
|
};
|
|
5530
5561
|
__decorate([
|
|
5531
5562
|
AsnProp({ type: AsnPropTypes.Integer })
|
|
5532
|
-
], CRLNumber.prototype, "value", void 0);
|
|
5533
|
-
CRLNumber = __decorate([
|
|
5563
|
+
], exports.CRLNumber.prototype, "value", void 0);
|
|
5564
|
+
exports.CRLNumber = __decorate([
|
|
5534
5565
|
AsnType({ type: AsnTypeTypes.Choice })
|
|
5535
|
-
], CRLNumber);
|
|
5566
|
+
], exports.CRLNumber);
|
|
5536
5567
|
|
|
5537
|
-
|
|
5568
|
+
const id_ce_deltaCRLIndicator = `${id_ce}.27`;
|
|
5569
|
+
let BaseCRLNumber = class BaseCRLNumber extends exports.CRLNumber {
|
|
5538
5570
|
};
|
|
5539
5571
|
BaseCRLNumber = __decorate([
|
|
5540
5572
|
AsnType({ type: AsnTypeTypes.Choice })
|
|
@@ -5640,6 +5672,7 @@ FreshestCRL = FreshestCRL_1 = __decorate([
|
|
|
5640
5672
|
AsnType({ type: AsnTypeTypes.Sequence, itemType: DistributionPoint })
|
|
5641
5673
|
], FreshestCRL);
|
|
5642
5674
|
|
|
5675
|
+
const id_ce_issuingDistributionPoint = `${id_ce}.28`;
|
|
5643
5676
|
class IssuingDistributionPoint {
|
|
5644
5677
|
constructor(params = {}) {
|
|
5645
5678
|
this.onlyContainsUserCerts = IssuingDistributionPoint.ONLY;
|
|
@@ -5648,29 +5681,25 @@ class IssuingDistributionPoint {
|
|
|
5648
5681
|
this.onlyContainsAttributeCerts = IssuingDistributionPoint.ONLY;
|
|
5649
5682
|
Object.assign(this, params);
|
|
5650
5683
|
}
|
|
5651
|
-
;
|
|
5652
|
-
;
|
|
5653
|
-
;
|
|
5654
|
-
;
|
|
5655
5684
|
}
|
|
5656
5685
|
IssuingDistributionPoint.ONLY = false;
|
|
5657
5686
|
__decorate([
|
|
5658
5687
|
AsnProp({ type: DistributionPointName, context: 0, optional: true })
|
|
5659
5688
|
], IssuingDistributionPoint.prototype, "distributionPoint", void 0);
|
|
5660
5689
|
__decorate([
|
|
5661
|
-
AsnProp({ type: AsnPropTypes.Boolean, context: 1, defaultValue: IssuingDistributionPoint.ONLY })
|
|
5690
|
+
AsnProp({ type: AsnPropTypes.Boolean, context: 1, defaultValue: IssuingDistributionPoint.ONLY, implicit: true })
|
|
5662
5691
|
], IssuingDistributionPoint.prototype, "onlyContainsUserCerts", void 0);
|
|
5663
5692
|
__decorate([
|
|
5664
|
-
AsnProp({ type: AsnPropTypes.Boolean, context: 2, defaultValue: IssuingDistributionPoint.ONLY })
|
|
5693
|
+
AsnProp({ type: AsnPropTypes.Boolean, context: 2, defaultValue: IssuingDistributionPoint.ONLY, implicit: true })
|
|
5665
5694
|
], IssuingDistributionPoint.prototype, "onlyContainsCACerts", void 0);
|
|
5666
5695
|
__decorate([
|
|
5667
|
-
AsnProp({ type: Reason, context: 3, optional: true })
|
|
5696
|
+
AsnProp({ type: Reason, context: 3, optional: true, implicit: true })
|
|
5668
5697
|
], IssuingDistributionPoint.prototype, "onlySomeReasons", void 0);
|
|
5669
5698
|
__decorate([
|
|
5670
|
-
AsnProp({ type: AsnPropTypes.Boolean, context: 4, defaultValue: IssuingDistributionPoint.ONLY })
|
|
5699
|
+
AsnProp({ type: AsnPropTypes.Boolean, context: 4, defaultValue: IssuingDistributionPoint.ONLY, implicit: true })
|
|
5671
5700
|
], IssuingDistributionPoint.prototype, "indirectCRL", void 0);
|
|
5672
5701
|
__decorate([
|
|
5673
|
-
AsnProp({ type: AsnPropTypes.Boolean, context: 5, defaultValue: IssuingDistributionPoint.ONLY })
|
|
5702
|
+
AsnProp({ type: AsnPropTypes.Boolean, context: 5, defaultValue: IssuingDistributionPoint.ONLY, implicit: true })
|
|
5674
5703
|
], IssuingDistributionPoint.prototype, "onlyContainsAttributeCerts", void 0);
|
|
5675
5704
|
|
|
5676
5705
|
const id_ce_cRLReasons = `${id_ce}.21`;
|
|
@@ -6009,7 +6038,7 @@ class AlgorithmIdentifier {
|
|
|
6009
6038
|
return data instanceof AlgorithmIdentifier
|
|
6010
6039
|
&& data.algorithm == this.algorithm
|
|
6011
6040
|
&& ((data.parameters && this.parameters
|
|
6012
|
-
&&
|
|
6041
|
+
&& download.build.isEqual(data.parameters, this.parameters))
|
|
6013
6042
|
||
|
|
6014
6043
|
(data.parameters === this.parameters));
|
|
6015
6044
|
}
|
|
@@ -8873,7 +8902,7 @@ var _Name_asn;
|
|
|
8873
8902
|
class Name {
|
|
8874
8903
|
constructor(data) {
|
|
8875
8904
|
_Name_asn.set(this, new exports.Name$1());
|
|
8876
|
-
if (
|
|
8905
|
+
if (download.build.BufferSourceConverter.isBufferSource(data)) {
|
|
8877
8906
|
__classPrivateFieldSet$1(this, _Name_asn, AsnParser.parse(data, exports.Name$1), "f");
|
|
8878
8907
|
}
|
|
8879
8908
|
else {
|
|
@@ -9078,8 +9107,8 @@ exports.CaVersion = class CaVersion {
|
|
|
9078
9107
|
data.set(new Uint8Array(this.value), 4 - this.value.byteLength);
|
|
9079
9108
|
}
|
|
9080
9109
|
return {
|
|
9081
|
-
keyIndex: parseInt(
|
|
9082
|
-
certificateIndex: parseInt(
|
|
9110
|
+
keyIndex: parseInt(download.build.Convert.ToHex(data.slice(0, 2)), 16),
|
|
9111
|
+
certificateIndex: parseInt(download.build.Convert.ToHex(data.slice(2)), 16),
|
|
9083
9112
|
};
|
|
9084
9113
|
}
|
|
9085
9114
|
};
|
|
@@ -9497,7 +9526,7 @@ exports.LeiRole = __decorate([
|
|
|
9497
9526
|
class ByteStream {
|
|
9498
9527
|
constructor(bytes) {
|
|
9499
9528
|
this.offset = 0;
|
|
9500
|
-
this.view =
|
|
9529
|
+
this.view = download.build.BufferSourceConverter.toUint8Array(bytes);
|
|
9501
9530
|
}
|
|
9502
9531
|
get position() {
|
|
9503
9532
|
return this.offset;
|
|
@@ -9516,7 +9545,7 @@ class ByteStream {
|
|
|
9516
9545
|
}
|
|
9517
9546
|
readNumber(size) {
|
|
9518
9547
|
const bytes = this.read(size);
|
|
9519
|
-
const hex =
|
|
9548
|
+
const hex = download.build.Convert.ToHex(bytes);
|
|
9520
9549
|
return parseInt(hex, 16);
|
|
9521
9550
|
}
|
|
9522
9551
|
readEnd() {
|
|
@@ -9529,7 +9558,7 @@ class ByteStream {
|
|
|
9529
9558
|
|
|
9530
9559
|
class Structure {
|
|
9531
9560
|
static createStream(bytes) {
|
|
9532
|
-
const view =
|
|
9561
|
+
const view = download.build.BufferSourceConverter.toUint8Array(bytes);
|
|
9533
9562
|
return new ByteStream(view);
|
|
9534
9563
|
}
|
|
9535
9564
|
}
|
|
@@ -9573,7 +9602,7 @@ class SignedCertificateTimestamp extends Structure {
|
|
|
9573
9602
|
parse(stream) {
|
|
9574
9603
|
this.version = stream.readByte();
|
|
9575
9604
|
stream.read(2);
|
|
9576
|
-
this.logId =
|
|
9605
|
+
this.logId = download.build.BufferSourceConverter.toArrayBuffer(stream.read(32));
|
|
9577
9606
|
this.timestamp = new Date(stream.readNumber(8));
|
|
9578
9607
|
const extLen = stream.readNumber(2);
|
|
9579
9608
|
this.extensions = stream.read(extLen).buffer;
|
|
@@ -9584,12 +9613,12 @@ class SignedCertificateTimestamp extends Structure {
|
|
|
9584
9613
|
toJSON() {
|
|
9585
9614
|
return {
|
|
9586
9615
|
version: this.version,
|
|
9587
|
-
logId:
|
|
9616
|
+
logId: download.build.Convert.ToHex(this.logId),
|
|
9588
9617
|
timestamp: this.timestamp,
|
|
9589
|
-
extensions:
|
|
9618
|
+
extensions: download.build.Convert.ToBase64(this.extensions),
|
|
9590
9619
|
hashAlgorithm: HashAlgorithm[this.hashAlgorithm] || "undefined",
|
|
9591
9620
|
signatureAlgorithm: SignatureAlgorithm[this.signatureAlgorithm] || "undefined",
|
|
9592
|
-
signature:
|
|
9621
|
+
signature: download.build.Convert.ToBase64(this.signature),
|
|
9593
9622
|
};
|
|
9594
9623
|
}
|
|
9595
9624
|
}
|
|
@@ -10011,7 +10040,7 @@ class AsnData {
|
|
|
10011
10040
|
else {
|
|
10012
10041
|
// raw, type
|
|
10013
10042
|
__classPrivateFieldSet(this, _AsnData_asn, AsnConvert.parse(args[0], args[1]), "f");
|
|
10014
|
-
__classPrivateFieldSet(this, _AsnData_raw,
|
|
10043
|
+
__classPrivateFieldSet(this, _AsnData_raw, download.build.BufferSourceConverter.toArrayBuffer(args[0]), "f");
|
|
10015
10044
|
}
|
|
10016
10045
|
}
|
|
10017
10046
|
get asn() {
|
|
@@ -10055,6 +10084,9 @@ class Extension extends AsnData {
|
|
|
10055
10084
|
case '2.5.29.46':
|
|
10056
10085
|
this.value = AsnParser.parse(asnExtnValue, exports.CRLDistributionPoints);
|
|
10057
10086
|
break;
|
|
10087
|
+
case id_ce_issuingDistributionPoint:
|
|
10088
|
+
this.value = AsnParser.parse(asnExtnValue, IssuingDistributionPoint);
|
|
10089
|
+
break;
|
|
10058
10090
|
case id_ce_cRLReasons:
|
|
10059
10091
|
this.value = AsnParser.parse(asnExtnValue, exports.CRLReason);
|
|
10060
10092
|
break;
|
|
@@ -10143,14 +10175,20 @@ class Extension extends AsnData {
|
|
|
10143
10175
|
case id_pe_subjectInfoAccess:
|
|
10144
10176
|
this.value = AsnParser.parse(asnExtnValue, exports.SubjectInfoAccessSyntax);
|
|
10145
10177
|
break;
|
|
10178
|
+
case id_ce_cRLNumber:
|
|
10179
|
+
this.value = AsnParser.parse(asnExtnValue, exports.CRLNumber);
|
|
10180
|
+
break;
|
|
10181
|
+
case id_ce_deltaCRLIndicator:
|
|
10182
|
+
this.value = AsnParser.parse(asnExtnValue, BaseCRLNumber);
|
|
10183
|
+
break;
|
|
10146
10184
|
default:
|
|
10147
10185
|
console.warn(`Didn't detect parser for "${this.asn.extnID}" extension.`);
|
|
10148
|
-
this.value =
|
|
10186
|
+
this.value = download.build.Convert.ToHex(asnExtnValue);
|
|
10149
10187
|
}
|
|
10150
10188
|
}
|
|
10151
10189
|
catch (error) {
|
|
10152
10190
|
console.error(`Error parse "${this.asn.extnID}" extension:`, error.message);
|
|
10153
|
-
this.value =
|
|
10191
|
+
this.value = download.build.Convert.ToHex(asnExtnValue);
|
|
10154
10192
|
}
|
|
10155
10193
|
}
|
|
10156
10194
|
getAsnExtnValue() {
|
|
@@ -10213,13 +10251,13 @@ const certificateRawToBuffer = (raw) => {
|
|
|
10213
10251
|
const rawClarified = base64Clarify(raw);
|
|
10214
10252
|
let buffer;
|
|
10215
10253
|
if (isHex(rawClarified)) {
|
|
10216
|
-
buffer =
|
|
10254
|
+
buffer = download.build.Convert.FromHex(rawClarified);
|
|
10217
10255
|
}
|
|
10218
10256
|
else if (isBase64(rawClarified) || isPem(rawClarified)) {
|
|
10219
|
-
buffer =
|
|
10257
|
+
buffer = download.build.Convert.FromBase64(rawClarified);
|
|
10220
10258
|
}
|
|
10221
10259
|
else {
|
|
10222
|
-
buffer =
|
|
10260
|
+
buffer = download.build.Convert.FromBinary(raw);
|
|
10223
10261
|
}
|
|
10224
10262
|
return buffer;
|
|
10225
10263
|
};
|
|
@@ -10883,6 +10921,107 @@ __decorate([
|
|
|
10883
10921
|
AsnProp({ type: EncapsulatedContent, context: 0, optional: true })
|
|
10884
10922
|
], EncapsulatedContentInfo.prototype, "eContent", void 0);
|
|
10885
10923
|
|
|
10924
|
+
var CMSVersion;
|
|
10925
|
+
(function (CMSVersion) {
|
|
10926
|
+
CMSVersion[CMSVersion["v0"] = 0] = "v0";
|
|
10927
|
+
CMSVersion[CMSVersion["v1"] = 1] = "v1";
|
|
10928
|
+
CMSVersion[CMSVersion["v2"] = 2] = "v2";
|
|
10929
|
+
CMSVersion[CMSVersion["v3"] = 3] = "v3";
|
|
10930
|
+
CMSVersion[CMSVersion["v4"] = 4] = "v4";
|
|
10931
|
+
CMSVersion[CMSVersion["v5"] = 5] = "v5";
|
|
10932
|
+
})(CMSVersion || (CMSVersion = {}));
|
|
10933
|
+
let DigestAlgorithmIdentifier = class DigestAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
10934
|
+
};
|
|
10935
|
+
DigestAlgorithmIdentifier = __decorate([
|
|
10936
|
+
AsnType({ type: AsnTypeTypes.Sequence })
|
|
10937
|
+
], DigestAlgorithmIdentifier);
|
|
10938
|
+
let SignatureAlgorithmIdentifier = class SignatureAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
10939
|
+
};
|
|
10940
|
+
SignatureAlgorithmIdentifier = __decorate([
|
|
10941
|
+
AsnType({ type: AsnTypeTypes.Sequence })
|
|
10942
|
+
], SignatureAlgorithmIdentifier);
|
|
10943
|
+
let KeyEncryptionAlgorithmIdentifier = class KeyEncryptionAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
10944
|
+
};
|
|
10945
|
+
KeyEncryptionAlgorithmIdentifier = __decorate([
|
|
10946
|
+
AsnType({ type: AsnTypeTypes.Sequence })
|
|
10947
|
+
], KeyEncryptionAlgorithmIdentifier);
|
|
10948
|
+
let ContentEncryptionAlgorithmIdentifier = class ContentEncryptionAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
10949
|
+
};
|
|
10950
|
+
ContentEncryptionAlgorithmIdentifier = __decorate([
|
|
10951
|
+
AsnType({ type: AsnTypeTypes.Sequence })
|
|
10952
|
+
], ContentEncryptionAlgorithmIdentifier);
|
|
10953
|
+
let MessageAuthenticationCodeAlgorithm = class MessageAuthenticationCodeAlgorithm extends AlgorithmIdentifier {
|
|
10954
|
+
};
|
|
10955
|
+
MessageAuthenticationCodeAlgorithm = __decorate([
|
|
10956
|
+
AsnType({ type: AsnTypeTypes.Sequence })
|
|
10957
|
+
], MessageAuthenticationCodeAlgorithm);
|
|
10958
|
+
let KeyDerivationAlgorithmIdentifier = class KeyDerivationAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
10959
|
+
};
|
|
10960
|
+
KeyDerivationAlgorithmIdentifier = __decorate([
|
|
10961
|
+
AsnType({ type: AsnTypeTypes.Sequence })
|
|
10962
|
+
], KeyDerivationAlgorithmIdentifier);
|
|
10963
|
+
|
|
10964
|
+
let EncryptedContent = class EncryptedContent {
|
|
10965
|
+
constructor(params = {}) {
|
|
10966
|
+
Object.assign(this, params);
|
|
10967
|
+
}
|
|
10968
|
+
};
|
|
10969
|
+
__decorate([
|
|
10970
|
+
AsnProp({ type: OctetString })
|
|
10971
|
+
], EncryptedContent.prototype, "single", void 0);
|
|
10972
|
+
__decorate([
|
|
10973
|
+
AsnProp({ type: AsnPropTypes.Any })
|
|
10974
|
+
], EncryptedContent.prototype, "any", void 0);
|
|
10975
|
+
EncryptedContent = __decorate([
|
|
10976
|
+
AsnType({ type: AsnTypeTypes.Choice })
|
|
10977
|
+
], EncryptedContent);
|
|
10978
|
+
class ImplicitEncryptedContentInfo {
|
|
10979
|
+
constructor(params = {}) {
|
|
10980
|
+
this.contentType = "";
|
|
10981
|
+
this.contentEncryptionAlgorithm = new ContentEncryptionAlgorithmIdentifier();
|
|
10982
|
+
Object.assign(this, params);
|
|
10983
|
+
}
|
|
10984
|
+
}
|
|
10985
|
+
__decorate([
|
|
10986
|
+
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
|
|
10987
|
+
], ImplicitEncryptedContentInfo.prototype, "contentType", void 0);
|
|
10988
|
+
__decorate([
|
|
10989
|
+
AsnProp({ type: ContentEncryptionAlgorithmIdentifier })
|
|
10990
|
+
], ImplicitEncryptedContentInfo.prototype, "contentEncryptionAlgorithm", void 0);
|
|
10991
|
+
__decorate([
|
|
10992
|
+
AsnProp({ type: OctetString, context: 0, implicit: true, optional: true })
|
|
10993
|
+
], ImplicitEncryptedContentInfo.prototype, "encryptedContent", void 0);
|
|
10994
|
+
class ExplicitEncryptedContentInfo {
|
|
10995
|
+
constructor(params = {}) {
|
|
10996
|
+
this.contentType = "";
|
|
10997
|
+
this.contentEncryptionAlgorithm = new ContentEncryptionAlgorithmIdentifier();
|
|
10998
|
+
Object.assign(this, params);
|
|
10999
|
+
}
|
|
11000
|
+
}
|
|
11001
|
+
__decorate([
|
|
11002
|
+
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
|
|
11003
|
+
], ExplicitEncryptedContentInfo.prototype, "contentType", void 0);
|
|
11004
|
+
__decorate([
|
|
11005
|
+
AsnProp({ type: ContentEncryptionAlgorithmIdentifier })
|
|
11006
|
+
], ExplicitEncryptedContentInfo.prototype, "contentEncryptionAlgorithm", void 0);
|
|
11007
|
+
__decorate([
|
|
11008
|
+
AsnProp({ type: EncryptedContent, context: 0, optional: true })
|
|
11009
|
+
], ExplicitEncryptedContentInfo.prototype, "encryptedContent", void 0);
|
|
11010
|
+
let EncryptedContentInfo = class EncryptedContentInfo {
|
|
11011
|
+
constructor(params = {}) {
|
|
11012
|
+
Object.assign(this, params);
|
|
11013
|
+
}
|
|
11014
|
+
};
|
|
11015
|
+
__decorate([
|
|
11016
|
+
AsnProp({ type: ImplicitEncryptedContentInfo, optional: true })
|
|
11017
|
+
], EncryptedContentInfo.prototype, "implicitEncryptedContentInfo", void 0);
|
|
11018
|
+
__decorate([
|
|
11019
|
+
AsnProp({ type: ExplicitEncryptedContentInfo, optional: true })
|
|
11020
|
+
], EncryptedContentInfo.prototype, "explicitEncryptedContentInfo", void 0);
|
|
11021
|
+
EncryptedContentInfo = __decorate([
|
|
11022
|
+
AsnType({ type: AsnTypeTypes.Choice })
|
|
11023
|
+
], EncryptedContentInfo);
|
|
11024
|
+
|
|
10886
11025
|
class IssuerAndSerialNumber {
|
|
10887
11026
|
constructor(params = {}) {
|
|
10888
11027
|
this.issuer = new exports.Name$1;
|
|
@@ -10897,6 +11036,268 @@ __decorate([
|
|
|
10897
11036
|
AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
|
|
10898
11037
|
], IssuerAndSerialNumber.prototype, "serialNumber", void 0);
|
|
10899
11038
|
|
|
11039
|
+
class OtherKeyAttribute {
|
|
11040
|
+
constructor(params = {}) {
|
|
11041
|
+
this.keyAttrId = "";
|
|
11042
|
+
Object.assign(this, params);
|
|
11043
|
+
}
|
|
11044
|
+
}
|
|
11045
|
+
__decorate([
|
|
11046
|
+
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
|
|
11047
|
+
], OtherKeyAttribute.prototype, "keyAttrId", void 0);
|
|
11048
|
+
__decorate([
|
|
11049
|
+
AsnProp({ type: AsnPropTypes.Any, optional: true })
|
|
11050
|
+
], OtherKeyAttribute.prototype, "keyAttr", void 0);
|
|
11051
|
+
|
|
11052
|
+
var RecipientEncryptedKeys_1;
|
|
11053
|
+
class RecipientKeyIdentifier {
|
|
11054
|
+
constructor(params = {}) {
|
|
11055
|
+
this.subjectKeyIdentifier = new SubjectKeyIdentifier();
|
|
11056
|
+
Object.assign(this, params);
|
|
11057
|
+
}
|
|
11058
|
+
}
|
|
11059
|
+
__decorate([
|
|
11060
|
+
AsnProp({ type: SubjectKeyIdentifier })
|
|
11061
|
+
], RecipientKeyIdentifier.prototype, "subjectKeyIdentifier", void 0);
|
|
11062
|
+
__decorate([
|
|
11063
|
+
AsnProp({ type: AsnPropTypes.GeneralizedTime, optional: true })
|
|
11064
|
+
], RecipientKeyIdentifier.prototype, "date", void 0);
|
|
11065
|
+
__decorate([
|
|
11066
|
+
AsnProp({ type: OtherKeyAttribute, optional: true })
|
|
11067
|
+
], RecipientKeyIdentifier.prototype, "other", void 0);
|
|
11068
|
+
let KeyAgreeRecipientIdentifier = class KeyAgreeRecipientIdentifier {
|
|
11069
|
+
constructor(params = {}) {
|
|
11070
|
+
Object.assign(this, params);
|
|
11071
|
+
}
|
|
11072
|
+
};
|
|
11073
|
+
__decorate([
|
|
11074
|
+
AsnProp({ type: RecipientKeyIdentifier, context: 0, implicit: true, optional: true })
|
|
11075
|
+
], KeyAgreeRecipientIdentifier.prototype, "rKeyId", void 0);
|
|
11076
|
+
__decorate([
|
|
11077
|
+
AsnProp({ type: IssuerAndSerialNumber, optional: true })
|
|
11078
|
+
], KeyAgreeRecipientIdentifier.prototype, "issuerAndSerialNumber", void 0);
|
|
11079
|
+
KeyAgreeRecipientIdentifier = __decorate([
|
|
11080
|
+
AsnType({ type: AsnTypeTypes.Choice })
|
|
11081
|
+
], KeyAgreeRecipientIdentifier);
|
|
11082
|
+
class RecipientEncryptedKey {
|
|
11083
|
+
constructor(params = {}) {
|
|
11084
|
+
this.rid = new KeyAgreeRecipientIdentifier();
|
|
11085
|
+
this.encryptedKey = new OctetString();
|
|
11086
|
+
Object.assign(this, params);
|
|
11087
|
+
}
|
|
11088
|
+
}
|
|
11089
|
+
__decorate([
|
|
11090
|
+
AsnProp({ type: KeyAgreeRecipientIdentifier })
|
|
11091
|
+
], RecipientEncryptedKey.prototype, "rid", void 0);
|
|
11092
|
+
__decorate([
|
|
11093
|
+
AsnProp({ type: OctetString })
|
|
11094
|
+
], RecipientEncryptedKey.prototype, "encryptedKey", void 0);
|
|
11095
|
+
let RecipientEncryptedKeys = RecipientEncryptedKeys_1 = class RecipientEncryptedKeys extends AsnArray {
|
|
11096
|
+
constructor(items) {
|
|
11097
|
+
super(items);
|
|
11098
|
+
Object.setPrototypeOf(this, RecipientEncryptedKeys_1.prototype);
|
|
11099
|
+
}
|
|
11100
|
+
};
|
|
11101
|
+
RecipientEncryptedKeys = RecipientEncryptedKeys_1 = __decorate([
|
|
11102
|
+
AsnType({ type: AsnTypeTypes.Sequence, itemType: RecipientEncryptedKey })
|
|
11103
|
+
], RecipientEncryptedKeys);
|
|
11104
|
+
class OriginatorPublicKey {
|
|
11105
|
+
constructor(params = {}) {
|
|
11106
|
+
this.algorithm = new AlgorithmIdentifier();
|
|
11107
|
+
this.publicKey = new ArrayBuffer(0);
|
|
11108
|
+
Object.assign(this, params);
|
|
11109
|
+
}
|
|
11110
|
+
}
|
|
11111
|
+
__decorate([
|
|
11112
|
+
AsnProp({ type: AlgorithmIdentifier })
|
|
11113
|
+
], OriginatorPublicKey.prototype, "algorithm", void 0);
|
|
11114
|
+
__decorate([
|
|
11115
|
+
AsnProp({ type: AsnPropTypes.BitString })
|
|
11116
|
+
], OriginatorPublicKey.prototype, "publicKey", void 0);
|
|
11117
|
+
let OriginatorIdentifierOrKey = class OriginatorIdentifierOrKey {
|
|
11118
|
+
constructor(params = {}) {
|
|
11119
|
+
Object.assign(this, params);
|
|
11120
|
+
}
|
|
11121
|
+
};
|
|
11122
|
+
__decorate([
|
|
11123
|
+
AsnProp({ type: SubjectKeyIdentifier, context: 0, implicit: true, optional: true })
|
|
11124
|
+
], OriginatorIdentifierOrKey.prototype, "subjectKeyIdentifier", void 0);
|
|
11125
|
+
__decorate([
|
|
11126
|
+
AsnProp({ type: OriginatorPublicKey, context: 1, implicit: true, optional: true })
|
|
11127
|
+
], OriginatorIdentifierOrKey.prototype, "originatorKey", void 0);
|
|
11128
|
+
__decorate([
|
|
11129
|
+
AsnProp({ type: IssuerAndSerialNumber, optional: true })
|
|
11130
|
+
], OriginatorIdentifierOrKey.prototype, "issuerAndSerialNumber", void 0);
|
|
11131
|
+
OriginatorIdentifierOrKey = __decorate([
|
|
11132
|
+
AsnType({ type: AsnTypeTypes.Choice })
|
|
11133
|
+
], OriginatorIdentifierOrKey);
|
|
11134
|
+
class KeyAgreeRecipientInfo {
|
|
11135
|
+
constructor(params = {}) {
|
|
11136
|
+
this.version = CMSVersion.v3;
|
|
11137
|
+
this.originator = new OriginatorIdentifierOrKey();
|
|
11138
|
+
this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
|
|
11139
|
+
this.recipientEncryptedKeys = new RecipientEncryptedKeys();
|
|
11140
|
+
Object.assign(this, params);
|
|
11141
|
+
}
|
|
11142
|
+
}
|
|
11143
|
+
__decorate([
|
|
11144
|
+
AsnProp({ type: AsnPropTypes.Integer })
|
|
11145
|
+
], KeyAgreeRecipientInfo.prototype, "version", void 0);
|
|
11146
|
+
__decorate([
|
|
11147
|
+
AsnProp({ type: OriginatorIdentifierOrKey, context: 0 })
|
|
11148
|
+
], KeyAgreeRecipientInfo.prototype, "originator", void 0);
|
|
11149
|
+
__decorate([
|
|
11150
|
+
AsnProp({ type: OctetString, context: 1, optional: true })
|
|
11151
|
+
], KeyAgreeRecipientInfo.prototype, "ukm", void 0);
|
|
11152
|
+
__decorate([
|
|
11153
|
+
AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
|
|
11154
|
+
], KeyAgreeRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
|
|
11155
|
+
__decorate([
|
|
11156
|
+
AsnProp({ type: RecipientEncryptedKeys })
|
|
11157
|
+
], KeyAgreeRecipientInfo.prototype, "recipientEncryptedKeys", void 0);
|
|
11158
|
+
|
|
11159
|
+
let RecipientIdentifier = class RecipientIdentifier {
|
|
11160
|
+
constructor(params = {}) {
|
|
11161
|
+
Object.assign(this, params);
|
|
11162
|
+
}
|
|
11163
|
+
};
|
|
11164
|
+
__decorate([
|
|
11165
|
+
AsnProp({ type: SubjectKeyIdentifier, context: 0, implicit: true })
|
|
11166
|
+
], RecipientIdentifier.prototype, "subjectKeyIdentifier", void 0);
|
|
11167
|
+
__decorate([
|
|
11168
|
+
AsnProp({ type: IssuerAndSerialNumber })
|
|
11169
|
+
], RecipientIdentifier.prototype, "issuerAndSerialNumber", void 0);
|
|
11170
|
+
RecipientIdentifier = __decorate([
|
|
11171
|
+
AsnType({ type: AsnTypeTypes.Choice })
|
|
11172
|
+
], RecipientIdentifier);
|
|
11173
|
+
class KeyTransRecipientInfo {
|
|
11174
|
+
constructor(params = {}) {
|
|
11175
|
+
this.version = CMSVersion.v0;
|
|
11176
|
+
this.rid = new RecipientIdentifier();
|
|
11177
|
+
this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
|
|
11178
|
+
this.encryptedKey = new OctetString();
|
|
11179
|
+
Object.assign(this, params);
|
|
11180
|
+
}
|
|
11181
|
+
}
|
|
11182
|
+
__decorate([
|
|
11183
|
+
AsnProp({ type: AsnPropTypes.Integer })
|
|
11184
|
+
], KeyTransRecipientInfo.prototype, "version", void 0);
|
|
11185
|
+
__decorate([
|
|
11186
|
+
AsnProp({ type: RecipientIdentifier })
|
|
11187
|
+
], KeyTransRecipientInfo.prototype, "rid", void 0);
|
|
11188
|
+
__decorate([
|
|
11189
|
+
AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
|
|
11190
|
+
], KeyTransRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
|
|
11191
|
+
__decorate([
|
|
11192
|
+
AsnProp({ type: OctetString })
|
|
11193
|
+
], KeyTransRecipientInfo.prototype, "encryptedKey", void 0);
|
|
11194
|
+
|
|
11195
|
+
class KEKIdentifier {
|
|
11196
|
+
constructor(params = {}) {
|
|
11197
|
+
this.keyIdentifier = new OctetString();
|
|
11198
|
+
Object.assign(this, params);
|
|
11199
|
+
}
|
|
11200
|
+
}
|
|
11201
|
+
__decorate([
|
|
11202
|
+
AsnProp({ type: OctetString })
|
|
11203
|
+
], KEKIdentifier.prototype, "keyIdentifier", void 0);
|
|
11204
|
+
__decorate([
|
|
11205
|
+
AsnProp({ type: AsnPropTypes.GeneralizedTime, optional: true })
|
|
11206
|
+
], KEKIdentifier.prototype, "date", void 0);
|
|
11207
|
+
__decorate([
|
|
11208
|
+
AsnProp({ type: OtherKeyAttribute, optional: true })
|
|
11209
|
+
], KEKIdentifier.prototype, "other", void 0);
|
|
11210
|
+
class KEKRecipientInfo {
|
|
11211
|
+
constructor(params = {}) {
|
|
11212
|
+
this.version = CMSVersion.v4;
|
|
11213
|
+
this.kekid = new KEKIdentifier();
|
|
11214
|
+
this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
|
|
11215
|
+
this.encryptedKey = new OctetString();
|
|
11216
|
+
Object.assign(this, params);
|
|
11217
|
+
}
|
|
11218
|
+
}
|
|
11219
|
+
__decorate([
|
|
11220
|
+
AsnProp({ type: AsnPropTypes.Integer })
|
|
11221
|
+
], KEKRecipientInfo.prototype, "version", void 0);
|
|
11222
|
+
__decorate([
|
|
11223
|
+
AsnProp({ type: KEKIdentifier })
|
|
11224
|
+
], KEKRecipientInfo.prototype, "kekid", void 0);
|
|
11225
|
+
__decorate([
|
|
11226
|
+
AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
|
|
11227
|
+
], KEKRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
|
|
11228
|
+
__decorate([
|
|
11229
|
+
AsnProp({ type: OctetString })
|
|
11230
|
+
], KEKRecipientInfo.prototype, "encryptedKey", void 0);
|
|
11231
|
+
|
|
11232
|
+
class PasswordRecipientInfo {
|
|
11233
|
+
constructor(params = {}) {
|
|
11234
|
+
this.version = CMSVersion.v0;
|
|
11235
|
+
this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
|
|
11236
|
+
this.encryptedKey = new OctetString();
|
|
11237
|
+
Object.assign(this, params);
|
|
11238
|
+
}
|
|
11239
|
+
}
|
|
11240
|
+
__decorate([
|
|
11241
|
+
AsnProp({ type: AsnPropTypes.Integer })
|
|
11242
|
+
], PasswordRecipientInfo.prototype, "version", void 0);
|
|
11243
|
+
__decorate([
|
|
11244
|
+
AsnProp({ type: KeyDerivationAlgorithmIdentifier, context: 0, optional: true })
|
|
11245
|
+
], PasswordRecipientInfo.prototype, "keyDerivationAlgorithm", void 0);
|
|
11246
|
+
__decorate([
|
|
11247
|
+
AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
|
|
11248
|
+
], PasswordRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
|
|
11249
|
+
__decorate([
|
|
11250
|
+
AsnProp({ type: OctetString })
|
|
11251
|
+
], PasswordRecipientInfo.prototype, "encryptedKey", void 0);
|
|
11252
|
+
|
|
11253
|
+
class OtherRecipientInfo {
|
|
11254
|
+
constructor(params = {}) {
|
|
11255
|
+
this.oriType = "";
|
|
11256
|
+
this.oriValue = new ArrayBuffer(0);
|
|
11257
|
+
Object.assign(this, params);
|
|
11258
|
+
}
|
|
11259
|
+
}
|
|
11260
|
+
__decorate([
|
|
11261
|
+
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
|
|
11262
|
+
], OtherRecipientInfo.prototype, "oriType", void 0);
|
|
11263
|
+
__decorate([
|
|
11264
|
+
AsnProp({ type: AsnPropTypes.Any })
|
|
11265
|
+
], OtherRecipientInfo.prototype, "oriValue", void 0);
|
|
11266
|
+
let RecipientInfo = class RecipientInfo {
|
|
11267
|
+
constructor(params = {}) {
|
|
11268
|
+
Object.assign(this, params);
|
|
11269
|
+
}
|
|
11270
|
+
};
|
|
11271
|
+
__decorate([
|
|
11272
|
+
AsnProp({ type: KeyTransRecipientInfo, optional: true })
|
|
11273
|
+
], RecipientInfo.prototype, "ktri", void 0);
|
|
11274
|
+
__decorate([
|
|
11275
|
+
AsnProp({ type: KeyAgreeRecipientInfo, context: 1, implicit: true, optional: true })
|
|
11276
|
+
], RecipientInfo.prototype, "kari", void 0);
|
|
11277
|
+
__decorate([
|
|
11278
|
+
AsnProp({ type: KEKRecipientInfo, context: 2, implicit: true, optional: true })
|
|
11279
|
+
], RecipientInfo.prototype, "kekri", void 0);
|
|
11280
|
+
__decorate([
|
|
11281
|
+
AsnProp({ type: PasswordRecipientInfo, context: 3, implicit: true, optional: true })
|
|
11282
|
+
], RecipientInfo.prototype, "pwri", void 0);
|
|
11283
|
+
__decorate([
|
|
11284
|
+
AsnProp({ type: OtherRecipientInfo, context: 4, implicit: true, optional: true })
|
|
11285
|
+
], RecipientInfo.prototype, "ori", void 0);
|
|
11286
|
+
RecipientInfo = __decorate([
|
|
11287
|
+
AsnType({ type: AsnTypeTypes.Choice })
|
|
11288
|
+
], RecipientInfo);
|
|
11289
|
+
|
|
11290
|
+
var RecipientInfos_1;
|
|
11291
|
+
let RecipientInfos = RecipientInfos_1 = class RecipientInfos extends AsnArray {
|
|
11292
|
+
constructor(items) {
|
|
11293
|
+
super(items);
|
|
11294
|
+
Object.setPrototypeOf(this, RecipientInfos_1.prototype);
|
|
11295
|
+
}
|
|
11296
|
+
};
|
|
11297
|
+
RecipientInfos = RecipientInfos_1 = __decorate([
|
|
11298
|
+
AsnType({ type: AsnTypeTypes.Set, itemType: RecipientInfo })
|
|
11299
|
+
], RecipientInfos);
|
|
11300
|
+
|
|
10900
11301
|
var RevocationInfoChoices_1;
|
|
10901
11302
|
class OtherRevocationInfoFormat {
|
|
10902
11303
|
constructor(params = {}) {
|
|
@@ -10933,25 +11334,51 @@ RevocationInfoChoices = RevocationInfoChoices_1 = __decorate([
|
|
|
10933
11334
|
AsnType({ type: AsnTypeTypes.Set, itemType: RevocationInfoChoice })
|
|
10934
11335
|
], RevocationInfoChoices);
|
|
10935
11336
|
|
|
10936
|
-
|
|
10937
|
-
(
|
|
10938
|
-
|
|
10939
|
-
|
|
10940
|
-
|
|
10941
|
-
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
|
|
10946
|
-
|
|
10947
|
-
|
|
10948
|
-
|
|
10949
|
-
|
|
10950
|
-
|
|
11337
|
+
class OriginatorInfo {
|
|
11338
|
+
constructor(params = {}) {
|
|
11339
|
+
Object.assign(this, params);
|
|
11340
|
+
}
|
|
11341
|
+
}
|
|
11342
|
+
__decorate([
|
|
11343
|
+
AsnProp({ type: CertificateSet, context: 0, implicit: true, optional: true })
|
|
11344
|
+
], OriginatorInfo.prototype, "certs", void 0);
|
|
11345
|
+
__decorate([
|
|
11346
|
+
AsnProp({ type: RevocationInfoChoices, context: 1, implicit: true, optional: true })
|
|
11347
|
+
], OriginatorInfo.prototype, "crls", void 0);
|
|
11348
|
+
|
|
11349
|
+
var UnprotectedAttributes_1;
|
|
11350
|
+
let UnprotectedAttributes = UnprotectedAttributes_1 = class UnprotectedAttributes extends AsnArray {
|
|
11351
|
+
constructor(items) {
|
|
11352
|
+
super(items);
|
|
11353
|
+
Object.setPrototypeOf(this, UnprotectedAttributes_1.prototype);
|
|
11354
|
+
}
|
|
10951
11355
|
};
|
|
10952
|
-
|
|
10953
|
-
AsnType({ type: AsnTypeTypes.
|
|
10954
|
-
],
|
|
11356
|
+
UnprotectedAttributes = UnprotectedAttributes_1 = __decorate([
|
|
11357
|
+
AsnType({ type: AsnTypeTypes.Set, itemType: Attribute })
|
|
11358
|
+
], UnprotectedAttributes);
|
|
11359
|
+
class EnvelopedData {
|
|
11360
|
+
constructor(params = {}) {
|
|
11361
|
+
this.version = CMSVersion.v0;
|
|
11362
|
+
this.recipientInfos = new RecipientInfos();
|
|
11363
|
+
this.encryptedContentInfo = new EncryptedContentInfo();
|
|
11364
|
+
Object.assign(this, params);
|
|
11365
|
+
}
|
|
11366
|
+
}
|
|
11367
|
+
__decorate([
|
|
11368
|
+
AsnProp({ type: AsnPropTypes.Integer })
|
|
11369
|
+
], EnvelopedData.prototype, "version", void 0);
|
|
11370
|
+
__decorate([
|
|
11371
|
+
AsnProp({ type: OriginatorInfo, context: 0, implicit: true, optional: true })
|
|
11372
|
+
], EnvelopedData.prototype, "originatorInfo", void 0);
|
|
11373
|
+
__decorate([
|
|
11374
|
+
AsnProp({ type: RecipientInfos })
|
|
11375
|
+
], EnvelopedData.prototype, "recipientInfos", void 0);
|
|
11376
|
+
__decorate([
|
|
11377
|
+
AsnProp({ type: EncryptedContentInfo })
|
|
11378
|
+
], EnvelopedData.prototype, "encryptedContentInfo", void 0);
|
|
11379
|
+
__decorate([
|
|
11380
|
+
AsnProp({ type: UnprotectedAttributes, context: 1, implicit: true, optional: true })
|
|
11381
|
+
], EnvelopedData.prototype, "unprotectedAttrs", void 0);
|
|
10955
11382
|
|
|
10956
11383
|
let SignerIdentifier = class SignerIdentifier {
|
|
10957
11384
|
constructor(params = {}) {
|
|
@@ -11518,12 +11945,14 @@ exports.AttributeCertificate = AttributeCertificate;
|
|
|
11518
11945
|
exports.AuthorityKeyIdentifier = AuthorityKeyIdentifier;
|
|
11519
11946
|
exports.BasicConstraints = BasicConstraints;
|
|
11520
11947
|
exports.Certificate = Certificate;
|
|
11948
|
+
exports.CertificateList = CertificateList;
|
|
11521
11949
|
exports.CertificateTemplate = CertificateTemplate;
|
|
11522
11950
|
exports.CertificateTransparency = CertificateTransparency;
|
|
11523
11951
|
exports.CertificationRequest = CertificationRequest;
|
|
11524
11952
|
exports.EDIPartyName = EDIPartyName;
|
|
11525
11953
|
exports.EntrustVersionInfo = EntrustVersionInfo;
|
|
11526
11954
|
exports.Extension = Extension;
|
|
11955
|
+
exports.IssuingDistributionPoint = IssuingDistributionPoint;
|
|
11527
11956
|
exports.KeyUsage = KeyUsage;
|
|
11528
11957
|
exports.LogotypeExtn = LogotypeExtn;
|
|
11529
11958
|
exports.Name = Name;
|
|
@@ -11558,4 +11987,5 @@ exports.id_rsaEncryption = id_rsaEncryption;
|
|
|
11558
11987
|
exports.isPem = isPem;
|
|
11559
11988
|
exports.isPkcs10Pem = isPkcs10Pem;
|
|
11560
11989
|
exports.isX509AttributePem = isX509AttributePem;
|
|
11990
|
+
exports.isX509CRLPem = isX509CRLPem;
|
|
11561
11991
|
exports.isX509Pem = isX509Pem;
|