@peculiar/certificates-viewer 3.0.4 → 3.2.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-43396146.js → certification_request-cde57123.js} +138 -266
- package/dist/cjs/csr-78378ed0.js +150 -0
- package/dist/cjs/download-6724f3a7.js +79 -0
- package/dist/cjs/{download-5e7d5455.js → index-ff818d4d.js} +0 -72
- package/dist/cjs/index.cjs.js +2 -1
- package/dist/cjs/l10n-a048a686.js +145 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer_2.cjs.entry.js +479 -0
- package/dist/cjs/peculiar-button_5.cjs.entry.js +148 -0
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +173 -0
- package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +1 -1
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +124 -0
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +6 -4
- package/dist/cjs/peculiar.cjs.js +1 -1
- package/dist/cjs/public_key-e56dbe52.js +1104 -0
- package/dist/cjs/x509_attribute_certificate-cc325b70.js +87 -0
- package/dist/cjs/x509_certificate-51a97033.js +139 -0
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +54 -11
- package/dist/collection/constants/oids.js +1 -0
- package/dist/collection/utils/index.js +0 -1
- package/dist/collection/www-copy/index.js +80 -0
- package/dist/esm/{certification_request-16ea346c.js → certification_request-c0674647.js} +77 -205
- package/dist/esm/csr-c1b6a176.js +147 -0
- package/dist/esm/download-735fb2eb.js +76 -0
- package/dist/esm/{download-cf68ac2c.js → index-0ba131b0.js} +1 -71
- package/dist/esm/index.js +2 -1
- package/dist/esm/l10n-ac28fa92.js +141 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/peculiar-attribute-certificate-viewer_2.entry.js +474 -0
- package/dist/esm/peculiar-button_5.entry.js +140 -0
- package/dist/esm/peculiar-certificate-decoder.entry.js +169 -0
- package/dist/esm/peculiar-certificate-summary_3.entry.js +1 -1
- package/dist/esm/peculiar-certificate-viewer.entry.js +120 -0
- package/dist/esm/peculiar-certificates-viewer.entry.js +5 -3
- package/dist/esm/peculiar.js +1 -1
- package/dist/esm/public_key-43b2cbf0.js +1089 -0
- package/dist/esm/x509_attribute_certificate-a6d4aa15.js +85 -0
- package/dist/esm/x509_certificate-12f6d344.js +137 -0
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/p-006865d7.js +4 -0
- package/dist/peculiar/p-17c4da7b.js +11 -0
- package/dist/peculiar/p-1ebab45c.js +78 -0
- package/dist/peculiar/{p-b09a1f0b.entry.js → p-38635919.entry.js} +1 -1
- package/dist/peculiar/p-3f8d1008.entry.js +4 -0
- package/dist/peculiar/p-42da7f97.js +11 -0
- package/dist/peculiar/p-464e0943.js +87 -0
- package/dist/peculiar/p-4f4c1d30.js +12 -0
- package/dist/peculiar/p-530afe84.entry.js +11 -0
- package/dist/peculiar/p-6011646e.entry.js +11 -0
- package/dist/peculiar/p-6c510523.js +18 -0
- package/dist/peculiar/p-d7a13cb4.js +18 -0
- package/dist/peculiar/p-dafae164.entry.js +4 -0
- package/dist/peculiar/p-e77d0ccc.entry.js +18 -0
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +13 -0
- package/dist/types/components.d.ts +20 -0
- package/dist/types/constants/oids.d.ts +1 -0
- package/dist/types/utils/index.d.ts +0 -1
- package/package.json +2 -3
- package/dist/cjs/l10n-d4a77087.js +0 -767
- package/dist/cjs/peculiar-attribute-certificate-viewer_9.cjs.entry.js +0 -2175
- package/dist/collection/utils/history.js +0 -19
- package/dist/collection/utils/parse_hash.js +0 -28
- package/dist/collection/utils/query_stringify.js +0 -21
- package/dist/esm/l10n-9ac63748.js +0 -762
- package/dist/esm/peculiar-attribute-certificate-viewer_9.entry.js +0 -2163
- package/dist/peculiar/p-7452b86e.entry.js +0 -4
- package/dist/peculiar/p-99797a49.js +0 -34
- package/dist/peculiar/p-c774ec0b.js +0 -18
- package/dist/peculiar/p-d0db9e70.entry.js +0 -113
- package/dist/peculiar/p-d7ed39f0.js +0 -87
- package/dist/types/utils/history.d.ts +0 -9
- package/dist/types/utils/parse_hash.d.ts +0 -9
- package/dist/types/utils/query_stringify.d.ts +0 -8
|
@@ -3,10 +3,38 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
6
|
+
const index = require('./index-ff818d4d.js');
|
|
7
|
+
require('./l10n-a048a686.js');
|
|
8
8
|
const _commonjsHelpers = require('./_commonjsHelpers-cb1f949a.js');
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @license
|
|
12
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the MIT license found in the
|
|
15
|
+
* LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/
|
|
17
|
+
/* eslint-disable no-useless-escape */
|
|
18
|
+
const isHex = (value) => (/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/
|
|
19
|
+
.test(value));
|
|
20
|
+
const isPem = (value) => (/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/
|
|
21
|
+
.test(value));
|
|
22
|
+
const isX509Pem = (value) => (/-----BEGIN CERTIFICATE-----([A-Za-z0-9+\/=\s]+)-----END CERTIFICATE-----/
|
|
23
|
+
.test(value));
|
|
24
|
+
const isPkcs10Pem = (value) => (/-----BEGIN CERTIFICATE REQUEST-----([A-Za-z0-9+\/=\s]+)-----END CERTIFICATE REQUEST-----/
|
|
25
|
+
.test(value));
|
|
26
|
+
const isX509AttributePem = (value) => (/-----BEGIN ATTRIBUTE CERTIFICATE-----([A-Za-z0-9+\/=\s]+)-----END ATTRIBUTE CERTIFICATE-----/
|
|
27
|
+
.test(value));
|
|
28
|
+
const isBase64 = (value) => {
|
|
29
|
+
try {
|
|
30
|
+
window.atob(value);
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
10
38
|
/*!
|
|
11
39
|
Copyright (c) Peculiar Ventures, LLC
|
|
12
40
|
*/
|
|
@@ -264,7 +292,7 @@ function HexBlock(BaseClass) {
|
|
|
264
292
|
super(...args);
|
|
265
293
|
const params = args[0] || {};
|
|
266
294
|
this.isHexOnly = (_a = params.isHexOnly) !== null && _a !== void 0 ? _a : false;
|
|
267
|
-
this.valueHexView = params.valueHex ?
|
|
295
|
+
this.valueHexView = params.valueHex ? index.build.BufferSourceConverter.toUint8Array(params.valueHex) : EMPTY_VIEW;
|
|
268
296
|
}
|
|
269
297
|
get valueHex() {
|
|
270
298
|
return this.valueHexView.slice().buffer;
|
|
@@ -302,7 +330,7 @@ function HexBlock(BaseClass) {
|
|
|
302
330
|
return {
|
|
303
331
|
...super.toJSON(),
|
|
304
332
|
isHexOnly: this.isHexOnly,
|
|
305
|
-
valueHex:
|
|
333
|
+
valueHex: index.build.Convert.ToHex(this.valueHexView),
|
|
306
334
|
};
|
|
307
335
|
}
|
|
308
336
|
},
|
|
@@ -315,7 +343,7 @@ class LocalBaseBlock {
|
|
|
315
343
|
this.blockLength = blockLength;
|
|
316
344
|
this.error = error;
|
|
317
345
|
this.warnings = warnings;
|
|
318
|
-
this.valueBeforeDecodeView =
|
|
346
|
+
this.valueBeforeDecodeView = index.build.BufferSourceConverter.toUint8Array(valueBeforeDecode);
|
|
319
347
|
}
|
|
320
348
|
static blockName() {
|
|
321
349
|
return this.NAME;
|
|
@@ -332,7 +360,7 @@ class LocalBaseBlock {
|
|
|
332
360
|
blockLength: this.blockLength,
|
|
333
361
|
error: this.error,
|
|
334
362
|
warnings: this.warnings,
|
|
335
|
-
valueBeforeDecode:
|
|
363
|
+
valueBeforeDecode: index.build.Convert.ToHex(this.valueBeforeDecodeView),
|
|
336
364
|
};
|
|
337
365
|
}
|
|
338
366
|
}
|
|
@@ -354,7 +382,7 @@ class LocalIdentificationBlock extends HexBlock(LocalBaseBlock) {
|
|
|
354
382
|
super();
|
|
355
383
|
if (idBlock) {
|
|
356
384
|
this.isHexOnly = (_a = idBlock.isHexOnly) !== null && _a !== void 0 ? _a : false;
|
|
357
|
-
this.valueHexView = idBlock.valueHex ?
|
|
385
|
+
this.valueHexView = idBlock.valueHex ? index.build.BufferSourceConverter.toUint8Array(idBlock.valueHex) : EMPTY_VIEW;
|
|
358
386
|
this.tagClass = (_b = idBlock.tagClass) !== null && _b !== void 0 ? _b : -1;
|
|
359
387
|
this.tagNumber = (_c = idBlock.tagNumber) !== null && _c !== void 0 ? _c : -1;
|
|
360
388
|
this.isConstructed = (_d = idBlock.isConstructed) !== null && _d !== void 0 ? _d : false;
|
|
@@ -420,7 +448,7 @@ class LocalIdentificationBlock extends HexBlock(LocalBaseBlock) {
|
|
|
420
448
|
return retView.buffer;
|
|
421
449
|
}
|
|
422
450
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
423
|
-
const inputView =
|
|
451
|
+
const inputView = index.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
424
452
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
425
453
|
return -1;
|
|
426
454
|
}
|
|
@@ -529,7 +557,7 @@ class LocalLengthBlock extends LocalBaseBlock {
|
|
|
529
557
|
this.length = (_c = lenBlock.length) !== null && _c !== void 0 ? _c : 0;
|
|
530
558
|
}
|
|
531
559
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
532
|
-
const view =
|
|
560
|
+
const view = index.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
533
561
|
if (!checkBufferParams(this, view, inputOffset, inputLength)) {
|
|
534
562
|
return -1;
|
|
535
563
|
}
|
|
@@ -688,10 +716,10 @@ class BaseBlock extends LocalBaseBlock {
|
|
|
688
716
|
if (encoding === "ascii") {
|
|
689
717
|
return this.onAsciiEncoding();
|
|
690
718
|
}
|
|
691
|
-
return
|
|
719
|
+
return index.build.Convert.ToHex(this.toBER());
|
|
692
720
|
}
|
|
693
721
|
onAsciiEncoding() {
|
|
694
|
-
return `${this.constructor.NAME} : ${
|
|
722
|
+
return `${this.constructor.NAME} : ${index.build.Convert.ToHex(this.valueBlock.valueBeforeDecodeView)}`;
|
|
695
723
|
}
|
|
696
724
|
isEqual(other) {
|
|
697
725
|
if (this === other) {
|
|
@@ -989,7 +1017,7 @@ function fromBER(inputBuffer) {
|
|
|
989
1017
|
result
|
|
990
1018
|
};
|
|
991
1019
|
}
|
|
992
|
-
return localFromBER(
|
|
1020
|
+
return localFromBER(index.build.BufferSourceConverter.toUint8Array(inputBuffer).slice(), 0, inputBuffer.byteLength);
|
|
993
1021
|
}
|
|
994
1022
|
|
|
995
1023
|
function checkLen(indefiniteLength, length) {
|
|
@@ -1005,7 +1033,7 @@ class LocalConstructedValueBlock extends ValueBlock {
|
|
|
1005
1033
|
this.isIndefiniteForm = isIndefiniteForm;
|
|
1006
1034
|
}
|
|
1007
1035
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
1008
|
-
const view =
|
|
1036
|
+
const view = index.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1009
1037
|
if (!checkBufferParams(this, view, inputOffset, inputLength)) {
|
|
1010
1038
|
return -1;
|
|
1011
1039
|
}
|
|
@@ -1175,7 +1203,7 @@ class LocalBooleanValueBlock extends HexBlock(ValueBlock) {
|
|
|
1175
1203
|
constructor({ value, ...parameters } = {}) {
|
|
1176
1204
|
super(parameters);
|
|
1177
1205
|
if (parameters.valueHex) {
|
|
1178
|
-
this.valueHexView =
|
|
1206
|
+
this.valueHexView = index.build.BufferSourceConverter.toUint8Array(parameters.valueHex);
|
|
1179
1207
|
}
|
|
1180
1208
|
else {
|
|
1181
1209
|
this.valueHexView = new Uint8Array(1);
|
|
@@ -1196,7 +1224,7 @@ class LocalBooleanValueBlock extends HexBlock(ValueBlock) {
|
|
|
1196
1224
|
this.valueHexView[0] = value ? 0xFF : 0x00;
|
|
1197
1225
|
}
|
|
1198
1226
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
1199
|
-
const inputView =
|
|
1227
|
+
const inputView = index.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1200
1228
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
1201
1229
|
return -1;
|
|
1202
1230
|
}
|
|
@@ -1343,7 +1371,7 @@ class OctetString$1 extends BaseBlock {
|
|
|
1343
1371
|
if (this.valueBlock.isConstructed || (this.valueBlock.value && this.valueBlock.value.length)) {
|
|
1344
1372
|
return Constructed.prototype.onAsciiEncoding.call(this);
|
|
1345
1373
|
}
|
|
1346
|
-
return `${this.constructor.NAME} : ${
|
|
1374
|
+
return `${this.constructor.NAME} : ${index.build.Convert.ToHex(this.valueBlock.valueHexView)}`;
|
|
1347
1375
|
}
|
|
1348
1376
|
getValue() {
|
|
1349
1377
|
if (!this.idBlock.isConstructed) {
|
|
@@ -1355,7 +1383,7 @@ class OctetString$1 extends BaseBlock {
|
|
|
1355
1383
|
array.push(content.valueBlock.valueHexView);
|
|
1356
1384
|
}
|
|
1357
1385
|
}
|
|
1358
|
-
return
|
|
1386
|
+
return index.build.BufferSourceConverter.concat(array);
|
|
1359
1387
|
}
|
|
1360
1388
|
}
|
|
1361
1389
|
_a$r = OctetString$1;
|
|
@@ -1403,7 +1431,7 @@ class LocalBitStringValueBlock extends HexBlock(LocalConstructedValueBlock) {
|
|
|
1403
1431
|
}
|
|
1404
1432
|
return resultOffset;
|
|
1405
1433
|
}
|
|
1406
|
-
const inputView =
|
|
1434
|
+
const inputView = index.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1407
1435
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
1408
1436
|
return -1;
|
|
1409
1437
|
}
|
|
@@ -1743,13 +1771,13 @@ class Integer extends BaseBlock {
|
|
|
1743
1771
|
const bigIntValue = BigInt(value);
|
|
1744
1772
|
const writer = new ViewWriter();
|
|
1745
1773
|
const hex = bigIntValue.toString(16).replace(/^-/, "");
|
|
1746
|
-
const view = new Uint8Array(
|
|
1774
|
+
const view = new Uint8Array(index.build.Convert.FromHex(hex));
|
|
1747
1775
|
if (bigIntValue < 0) {
|
|
1748
1776
|
const first = new Uint8Array(view.length + (view[0] & 0x80 ? 1 : 0));
|
|
1749
1777
|
first[0] |= 0x80;
|
|
1750
|
-
const firstInt = BigInt(`0x${
|
|
1778
|
+
const firstInt = BigInt(`0x${index.build.Convert.ToHex(first)}`);
|
|
1751
1779
|
const secondInt = firstInt + bigIntValue;
|
|
1752
|
-
const second =
|
|
1780
|
+
const second = index.build.BufferSourceConverter.toUint8Array(index.build.Convert.FromHex(secondInt.toString(16)));
|
|
1753
1781
|
second[0] |= 0x80;
|
|
1754
1782
|
writer.write(second);
|
|
1755
1783
|
}
|
|
@@ -1810,7 +1838,7 @@ class LocalSidValueBlock extends HexBlock(ValueBlock) {
|
|
|
1810
1838
|
if (!inputLength) {
|
|
1811
1839
|
return inputOffset;
|
|
1812
1840
|
}
|
|
1813
|
-
const inputView =
|
|
1841
|
+
const inputView = index.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1814
1842
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
1815
1843
|
return -1;
|
|
1816
1844
|
}
|
|
@@ -1882,7 +1910,7 @@ class LocalSidValueBlock extends HexBlock(ValueBlock) {
|
|
|
1882
1910
|
toString() {
|
|
1883
1911
|
let result = "";
|
|
1884
1912
|
if (this.isHexOnly)
|
|
1885
|
-
result =
|
|
1913
|
+
result = index.build.Convert.ToHex(this.valueHexView);
|
|
1886
1914
|
else {
|
|
1887
1915
|
if (this.isFirstSid) {
|
|
1888
1916
|
let sidValue = this.valueDec;
|
|
@@ -2079,7 +2107,7 @@ class LocalRelativeSidValueBlock extends HexBlock(LocalBaseBlock) {
|
|
|
2079
2107
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
2080
2108
|
if (inputLength === 0)
|
|
2081
2109
|
return inputOffset;
|
|
2082
|
-
const inputView =
|
|
2110
|
+
const inputView = index.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2083
2111
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength))
|
|
2084
2112
|
return -1;
|
|
2085
2113
|
const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);
|
|
@@ -2137,7 +2165,7 @@ class LocalRelativeSidValueBlock extends HexBlock(LocalBaseBlock) {
|
|
|
2137
2165
|
toString() {
|
|
2138
2166
|
let result = "";
|
|
2139
2167
|
if (this.isHexOnly)
|
|
2140
|
-
result =
|
|
2168
|
+
result = index.build.Convert.ToHex(this.valueHexView);
|
|
2141
2169
|
else {
|
|
2142
2170
|
result = this.valueDec.toString();
|
|
2143
2171
|
}
|
|
@@ -2319,7 +2347,7 @@ class LocalSimpleStringBlock extends BaseStringBlock {
|
|
|
2319
2347
|
super(parameters, LocalSimpleStringValueBlock);
|
|
2320
2348
|
}
|
|
2321
2349
|
fromBuffer(inputBuffer) {
|
|
2322
|
-
this.valueBlock.value = String.fromCharCode.apply(null,
|
|
2350
|
+
this.valueBlock.value = String.fromCharCode.apply(null, index.build.BufferSourceConverter.toUint8Array(inputBuffer));
|
|
2323
2351
|
}
|
|
2324
2352
|
fromString(inputString) {
|
|
2325
2353
|
const strLen = inputString.length;
|
|
@@ -2333,17 +2361,17 @@ LocalSimpleStringBlock.NAME = "SIMPLE STRING";
|
|
|
2333
2361
|
|
|
2334
2362
|
class LocalUtf8StringValueBlock extends LocalSimpleStringBlock {
|
|
2335
2363
|
fromBuffer(inputBuffer) {
|
|
2336
|
-
this.valueBlock.valueHexView =
|
|
2364
|
+
this.valueBlock.valueHexView = index.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2337
2365
|
try {
|
|
2338
|
-
this.valueBlock.value =
|
|
2366
|
+
this.valueBlock.value = index.build.Convert.ToUtf8String(inputBuffer);
|
|
2339
2367
|
}
|
|
2340
2368
|
catch (ex) {
|
|
2341
2369
|
this.warnings.push(`Error during "decodeURIComponent": ${ex}, using raw string`);
|
|
2342
|
-
this.valueBlock.value =
|
|
2370
|
+
this.valueBlock.value = index.build.Convert.ToBinary(inputBuffer);
|
|
2343
2371
|
}
|
|
2344
2372
|
}
|
|
2345
2373
|
fromString(inputString) {
|
|
2346
|
-
this.valueBlock.valueHexView = new Uint8Array(
|
|
2374
|
+
this.valueBlock.valueHexView = new Uint8Array(index.build.Convert.FromUtf8String(inputString));
|
|
2347
2375
|
this.valueBlock.value = inputString;
|
|
2348
2376
|
}
|
|
2349
2377
|
}
|
|
@@ -2365,12 +2393,12 @@ Utf8String.NAME = "UTF8String";
|
|
|
2365
2393
|
|
|
2366
2394
|
class LocalBmpStringValueBlock extends LocalSimpleStringBlock {
|
|
2367
2395
|
fromBuffer(inputBuffer) {
|
|
2368
|
-
this.valueBlock.value =
|
|
2369
|
-
this.valueBlock.valueHexView =
|
|
2396
|
+
this.valueBlock.value = index.build.Convert.ToUtf16String(inputBuffer);
|
|
2397
|
+
this.valueBlock.valueHexView = index.build.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2370
2398
|
}
|
|
2371
2399
|
fromString(inputString) {
|
|
2372
2400
|
this.valueBlock.value = inputString;
|
|
2373
|
-
this.valueBlock.valueHexView = new Uint8Array(
|
|
2401
|
+
this.valueBlock.valueHexView = new Uint8Array(index.build.Convert.FromUtf16String(inputString));
|
|
2374
2402
|
}
|
|
2375
2403
|
}
|
|
2376
2404
|
LocalBmpStringValueBlock.NAME = "BmpStringValueBlock";
|
|
@@ -2582,7 +2610,7 @@ class UTCTime extends VisibleString {
|
|
|
2582
2610
|
this.idBlock.tagNumber = 23;
|
|
2583
2611
|
}
|
|
2584
2612
|
fromBuffer(inputBuffer) {
|
|
2585
|
-
this.fromString(String.fromCharCode.apply(null,
|
|
2613
|
+
this.fromString(String.fromCharCode.apply(null, index.build.BufferSourceConverter.toUint8Array(inputBuffer)));
|
|
2586
2614
|
}
|
|
2587
2615
|
toBuffer() {
|
|
2588
2616
|
const str = this.toString();
|
|
@@ -2932,17 +2960,17 @@ class Repeated extends Any {
|
|
|
2932
2960
|
|
|
2933
2961
|
class RawData {
|
|
2934
2962
|
constructor({ data = EMPTY_VIEW } = {}) {
|
|
2935
|
-
this.dataView =
|
|
2963
|
+
this.dataView = index.build.BufferSourceConverter.toUint8Array(data);
|
|
2936
2964
|
}
|
|
2937
2965
|
get data() {
|
|
2938
2966
|
return this.dataView.slice().buffer;
|
|
2939
2967
|
}
|
|
2940
2968
|
set data(value) {
|
|
2941
|
-
this.dataView =
|
|
2969
|
+
this.dataView = index.build.BufferSourceConverter.toUint8Array(value);
|
|
2942
2970
|
}
|
|
2943
2971
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
2944
2972
|
const endLength = inputOffset + inputLength;
|
|
2945
|
-
this.dataView =
|
|
2973
|
+
this.dataView = index.build.BufferSourceConverter.toUint8Array(inputBuffer).subarray(inputOffset, endLength);
|
|
2946
2974
|
return endLength;
|
|
2947
2975
|
}
|
|
2948
2976
|
toBER(sizeOnly) {
|
|
@@ -3261,7 +3289,7 @@ function verifySchema(inputBuffer, inputSchema) {
|
|
|
3261
3289
|
result: { error: "Wrong ASN.1 schema type" }
|
|
3262
3290
|
};
|
|
3263
3291
|
}
|
|
3264
|
-
const asn1 = localFromBER(
|
|
3292
|
+
const asn1 = localFromBER(index.build.BufferSourceConverter.toUint8Array(inputBuffer));
|
|
3265
3293
|
if (asn1.offset === -1) {
|
|
3266
3294
|
return {
|
|
3267
3295
|
verified: false,
|
|
@@ -3272,51 +3300,51 @@ function verifySchema(inputBuffer, inputSchema) {
|
|
|
3272
3300
|
}
|
|
3273
3301
|
|
|
3274
3302
|
const asn1 = /*#__PURE__*/Object.freeze({
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3303
|
+
__proto__: null,
|
|
3304
|
+
Any: Any,
|
|
3305
|
+
BaseBlock: BaseBlock,
|
|
3306
|
+
BaseStringBlock: BaseStringBlock,
|
|
3307
|
+
BitString: BitString$1,
|
|
3308
|
+
BmpString: BmpString,
|
|
3309
|
+
Boolean: Boolean,
|
|
3310
|
+
CharacterString: CharacterString,
|
|
3311
|
+
Choice: Choice,
|
|
3312
|
+
Constructed: Constructed,
|
|
3313
|
+
DATE: DATE,
|
|
3314
|
+
DateTime: DateTime,
|
|
3315
|
+
Duration: Duration,
|
|
3316
|
+
EndOfContent: EndOfContent,
|
|
3317
|
+
Enumerated: Enumerated,
|
|
3318
|
+
GeneralString: GeneralString,
|
|
3319
|
+
GeneralizedTime: GeneralizedTime,
|
|
3320
|
+
GraphicString: GraphicString,
|
|
3321
|
+
HexBlock: HexBlock,
|
|
3322
|
+
IA5String: IA5String,
|
|
3323
|
+
Integer: Integer,
|
|
3324
|
+
Null: Null,
|
|
3325
|
+
NumericString: NumericString,
|
|
3326
|
+
ObjectIdentifier: ObjectIdentifier,
|
|
3327
|
+
OctetString: OctetString$1,
|
|
3328
|
+
Primitive: Primitive,
|
|
3329
|
+
PrintableString: PrintableString,
|
|
3330
|
+
RawData: RawData,
|
|
3331
|
+
RelativeObjectIdentifier: RelativeObjectIdentifier,
|
|
3332
|
+
Repeated: Repeated,
|
|
3333
|
+
Sequence: Sequence,
|
|
3334
|
+
Set: Set,
|
|
3335
|
+
TIME: TIME,
|
|
3336
|
+
TeletexString: TeletexString,
|
|
3337
|
+
TimeOfDay: TimeOfDay,
|
|
3338
|
+
UTCTime: UTCTime,
|
|
3339
|
+
UniversalString: UniversalString,
|
|
3340
|
+
Utf8String: Utf8String,
|
|
3341
|
+
ValueBlock: ValueBlock,
|
|
3342
|
+
VideotexString: VideotexString,
|
|
3343
|
+
ViewWriter: ViewWriter,
|
|
3344
|
+
VisibleString: VisibleString,
|
|
3345
|
+
compareSchema: compareSchema,
|
|
3346
|
+
fromBER: fromBER,
|
|
3347
|
+
verifySchema: verifySchema
|
|
3320
3348
|
});
|
|
3321
3349
|
|
|
3322
3350
|
var AsnTypeTypes;
|
|
@@ -3490,9 +3518,9 @@ class BitString {
|
|
|
3490
3518
|
if (typeof params === "number") {
|
|
3491
3519
|
this.fromNumber(params);
|
|
3492
3520
|
}
|
|
3493
|
-
else if (
|
|
3521
|
+
else if (index.build.BufferSourceConverter.isBufferSource(params)) {
|
|
3494
3522
|
this.unusedBits = unusedBits;
|
|
3495
|
-
this.value =
|
|
3523
|
+
this.value = index.build.BufferSourceConverter.toArrayBuffer(params);
|
|
3496
3524
|
}
|
|
3497
3525
|
else {
|
|
3498
3526
|
throw TypeError("Unsupported type of 'params' argument for BitString");
|
|
@@ -3546,8 +3574,8 @@ class OctetString {
|
|
|
3546
3574
|
this.buffer = new ArrayBuffer(param);
|
|
3547
3575
|
}
|
|
3548
3576
|
else {
|
|
3549
|
-
if (
|
|
3550
|
-
this.buffer =
|
|
3577
|
+
if (index.build.BufferSourceConverter.isBufferSource(param)) {
|
|
3578
|
+
this.buffer = index.build.BufferSourceConverter.toArrayBuffer(param);
|
|
3551
3579
|
}
|
|
3552
3580
|
else if (Array.isArray(param)) {
|
|
3553
3581
|
this.buffer = new Uint8Array(param);
|
|
@@ -4090,8 +4118,8 @@ class AsnConvert {
|
|
|
4090
4118
|
return AsnParser.parse(data, target);
|
|
4091
4119
|
}
|
|
4092
4120
|
static toString(data) {
|
|
4093
|
-
const buf =
|
|
4094
|
-
?
|
|
4121
|
+
const buf = index.build.BufferSourceConverter.isBufferSource(data)
|
|
4122
|
+
? index.build.BufferSourceConverter.toArrayBuffer(data)
|
|
4095
4123
|
: AsnConvert.serialize(data);
|
|
4096
4124
|
const asn = fromBER(buf);
|
|
4097
4125
|
if (asn.offset === -1) {
|
|
@@ -5144,7 +5172,7 @@ class IpConverter {
|
|
|
5144
5172
|
const addr = ipaddr.fromByteArray(Array.from(uint8));
|
|
5145
5173
|
return addr.toString();
|
|
5146
5174
|
}
|
|
5147
|
-
return this.decodeIP(
|
|
5175
|
+
return this.decodeIP(index.build.Convert.ToHex(buf));
|
|
5148
5176
|
}
|
|
5149
5177
|
static fromString(text) {
|
|
5150
5178
|
const addr = ipaddr.parse(text);
|
|
@@ -5186,7 +5214,7 @@ let AttributeValue = class AttributeValue extends DirectoryString {
|
|
|
5186
5214
|
Object.assign(this, params);
|
|
5187
5215
|
}
|
|
5188
5216
|
toString() {
|
|
5189
|
-
return this.ia5String || (this.anyValue ?
|
|
5217
|
+
return this.ia5String || (this.anyValue ? index.build.Convert.ToHex(this.anyValue) : super.toString());
|
|
5190
5218
|
}
|
|
5191
5219
|
};
|
|
5192
5220
|
__decorate([
|
|
@@ -5981,7 +6009,7 @@ class AlgorithmIdentifier {
|
|
|
5981
6009
|
return data instanceof AlgorithmIdentifier
|
|
5982
6010
|
&& data.algorithm == this.algorithm
|
|
5983
6011
|
&& ((data.parameters && this.parameters
|
|
5984
|
-
&&
|
|
6012
|
+
&& index.build.isEqual(data.parameters, this.parameters))
|
|
5985
6013
|
||
|
|
5986
6014
|
(data.parameters === this.parameters));
|
|
5987
6015
|
}
|
|
@@ -6512,34 +6540,6 @@ __decorate([
|
|
|
6512
6540
|
AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
|
|
6513
6541
|
], RSAPublicKey.prototype, "publicExponent", void 0);
|
|
6514
6542
|
|
|
6515
|
-
/**
|
|
6516
|
-
* @license
|
|
6517
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
6518
|
-
*
|
|
6519
|
-
* This source code is licensed under the MIT license found in the
|
|
6520
|
-
* LICENSE file in the root directory of this source tree.
|
|
6521
|
-
*/
|
|
6522
|
-
/* eslint-disable no-useless-escape */
|
|
6523
|
-
const isHex = (value) => (/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/
|
|
6524
|
-
.test(value));
|
|
6525
|
-
const isPem = (value) => (/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/
|
|
6526
|
-
.test(value));
|
|
6527
|
-
const isX509Pem = (value) => (/-----BEGIN CERTIFICATE-----([A-Za-z0-9+\/=\s]+)-----END CERTIFICATE-----/
|
|
6528
|
-
.test(value));
|
|
6529
|
-
const isPkcs10Pem = (value) => (/-----BEGIN CERTIFICATE REQUEST-----([A-Za-z0-9+\/=\s]+)-----END CERTIFICATE REQUEST-----/
|
|
6530
|
-
.test(value));
|
|
6531
|
-
const isX509AttributePem = (value) => (/-----BEGIN ATTRIBUTE CERTIFICATE-----([A-Za-z0-9+\/=\s]+)-----END ATTRIBUTE CERTIFICATE-----/
|
|
6532
|
-
.test(value));
|
|
6533
|
-
const isBase64 = (value) => {
|
|
6534
|
-
try {
|
|
6535
|
-
window.atob(value);
|
|
6536
|
-
return true;
|
|
6537
|
-
}
|
|
6538
|
-
catch (error) {
|
|
6539
|
-
return false;
|
|
6540
|
-
}
|
|
6541
|
-
};
|
|
6542
|
-
|
|
6543
6543
|
/**
|
|
6544
6544
|
* @license
|
|
6545
6545
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -8710,6 +8710,7 @@ const OIDs = {
|
|
|
8710
8710
|
'2.16.840.1.114412.31.4.31.1': 'Digi Cert Grid Host Cert',
|
|
8711
8711
|
'2.16.840.1.114413.1.7.23.3': 'Go Daddy EV policy',
|
|
8712
8712
|
'2.16.840.1.114414.1.7.23.3': 'Starfield EV policy',
|
|
8713
|
+
'2.16.840.1.114569.1.1.3': 'SHAKEN/STIR Certificate Policy v1.3',
|
|
8713
8714
|
'2.23.42.0': 'Content Type',
|
|
8714
8715
|
'2.23.42.0.0': 'Pan Data',
|
|
8715
8716
|
'2.23.42.0.1': 'Pan Token',
|
|
@@ -8872,7 +8873,7 @@ var _Name_asn;
|
|
|
8872
8873
|
class Name {
|
|
8873
8874
|
constructor(data) {
|
|
8874
8875
|
_Name_asn.set(this, new exports.Name$1());
|
|
8875
|
-
if (
|
|
8876
|
+
if (index.build.BufferSourceConverter.isBufferSource(data)) {
|
|
8876
8877
|
__classPrivateFieldSet$1(this, _Name_asn, AsnParser.parse(data, exports.Name$1), "f");
|
|
8877
8878
|
}
|
|
8878
8879
|
else {
|
|
@@ -9077,8 +9078,8 @@ exports.CaVersion = class CaVersion {
|
|
|
9077
9078
|
data.set(new Uint8Array(this.value), 4 - this.value.byteLength);
|
|
9078
9079
|
}
|
|
9079
9080
|
return {
|
|
9080
|
-
keyIndex: parseInt(
|
|
9081
|
-
certificateIndex: parseInt(
|
|
9081
|
+
keyIndex: parseInt(index.build.Convert.ToHex(data.slice(0, 2)), 16),
|
|
9082
|
+
certificateIndex: parseInt(index.build.Convert.ToHex(data.slice(2)), 16),
|
|
9082
9083
|
};
|
|
9083
9084
|
}
|
|
9084
9085
|
};
|
|
@@ -9496,7 +9497,7 @@ exports.LeiRole = __decorate([
|
|
|
9496
9497
|
class ByteStream {
|
|
9497
9498
|
constructor(bytes) {
|
|
9498
9499
|
this.offset = 0;
|
|
9499
|
-
this.view =
|
|
9500
|
+
this.view = index.build.BufferSourceConverter.toUint8Array(bytes);
|
|
9500
9501
|
}
|
|
9501
9502
|
get position() {
|
|
9502
9503
|
return this.offset;
|
|
@@ -9515,7 +9516,7 @@ class ByteStream {
|
|
|
9515
9516
|
}
|
|
9516
9517
|
readNumber(size) {
|
|
9517
9518
|
const bytes = this.read(size);
|
|
9518
|
-
const hex =
|
|
9519
|
+
const hex = index.build.Convert.ToHex(bytes);
|
|
9519
9520
|
return parseInt(hex, 16);
|
|
9520
9521
|
}
|
|
9521
9522
|
readEnd() {
|
|
@@ -9528,7 +9529,7 @@ class ByteStream {
|
|
|
9528
9529
|
|
|
9529
9530
|
class Structure {
|
|
9530
9531
|
static createStream(bytes) {
|
|
9531
|
-
const view =
|
|
9532
|
+
const view = index.build.BufferSourceConverter.toUint8Array(bytes);
|
|
9532
9533
|
return new ByteStream(view);
|
|
9533
9534
|
}
|
|
9534
9535
|
}
|
|
@@ -9572,7 +9573,7 @@ class SignedCertificateTimestamp extends Structure {
|
|
|
9572
9573
|
parse(stream) {
|
|
9573
9574
|
this.version = stream.readByte();
|
|
9574
9575
|
stream.read(2);
|
|
9575
|
-
this.logId =
|
|
9576
|
+
this.logId = index.build.BufferSourceConverter.toArrayBuffer(stream.read(32));
|
|
9576
9577
|
this.timestamp = new Date(stream.readNumber(8));
|
|
9577
9578
|
const extLen = stream.readNumber(2);
|
|
9578
9579
|
this.extensions = stream.read(extLen).buffer;
|
|
@@ -9583,12 +9584,12 @@ class SignedCertificateTimestamp extends Structure {
|
|
|
9583
9584
|
toJSON() {
|
|
9584
9585
|
return {
|
|
9585
9586
|
version: this.version,
|
|
9586
|
-
logId:
|
|
9587
|
+
logId: index.build.Convert.ToHex(this.logId),
|
|
9587
9588
|
timestamp: this.timestamp,
|
|
9588
|
-
extensions:
|
|
9589
|
+
extensions: index.build.Convert.ToBase64(this.extensions),
|
|
9589
9590
|
hashAlgorithm: HashAlgorithm[this.hashAlgorithm] || "undefined",
|
|
9590
9591
|
signatureAlgorithm: SignatureAlgorithm[this.signatureAlgorithm] || "undefined",
|
|
9591
|
-
signature:
|
|
9592
|
+
signature: index.build.Convert.ToBase64(this.signature),
|
|
9592
9593
|
};
|
|
9593
9594
|
}
|
|
9594
9595
|
}
|
|
@@ -10010,7 +10011,7 @@ class AsnData {
|
|
|
10010
10011
|
else {
|
|
10011
10012
|
// raw, type
|
|
10012
10013
|
__classPrivateFieldSet(this, _AsnData_asn, AsnConvert.parse(args[0], args[1]), "f");
|
|
10013
|
-
__classPrivateFieldSet(this, _AsnData_raw,
|
|
10014
|
+
__classPrivateFieldSet(this, _AsnData_raw, index.build.BufferSourceConverter.toArrayBuffer(args[0]), "f");
|
|
10014
10015
|
}
|
|
10015
10016
|
}
|
|
10016
10017
|
get asn() {
|
|
@@ -10144,12 +10145,12 @@ class Extension extends AsnData {
|
|
|
10144
10145
|
break;
|
|
10145
10146
|
default:
|
|
10146
10147
|
console.warn(`Didn't detect parser for "${this.asn.extnID}" extension.`);
|
|
10147
|
-
this.value =
|
|
10148
|
+
this.value = index.build.Convert.ToHex(asnExtnValue);
|
|
10148
10149
|
}
|
|
10149
10150
|
}
|
|
10150
10151
|
catch (error) {
|
|
10151
10152
|
console.error(`Error parse "${this.asn.extnID}" extension:`, error.message);
|
|
10152
|
-
this.value =
|
|
10153
|
+
this.value = index.build.Convert.ToHex(asnExtnValue);
|
|
10153
10154
|
}
|
|
10154
10155
|
}
|
|
10155
10156
|
getAsnExtnValue() {
|
|
@@ -10212,13 +10213,13 @@ const certificateRawToBuffer = (raw) => {
|
|
|
10212
10213
|
const rawClarified = base64Clarify(raw);
|
|
10213
10214
|
let buffer;
|
|
10214
10215
|
if (isHex(rawClarified)) {
|
|
10215
|
-
buffer =
|
|
10216
|
+
buffer = index.build.Convert.FromHex(rawClarified);
|
|
10216
10217
|
}
|
|
10217
10218
|
else if (isBase64(rawClarified) || isPem(rawClarified)) {
|
|
10218
|
-
buffer =
|
|
10219
|
+
buffer = index.build.Convert.FromBase64(rawClarified);
|
|
10219
10220
|
}
|
|
10220
10221
|
else {
|
|
10221
|
-
buffer =
|
|
10222
|
+
buffer = index.build.Convert.FromBinary(raw);
|
|
10222
10223
|
}
|
|
10223
10224
|
return buffer;
|
|
10224
10225
|
};
|
|
@@ -10230,135 +10231,6 @@ const getCertificateThumbprint = async (algorithm, data) => {
|
|
|
10230
10231
|
return undefined;
|
|
10231
10232
|
};
|
|
10232
10233
|
|
|
10233
|
-
/**
|
|
10234
|
-
* @license
|
|
10235
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
10236
|
-
*
|
|
10237
|
-
* This source code is licensed under the MIT license found in the
|
|
10238
|
-
* LICENSE file in the root directory of this source tree.
|
|
10239
|
-
*/
|
|
10240
|
-
class X509Certificate extends AsnData {
|
|
10241
|
-
constructor(raw) {
|
|
10242
|
-
super(certificateRawToBuffer(raw), Certificate);
|
|
10243
|
-
this.thumbprints = {};
|
|
10244
|
-
this.type = 'X.509 Certificate';
|
|
10245
|
-
const { tbsCertificate } = this.asn;
|
|
10246
|
-
this.serialNumber = download.build.Convert.ToHex(tbsCertificate.serialNumber);
|
|
10247
|
-
this.subject = new Name(tbsCertificate.subject).toJSON();
|
|
10248
|
-
this.issuer = new Name(tbsCertificate.issuer).toJSON();
|
|
10249
|
-
this.version = tbsCertificate.version + 1;
|
|
10250
|
-
const notBefore = tbsCertificate.validity.notBefore.utcTime
|
|
10251
|
-
|| tbsCertificate.validity.notBefore.generalTime;
|
|
10252
|
-
if (!notBefore) {
|
|
10253
|
-
throw new Error("Cannot get 'notBefore' value");
|
|
10254
|
-
}
|
|
10255
|
-
this.notBefore = notBefore;
|
|
10256
|
-
const notAfter = tbsCertificate.validity.notAfter.utcTime
|
|
10257
|
-
|| tbsCertificate.validity.notAfter.generalTime;
|
|
10258
|
-
if (!notAfter) {
|
|
10259
|
-
throw new Error("Cannot get 'notAfter' value");
|
|
10260
|
-
}
|
|
10261
|
-
this.notAfter = notAfter;
|
|
10262
|
-
this.validity = l10n.dateDiff(this.notBefore, this.notAfter);
|
|
10263
|
-
}
|
|
10264
|
-
parseExtensions() {
|
|
10265
|
-
const { tbsCertificate } = this.asn;
|
|
10266
|
-
if (tbsCertificate.extensions) {
|
|
10267
|
-
this.extensions = tbsCertificate.extensions
|
|
10268
|
-
.map((e) => new Extension(AsnConvert.serialize(e)));
|
|
10269
|
-
}
|
|
10270
|
-
}
|
|
10271
|
-
get publicKey() {
|
|
10272
|
-
const { subjectPublicKey, algorithm } = this.asn.tbsCertificate.subjectPublicKeyInfo;
|
|
10273
|
-
let params;
|
|
10274
|
-
if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {
|
|
10275
|
-
params = AsnConvert.parse(algorithm.parameters, exports.ECParameters);
|
|
10276
|
-
}
|
|
10277
|
-
if (algorithm.algorithm === id_rsaEncryption) {
|
|
10278
|
-
params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);
|
|
10279
|
-
}
|
|
10280
|
-
const spki = AsnConvert.serialize(this.asn.tbsCertificate.subjectPublicKeyInfo);
|
|
10281
|
-
return {
|
|
10282
|
-
params,
|
|
10283
|
-
value: spki,
|
|
10284
|
-
algorithm: algorithm.algorithm,
|
|
10285
|
-
};
|
|
10286
|
-
}
|
|
10287
|
-
get signature() {
|
|
10288
|
-
const { signatureValue, signatureAlgorithm } = this.asn;
|
|
10289
|
-
return {
|
|
10290
|
-
value: signatureValue,
|
|
10291
|
-
algorithm: signatureAlgorithm.algorithm,
|
|
10292
|
-
};
|
|
10293
|
-
}
|
|
10294
|
-
exportAsBase64() {
|
|
10295
|
-
return download.build.Convert.ToBase64(this.raw);
|
|
10296
|
-
}
|
|
10297
|
-
exportAsHexFormatted() {
|
|
10298
|
-
return hexFormat(download.build.Convert.ToHex(this.raw));
|
|
10299
|
-
}
|
|
10300
|
-
exportAsPemFormatted() {
|
|
10301
|
-
return `-----BEGIN CERTIFICATE-----\n${base64Format(this.exportAsBase64())}\n-----END CERTIFICATE-----`;
|
|
10302
|
-
}
|
|
10303
|
-
async getThumbprint(algorithm = 'SHA-1') {
|
|
10304
|
-
try {
|
|
10305
|
-
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
10306
|
-
if (thumbprint) {
|
|
10307
|
-
this.thumbprints[algorithm['name'] || algorithm] = download.build.Convert.ToHex(thumbprint);
|
|
10308
|
-
}
|
|
10309
|
-
}
|
|
10310
|
-
catch (error) {
|
|
10311
|
-
console.error('Error thumbprint get:', error);
|
|
10312
|
-
}
|
|
10313
|
-
}
|
|
10314
|
-
get commonName() {
|
|
10315
|
-
if (!this.subject) {
|
|
10316
|
-
return '';
|
|
10317
|
-
}
|
|
10318
|
-
for (let i = 0; i < this.subject.length; i += 1) {
|
|
10319
|
-
const name = this.subject[i];
|
|
10320
|
-
if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {
|
|
10321
|
-
return name.value;
|
|
10322
|
-
}
|
|
10323
|
-
}
|
|
10324
|
-
return '';
|
|
10325
|
-
}
|
|
10326
|
-
get issuerCommonName() {
|
|
10327
|
-
if (!this.issuer) {
|
|
10328
|
-
return '';
|
|
10329
|
-
}
|
|
10330
|
-
for (let i = 0; i < this.issuer.length; i += 1) {
|
|
10331
|
-
const name = this.issuer[i];
|
|
10332
|
-
if (name.shortName === 'CN') {
|
|
10333
|
-
return name.value;
|
|
10334
|
-
}
|
|
10335
|
-
if (name.shortName === 'E') {
|
|
10336
|
-
return name.value;
|
|
10337
|
-
}
|
|
10338
|
-
}
|
|
10339
|
-
return '';
|
|
10340
|
-
}
|
|
10341
|
-
get isRoot() {
|
|
10342
|
-
return JSON.stringify(this.issuer) === JSON.stringify(this.subject);
|
|
10343
|
-
}
|
|
10344
|
-
subjectToString() {
|
|
10345
|
-
if (!this.subject) {
|
|
10346
|
-
return '';
|
|
10347
|
-
}
|
|
10348
|
-
return this.subject
|
|
10349
|
-
.map((name) => (`${name.shortName}=${name.value}`))
|
|
10350
|
-
.join(', ');
|
|
10351
|
-
}
|
|
10352
|
-
issuerToString() {
|
|
10353
|
-
if (!this.issuer) {
|
|
10354
|
-
return '';
|
|
10355
|
-
}
|
|
10356
|
-
return this.issuer
|
|
10357
|
-
.map((name) => (`${name.shortName}=${name.value}`))
|
|
10358
|
-
.join(', ');
|
|
10359
|
-
}
|
|
10360
|
-
}
|
|
10361
|
-
|
|
10362
10234
|
class ACClearAttrs {
|
|
10363
10235
|
constructor(params = {}) {
|
|
10364
10236
|
this.acIssuer = new GeneralName();
|
|
@@ -11645,6 +11517,7 @@ exports.Attribute = Attribute$1;
|
|
|
11645
11517
|
exports.AttributeCertificate = AttributeCertificate;
|
|
11646
11518
|
exports.AuthorityKeyIdentifier = AuthorityKeyIdentifier;
|
|
11647
11519
|
exports.BasicConstraints = BasicConstraints;
|
|
11520
|
+
exports.Certificate = Certificate;
|
|
11648
11521
|
exports.CertificateTemplate = CertificateTemplate;
|
|
11649
11522
|
exports.CertificateTransparency = CertificateTransparency;
|
|
11650
11523
|
exports.CertificationRequest = CertificationRequest;
|
|
@@ -11664,7 +11537,6 @@ exports.RSAPublicKey = RSAPublicKey;
|
|
|
11664
11537
|
exports.SubjectKeyIdentifier = SubjectKeyIdentifier;
|
|
11665
11538
|
exports.Timestamp = Timestamp;
|
|
11666
11539
|
exports.UserNotice = UserNotice;
|
|
11667
|
-
exports.X509Certificate = X509Certificate;
|
|
11668
11540
|
exports.base64Format = base64Format;
|
|
11669
11541
|
exports.certificateRawToBuffer = certificateRawToBuffer;
|
|
11670
11542
|
exports.getCertificateThumbprint = getCertificateThumbprint;
|