@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.
Files changed (74) hide show
  1. package/dist/cjs/{certification_request-43396146.js → certification_request-cde57123.js} +138 -266
  2. package/dist/cjs/csr-78378ed0.js +150 -0
  3. package/dist/cjs/download-6724f3a7.js +79 -0
  4. package/dist/cjs/{download-5e7d5455.js → index-ff818d4d.js} +0 -72
  5. package/dist/cjs/index.cjs.js +2 -1
  6. package/dist/cjs/l10n-a048a686.js +145 -0
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/peculiar-attribute-certificate-viewer_2.cjs.entry.js +479 -0
  9. package/dist/cjs/peculiar-button_5.cjs.entry.js +148 -0
  10. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +173 -0
  11. package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +1 -1
  12. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +124 -0
  13. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +6 -4
  14. package/dist/cjs/peculiar.cjs.js +1 -1
  15. package/dist/cjs/public_key-e56dbe52.js +1104 -0
  16. package/dist/cjs/x509_attribute_certificate-cc325b70.js +87 -0
  17. package/dist/cjs/x509_certificate-51a97033.js +139 -0
  18. package/dist/collection/components/certificate-decoder/certificate-decoder.js +54 -11
  19. package/dist/collection/constants/oids.js +1 -0
  20. package/dist/collection/utils/index.js +0 -1
  21. package/dist/collection/www-copy/index.js +80 -0
  22. package/dist/esm/{certification_request-16ea346c.js → certification_request-c0674647.js} +77 -205
  23. package/dist/esm/csr-c1b6a176.js +147 -0
  24. package/dist/esm/download-735fb2eb.js +76 -0
  25. package/dist/esm/{download-cf68ac2c.js → index-0ba131b0.js} +1 -71
  26. package/dist/esm/index.js +2 -1
  27. package/dist/esm/l10n-ac28fa92.js +141 -0
  28. package/dist/esm/loader.js +1 -1
  29. package/dist/esm/peculiar-attribute-certificate-viewer_2.entry.js +474 -0
  30. package/dist/esm/peculiar-button_5.entry.js +140 -0
  31. package/dist/esm/peculiar-certificate-decoder.entry.js +169 -0
  32. package/dist/esm/peculiar-certificate-summary_3.entry.js +1 -1
  33. package/dist/esm/peculiar-certificate-viewer.entry.js +120 -0
  34. package/dist/esm/peculiar-certificates-viewer.entry.js +5 -3
  35. package/dist/esm/peculiar.js +1 -1
  36. package/dist/esm/public_key-43b2cbf0.js +1089 -0
  37. package/dist/esm/x509_attribute_certificate-a6d4aa15.js +85 -0
  38. package/dist/esm/x509_certificate-12f6d344.js +137 -0
  39. package/dist/peculiar/index.esm.js +1 -1
  40. package/dist/peculiar/p-006865d7.js +4 -0
  41. package/dist/peculiar/p-17c4da7b.js +11 -0
  42. package/dist/peculiar/p-1ebab45c.js +78 -0
  43. package/dist/peculiar/{p-b09a1f0b.entry.js → p-38635919.entry.js} +1 -1
  44. package/dist/peculiar/p-3f8d1008.entry.js +4 -0
  45. package/dist/peculiar/p-42da7f97.js +11 -0
  46. package/dist/peculiar/p-464e0943.js +87 -0
  47. package/dist/peculiar/p-4f4c1d30.js +12 -0
  48. package/dist/peculiar/p-530afe84.entry.js +11 -0
  49. package/dist/peculiar/p-6011646e.entry.js +11 -0
  50. package/dist/peculiar/p-6c510523.js +18 -0
  51. package/dist/peculiar/p-d7a13cb4.js +18 -0
  52. package/dist/peculiar/p-dafae164.entry.js +4 -0
  53. package/dist/peculiar/p-e77d0ccc.entry.js +18 -0
  54. package/dist/peculiar/peculiar.esm.js +1 -1
  55. package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +13 -0
  56. package/dist/types/components.d.ts +20 -0
  57. package/dist/types/constants/oids.d.ts +1 -0
  58. package/dist/types/utils/index.d.ts +0 -1
  59. package/package.json +2 -3
  60. package/dist/cjs/l10n-d4a77087.js +0 -767
  61. package/dist/cjs/peculiar-attribute-certificate-viewer_9.cjs.entry.js +0 -2175
  62. package/dist/collection/utils/history.js +0 -19
  63. package/dist/collection/utils/parse_hash.js +0 -28
  64. package/dist/collection/utils/query_stringify.js +0 -21
  65. package/dist/esm/l10n-9ac63748.js +0 -762
  66. package/dist/esm/peculiar-attribute-certificate-viewer_9.entry.js +0 -2163
  67. package/dist/peculiar/p-7452b86e.entry.js +0 -4
  68. package/dist/peculiar/p-99797a49.js +0 -34
  69. package/dist/peculiar/p-c774ec0b.js +0 -18
  70. package/dist/peculiar/p-d0db9e70.entry.js +0 -113
  71. package/dist/peculiar/p-d7ed39f0.js +0 -87
  72. package/dist/types/utils/history.d.ts +0 -9
  73. package/dist/types/utils/parse_hash.d.ts +0 -9
  74. package/dist/types/utils/query_stringify.d.ts +0 -8
@@ -1,2175 +0,0 @@
1
- /*!
2
- * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
- */
4
- 'use strict';
5
-
6
- Object.defineProperty(exports, '__esModule', { value: true });
7
-
8
- const index = require('./index-064e95c7.js');
9
- const certification_request = require('./certification_request-43396146.js');
10
- const download = require('./download-5e7d5455.js');
11
- const l10n = require('./l10n-d4a77087.js');
12
- require('./_commonjsHelpers-cb1f949a.js');
13
-
14
- /**
15
- * @license
16
- * Copyright (c) Peculiar Ventures, LLC.
17
- *
18
- * This source code is licensed under the MIT license found in the
19
- * LICENSE file in the root directory of this source tree.
20
- */
21
- /**
22
- * Read file as Binary string
23
- *
24
- * @example
25
- * ```js
26
- * const file = new File(['file'], 'file.pdf', { type: 'text/plain' });
27
- * readAsBinaryString(file)
28
- * .then(result => console.log('Readed success', result))
29
- * .catch(err => console.log('An error occured when reading file', err));
30
- * ```
31
- */
32
- function readAsBinaryString(file) {
33
- return new Promise((resolve, reject) => {
34
- const reader = new FileReader();
35
- reader.onload = () => resolve({
36
- value: reader.result,
37
- fileName: file.name,
38
- fileSize: file.size,
39
- sourceMime: file.type,
40
- });
41
- reader.onerror = () => reject(reader.error);
42
- reader.readAsBinaryString(file);
43
- });
44
- }
45
-
46
- /**
47
- * @license
48
- * Copyright (c) Peculiar Ventures, LLC.
49
- *
50
- * This source code is licensed under the MIT license found in the
51
- * LICENSE file in the root directory of this source tree.
52
- */
53
- class Attribute extends certification_request.AsnData {
54
- constructor(raw) {
55
- super(raw, certification_request.Attribute);
56
- const asnExtnValue = this.getAsnExtnValue();
57
- switch (this.asn.type) {
58
- case certification_request.id_DomainNameBeneficiary:
59
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameBeneficiary);
60
- break;
61
- case certification_request.id_DomainNameLegalRepresentative:
62
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameLegalRepresentative);
63
- break;
64
- case certification_request.id_DomainNameOwner:
65
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameOwner);
66
- break;
67
- case certification_request.id_DomainNameTechnicalOperator:
68
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameTechnicalOperator);
69
- break;
70
- case certification_request.id_TypeRelationship:
71
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.TypeRelationship);
72
- break;
73
- case certification_request.id_ActivityDescription:
74
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.ActivityDescription);
75
- break;
76
- case certification_request.id_WebGDPR:
77
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.WebGDPR);
78
- break;
79
- case certification_request.id_InsuranceValue:
80
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.InsuranceValue);
81
- break;
82
- case certification_request.id_ValuationRanking:
83
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.ValuationRanking);
84
- break;
85
- case certification_request.id_pkcs9_at_challengePassword:
86
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.ChallengePassword);
87
- break;
88
- case certification_request.id_pkcs9_at_unstructuredName:
89
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.UnstructuredName);
90
- break;
91
- case certification_request.id_pkcs9_at_extensionRequest: {
92
- const extensionRequest = certification_request.AsnParser.parse(asnExtnValue, certification_request.ExtensionRequest);
93
- this.value = extensionRequest
94
- .map((e) => new certification_request.Extension(certification_request.AsnConvert.serialize(e)));
95
- break;
96
- }
97
- default:
98
- this.value = download.build.Convert.ToHex(asnExtnValue);
99
- }
100
- }
101
- getAsnExtnValue() {
102
- return this.asn.values[0];
103
- }
104
- }
105
-
106
- /**
107
- * @license
108
- * Copyright (c) Peculiar Ventures, LLC.
109
- *
110
- * This source code is licensed under the MIT license found in the
111
- * LICENSE file in the root directory of this source tree.
112
- */
113
- class X509AttributeCertificate extends certification_request.AsnData {
114
- constructor(raw) {
115
- var _a;
116
- super(certification_request.certificateRawToBuffer(raw), certification_request.AttributeCertificate);
117
- this.thumbprints = {};
118
- this.type = 'X.509 Attribute Certificate';
119
- const { acinfo } = this.asn;
120
- this.serialNumber = download.build.Convert.ToHex(acinfo.serialNumber);
121
- this.version = acinfo.version;
122
- const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;
123
- if (!notBefore) {
124
- throw new Error("Cannot get 'notBefore' value");
125
- }
126
- this.notBefore = notBefore;
127
- const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;
128
- if (!notAfter) {
129
- throw new Error("Cannot get 'notAfter' value");
130
- }
131
- this.notAfter = notAfter;
132
- this.validity = l10n.dateDiff(this.notBefore, this.notAfter);
133
- this.issuer = acinfo.issuer.v1Form || ((_a = acinfo.issuer.v2Form) === null || _a === void 0 ? void 0 : _a.issuerName);
134
- this.holder = acinfo.holder;
135
- }
136
- get signature() {
137
- const { signatureValue, signatureAlgorithm } = this.asn;
138
- return {
139
- value: signatureValue,
140
- algorithm: signatureAlgorithm.algorithm,
141
- };
142
- }
143
- parseExtensions() {
144
- const { acinfo } = this.asn;
145
- if (acinfo.extensions) {
146
- this.extensions = acinfo.extensions
147
- .map((e) => new certification_request.Extension(certification_request.AsnConvert.serialize(e)));
148
- }
149
- }
150
- parseAttributes() {
151
- const { acinfo } = this.asn;
152
- if (acinfo.attributes) {
153
- this.attributes = acinfo.attributes
154
- .map((e) => new Attribute(certification_request.AsnConvert.serialize(e)));
155
- }
156
- }
157
- async getThumbprint(algorithm = 'SHA-1') {
158
- try {
159
- const thumbprint = await certification_request.getCertificateThumbprint(algorithm, this.raw);
160
- if (thumbprint) {
161
- this.thumbprints[algorithm['name'] || algorithm] = download.build.Convert.ToHex(thumbprint);
162
- }
163
- }
164
- catch (error) {
165
- console.error('Error thumbprint get:', error);
166
- }
167
- }
168
- exportAsBase64() {
169
- return download.build.Convert.ToBase64(this.raw);
170
- }
171
- exportAsHexFormatted() {
172
- return certification_request.hexFormat(download.build.Convert.ToHex(this.raw));
173
- }
174
- exportAsPemFormatted() {
175
- return `-----BEGIN ATTRIBUTE CERTIFICATE-----\n${certification_request.base64Format(this.exportAsBase64())}\n-----END ATTRIBUTE CERTIFICATE-----`;
176
- }
177
- get commonName() {
178
- return `attribute-certificate-${this.thumbprints['SHA-1']}`;
179
- }
180
- }
181
-
182
- /**
183
- * @license
184
- * Copyright (c) Peculiar Ventures, LLC.
185
- *
186
- * This source code is licensed under the MIT license found in the
187
- * LICENSE file in the root directory of this source tree.
188
- */
189
- class CSR extends certification_request.AsnData {
190
- constructor(raw) {
191
- super(certification_request.certificateRawToBuffer(raw), certification_request.CertificationRequest);
192
- this.thumbprints = {};
193
- this.type = 'PKCS#10 Certificate Request';
194
- const { certificationRequestInfo } = this.asn;
195
- this.subject = new certification_request.Name(certificationRequestInfo.subject).toJSON();
196
- this.version = certificationRequestInfo.version;
197
- }
198
- get publicKey() {
199
- const { subjectPublicKey, algorithm } = this.asn.certificationRequestInfo.subjectPKInfo;
200
- let params;
201
- if (algorithm.algorithm === certification_request.id_ecPublicKey && algorithm.parameters) {
202
- params = certification_request.AsnConvert.parse(algorithm.parameters, certification_request.ECParameters);
203
- }
204
- if (algorithm.algorithm === certification_request.id_rsaEncryption) {
205
- params = certification_request.AsnConvert.parse(subjectPublicKey, certification_request.RSAPublicKey);
206
- }
207
- const spki = certification_request.AsnConvert.serialize(this.asn.certificationRequestInfo.subjectPKInfo);
208
- return {
209
- params,
210
- value: spki,
211
- algorithm: algorithm.algorithm,
212
- };
213
- }
214
- get signature() {
215
- const { signature, signatureAlgorithm } = this.asn;
216
- return {
217
- value: signature,
218
- algorithm: signatureAlgorithm.algorithm,
219
- };
220
- }
221
- get commonName() {
222
- if (!this.subject) {
223
- return '';
224
- }
225
- for (let i = 0; i < this.subject.length; i += 1) {
226
- const name = this.subject[i];
227
- if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {
228
- return name.value;
229
- }
230
- }
231
- return '';
232
- }
233
- async getThumbprint(algorithm = 'SHA-1') {
234
- try {
235
- const thumbprint = await certification_request.getCertificateThumbprint(algorithm, this.raw);
236
- if (thumbprint) {
237
- this.thumbprints[algorithm['name'] || algorithm] = download.build.Convert.ToHex(thumbprint);
238
- }
239
- }
240
- catch (error) {
241
- console.error('Error thumbprint get:', error);
242
- }
243
- }
244
- parseAttributes() {
245
- const { certificationRequestInfo } = this.asn;
246
- if (certificationRequestInfo.attributes) {
247
- this.attributes = certificationRequestInfo.attributes
248
- .map((e) => new Attribute(certification_request.AsnConvert.serialize(e)));
249
- }
250
- }
251
- exportAsBase64() {
252
- return download.build.Convert.ToBase64(this.raw);
253
- }
254
- exportAsHexFormatted() {
255
- return certification_request.hexFormat(download.build.Convert.ToHex(this.raw));
256
- }
257
- exportAsPemFormatted() {
258
- return `-----BEGIN CERTIFICATE REQUEST-----\n${certification_request.base64Format(this.exportAsBase64())}\n-----END CERTIFICATE REQUEST-----`;
259
- }
260
- }
261
-
262
- /**
263
- * @license
264
- * Copyright (c) Peculiar Ventures, LLC.
265
- *
266
- * This source code is licensed under the MIT license found in the
267
- * LICENSE file in the root directory of this source tree.
268
- */
269
- function getStringByOID(value) {
270
- const oid = certification_request.OIDs[value];
271
- if (oid) {
272
- return `${oid} (${value})`;
273
- }
274
- return value;
275
- }
276
-
277
- /**
278
- * @license
279
- * Copyright (c) Peculiar Ventures, LLC.
280
- *
281
- * This source code is licensed under the MIT license found in the
282
- * LICENSE file in the root directory of this source tree.
283
- */
284
- function isLink(value) {
285
- return value.indexOf('http') === 0;
286
- }
287
-
288
- /**
289
- * @license
290
- * Copyright (c) Peculiar Ventures, LLC.
291
- *
292
- * This source code is licensed under the MIT license found in the
293
- * LICENSE file in the root directory of this source tree.
294
- */
295
- const RowTitle = (props) => {
296
- const { value } = props;
297
- if (!value) {
298
- return null;
299
- }
300
- return (index.h("tr", { class: "title" },
301
- index.h("td", { colSpan: 2 },
302
- index.h("peculiar-typography", { type: "h6" }, value))));
303
- };
304
- const RowValue = (props) => {
305
- const { name, value, monospace, collapse, href, extraValue, } = props;
306
- if (!name) {
307
- return null;
308
- }
309
- if (value === undefined || value === null) {
310
- return null;
311
- }
312
- let elementValue;
313
- if (collapse) {
314
- elementValue = (index.h("peculiar-text-hider", null, value));
315
- }
316
- else {
317
- elementValue = value;
318
- }
319
- const hasValue = !!value.toString();
320
- return (index.h("tr", null,
321
- index.h("td", { colSpan: hasValue ? 1 : 2 },
322
- index.h("peculiar-typography", { color: "grey_5" },
323
- name,
324
- hasValue ? ':' : '')),
325
- hasValue && (index.h("td", { class: {
326
- monospace,
327
- } }, (isLink(value.toString()) || href) ? (index.h("peculiar-link", { href: href || value.toString() }, value)) : (index.h("peculiar-typography", { monospace: monospace },
328
- elementValue,
329
- extraValue))))));
330
- };
331
-
332
- /**
333
- * @license
334
- * Copyright (c) Peculiar Ventures, LLC.
335
- *
336
- * This source code is licensed under the MIT license found in the
337
- * LICENSE file in the root directory of this source tree.
338
- */
339
- const Signature = (props) => {
340
- const { signature } = props;
341
- if (!signature) {
342
- return null;
343
- }
344
- return [
345
- index.h(RowTitle, { value: l10n.l10n.getString('signature') }),
346
- index.h(RowValue, { name: l10n.l10n.getString('algorithm'), value: getStringByOID(signature.algorithm) }),
347
- index.h(RowValue, { name: l10n.l10n.getString('value'), value: download.build.Convert.ToHex(signature.value), monospace: true, collapse: true }),
348
- ];
349
- };
350
-
351
- /**
352
- * @license
353
- * Copyright (c) Peculiar Ventures, LLC.
354
- *
355
- * This source code is licensed under the MIT license found in the
356
- * LICENSE file in the root directory of this source tree.
357
- */
358
- const BasicAttribute = (props, children) => {
359
- const { attribute } = props;
360
- return ([
361
- index.h(RowValue, { name: "Name", value: getStringByOID(attribute.asn.type) }),
362
- children,
363
- index.h("tr", null,
364
- index.h("td", { colSpan: 2, class: "divider" },
365
- index.h("span", { class: "bg_fill" }))),
366
- ]);
367
- };
368
-
369
- /**
370
- * @license
371
- * Copyright (c) Peculiar Ventures, LLC.
372
- *
373
- * This source code is licensed under the MIT license found in the
374
- * LICENSE file in the root directory of this source tree.
375
- */
376
- const NamePart = (props) => {
377
- const { name } = props;
378
- if (!name) {
379
- return null;
380
- }
381
- return name.map((relativeDistinguishedName) => (relativeDistinguishedName.map((attributeTypeAndValue) => (index.h(RowValue, { name: certification_request.OIDs[attributeTypeAndValue.type] || attributeTypeAndValue.type, value: attributeTypeAndValue.value.toString() })))));
382
- };
383
-
384
- /**
385
- * @license
386
- * Copyright (c) Peculiar Ventures, LLC.
387
- *
388
- * This source code is licensed under the MIT license found in the
389
- * LICENSE file in the root directory of this source tree.
390
- */
391
- const NameAttribute = (props) => {
392
- const { attribute } = props;
393
- return (index.h(BasicAttribute, { attribute: attribute },
394
- index.h(NamePart, { name: attribute.value })));
395
- };
396
-
397
- /**
398
- * @license
399
- * Copyright (c) Peculiar Ventures, LLC.
400
- *
401
- * This source code is licensed under the MIT license found in the
402
- * LICENSE file in the root directory of this source tree.
403
- */
404
- const names = {
405
- otherName: 'Other Name',
406
- rfc822Name: 'RFC 822 Name',
407
- dNSName: 'DNS Name',
408
- x400Address: 'X400 Address',
409
- directoryName: 'Directory Name',
410
- ediPartyName: 'Edi Party Name ',
411
- uniformResourceIdentifier: 'URI',
412
- iPAddress: 'IP Address',
413
- registeredID: 'Registered ID',
414
- };
415
- const GeneralNamePart = (props) => {
416
- const { generalName, getDNSNameLink, getIPAddressLink } = props;
417
- if (!generalName) {
418
- return null;
419
- }
420
- return Object.keys(generalName).map((name) => {
421
- const value = generalName[name];
422
- if (value instanceof certification_request.Name$1) {
423
- return [
424
- index.h(RowValue, { name: names[name] || name, value: "" }),
425
- value.map((relativeDistinguishedName) => (relativeDistinguishedName.map((attributeTypeAndValue) => (index.h(RowValue, { name: certification_request.OIDs[attributeTypeAndValue.type] || attributeTypeAndValue.type, value: attributeTypeAndValue.value.toString() }))))),
426
- ];
427
- }
428
- if (value instanceof certification_request.OtherName) {
429
- try {
430
- const text = certification_request.AsnParser.parse(value.value, certification_request.DisplayText);
431
- return (index.h(RowValue, { name: certification_request.OIDs[value.typeId] || value.typeId, value: text.toString() }));
432
- }
433
- catch (error) {
434
- //
435
- }
436
- try {
437
- const text = certification_request.AsnParser.parse(value.value, certification_request.UserNotice);
438
- if (text.explicitText) {
439
- return (index.h(RowValue, { name: certification_request.OIDs[value.typeId] || value.typeId, value: text.explicitText.toString() }));
440
- }
441
- }
442
- catch (error) {
443
- //
444
- }
445
- return (index.h(RowValue, { name: certification_request.OIDs[value.typeId] || value.typeId, value: download.build.Convert.ToHex(value.value), monospace: true }));
446
- }
447
- if (download.build.BufferSourceConverter.isBufferSource(value)) {
448
- return (index.h(RowValue, { name: names[name] || name, value: download.build.Convert.ToString(value) }));
449
- }
450
- if (value instanceof certification_request.EDIPartyName) {
451
- return (index.h(RowValue, { name: names[name] || name, value: download.build.Convert.ToString(value.partyName) }));
452
- }
453
- if (name === 'dNSName') {
454
- return (index.h(RowValue, { name: names[name] || name, value: value, href: getDNSNameLink(value) }));
455
- }
456
- if (name === 'iPAddress') {
457
- return (index.h(RowValue, { name: names[name] || name, value: value, href: getIPAddressLink(value) }));
458
- }
459
- return (index.h(RowValue, { name: names[name] || name, value: value }));
460
- });
461
- };
462
-
463
- /**
464
- * @license
465
- * Copyright (c) Peculiar Ventures, LLC.
466
- *
467
- * This source code is licensed under the MIT license found in the
468
- * LICENSE file in the root directory of this source tree.
469
- */
470
- const ActivityDescriptionAttribute = (props) => {
471
- const { attribute } = props;
472
- return (index.h(BasicAttribute, { attribute: attribute },
473
- index.h(RowValue, { name: "Code Authority", value: "" }),
474
- index.h(GeneralNamePart, { generalName: attribute.value.codeAuthority, getDNSNameLink: () => '', getIPAddressLink: () => '' }),
475
- index.h(RowValue, { name: "Code Id", value: "" }),
476
- index.h(GeneralNamePart, { generalName: attribute.value.codeId, getDNSNameLink: () => '', getIPAddressLink: () => '' }),
477
- index.h(RowValue, { name: "Short Name", value: attribute.value.shortName }),
478
- index.h(RowValue, { name: "Short Description", value: attribute.value.shortDescription })));
479
- };
480
-
481
- /**
482
- * @license
483
- * Copyright (c) Peculiar Ventures, LLC.
484
- *
485
- * This source code is licensed under the MIT license found in the
486
- * LICENSE file in the root directory of this source tree.
487
- */
488
- const WebGdprAttribute = (props) => {
489
- const { attribute } = props;
490
- return (index.h(BasicAttribute, { attribute: attribute },
491
- index.h(RowValue, { name: "Assessment Authority", value: "" }),
492
- index.h(GeneralNamePart, { generalName: attribute.value.assessmentAuthority, getDNSNameLink: () => '', getIPAddressLink: () => '' }),
493
- index.h(RowValue, { name: "Assessment Location", value: "" }),
494
- index.h(GeneralNamePart, { generalName: attribute.value.assessmentLocation, getDNSNameLink: () => '', getIPAddressLink: () => '' }),
495
- index.h(RowValue, { name: "Assessment Ref", value: "" }),
496
- index.h(GeneralNamePart, { generalName: attribute.value.assessmentRef, getDNSNameLink: () => '', getIPAddressLink: () => '' }),
497
- index.h(RowValue, { name: "Data Storage Territory", value: attribute.value.dataStorageTerritory }),
498
- index.h(RowValue, { name: "Description", value: attribute.value.description })));
499
- };
500
-
501
- /**
502
- * @license
503
- * Copyright (c) Peculiar Ventures, LLC.
504
- *
505
- * This source code is licensed under the MIT license found in the
506
- * LICENSE file in the root directory of this source tree.
507
- */
508
- const InsuranceValueAttribute = (props) => {
509
- const { attribute } = props;
510
- const value = `${attribute.value.base} * 10^${attribute.value.degree} ${attribute.value.location}`;
511
- return (index.h(BasicAttribute, { attribute: attribute },
512
- index.h(RowValue, { name: "Value", value: value })));
513
- };
514
-
515
- /**
516
- * @license
517
- * Copyright (c) Peculiar Ventures, LLC.
518
- *
519
- * This source code is licensed under the MIT license found in the
520
- * LICENSE file in the root directory of this source tree.
521
- */
522
- const TypeRelationshipAttribute = (props) => {
523
- const { attribute } = props;
524
- return (index.h(BasicAttribute, { attribute: attribute }, Object.keys(attribute.value).map((keyName) => (index.h(RowValue, { name: keyName, value: attribute.value[keyName].toNumber() ? 'YES' : 'NO' })))));
525
- };
526
-
527
- /**
528
- * @license
529
- * Copyright (c) Peculiar Ventures, LLC.
530
- *
531
- * This source code is licensed under the MIT license found in the
532
- * LICENSE file in the root directory of this source tree.
533
- */
534
- const getValueRank = (value) => {
535
- let ratio = 1;
536
- if (value / 100 > 1) {
537
- ratio = 100;
538
- }
539
- else if (value / 10 > 1) {
540
- ratio = 10;
541
- }
542
- return `${value}/${5 * ratio}`;
543
- };
544
- const ValuationRankingAttribute = (props) => {
545
- const { attribute } = props;
546
- const values = Object.keys(attribute.value).map((keyName) => ([
547
- getValueRank(attribute.value[keyName]),
548
- index.h("br", null),
549
- ]));
550
- return (index.h(BasicAttribute, { attribute: attribute },
551
- index.h(RowValue, { name: "Value", value: values })));
552
- };
553
-
554
- /**
555
- * @license
556
- * Copyright (c) Peculiar Ventures, LLC.
557
- *
558
- * This source code is licensed under the MIT license found in the
559
- * LICENSE file in the root directory of this source tree.
560
- */
561
- const AsStringAttribute = (props) => {
562
- const { attribute } = props;
563
- return (index.h(BasicAttribute, { attribute: attribute },
564
- index.h(RowValue, { name: "Value", value: attribute.value, monospace: true })));
565
- };
566
-
567
- /**
568
- * @license
569
- * Copyright (c) Peculiar Ventures, LLC.
570
- *
571
- * This source code is licensed under the MIT license found in the
572
- * LICENSE file in the root directory of this source tree.
573
- */
574
- const UnstructuredNameAttribute = (props) => {
575
- const { attribute } = props;
576
- return (index.h(BasicAttribute, { attribute: attribute },
577
- index.h(RowValue, { name: "Value", value: attribute.value.utf8String })));
578
- };
579
-
580
- /**
581
- * @license
582
- * Copyright (c) Peculiar Ventures, LLC.
583
- *
584
- * This source code is licensed under the MIT license found in the
585
- * LICENSE file in the root directory of this source tree.
586
- */
587
- const ChallengePasswordAttribute = (props) => {
588
- const { attribute } = props;
589
- return (index.h(BasicAttribute, { attribute: attribute },
590
- index.h(RowValue, { name: "Value", value: attribute.value.toString() })));
591
- };
592
-
593
- /**
594
- * @license
595
- * Copyright (c) Peculiar Ventures, LLC.
596
- *
597
- * This source code is licensed under the MIT license found in the
598
- * LICENSE file in the root directory of this source tree.
599
- */
600
- const Attributes = (props) => {
601
- const { attributes } = props;
602
- if (!attributes || !attributes.length) {
603
- return null;
604
- }
605
- return ([
606
- index.h(RowTitle, { value: "Attributes" }),
607
- attributes.map((attribute) => {
608
- try {
609
- if (attribute.value instanceof certification_request.Name$1) {
610
- return (index.h(NameAttribute, { attribute: attribute }));
611
- }
612
- if (attribute.value instanceof certification_request.ActivityDescription) {
613
- return (index.h(ActivityDescriptionAttribute, { attribute: attribute }));
614
- }
615
- if (attribute.value instanceof certification_request.WebGDPR) {
616
- return (index.h(WebGdprAttribute, { attribute: attribute }));
617
- }
618
- if (attribute.value instanceof certification_request.InsuranceValue) {
619
- return (index.h(InsuranceValueAttribute, { attribute: attribute }));
620
- }
621
- if (attribute.value instanceof certification_request.TypeRelationship) {
622
- return (index.h(TypeRelationshipAttribute, { attribute: attribute }));
623
- }
624
- if (attribute.value instanceof certification_request.ValuationRanking) {
625
- return (index.h(ValuationRankingAttribute, { attribute: attribute }));
626
- }
627
- if (attribute.value instanceof certification_request.UnstructuredName) {
628
- return (index.h(UnstructuredNameAttribute, { attribute: attribute }));
629
- }
630
- if (attribute.value instanceof certification_request.ChallengePassword) {
631
- return (index.h(ChallengePasswordAttribute, { attribute: attribute }));
632
- }
633
- if (typeof attribute.value === 'string') {
634
- return (index.h(AsStringAttribute, { attribute: attribute }));
635
- }
636
- return (index.h(BasicAttribute, { attribute: attribute }));
637
- }
638
- catch (error) {
639
- console.error('Error render attribute:', attribute.asn.type);
640
- return null;
641
- }
642
- }),
643
- ]);
644
- };
645
-
646
- /**
647
- * @license
648
- * Copyright (c) Peculiar Ventures, LLC.
649
- *
650
- * This source code is licensed under the MIT license found in the
651
- * LICENSE file in the root directory of this source tree.
652
- */
653
- const Thumbprints = (props) => {
654
- const { thumbprints } = props;
655
- if (!thumbprints) {
656
- return null;
657
- }
658
- const keys = Object.keys(thumbprints);
659
- if (!keys.length) {
660
- return null;
661
- }
662
- return [
663
- index.h(RowTitle, { value: l10n.l10n.getString('fingerprints') }),
664
- keys.map((name) => (index.h(RowValue, { name: name, value: thumbprints[name], monospace: true }))),
665
- ];
666
- };
667
-
668
- /**
669
- * @license
670
- * Copyright (c) Peculiar Ventures, LLC.
671
- *
672
- * This source code is licensed under the MIT license found in the
673
- * LICENSE file in the root directory of this source tree.
674
- */
675
- const BasicExtension = (props, children) => {
676
- const { extension } = props;
677
- return ([
678
- index.h(RowValue, { name: "Name", value: getStringByOID(extension.asn.extnID) }),
679
- index.h(RowValue, { name: "Critical", value: extension.asn.critical ? 'YES' : 'NO' }),
680
- children,
681
- index.h("tr", null,
682
- index.h("td", { colSpan: 2, class: "divider" },
683
- index.h("span", { class: "bg_fill" }))),
684
- ]);
685
- };
686
-
687
- /**
688
- * @license
689
- * Copyright (c) Peculiar Ventures, LLC.
690
- *
691
- * This source code is licensed under the MIT license found in the
692
- * LICENSE file in the root directory of this source tree.
693
- */
694
- const KeyUsageExtension = (props) => {
695
- const { extension } = props;
696
- return (index.h(BasicExtension, { extension: extension },
697
- index.h(RowValue, { name: "Usage", value: extension.value.toJSON().join(', ') })));
698
- };
699
-
700
- /**
701
- * @license
702
- * Copyright (c) Peculiar Ventures, LLC.
703
- *
704
- * This source code is licensed under the MIT license found in the
705
- * LICENSE file in the root directory of this source tree.
706
- */
707
- const BasicConstraintsExtension = (props) => {
708
- const { extension } = props;
709
- return (index.h(BasicExtension, { extension: extension },
710
- index.h(RowValue, { name: "Certificate Authority", value: extension.value.cA ? 'YES' : 'NO' }),
711
- index.h(RowValue, { name: "Path Length Constraint", value: extension.value.pathLenConstraint })));
712
- };
713
-
714
- /**
715
- * @license
716
- * Copyright (c) Peculiar Ventures, LLC.
717
- *
718
- * This source code is licensed under the MIT license found in the
719
- * LICENSE file in the root directory of this source tree.
720
- */
721
- const ExtendedKeyUsageExtension = (props) => {
722
- const { extension } = props;
723
- return (index.h(BasicExtension, { extension: extension }, extension.value.map((usage, arrayIndex) => (index.h(RowValue, { name: `Purpose #${arrayIndex + 1}`, value: getStringByOID(usage) })))));
724
- };
725
-
726
- /**
727
- * @license
728
- * Copyright (c) Peculiar Ventures, LLC.
729
- *
730
- * This source code is licensed under the MIT license found in the
731
- * LICENSE file in the root directory of this source tree.
732
- */
733
- const SubjectKeyIdentifierExtension = (props) => {
734
- const { extension, getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink } = props;
735
- const keyId = download.build.Convert.ToHex(extension.value.buffer);
736
- const childrenLink = getSubjectKeyIdChildrenLink(keyId);
737
- const siblingsLink = getSubjectKeyIdSiblingsLink(keyId);
738
- return (index.h(BasicExtension, { extension: extension },
739
- index.h(RowValue, { name: "Key ID", value: keyId, monospace: true, extraValue: [
740
- childrenLink && (index.h("span", null,
741
- "\u00A0[",
742
- index.h("peculiar-link", { href: childrenLink }, "children"),
743
- "]")),
744
- siblingsLink && (index.h("span", null,
745
- "\u00A0[",
746
- index.h("peculiar-link", { href: siblingsLink }, "siblings"),
747
- "]")),
748
- ] })));
749
- };
750
-
751
- /**
752
- * @license
753
- * Copyright (c) Peculiar Ventures, LLC.
754
- *
755
- * This source code is licensed under the MIT license found in the
756
- * LICENSE file in the root directory of this source tree.
757
- */
758
- const AuthorityKeyIdentifierExtension = (props) => {
759
- const { extension, getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink } = props;
760
- const keyId = download.build.Convert.ToHex(extension.value.keyIdentifier.buffer);
761
- const parentLink = getAuthKeyIdParentLink(keyId);
762
- const siblingsLink = getAuthKeyIdSiblingsLink(keyId);
763
- return (index.h(BasicExtension, { extension: extension },
764
- index.h(RowValue, { name: "Key ID", value: keyId, monospace: true, extraValue: [
765
- parentLink && (index.h("span", null,
766
- "\u00A0[",
767
- index.h("peculiar-link", { href: parentLink }, "parents"),
768
- "]")),
769
- siblingsLink && (index.h("span", null,
770
- "\u00A0[",
771
- index.h("peculiar-link", { href: siblingsLink }, "siblings"),
772
- "]")),
773
- ] })));
774
- };
775
-
776
- /**
777
- * @license
778
- * Copyright (c) Peculiar Ventures, LLC.
779
- *
780
- * This source code is licensed under the MIT license found in the
781
- * LICENSE file in the root directory of this source tree.
782
- */
783
- const CRLDistributionPointsExtension = (props) => {
784
- const { extension } = props;
785
- return (index.h(BasicExtension, { extension: extension }, extension.value.map((point) => {
786
- var _a, _b;
787
- return ([
788
- (_a = point.distributionPoint) === null || _a === void 0 ? void 0 : _a.fullName.map((gn) => (index.h(GeneralNamePart, Object.assign({ generalName: gn }, props)))),
789
- (_b = point.cRLIssuer) === null || _b === void 0 ? void 0 : _b.map((gn) => (index.h(GeneralNamePart, Object.assign({ generalName: gn }, props)))),
790
- ]);
791
- })));
792
- };
793
-
794
- /**
795
- * @license
796
- * Copyright (c) Peculiar Ventures, LLC.
797
- *
798
- * This source code is licensed under the MIT license found in the
799
- * LICENSE file in the root directory of this source tree.
800
- */
801
- const InfoAccessSyntaxExtension = (props) => {
802
- const { extension } = props;
803
- return (index.h(BasicExtension, { extension: extension }, extension.value.map((description, arrayIndex) => ([
804
- index.h(RowValue, { name: `Description #${arrayIndex + 1}`, value: "" }),
805
- index.h(RowValue, { name: "Method", value: getStringByOID(description.accessMethod) }),
806
- index.h(GeneralNamePart, Object.assign({ generalName: description.accessLocation }, props)),
807
- ]))));
808
- };
809
-
810
- /**
811
- * @license
812
- * Copyright (c) Peculiar Ventures, LLC.
813
- *
814
- * This source code is licensed under the MIT license found in the
815
- * LICENSE file in the root directory of this source tree.
816
- */
817
- const SubjectAlternativeNameExtension = (props) => {
818
- const { extension } = props;
819
- return (index.h(BasicExtension, { extension: extension }, extension.value.map((gn) => (index.h(GeneralNamePart, Object.assign({ generalName: gn }, props))))));
820
- };
821
-
822
- /**
823
- * @license
824
- * Copyright (c) Peculiar Ventures, LLC.
825
- *
826
- * This source code is licensed under the MIT license found in the
827
- * LICENSE file in the root directory of this source tree.
828
- */
829
- const CertificatePoliciesExtension = (props) => {
830
- const { extension } = props;
831
- return (index.h(BasicExtension, { extension: extension }, extension.value.map((policy, arrayIndex) => {
832
- var _a;
833
- return ([
834
- index.h(RowValue, { name: `Policy #${arrayIndex + 1}`, value: "" }),
835
- index.h(RowValue, { name: "ID", value: getStringByOID(policy.policyIdentifier) }),
836
- (_a = policy.policyQualifiers) === null || _a === void 0 ? void 0 : _a.map((qualifierInfo, indexInfo) => {
837
- const data = [
838
- index.h(RowValue, { name: `Qualifier #${arrayIndex + 1}.${indexInfo + 1}`, value: "" }),
839
- index.h(RowValue, { name: "ID", value: getStringByOID(qualifierInfo.policyQualifierId) }),
840
- ];
841
- if (qualifierInfo.policyQualifierId === '1.3.6.1.5.5.7.2.1') {
842
- const value = certification_request.AsnParser.parse(qualifierInfo.qualifier, certification_request.DisplayText);
843
- data.push(index.h(RowValue, { name: "Value", value: value.toString() }));
844
- }
845
- if (qualifierInfo.policyQualifierId === '1.3.6.1.5.5.7.2.2') {
846
- const value = certification_request.AsnParser.parse(qualifierInfo.qualifier, certification_request.UserNotice);
847
- if (value.explicitText) {
848
- data.push(index.h(RowValue, { name: "Value", value: value.explicitText.toString() }));
849
- }
850
- }
851
- return data;
852
- }),
853
- ]);
854
- })));
855
- };
856
-
857
- /**
858
- * @license
859
- * Copyright (c) Peculiar Ventures, LLC.
860
- *
861
- * This source code is licensed under the MIT license found in the
862
- * LICENSE file in the root directory of this source tree.
863
- */
864
- const logs = {
865
- '9606c02c690033aa1d145f59c6e2648d0549f0df96aab8db915a70d8ecf390a5': 'Akamai CT',
866
- '39376f545f7b4607f59742d768cd5d2437bf3473b6534a4834bcf72e681c83c9': 'Alpha CT',
867
- a577ac9ced7548dd8f025b67a241089df86e0f476ec203c2ecbedb185f282638: 'CNNIC CT',
868
- cdb5179b7fc1c046feea31136a3f8f002e6182faf8896fecc8b2f5b5ab604900: 'Certly.IO',
869
- '1fbc36e002ede97f40199e86b3573b8a4217d80187746ad0da03a06054d20df4': 'Cloudflare “Nimbus2017”',
870
- db74afeecb29ecb1feca3e716d2ce5b9aabb36f7847183c75d9d4f37b61fbf64: 'Cloudflare “Nimbus2018”',
871
- '747eda8331ad331091219cce254f4270c2bffd5e422008c6373579e6107bcc56': 'Cloudflare “Nimbus2019”',
872
- '5ea773f9df56c0e7b536487dd049e0327a919a0c84a112128418759681714558': 'Cloudflare “Nimbus2020”',
873
- '4494652eb0eeceafc44007d8a8fe28c0dae682bed8cb31b53fd33396b5b681a8': 'Cloudflare “Nimbus2021”',
874
- '41c8cab1df22464a10c6a13a0942875e4e318b1b03ebeb4bc768f090629606f6': 'Cloudflare “Nimbus2022”',
875
- '7a328c54d8b72db620ea38e0521ee98416703213854d3bd22bc13a57a352eb52': 'Cloudflare “Nimbus2023”',
876
- '6ff141b5647e4222f7ef052cefae7c21fd608e27d2af5a6e9f4b8a37d6633ee5': 'DigiCert Nessie2018',
877
- fe446108b1d01ab78a62ccfeab6ab2b2babff3abdad80a4d8b30df2d0008830c: 'DigiCert Nessie2019',
878
- c652a0ec48ceb3fcab170992c43a87413309e80065a26252401ba3362a17c565: 'DigiCert Nessie2020',
879
- eec095ee8d72640f92e3c3b91bc712a3696a097b4b6a1a1438e647b2cbedc5f9: 'DigiCert Nessie2021',
880
- '51a3b0f5fd01799c566db837788f0ca47acc1b27cbf79e88429a0dfed48b05e5': 'DigiCert Nessie2022',
881
- b3737707e18450f86386d605a9dc11094a792db1670c0b87dcf0030e7936a59a: 'DigiCert Nessie2023',
882
- '5614069a2fd7c2ecd3f5e1bd44b23ec74676b9bc99115cc0ef949855d689d0dd': 'DigiCert Server',
883
- '8775bfe7597cf88c43995fbdf36eff568d475636ff4ab560c1b4eaff5ea0830f': 'DigiCert Server 2',
884
- c1164ae0a772d2d4392dc80ac10770d4f0c49bde991a4840c1fa075164f63360: 'DigiCert Yeti2018',
885
- e2694bae26e8e94009e8861bb63b83d43ee7fe7488fba48f2893019dddf1dbfe: 'DigiCert Yeti2019',
886
- f095a459f200d18240102d2f93888ead4bfe1d47e399e1d034a6b0a8aa8eb273: 'DigiCert Yeti2020',
887
- '5cdc4392fee6ab4544b15e9ad456e61037fbd5fa47dca17394b25ee6f6c70eca': 'DigiCert Yeti2021',
888
- '2245450759552456963fa12ff1f76d86e0232663adc04b7f5dc6835c6ee20f02': 'DigiCert Yeti2022',
889
- '35cf191bbfb16c57bf0fad4c6d42cbbbb627202651ea3fe12aefa803c33bd64c': 'DigiCert Yeti2023',
890
- '717ea7420975be84a2723553f1777c26dd51af4e102144094d9019b462fb6668': 'GDCA 1',
891
- '14308d90ccd030135005c01ca526d81e84e87624e39b6248e08f724aea3bb42a': 'GDCA 2',
892
- c9cf890a21109c666cc17a3ed065c930d0e0135a9feba85af14210b8072421aa: 'GDCA CT #1',
893
- '924a30f909336ff435d6993a10ac75a2c641728e7fc2d659ae6188ffad40ce01': 'GDCA CT #2',
894
- fad4c97cc49ee2f8ac85c5ea5cea09d0220dbbf4e49c6b50662ff868f86b8c28: 'Google “Argon2017”',
895
- a4501269055a15545e6211ab37bc103f62ae5576a45e4b1714453e1b22106a25: 'Google “Argon2018”',
896
- '63f2dbcde83bcc2ccf0b728427576b33a48d61778fbd75a638b1c768544bd88d': 'Google “Argon2019”',
897
- b21e05cc8ba2cd8a204e8766f92bb98a2520676bdafa70e7b249532def8b905e: 'Google “Argon2020”',
898
- f65c942fd1773022145418083094568ee34d131933bfdf0c2f200bcc4ef164e3: 'Google “Argon2021”',
899
- '2979bef09e393921f056739f63a577e5be577d9c600af8f94d5d265c255dc784': 'Google “Argon2022”',
900
- '68f698f81f6482be3a8ceeb9281d4cfc71515d6793d444d10a67acbb4f4ffbc4': 'Google “Aviator”',
901
- c3bf03a7e1ca8841c607bae3ff4270fca5ec45b186ebbe4e2cf3fc778630f5f6: 'Google “Crucible”',
902
- '1d024b8eb1498b344dfd87ea3efc0996f7506f235d1d497061a4773c439c25fb': 'Google “Daedalus”',
903
- '293c519654c83965baaa50fc5807d4b76fbf587a2972dca4c30cf4e54547f478': 'Google “Icarus”',
904
- a4b90990b418581487bb13a2cc67700a3c359804f91bdfb8e377cd0ec80ddc10: 'Google “Pilot”',
905
- ee4bbdb775ce60bae142691fabe19e66a30f7e5fb072d88300c47b897aa8fdcb: 'Google “Rocketeer”',
906
- bbd9dfbc1f8a71b593942397aa927b473857950aab52e81a909664368e1ed185: 'Google “Skydiver”',
907
- '52eb4b225ec896974850675f23e43bc1d021e3214ce52ecd5fa87c203cdfca03': 'Google “Solera2018”',
908
- '0b760e9a8b9a682f88985b15e947501a56446bba8830785c3842994386450c00': 'Google “Solera2019”',
909
- '1fc72ce5a1b799f400c359bff96ca3913548e8644220610952e9ba1774f7bac7': 'Google “Solera2020”',
910
- a3c99845e80ab7ce00157b3742df0207dd272b2b602ecf98ee2c12db9c5ae7e7: 'Google “Solera2021”',
911
- '697aafca1a6b536fae21205046debad7e0eaea13d2432e6e9d8fb379f2b9aaf3': 'Google “Solera2022”',
912
- a899d8780c9290aaf462f31880ccfbd52451e970d0fbf591ef75b0d99b645681: 'Google “Submariner”',
913
- b0cc83e5a5f97d6baf7c09cc284904872ac7e88b132c6350b7c6fd26e16c6c77: 'Google “Testtube”',
914
- b10cd559a6d67846811f7df9a51532739ac48d703bea0323da5d38755bc0ad4e: 'Google “Xenon2018”',
915
- '084114980071532c16190460bcfc47fdc2653afa292c72b37ff863ae29ccc9f0': 'Google “Xenon2019”',
916
- '07b75c1be57d68fff1b0c61d2315c7bae6577c5794b76aeebc613a1a69d3a21c': 'Google “Xenon2020”',
917
- '7d3ef2f88fff88556824c2c0ca9e5289792bc50e78097f2e6a9768997e22f0d7': 'Google “Xenon2021”',
918
- '46a555eb75fa912030b5a28969f4f37d112c4174befd49b885abf2fc70fe6d47': 'Google “Xenon2022”',
919
- '7461b4a09cfb3d41d75159575b2e7649a445a8d27709b0cc564a6482b7eb41a3': 'Izenpe',
920
- '8941449c70742e06b9fc9ce7b116ba0024aa36d59af44f0204404f00f7ea8566': 'Izenpe “Argi”',
921
- '296afa2d568bca0d2ea844956ae9721fc35fa355ecda99693aafd458a71aefdd': 'Let“s Encrypt ”Clicky”',
922
- '537b69a3564335a9c04904e39593b2c298eb8d7a6e83023635c627248cd6b440': 'Nordu “flimsy”',
923
- aae70b7f3cb8d566c86c2f16979c9f445f69ab0eb4535589b2f77a030104f3cd: 'Nordu “plausible”',
924
- e0127629e90496564e3d0147984498aa48f8adb16600eb7902a1ef9909906273: 'PuChuangSiDa CT',
925
- cf55e28923497c340d5206d05353aeb25834b52f1f8dc9526809f212efdd7ca6: 'SHECA CT 1',
926
- '32dc59c2d4c41968d56e14bc61ac8f0e45db39faf3c155aa4252f5001fa0c623': 'SHECA CT 2',
927
- db76fdadac65e7d09508886e2159bd8b90352f5fead3e3dc5e22eb350acc7b98: 'Sectigo (Comodo) “Dodo” CT',
928
- '6f5376ac31f03119d89900a45115ff77151c11d902c10029068db2089a37d913': 'Sectigo (Comodo) “Mammoth” CT',
929
- '5581d4c2169036014aea0b9b573c53f0c0e43878702508172fa3aa1d0713d30c': 'Sectigo (Comodo) “Sabre” CT',
930
- '34bb6ad6c3df9c03eea8a499ff7891486c9d5e5cac92d01f7bfd1bce19db48ef': 'StartCom',
931
- ddeb1d2b7a0d4fa6208b81ad8168707e2e8e9d01d55c888d3d11c4cdb6ecbecc: 'Symantec',
932
- a7ce4a4e6207e0addee5fdaa4b1f86768767b5d002a55d47310e7e670a95eab2: 'Symantec Deneb',
933
- '15970488d7b997a05beb52512adee8d2e8b4a3165264121a9fabfbd5f85ad93f': 'Symantec “Sirius”',
934
- bc78e1dfc5f63c684649334da10fa15f0979692009c081b4f3f6917f3ed9b8a5: 'Symantec “Vega”',
935
- b0b784bc81c0ddc47544e883f05985bb9077d134d8ab88b2b2e533980b8e508b: 'Up In The Air “Behind the Sofa”',
936
- ac3b9aed7fa9674757159e6d7d575672f9d98100941e9bdeffeca1313b75782d: 'Venafi',
937
- '03019df3fd85a69a8ebd1facc6da9ba73e469774fe77f579fc5a08b8328c1d6b': 'Venafi Gen2 CT',
938
- '41b2dc2e89e63ce4af1ba7bb29bf68c6dee6f9f1cc047e30dffae3b3ba259263': 'WoSign',
939
- '63d0006026dde10bb0601f452446965ee2b6ea2cd4fbc95ac866a550af9075b7': 'WoSign 2',
940
- '9e4ff73dc3ce220b69217c899e468076abf8d78636d5ccfc85a31a75628ba88b': 'WoSign CT #1',
941
- };
942
-
943
- /**
944
- * @license
945
- * Copyright (c) Peculiar Ventures, LLC.
946
- *
947
- * This source code is licensed under the MIT license found in the
948
- * LICENSE file in the root directory of this source tree.
949
- */
950
- const CertificateTransparencyExtension = (props) => {
951
- const { extension } = props;
952
- return (index.h(BasicExtension, { extension: extension }, extension.value.toJSON().map((signedCertificateTimestamp, arrayIndex) => ([
953
- index.h(RowValue, { name: `SCT #${arrayIndex + 1}`, value: "" }),
954
- index.h(RowValue, { name: "Version", value: signedCertificateTimestamp.version + 1 }),
955
- index.h(RowValue, { name: "Log Operator", value: logs[signedCertificateTimestamp.logId] || signedCertificateTimestamp.logId }),
956
- index.h(RowValue, { name: "Log Key ID", value: signedCertificateTimestamp.logId, monospace: true }),
957
- index.h(RowValue, { name: "Timestamp", value: l10n.dateShort(signedCertificateTimestamp.timestamp) }),
958
- index.h(RowValue, { name: "Signature Algorithm", value: `${signedCertificateTimestamp.hashAlgorithm} ${signedCertificateTimestamp.signatureAlgorithm}`.toUpperCase() }),
959
- index.h(RowValue, { name: "Signature", value: signedCertificateTimestamp.signature, monospace: true }),
960
- ]))));
961
- };
962
-
963
- /**
964
- * @license
965
- * Copyright (c) Peculiar Ventures, LLC.
966
- *
967
- * This source code is licensed under the MIT license found in the
968
- * LICENSE file in the root directory of this source tree.
969
- */
970
- const NameConstraintsExtension = (props) => {
971
- var _a, _b;
972
- const { extension } = props;
973
- return (index.h(BasicExtension, { extension: extension }, (_a = extension.value.excludedSubtrees) === null || _a === void 0 ? void 0 :
974
- _a.map((generalSubtree) => (index.h(GeneralNamePart, Object.assign({ generalName: generalSubtree.base }, props)))), (_b = extension.value.permittedSubtrees) === null || _b === void 0 ? void 0 :
975
- _b.map((generalSubtree) => (index.h(GeneralNamePart, Object.assign({ generalName: generalSubtree.base }, props))))));
976
- };
977
-
978
- /**
979
- * @license
980
- * Copyright (c) Peculiar Ventures, LLC.
981
- *
982
- * This source code is licensed under the MIT license found in the
983
- * LICENSE file in the root directory of this source tree.
984
- */
985
- const CertificateTemplateExtension = (props) => {
986
- const { extension } = props;
987
- return (index.h(BasicExtension, { extension: extension },
988
- index.h(RowValue, { name: "Template ID", value: extension.value.templateID }),
989
- index.h(RowValue, { name: "Template Major Version", value: extension.value.templateMajorVersion }),
990
- index.h(RowValue, { name: "Template Minor Version", value: extension.value.templateMinorVersion })));
991
- };
992
-
993
- /**
994
- * @license
995
- * Copyright (c) Peculiar Ventures, LLC.
996
- *
997
- * This source code is licensed under the MIT license found in the
998
- * LICENSE file in the root directory of this source tree.
999
- */
1000
- const EnrollCertTypeChoiceExtension = (props) => {
1001
- const { extension } = props;
1002
- return (index.h(BasicExtension, { extension: extension },
1003
- index.h(RowValue, { name: "Name", value: extension.value.toString() })));
1004
- };
1005
-
1006
- /**
1007
- * @license
1008
- * Copyright (c) Peculiar Ventures, LLC.
1009
- *
1010
- * This source code is licensed under the MIT license found in the
1011
- * LICENSE file in the root directory of this source tree.
1012
- */
1013
- const CaVersionExtension = (props) => {
1014
- const { extension } = props;
1015
- const version = extension.value.getVersion();
1016
- return (index.h(BasicExtension, { extension: extension },
1017
- index.h(RowValue, { name: "Certificate Index", value: version.certificateIndex }),
1018
- index.h(RowValue, { name: "Key Index", value: version.keyIndex })));
1019
- };
1020
-
1021
- /**
1022
- * @license
1023
- * Copyright (c) Peculiar Ventures, LLC.
1024
- *
1025
- * This source code is licensed under the MIT license found in the
1026
- * LICENSE file in the root directory of this source tree.
1027
- */
1028
- const QCStatementsExtension = (props) => {
1029
- const { extension } = props;
1030
- return (index.h(BasicExtension, { extension: extension }, extension.value.map((statement, arrayIndex) => ([
1031
- index.h(RowValue, { name: `Statement #${arrayIndex + 1}`, value: "" }),
1032
- index.h(RowValue, { name: "ID", value: getStringByOID(statement.statementId) }),
1033
- index.h(RowValue, { name: "Info", value: statement.statementInfo.byteLength ? download.build.Convert.ToHex(statement.statementInfo) : null, monospace: true }),
1034
- ]))));
1035
- };
1036
-
1037
- /**
1038
- * @license
1039
- * Copyright (c) Peculiar Ventures, LLC.
1040
- *
1041
- * This source code is licensed under the MIT license found in the
1042
- * LICENSE file in the root directory of this source tree.
1043
- */
1044
- const NetscapeCommentExtension = (props) => {
1045
- const { extension } = props;
1046
- return (index.h(BasicExtension, { extension: extension },
1047
- index.h(RowValue, { name: "Comment", value: extension.value.value })));
1048
- };
1049
-
1050
- /**
1051
- * @license
1052
- * Copyright (c) Peculiar Ventures, LLC.
1053
- *
1054
- * This source code is licensed under the MIT license found in the
1055
- * LICENSE file in the root directory of this source tree.
1056
- */
1057
- const NetscapeCertTypeExtension = (props) => {
1058
- const { extension } = props;
1059
- return (index.h(BasicExtension, { extension: extension },
1060
- index.h(RowValue, { name: "Type", value: extension.value.toJSON().join(', ') })));
1061
- };
1062
-
1063
- /**
1064
- * @license
1065
- * Copyright (c) Peculiar Ventures, LLC.
1066
- *
1067
- * This source code is licensed under the MIT license found in the
1068
- * LICENSE file in the root directory of this source tree.
1069
- */
1070
- const LeiRoleExtension = (props) => {
1071
- const { extension } = props;
1072
- return (index.h(BasicExtension, { extension: extension },
1073
- index.h(RowValue, { name: "Role", value: extension.value.text })));
1074
- };
1075
-
1076
- /**
1077
- * @license
1078
- * Copyright (c) Peculiar Ventures, LLC.
1079
- *
1080
- * This source code is licensed under the MIT license found in the
1081
- * LICENSE file in the root directory of this source tree.
1082
- */
1083
- const LeiExtension = (props) => {
1084
- const { extension, getLEILink } = props;
1085
- return (index.h(BasicExtension, { extension: extension },
1086
- index.h(RowValue, { name: "Identifier", value: extension.value.text, href: getLEILink(extension.value.text) })));
1087
- };
1088
-
1089
- /**
1090
- * @license
1091
- * Copyright (c) Peculiar Ventures, LLC.
1092
- *
1093
- * This source code is licensed under the MIT license found in the
1094
- * LICENSE file in the root directory of this source tree.
1095
- */
1096
- const TimestampExtension = (props) => {
1097
- const { extension } = props;
1098
- return (index.h(BasicExtension, { extension: extension },
1099
- index.h(RowValue, { name: "Version", value: extension.value.version }),
1100
- index.h(GeneralNamePart, Object.assign({ generalName: extension.value.location }, props)),
1101
- index.h(RowValue, { name: "Requires Auth", value: extension.value.requiresAuth ? 'YES' : 'NO' })));
1102
- };
1103
-
1104
- /**
1105
- * @license
1106
- * Copyright (c) Peculiar Ventures, LLC.
1107
- *
1108
- * This source code is licensed under the MIT license found in the
1109
- * LICENSE file in the root directory of this source tree.
1110
- */
1111
- const ArchiveRevInfoExtension = (props) => {
1112
- const { extension } = props;
1113
- return (index.h(BasicExtension, { extension: extension },
1114
- index.h(RowValue, { name: "Version", value: extension.value.version })));
1115
- };
1116
-
1117
- /**
1118
- * @license
1119
- * Copyright (c) Peculiar Ventures, LLC.
1120
- *
1121
- * This source code is licensed under the MIT license found in the
1122
- * LICENSE file in the root directory of this source tree.
1123
- */
1124
- const CRLReasonExtension = (props) => {
1125
- const { extension } = props;
1126
- return (index.h(BasicExtension, { extension: extension },
1127
- index.h(RowValue, { name: "Reason", value: extension.value.toJSON() })));
1128
- };
1129
-
1130
- /**
1131
- * @license
1132
- * Copyright (c) Peculiar Ventures, LLC.
1133
- *
1134
- * This source code is licensed under the MIT license found in the
1135
- * LICENSE file in the root directory of this source tree.
1136
- */
1137
- function getAttributeValue(attribute) {
1138
- return download.build.Convert.ToString(attribute.values[0]);
1139
- }
1140
-
1141
- /**
1142
- * @license
1143
- * Copyright (c) Peculiar Ventures, LLC.
1144
- *
1145
- * This source code is licensed under the MIT license found in the
1146
- * LICENSE file in the root directory of this source tree.
1147
- */
1148
- const SubjectDirectoryAttributesExtension = (props) => {
1149
- const { extension } = props;
1150
- return (index.h(BasicExtension, { extension: extension }, extension.value.map((attribute, arrayIndex) => ([
1151
- index.h(RowValue, { name: `Attribute #${arrayIndex + 1}`, value: "" }),
1152
- index.h(RowValue, { name: "Type", value: getStringByOID(attribute.type) }),
1153
- index.h(RowValue, { name: "Value", value: getAttributeValue(attribute) }),
1154
- ]))));
1155
- };
1156
-
1157
- /**
1158
- * @license
1159
- * Copyright (c) Peculiar Ventures, LLC.
1160
- *
1161
- * This source code is licensed under the MIT license found in the
1162
- * LICENSE file in the root directory of this source tree.
1163
- */
1164
- const AsStringExtension = (props) => {
1165
- const { extension } = props;
1166
- return (index.h(BasicExtension, { extension: extension },
1167
- index.h(RowValue, { name: "Value", value: extension.value, monospace: true })));
1168
- };
1169
-
1170
- /**
1171
- * @license
1172
- * Copyright (c) Peculiar Ventures, LLC.
1173
- *
1174
- * This source code is licensed under the MIT license found in the
1175
- * LICENSE file in the root directory of this source tree.
1176
- */
1177
- const PrivateKeyUsagePeriodExtension = (props) => {
1178
- const { extension } = props;
1179
- return (index.h(BasicExtension, { extension: extension },
1180
- index.h(RowValue, { name: "Not Before", value: l10n.dateShort(extension.value.notBefore) }),
1181
- index.h(RowValue, { name: "Not After", value: l10n.dateShort(extension.value.notAfter) })));
1182
- };
1183
-
1184
- /**
1185
- * @license
1186
- * Copyright (c) Peculiar Ventures, LLC.
1187
- *
1188
- * This source code is licensed under the MIT license found in the
1189
- * LICENSE file in the root directory of this source tree.
1190
- */
1191
- const EntrustVersionInfoExtension = (props) => {
1192
- const { extension } = props;
1193
- return (index.h(BasicExtension, { extension: extension },
1194
- index.h(RowValue, { name: "Version", value: extension.value.entrustVers }),
1195
- index.h(RowValue, { name: "Info Flags", value: extension.value.entrustInfoFlags.toJSON().join(', ') })));
1196
- };
1197
-
1198
- /**
1199
- * @license
1200
- * Copyright (c) Peculiar Ventures, LLC.
1201
- *
1202
- * This source code is licensed under the MIT license found in the
1203
- * LICENSE file in the root directory of this source tree.
1204
- */
1205
- const BiometricSyntaxExtension = (props) => {
1206
- const { extension } = props;
1207
- return (index.h(BasicExtension, { extension: extension }, extension.value.map((data, arrayIndex) => ([
1208
- index.h(RowValue, { name: `Biometric #${arrayIndex + 1}`, value: "" }),
1209
- index.h(RowValue, { name: "OID", value: getStringByOID(data.typeOfBiometricData.biometricDataOid) }),
1210
- index.h(RowValue, { name: "Type", value: data.typeOfBiometricData.predefinedBiometricType }),
1211
- index.h(RowValue, { name: "Algorithm", value: getStringByOID(data.hashAlgorithm.algorithm) }),
1212
- index.h(RowValue, { name: "Hash", value: download.build.Convert.ToHex(data.biometricDataHash.buffer), monospace: true }),
1213
- index.h(RowValue, { name: "Source Uri", value: data.sourceDataUri }),
1214
- ]))));
1215
- };
1216
-
1217
- /**
1218
- * @license
1219
- * Copyright (c) Peculiar Ventures, LLC.
1220
- *
1221
- * This source code is licensed under the MIT license found in the
1222
- * LICENSE file in the root directory of this source tree.
1223
- */
1224
- const LogotypeExtension = (props) => {
1225
- const { extension } = props;
1226
- const renderImage = (image) => {
1227
- if (!image) {
1228
- return null;
1229
- }
1230
- return image.map((img) => {
1231
- const { imageDetails } = img;
1232
- return [
1233
- index.h(RowValue, { name: "Image Type", value: imageDetails.mediaType }),
1234
- index.h(RowValue, { name: "Image Hash", value: download.build.Convert.ToHex(imageDetails.logotypeHash[0].hashValue), monospace: true }),
1235
- index.h(RowValue, { name: "Image URL", value: imageDetails.logotypeURI[0], monospace: true, collapse: true }),
1236
- index.h(RowValue, { name: "Image Hash Algorithm", value: getStringByOID(imageDetails.logotypeHash[0].hashAlg.algorithm) }),
1237
- ];
1238
- });
1239
- };
1240
- const renderAudio = (audio) => {
1241
- if (!audio) {
1242
- return null;
1243
- }
1244
- return audio.map((aud) => {
1245
- const { audioDetails } = aud;
1246
- return [
1247
- index.h(RowValue, { name: "Audio Type", value: audioDetails.mediaType }),
1248
- index.h(RowValue, { name: "Audio Hash", value: download.build.Convert.ToHex(audioDetails.logotypeHash[0].hashValue), monospace: true }),
1249
- index.h(RowValue, { name: "Audio URL", value: audioDetails.logotypeURI[0], monospace: true, collapse: true }),
1250
- index.h(RowValue, { name: "Audio Hash Algorithm", value: getStringByOID(audioDetails.logotypeHash[0].hashAlg.algorithm) }),
1251
- ];
1252
- });
1253
- };
1254
- const renderLogo = (title, info) => {
1255
- if (!info || !info.direct) {
1256
- return null;
1257
- }
1258
- const { image, audio } = info.direct;
1259
- return [
1260
- index.h(RowValue, { name: "Type", value: title }),
1261
- renderImage(image),
1262
- renderAudio(audio),
1263
- index.h("tr", null,
1264
- index.h("td", null),
1265
- index.h("td", null)),
1266
- ];
1267
- };
1268
- return (index.h(BasicExtension, { extension: extension },
1269
- renderLogo('Subject', extension.value.subjectLogo),
1270
- renderLogo('Issuer', extension.value.issuerLogo)));
1271
- };
1272
-
1273
- /**
1274
- * @license
1275
- * Copyright (c) Peculiar Ventures, LLC.
1276
- *
1277
- * This source code is licensed under the MIT license found in the
1278
- * LICENSE file in the root directory of this source tree.
1279
- */
1280
- const TNAuthListExtension = (props) => {
1281
- const { extension } = props;
1282
- return (index.h(BasicExtension, { extension: extension }, extension.value.map((entry, arrayIndex) => ([
1283
- index.h(RowValue, { name: `Entry #${arrayIndex + 1}`, value: "" }),
1284
- index.h(RowValue, { name: "SPC", value: entry.spc }),
1285
- index.h(RowValue, { name: "Range", value: entry.range ? `start=${entry.range.start} count==${entry.range.count}` : null }),
1286
- index.h(RowValue, { name: "One", value: entry.one }),
1287
- ]))));
1288
- };
1289
-
1290
- /**
1291
- * @license
1292
- * Copyright (c) Peculiar Ventures, LLC.
1293
- *
1294
- * This source code is licensed under the MIT license found in the
1295
- * LICENSE file in the root directory of this source tree.
1296
- */
1297
- const PolicyConstraintsExtension = (props) => {
1298
- const { extension } = props;
1299
- return (index.h(BasicExtension, { extension: extension },
1300
- extension.value.requireExplicitPolicy && (index.h(RowValue, { name: "Require Explicit Policy", value: certification_request.AsnIntegerArrayBufferConverter.toASN(extension.value.requireExplicitPolicy).valueBlock.toString() })),
1301
- extension.value.inhibitPolicyMapping && (index.h(RowValue, { name: "Inhibit Policy Mapping", value: certification_request.AsnIntegerArrayBufferConverter.toASN(extension.value.inhibitPolicyMapping).valueBlock.toString() }))));
1302
- };
1303
-
1304
- /**
1305
- * @license
1306
- * Copyright (c) Peculiar Ventures, LLC.
1307
- *
1308
- * This source code is licensed under the MIT license found in the
1309
- * LICENSE file in the root directory of this source tree.
1310
- */
1311
- const PolicyMappingsExtension = (props) => {
1312
- const { extension } = props;
1313
- return (index.h(BasicExtension, { extension: extension }, extension.value.map((policy, arrayIndex) => ([
1314
- index.h(RowValue, { name: `Policy #${arrayIndex + 1}`, value: "" }),
1315
- index.h(RowValue, { name: "Issuer Domain", value: getStringByOID(policy.issuerDomainPolicy) }),
1316
- index.h(RowValue, { name: "Subject Domain", value: getStringByOID(policy.subjectDomainPolicy) }),
1317
- ]))));
1318
- };
1319
-
1320
- /**
1321
- * @license
1322
- * Copyright (c) Peculiar Ventures, LLC.
1323
- *
1324
- * This source code is licensed under the MIT license found in the
1325
- * LICENSE file in the root directory of this source tree.
1326
- */
1327
- const Extensions = (props) => {
1328
- const { extensions, title } = props;
1329
- if (!extensions || !extensions.length) {
1330
- return null;
1331
- }
1332
- return ([
1333
- index.h(RowTitle, { value: title || 'Extensions' }),
1334
- extensions.map((extension) => {
1335
- try {
1336
- if (extension.value instanceof certification_request.KeyUsage) {
1337
- return (index.h(KeyUsageExtension, { extension: extension }));
1338
- }
1339
- if (extension.value instanceof certification_request.BasicConstraints) {
1340
- return (index.h(BasicConstraintsExtension, { extension: extension }));
1341
- }
1342
- if (extension.value instanceof certification_request.ExtendedKeyUsage) {
1343
- return (index.h(ExtendedKeyUsageExtension, { extension: extension }));
1344
- }
1345
- if (extension.value instanceof certification_request.SubjectKeyIdentifier) {
1346
- return (index.h(SubjectKeyIdentifierExtension, Object.assign({ extension: extension }, props)));
1347
- }
1348
- if (extension.value instanceof certification_request.AuthorityKeyIdentifier) {
1349
- return (index.h(AuthorityKeyIdentifierExtension, Object.assign({ extension: extension }, props)));
1350
- }
1351
- if (extension.value instanceof certification_request.CRLDistributionPoints) {
1352
- return (index.h(CRLDistributionPointsExtension, Object.assign({ extension: extension }, props)));
1353
- }
1354
- if (extension.value instanceof certification_request.AuthorityInfoAccessSyntax
1355
- || extension.value instanceof certification_request.SubjectInfoAccessSyntax) {
1356
- return (index.h(InfoAccessSyntaxExtension, Object.assign({ extension: extension }, props)));
1357
- }
1358
- if (extension.value instanceof certification_request.SubjectAlternativeName) {
1359
- return (index.h(SubjectAlternativeNameExtension, Object.assign({ extension: extension }, props)));
1360
- }
1361
- if (extension.value instanceof certification_request.CertificatePolicies) {
1362
- return (index.h(CertificatePoliciesExtension, { extension: extension }));
1363
- }
1364
- if (extension.value instanceof certification_request.CertificateTransparency) {
1365
- return (index.h(CertificateTransparencyExtension, { extension: extension }));
1366
- }
1367
- if (extension.value instanceof certification_request.NameConstraints) {
1368
- return (index.h(NameConstraintsExtension, Object.assign({ extension: extension }, props)));
1369
- }
1370
- if (extension.value instanceof certification_request.CertificateTemplate) {
1371
- return (index.h(CertificateTemplateExtension, { extension: extension }));
1372
- }
1373
- if (extension.value instanceof certification_request.EnrollCertTypeChoice) {
1374
- return (index.h(EnrollCertTypeChoiceExtension, { extension: extension }));
1375
- }
1376
- if (extension.value instanceof certification_request.CaVersion) {
1377
- return (index.h(CaVersionExtension, { extension: extension }));
1378
- }
1379
- if (extension.value instanceof certification_request.QCStatements) {
1380
- return (index.h(QCStatementsExtension, { extension: extension }));
1381
- }
1382
- if (extension.value instanceof certification_request.NetscapeComment) {
1383
- return (index.h(NetscapeCommentExtension, { extension: extension }));
1384
- }
1385
- if (extension.value instanceof certification_request.NetscapeCertType) {
1386
- return (index.h(NetscapeCertTypeExtension, { extension: extension }));
1387
- }
1388
- if (extension.value instanceof certification_request.LeiRole) {
1389
- return (index.h(LeiRoleExtension, { extension: extension }));
1390
- }
1391
- if (extension.value instanceof certification_request.LeiChoice) {
1392
- return (index.h(LeiExtension, Object.assign({ extension: extension }, props)));
1393
- }
1394
- if (extension.value instanceof certification_request.Timestamp) {
1395
- return (index.h(TimestampExtension, Object.assign({ extension: extension }, props)));
1396
- }
1397
- if (extension.value instanceof certification_request.ArchiveRevInfo) {
1398
- return (index.h(ArchiveRevInfoExtension, { extension: extension }));
1399
- }
1400
- if (extension.value instanceof certification_request.CRLReason) {
1401
- return (index.h(CRLReasonExtension, { extension: extension }));
1402
- }
1403
- if (extension.value instanceof certification_request.SubjectDirectoryAttributes) {
1404
- return (index.h(SubjectDirectoryAttributesExtension, { extension: extension }));
1405
- }
1406
- if (extension.value instanceof certification_request.PrivateKeyUsagePeriod) {
1407
- return (index.h(PrivateKeyUsagePeriodExtension, { extension: extension }));
1408
- }
1409
- if (extension.value instanceof certification_request.EntrustVersionInfo) {
1410
- return (index.h(EntrustVersionInfoExtension, { extension: extension }));
1411
- }
1412
- if (extension.value instanceof certification_request.BiometricSyntax) {
1413
- return (index.h(BiometricSyntaxExtension, { extension: extension }));
1414
- }
1415
- if (extension.value instanceof certification_request.LogotypeExtn) {
1416
- return (index.h(LogotypeExtension, { extension: extension }));
1417
- }
1418
- if (extension.value instanceof certification_request.TNAuthorizationList) {
1419
- return (index.h(TNAuthListExtension, { extension: extension }));
1420
- }
1421
- if (extension.value instanceof certification_request.PolicyConstraints) {
1422
- return (index.h(PolicyConstraintsExtension, { extension: extension }));
1423
- }
1424
- if (extension.value instanceof certification_request.PolicyMappings) {
1425
- return (index.h(PolicyMappingsExtension, { extension: extension }));
1426
- }
1427
- if (typeof extension.value === 'string') {
1428
- return (index.h(AsStringExtension, { extension: extension }));
1429
- }
1430
- return (index.h(BasicExtension, { extension: extension }));
1431
- }
1432
- catch (error) {
1433
- console.error('Error render extension:', extension.asn.extnID);
1434
- return null;
1435
- }
1436
- }),
1437
- ]);
1438
- };
1439
-
1440
- /**
1441
- * @license
1442
- * Copyright (c) Peculiar Ventures, LLC.
1443
- *
1444
- * This source code is licensed under the MIT license found in the
1445
- * LICENSE file in the root directory of this source tree.
1446
- */
1447
- const BasicInformation = (props) => {
1448
- const { serialNumber, version, validity, notBefore, notAfter, type, } = props;
1449
- return [
1450
- index.h(RowTitle, { value: l10n.l10n.getString('basicInformation') }),
1451
- index.h(RowValue, { name: l10n.l10n.getString('type'), value: type }),
1452
- index.h(RowValue, { name: l10n.l10n.getString('serialNumber'), value: serialNumber, monospace: true }),
1453
- index.h(RowValue, { name: l10n.l10n.getString('version'), value: version }),
1454
- index.h(RowValue, { name: l10n.l10n.getString('validity'), value: validity }),
1455
- index.h(RowValue, { name: l10n.l10n.getString('issued'), value: notBefore ? l10n.dateShort(notBefore) : undefined }),
1456
- index.h(RowValue, { name: l10n.l10n.getString('expired'), value: notAfter ? l10n.dateShort(notAfter) : undefined }),
1457
- ];
1458
- };
1459
-
1460
- /**
1461
- * @license
1462
- * Copyright (c) Peculiar Ventures, LLC.
1463
- *
1464
- * This source code is licensed under the MIT license found in the
1465
- * LICENSE file in the root directory of this source tree.
1466
- */
1467
- function downloadCertificateAsPem(certificate) {
1468
- if (certificate instanceof CSR) {
1469
- download.Download.pkcs10.asPEM(certificate.exportAsPemFormatted(), certificate.commonName);
1470
- }
1471
- else {
1472
- download.Download.x509.asPEM(certificate.exportAsPemFormatted(), certificate.commonName);
1473
- }
1474
- }
1475
- function downloadCertificateAsDer(certificate) {
1476
- if (certificate instanceof CSR) {
1477
- download.Download.pkcs10.asDER(certificate.exportAsHexFormatted(), certificate.commonName);
1478
- }
1479
- else {
1480
- download.Download.x509.asDER(certificate.exportAsHexFormatted(), certificate.commonName);
1481
- }
1482
- }
1483
- const Miscellaneous = (props) => {
1484
- const { certificate } = props;
1485
- return [
1486
- index.h(RowTitle, { value: l10n.l10n.getString('miscellaneous') }),
1487
- index.h("tr", null,
1488
- index.h("td", { class: "vertical_align_middle" },
1489
- index.h("peculiar-typography", { color: "grey_5" },
1490
- l10n.l10n.getString('download'),
1491
- ":")),
1492
- index.h("td", null,
1493
- index.h("peculiar-button-split", { onClick: downloadCertificateAsPem.bind(undefined, certificate), actions: [{
1494
- text: l10n.l10n.getString('download.der'),
1495
- onClick: downloadCertificateAsDer.bind(undefined, certificate),
1496
- }] }, l10n.l10n.getString('download.pem')))),
1497
- ];
1498
- };
1499
-
1500
- /**
1501
- * @license
1502
- * Copyright (c) Peculiar Ventures, LLC.
1503
- *
1504
- * This source code is licensed under the MIT license found in the
1505
- * LICENSE file in the root directory of this source tree.
1506
- */
1507
- const getLEILink = (lei) => `https://search.gleif.org/#/record/${lei}`;
1508
- const getDNSNameLink = (dnsName) => `https://search.censys.io/search?resource=hosts&q=dns.names%3A${dnsName}`;
1509
- const getIPAddressLink = (ipAddress) => `https://search.censys.io/search?resource=hosts&q=ip%3A${ipAddress}`;
1510
-
1511
- /**
1512
- * @license
1513
- * Copyright (c) Peculiar Ventures, LLC.
1514
- *
1515
- * This source code is licensed under the MIT license found in the
1516
- * LICENSE file in the root directory of this source tree.
1517
- */
1518
- const Issuer = (props) => {
1519
- const { issuer } = props;
1520
- if (!issuer) {
1521
- return null;
1522
- }
1523
- return [
1524
- index.h(RowTitle, { value: l10n.l10n.getString('issuer') }),
1525
- issuer.map((item) => (index.h(GeneralNamePart, { generalName: item, getDNSNameLink: () => '', getIPAddressLink: () => '' }))),
1526
- ];
1527
- };
1528
-
1529
- /**
1530
- * @license
1531
- * Copyright (c) Peculiar Ventures, LLC.
1532
- *
1533
- * This source code is licensed under the MIT license found in the
1534
- * LICENSE file in the root directory of this source tree.
1535
- */
1536
- const Holder = (props) => {
1537
- const { holder } = props;
1538
- if (!holder) {
1539
- return null;
1540
- }
1541
- const { baseCertificateID, objectDigestInfo } = holder;
1542
- return [
1543
- index.h(RowTitle, { value: l10n.l10n.getString('holder') }),
1544
- baseCertificateID && ([
1545
- baseCertificateID.issuer.map((item) => (index.h(GeneralNamePart, { generalName: item, getDNSNameLink: () => '', getIPAddressLink: () => '' }))),
1546
- index.h("tr", null,
1547
- index.h("td", null),
1548
- index.h("td", null)),
1549
- index.h(RowValue, { name: l10n.l10n.getString('serialNumber'), value: download.build.Convert.ToHex(baseCertificateID.serial), monospace: true }),
1550
- index.h("tr", null,
1551
- index.h("td", null),
1552
- index.h("td", null)),
1553
- ]),
1554
- objectDigestInfo && ([
1555
- index.h(RowValue, { name: l10n.l10n.getString('digestInfo'), value: "" }),
1556
- index.h(RowValue, { name: l10n.l10n.getString('algorithm'), value: getStringByOID(objectDigestInfo.digestAlgorithm.algorithm) }),
1557
- index.h(RowValue, { name: l10n.l10n.getString('value'), value: download.build.Convert.ToHex(objectDigestInfo.objectDigest), monospace: true }),
1558
- index.h(RowValue, { name: l10n.l10n.getString('type'), value: objectDigestInfo.digestedObjectType }),
1559
- ]),
1560
- ];
1561
- };
1562
-
1563
- const certificateViewerCss$2 = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%;word-wrap:break-word;position:relative;min-width:280px;min-height:300px;background:white;background:rgba(var(--pv-color-light-rgb), 1)}th,td{border:none}table{width:100%;margin-bottom:30px;border-spacing:0;border-collapse:collapse}table .title td{border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5);padding-top:60px;padding-bottom:15px;border-bottom-width:1px;border-bottom-style:solid}table td:first-child{padding-left:30px;width:130px;padding-right:10px}table td:last-child{padding-right:30px;width:calc(100% - 130px)}table td{vertical-align:top;padding-top:5px;padding-bottom:5px}table td.vertical_align_middle{vertical-align:middle}table .title:first-child td{padding-top:15px}table .title+tr td{padding-top:15px}table td.monospace{max-width:0}table .divider{padding-top:15px;padding-bottom:15px}.divider .bg_fill{background-color:rgba(209, 213, 217, 0.5);background-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr:last-child .divider{padding-top:0;opacity:0}.divider span{display:block;height:1px}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.interaction_text{padding:15px 0;width:300px;margin:auto;text-align:center}@media (max-width: 900px){table,tr,td{display:block}table td:last-child,table td:first-child{padding-right:15px;padding-left:15px;width:100%}table .title+tr td{padding-top:5px}table .title+tr td:first-child{padding-top:15px}table td.monospace{width:100%;max-width:none}}:host([data-view=mobile]) table,:host([data-view=mobile]) tr,:host([data-view=mobile]) td{display:block}:host([data-view=mobile]) table td:last-child,:host([data-view=mobile]) table td:first-child{padding-right:15px;padding-left:15px;width:100%}:host([data-view=mobile]) table .title+tr td{padding-top:5px}:host([data-view=mobile]) table .title+tr td:first-child{padding-top:15px}:host([data-view=mobile]) table td.monospace{width:100%;max-width:none}";
1564
-
1565
- const AttributeCertificateViewer = class {
1566
- constructor(hostRef) {
1567
- index.registerInstance(this, hostRef);
1568
- this.isDecodeInProcess = true;
1569
- this.getAuthKeyIdParentLink = (value) => {
1570
- var _a;
1571
- return (_a = this.authKeyIdParentLink) === null || _a === void 0 ? void 0 : _a.replace('{{authKeyId}}', value);
1572
- };
1573
- this.getAuthKeyIdSiblingsLink = (value) => {
1574
- var _a;
1575
- return (_a = this.authKeyIdSiblingsLink) === null || _a === void 0 ? void 0 : _a.replace('{{authKeyId}}', value);
1576
- };
1577
- this.getSubjectKeyIdChildrenLink = (value) => {
1578
- var _a;
1579
- return (_a = this.subjectKeyIdChildrenLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
1580
- };
1581
- this.getSubjectKeyIdSiblingsLink = (value) => {
1582
- var _a;
1583
- return (_a = this.subjectKeyIdSiblingsLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
1584
- };
1585
- }
1586
- componentWillLoad() {
1587
- this.decodeCertificate(this.certificate);
1588
- }
1589
- async decodeCertificate(certificate) {
1590
- this.isDecodeInProcess = true;
1591
- try {
1592
- if (certificate instanceof X509AttributeCertificate) {
1593
- this.certificateDecoded = certificate;
1594
- }
1595
- else if (typeof certificate === 'string') {
1596
- this.certificateDecoded = new X509AttributeCertificate(certificate);
1597
- }
1598
- else {
1599
- return;
1600
- }
1601
- this.certificateDecoded.parseExtensions();
1602
- this.certificateDecoded.parseAttributes();
1603
- await this.certificateDecoded.getThumbprint('SHA-1');
1604
- await this.certificateDecoded.getThumbprint('SHA-256');
1605
- }
1606
- catch (error) {
1607
- this.certificateDecodeError = error;
1608
- console.error('Error certificate parse:', error);
1609
- }
1610
- this.isDecodeInProcess = false;
1611
- }
1612
- /**
1613
- * Rerun decodeCertificate if previuos value not equal current value
1614
- */
1615
- watchCertificateAndDecode(newValue, oldValue) {
1616
- if (typeof newValue === 'string' && typeof oldValue === 'string') {
1617
- if (newValue !== oldValue) {
1618
- this.decodeCertificate(newValue);
1619
- }
1620
- return;
1621
- }
1622
- if (newValue instanceof X509AttributeCertificate
1623
- && oldValue instanceof X509AttributeCertificate) {
1624
- if (newValue.serialNumber !== oldValue.serialNumber) {
1625
- this.decodeCertificate(newValue);
1626
- }
1627
- }
1628
- }
1629
- // eslint-disable-next-line class-methods-use-this
1630
- renderErrorState() {
1631
- return (index.h("div", { class: "status_wrapper" }, index.h("peculiar-typography", { type: "b1", class: "interaction_text" }, "There was an error decoding this attribute certificate.")));
1632
- }
1633
- // eslint-disable-next-line class-methods-use-this
1634
- renderEmptyState() {
1635
- return (index.h("div", { class: "status_wrapper" }, index.h("peculiar-typography", { type: "b1", class: "interaction_text" }, "There is no attribute certificate available.")));
1636
- }
1637
- render() {
1638
- if (this.certificateDecodeError) {
1639
- return this.renderErrorState();
1640
- }
1641
- if (!this.certificateDecoded) {
1642
- return this.renderEmptyState();
1643
- }
1644
- return (index.h(index.Host, null, index.h("table", null, index.h(BasicInformation, Object.assign({}, this.certificateDecoded)), index.h(Issuer, { issuer: this.certificateDecoded.issuer }), index.h(Holder, { holder: this.certificateDecoded.holder }), index.h(Signature, { signature: this.certificateDecoded.signature }), index.h(Thumbprints, { thumbprints: this.certificateDecoded.thumbprints }), index.h(Attributes, { attributes: this.certificateDecoded.attributes, getLEILink: getLEILink, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink, getAuthKeyIdParentLink: this.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink: this.getAuthKeyIdSiblingsLink, getSubjectKeyIdChildrenLink: this.getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink: this.getSubjectKeyIdSiblingsLink }), index.h(Extensions, { extensions: this.certificateDecoded.extensions, getLEILink: getLEILink, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink, getAuthKeyIdParentLink: this.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink: this.getAuthKeyIdSiblingsLink, getSubjectKeyIdChildrenLink: this.getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink: this.getSubjectKeyIdSiblingsLink }), this.download && (index.h(Miscellaneous, { certificate: this.certificateDecoded })))));
1645
- }
1646
- static get watchers() { return {
1647
- "certificate": ["watchCertificateAndDecode"]
1648
- }; }
1649
- };
1650
- AttributeCertificateViewer.style = certificateViewerCss$2;
1651
-
1652
- const buttonCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:inline-block;width:auto;cursor:pointer;position:relative;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-user-drag:none;-ms-content-zooming:none;word-wrap:break-word;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;--pv-button-padding-end:5px;--pv-button-padding-start:5px}.button{font-family:\"Open Sans\", \"Arial\", sans-serif;font-family:var(--pv-font-family);font-size:13px;font-size:var(--pv-font-size-b3);letter-spacing:0.03em;letter-spacing:var(--pv-letter-spacing-normal);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;border-style:solid;border-width:1px;font-weight:400;text-decoration:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;vertical-align:middle;cursor:inherit;height:30px;line-height:30px;border-radius:2px;padding:0 5px;padding:0 var(--pv-button-padding-end) 0 var(--pv-button-padding-start)}.button::-moz-focus-inner{border:0}.button:focus{outline:none;-webkit-box-shadow:0 4px 10px 0 rgba(var(--pv-color-dark-rgb), 0.1);box-shadow:0 4px 10px 0 rgba(var(--pv-color-dark-rgb), 0.1)}.button[disabled]{opacity:0.5;cursor:not-allowed}.button_stroke{border-color:rgba(53, 132, 247, 0.3);border-color:rgba(var(--pv-color-primary-rgb), 0.3);color:#3584f7;color:rgba(var(--pv-color-primary-rgb), 1);background-color:transparent}.button_fill{border-color:#3584f7;border-color:rgba(var(--pv-color-primary-rgb), 1);background-color:#3584f7;background-color:rgba(var(--pv-color-primary-rgb), 1);color:white;color:rgba(var(--pv-color-light-rgb), 1)}.button_label{-webkit-transition:opacity 200ms;transition:opacity 200ms}.button:hover .button_label{opacity:0.7}";
1653
-
1654
- const Button = class {
1655
- constructor(hostRef) {
1656
- index.registerInstance(this, hostRef);
1657
- this.fill = 'stroke';
1658
- this.handleClick = (event) => {
1659
- if (this.disabled) {
1660
- event.preventDefault();
1661
- event.stopPropagation();
1662
- return;
1663
- }
1664
- if (this.onClick) {
1665
- this.onClick(event);
1666
- }
1667
- };
1668
- }
1669
- render() {
1670
- const isLink = !!this.href;
1671
- const TagType = isLink ? 'a' : 'button';
1672
- return (index.h(TagType, { class: {
1673
- button: true,
1674
- button_stroke: this.fill === 'stroke',
1675
- button_fill: this.fill === 'fill',
1676
- button_disabled: this.disabled,
1677
- }, disabled: this.disabled, type: !isLink && 'button', href: isLink && this.href, target: isLink && this.target ? this.target : null, rel: isLink && 'noreferrer noopener', onClick: this.handleClick, part: "base" }, index.h("span", { part: "label", class: "button_label" }, index.h("slot", null))));
1678
- }
1679
- };
1680
- Button.style = buttonCss;
1681
-
1682
- const buttonSplitCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:inline-block;vertical-align:top;position:relative;white-space:nowrap;font-size:0}.button_split_icon{width:7px;height:5px;display:inline-block;vertical-align:middle}.button_split_with_icon{width:25px;border-bottom-left-radius:0;border-top-left-radius:0}.button_split_with_icon.m_open::part(base):before{position:fixed;width:100%;height:100%;top:0;left:0;content:\"\"}.button_split_action{width:100%}.button_split_container{position:absolute;bottom:calc(100% + 1px);left:0;width:100%;border-radius:2px;-webkit-box-shadow:0px -2px 1px rgb(var(--pv-color-light-rgb)), 0px 0px 10px rgba(var(--pv-color-dark-rgb), 0.0241168);box-shadow:0px -2px 1px rgb(var(--pv-color-light-rgb)), 0px 0px 10px rgba(var(--pv-color-dark-rgb), 0.0241168);z-index:1}.button_split>peculiar-button:first-of-type::part(base){border-top-right-radius:0;border-bottom-right-radius:0}.button_split>peculiar-button:last-of-type::part(base){border-top-left-radius:0;border-bottom-left-radius:0}.button_split>peculiar-button:not(:first-child){margin-left:-1px}";
1683
-
1684
- const ButtonSplit = class {
1685
- constructor(hostRef) {
1686
- index.registerInstance(this, hostRef);
1687
- this.fill = 'stroke';
1688
- this.actions = [];
1689
- this.open = false;
1690
- this.onClickSplitButton = (event) => {
1691
- event.stopPropagation();
1692
- this.open = !this.open;
1693
- };
1694
- }
1695
- onClickActiveButton(action, event) {
1696
- this.open = false;
1697
- action(event);
1698
- }
1699
- renderActiveSplitState() {
1700
- if (!this.open) {
1701
- return null;
1702
- }
1703
- return (index.h("div", { class: "button_split_container" }, this.actions.map((action) => (index.h("peculiar-button", { fill: "fill", class: "button_split_action", onClick: this.onClickActiveButton.bind(this, action.onClick) }, action.text)))));
1704
- }
1705
- render() {
1706
- return (index.h("div", { class: {
1707
- button_split: true,
1708
- } }, index.h("peculiar-button", { fill: this.fill, onClick: this.onClick }, index.h("slot", null)), index.h("peculiar-button", { fill: this.fill, onClick: this.onClickSplitButton, class: {
1709
- button_split_with_icon: true,
1710
- m_open: this.open,
1711
- } }, index.h("svg", { viewBox: "0 0 7 5", xmlns: "http://www.w3.org/2000/svg", class: "button_split_icon" }, index.h("path", { fill: "currentColor", "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M5.459.124c.934.001 1.442.994.84 1.644L4.425 3.794c-.44.475-1.244.475-1.684 0L.862 1.764C.26 1.115.77.12 1.705.122l3.754.003z" }))), this.renderActiveSplitState()));
1712
- }
1713
- };
1714
- ButtonSplit.style = buttonSplitCss;
1715
-
1716
- const certificateDecoderCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-user-drag:none;-ms-content-zooming:none;word-wrap:break-word;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;display:block;width:100%;font-size:0}.textarea{min-height:300px;width:100%;border-radius:3px;border-width:1px;border-style:solid;padding:14px;font-family:monospace;resize:vertical;background-color:white;background-color:rgba(var(--pv-color-light-rgb), 1);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);color:#2a3134;color:rgba(var(--pv-color-dark-rgb), 1);letter-spacing:0.03em;letter-spacing:var(--pv-letter-spacing-normal);font-size:14px;font-size:var(--pv-font-size-h7)}.controls{margin-top:10px}.button{position:relative}.button:not(:first-child){margin-left:10px}.viewer{margin-top:64px}.input_file{opacity:0;width:100%;height:100%;top:0;left:0;display:block;position:absolute}";
1717
-
1718
- const CertificateDecoder = class {
1719
- constructor(hostRef) {
1720
- index.registerInstance(this, hostRef);
1721
- this.onClickDecode = () => {
1722
- const { value } = this.inputPaste;
1723
- if (value) {
1724
- this.decode(value);
1725
- }
1726
- };
1727
- this.onClickExample = () => {
1728
- this.decode(this.certificateExample);
1729
- };
1730
- this.onClickClear = () => {
1731
- this.clearValue();
1732
- };
1733
- this.onChangeInputFile = async (e) => {
1734
- const element = e.target;
1735
- if (element.files) {
1736
- const file = await readAsBinaryString(element.files[0]);
1737
- if (typeof file.value === 'string') {
1738
- this.decode(file.value);
1739
- }
1740
- element.value = '';
1741
- }
1742
- };
1743
- this.onDropFile = async (e) => {
1744
- e.stopPropagation();
1745
- e.preventDefault();
1746
- const element = e.dataTransfer;
1747
- if (element.files) {
1748
- const file = await readAsBinaryString(element.files[0]);
1749
- if (typeof file.value === 'string') {
1750
- this.decode(file.value);
1751
- }
1752
- }
1753
- };
1754
- }
1755
- componentDidLoad() {
1756
- const parsedHash = l10n.history.parseHash(window.location.search);
1757
- if (parsedHash.cert) {
1758
- /**
1759
- * Prevent Stencil warning about re-render
1760
- */
1761
- setTimeout(() => this.decode(parsedHash.cert), 100);
1762
- }
1763
- }
1764
- clearValue() {
1765
- this.inputPaste.value = '';
1766
- this.certificateDecoded = null;
1767
- l10n.history.replace({ search: '' });
1768
- }
1769
- setValue(value) {
1770
- this.certificateDecoded = value;
1771
- this.inputPaste.value = value.exportAsPemFormatted();
1772
- l10n.history.replace({
1773
- search: l10n.history.queryStringify({
1774
- cert: value.exportAsBase64(),
1775
- }),
1776
- });
1777
- }
1778
- decode(certificate) {
1779
- const isPem = certification_request.isPem(certificate);
1780
- const isX509Pem = certification_request.isX509Pem(certificate);
1781
- const isPkcs10Pem = certification_request.isPkcs10Pem(certificate);
1782
- const isX509AttributePem = certification_request.isX509AttributePem(certificate);
1783
- let decoded;
1784
- let decodeError;
1785
- if (isPem && !(isX509Pem || isX509AttributePem || isPkcs10Pem)) {
1786
- this.clearValue();
1787
- alert('Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest.');
1788
- return;
1789
- }
1790
- try {
1791
- if (isX509Pem) {
1792
- decoded = new certification_request.X509Certificate(certificate);
1793
- }
1794
- if (isX509AttributePem) {
1795
- decoded = new X509AttributeCertificate(certificate);
1796
- }
1797
- if (isPkcs10Pem) {
1798
- decoded = new CSR(certificate);
1799
- }
1800
- }
1801
- catch (error) {
1802
- decodeError = error;
1803
- }
1804
- if (!decoded) {
1805
- try {
1806
- decoded = new certification_request.X509Certificate(certificate);
1807
- }
1808
- catch (error) {
1809
- decodeError = error;
1810
- }
1811
- }
1812
- if (!decoded) {
1813
- try {
1814
- decoded = new X509AttributeCertificate(certificate);
1815
- }
1816
- catch (error) {
1817
- decodeError = error;
1818
- }
1819
- }
1820
- if (!decoded) {
1821
- try {
1822
- decoded = new CSR(certificate);
1823
- }
1824
- catch (error) {
1825
- decodeError = error;
1826
- }
1827
- }
1828
- if (!decoded) {
1829
- this.clearValue();
1830
- console.log(decodeError);
1831
- alert('Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest.');
1832
- }
1833
- else {
1834
- this.setValue(decoded);
1835
- }
1836
- }
1837
- render() {
1838
- return (index.h(index.Host, null, index.h("textarea", { placeholder: "Certificate DER or PEM", class: "textarea", ref: (el) => { this.inputPaste = el; }, onDrop: this.onDropFile }), index.h("div", { class: "controls" }, index.h("peculiar-button", { fill: "fill", class: "button", onClick: this.onClickDecode }, "Decode"), index.h("peculiar-button", { class: "button" }, "Choose file", index.h("input", { type: "file", class: "input_file", accept: "application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,.csr,.req", onChange: this.onChangeInputFile, value: "" })), index.h("peculiar-button", { class: "button", onClick: this.onClickClear }, "Clear"), this.certificateExample && (index.h("peculiar-button", { class: "button", onClick: this.onClickExample }, "Example"))), this.certificateDecoded instanceof certification_request.X509Certificate && (index.h("peculiar-certificate-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })), this.certificateDecoded instanceof X509AttributeCertificate && (index.h("peculiar-attribute-certificate-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })), this.certificateDecoded instanceof CSR && (index.h("peculiar-csr-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true }))));
1839
- }
1840
- };
1841
- CertificateDecoder.style = certificateDecoderCss;
1842
-
1843
- /**
1844
- * @license
1845
- * Copyright (c) Peculiar Ventures, LLC.
1846
- *
1847
- * This source code is licensed under the MIT license found in the
1848
- * LICENSE file in the root directory of this source tree.
1849
- */
1850
- function getPublicKeyModulus(publicKey) {
1851
- var _a;
1852
- if ((_a = publicKey.params) === null || _a === void 0 ? void 0 : _a['modulus']) {
1853
- let length = publicKey.params['modulus'].byteLength;
1854
- if (length % 2) {
1855
- length -= 1;
1856
- }
1857
- return length * 8;
1858
- }
1859
- return null;
1860
- }
1861
- function getPublicKeyExponent(publicKey) {
1862
- var _a;
1863
- if ((_a = publicKey.params) === null || _a === void 0 ? void 0 : _a['publicExponent']) {
1864
- return publicKey.params['publicExponent'].byteLength === 3
1865
- ? 65537
1866
- : 3;
1867
- }
1868
- return null;
1869
- }
1870
- const PublicKey = (props) => {
1871
- var _a;
1872
- const { publicKey } = props;
1873
- if (!publicKey) {
1874
- return null;
1875
- }
1876
- return [
1877
- index.h(RowTitle, { value: l10n.l10n.getString('publicKeyInfo') }),
1878
- index.h(RowValue, { name: l10n.l10n.getString('algorithm'), value: getStringByOID(publicKey.algorithm) }),
1879
- index.h(RowValue, { name: l10n.l10n.getString('namedCurve'), value: getStringByOID((_a = publicKey.params) === null || _a === void 0 ? void 0 : _a['namedCurve']) }),
1880
- index.h(RowValue, { name: l10n.l10n.getString('exponent'), value: getPublicKeyExponent(publicKey) }),
1881
- index.h(RowValue, { name: l10n.l10n.getString('modulus'), value: getPublicKeyModulus(publicKey) }),
1882
- index.h(RowValue, { name: l10n.l10n.getString('value'), value: download.build.Convert.ToHex(publicKey.value), monospace: true, collapse: true }),
1883
- ];
1884
- };
1885
-
1886
- /**
1887
- * @license
1888
- * Copyright (c) Peculiar Ventures, LLC.
1889
- *
1890
- * This source code is licensed under the MIT license found in the
1891
- * LICENSE file in the root directory of this source tree.
1892
- */
1893
- const SubjectName = (props) => {
1894
- const { name } = props;
1895
- return [
1896
- index.h(RowTitle, { value: l10n.l10n.getString('subjectName') }),
1897
- name.map((n) => (index.h(RowValue, { name: n.name || n.type, value: n.value }))),
1898
- ];
1899
- };
1900
-
1901
- /**
1902
- * @license
1903
- * Copyright (c) Peculiar Ventures, LLC.
1904
- *
1905
- * This source code is licensed under the MIT license found in the
1906
- * LICENSE file in the root directory of this source tree.
1907
- */
1908
- const IssuerName = (props) => {
1909
- const { name, issuerDnLink } = props;
1910
- const title = l10n.l10n.getString('issuerName');
1911
- return [
1912
- index.h(RowTitle, { value: issuerDnLink ? (index.h("peculiar-link", { href: issuerDnLink, type: "h6" }, title)) : title }),
1913
- name.map((n) => (index.h(RowValue, { name: n.name || n.type, value: n.value }))),
1914
- ];
1915
- };
1916
-
1917
- const certificateViewerCss$1 = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%;word-wrap:break-word;position:relative;min-width:280px;min-height:300px;background:white;background:rgba(var(--pv-color-light-rgb), 1)}th,td{border:none}table{width:100%;margin-bottom:30px;border-spacing:0;border-collapse:collapse}table .title td{border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5);padding-top:60px;padding-bottom:15px;border-bottom-width:1px;border-bottom-style:solid}table td:first-child{padding-left:30px;width:130px;padding-right:10px}table td:last-child{padding-right:30px;width:calc(100% - 130px)}table td{vertical-align:top;padding-top:5px;padding-bottom:5px}table td.vertical_align_middle{vertical-align:middle}table .title:first-child td{padding-top:15px}table .title+tr td{padding-top:15px}table td.monospace{max-width:0}table .divider{padding-top:15px;padding-bottom:15px}.divider .bg_fill{background-color:rgba(209, 213, 217, 0.5);background-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr:last-child .divider{padding-top:0;opacity:0}.divider span{display:block;height:1px}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.interaction_text{padding:15px 0;width:300px;margin:auto;text-align:center}@media (max-width: 900px){table,tr,td{display:block}table td:last-child,table td:first-child{padding-right:15px;padding-left:15px;width:100%}table .title+tr td{padding-top:5px}table .title+tr td:first-child{padding-top:15px}table td.monospace{width:100%;max-width:none}}:host([data-view=mobile]) table,:host([data-view=mobile]) tr,:host([data-view=mobile]) td{display:block}:host([data-view=mobile]) table td:last-child,:host([data-view=mobile]) table td:first-child{padding-right:15px;padding-left:15px;width:100%}:host([data-view=mobile]) table .title+tr td{padding-top:5px}:host([data-view=mobile]) table .title+tr td:first-child{padding-top:15px}:host([data-view=mobile]) table td.monospace{width:100%;max-width:none}";
1918
-
1919
- const CertificateViewer = class {
1920
- constructor(hostRef) {
1921
- index.registerInstance(this, hostRef);
1922
- this.isDecodeInProcess = true;
1923
- this.getAuthKeyIdParentLink = (value) => {
1924
- var _a;
1925
- return (_a = this.authKeyIdParentLink) === null || _a === void 0 ? void 0 : _a.replace('{{authKeyId}}', value);
1926
- };
1927
- this.getAuthKeyIdSiblingsLink = (value) => {
1928
- var _a;
1929
- return (_a = this.authKeyIdSiblingsLink) === null || _a === void 0 ? void 0 : _a.replace('{{authKeyId}}', value);
1930
- };
1931
- this.getSubjectKeyIdChildrenLink = (value) => {
1932
- var _a;
1933
- return (_a = this.subjectKeyIdChildrenLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
1934
- };
1935
- this.getSubjectKeyIdSiblingsLink = (value) => {
1936
- var _a;
1937
- return (_a = this.subjectKeyIdSiblingsLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
1938
- };
1939
- }
1940
- componentWillLoad() {
1941
- this.decodeCertificate(this.certificate);
1942
- }
1943
- async decodeCertificate(certificate) {
1944
- this.isDecodeInProcess = true;
1945
- try {
1946
- if (certificate instanceof certification_request.X509Certificate) {
1947
- this.certificateDecoded = certificate;
1948
- }
1949
- else if (typeof certificate === 'string') {
1950
- this.certificateDecoded = new certification_request.X509Certificate(certificate);
1951
- }
1952
- else {
1953
- return;
1954
- }
1955
- this.certificateDecoded.parseExtensions();
1956
- await this.certificateDecoded.getThumbprint('SHA-1');
1957
- await this.certificateDecoded.getThumbprint('SHA-256');
1958
- }
1959
- catch (error) {
1960
- this.certificateDecodeError = error;
1961
- console.error('Error certificate parse:', error);
1962
- }
1963
- this.isDecodeInProcess = false;
1964
- }
1965
- /**
1966
- * Rerun decodeCertificate if previuos value not equal current value
1967
- */
1968
- watchCertificateAndDecode(newValue, oldValue) {
1969
- if (typeof newValue === 'string' && typeof oldValue === 'string') {
1970
- if (newValue !== oldValue) {
1971
- this.decodeCertificate(newValue);
1972
- }
1973
- return;
1974
- }
1975
- if (newValue instanceof certification_request.X509Certificate && oldValue instanceof certification_request.X509Certificate) {
1976
- if (newValue.serialNumber !== oldValue.serialNumber) {
1977
- this.decodeCertificate(newValue);
1978
- }
1979
- }
1980
- }
1981
- getIssuerDnLink() {
1982
- return this.issuerDnLink;
1983
- }
1984
- // eslint-disable-next-line class-methods-use-this
1985
- renderErrorState() {
1986
- return (index.h("div", { class: "status_wrapper" }, index.h("peculiar-typography", { type: "b1", class: "interaction_text" }, "There was an error decoding this certificate.")));
1987
- }
1988
- // eslint-disable-next-line class-methods-use-this
1989
- renderEmptyState() {
1990
- return (index.h("div", { class: "status_wrapper" }, index.h("peculiar-typography", { type: "b1", class: "interaction_text" }, "There is no certificate available.")));
1991
- }
1992
- render() {
1993
- if (this.certificateDecodeError) {
1994
- return this.renderErrorState();
1995
- }
1996
- if (!this.certificateDecoded) {
1997
- return this.renderEmptyState();
1998
- }
1999
- return (index.h(index.Host, { "data-view": this.view }, index.h("table", null, index.h(BasicInformation, Object.assign({}, this.certificateDecoded)), index.h(SubjectName, { name: this.certificateDecoded.subject }), index.h(IssuerName, { name: this.certificateDecoded.issuer, issuerDnLink: this.getIssuerDnLink() }), index.h(PublicKey, { publicKey: this.certificateDecoded.publicKey }), index.h(Signature, { signature: this.certificateDecoded.signature }), index.h(Thumbprints, { thumbprints: this.certificateDecoded.thumbprints }), index.h(Extensions, { extensions: this.certificateDecoded.extensions, getLEILink: getLEILink, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink, getAuthKeyIdParentLink: this.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink: this.getAuthKeyIdSiblingsLink, getSubjectKeyIdChildrenLink: this.getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink: this.getSubjectKeyIdSiblingsLink }), this.download && (index.h(Miscellaneous, { certificate: this.certificateDecoded })))));
2000
- }
2001
- static get watchers() { return {
2002
- "certificate": ["watchCertificateAndDecode"]
2003
- }; }
2004
- };
2005
- CertificateViewer.style = certificateViewerCss$1;
2006
-
2007
- const certificateViewerCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%;word-wrap:break-word;position:relative;min-width:280px;min-height:300px;background:white;background:rgba(var(--pv-color-light-rgb), 1)}th,td{border:none}table{width:100%;margin-bottom:30px;border-spacing:0;border-collapse:collapse}table .title td{border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5);padding-top:60px;padding-bottom:15px;border-bottom-width:1px;border-bottom-style:solid}table td:first-child{padding-left:30px;width:130px;padding-right:10px}table td:last-child{padding-right:30px;width:calc(100% - 130px)}table td{vertical-align:top;padding-top:5px;padding-bottom:5px}table td.vertical_align_middle{vertical-align:middle}table .title:first-child td{padding-top:15px}table .title+tr td{padding-top:15px}table td.monospace{max-width:0}table .divider{padding-top:15px;padding-bottom:15px}.divider .bg_fill{background-color:rgba(209, 213, 217, 0.5);background-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr:last-child .divider{padding-top:0;opacity:0}.divider span{display:block;height:1px}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.interaction_text{padding:15px 0;width:300px;margin:auto;text-align:center}@media (max-width: 900px){table,tr,td{display:block}table td:last-child,table td:first-child{padding-right:15px;padding-left:15px;width:100%}table .title+tr td{padding-top:5px}table .title+tr td:first-child{padding-top:15px}table td.monospace{width:100%;max-width:none}}:host([data-view=mobile]) table,:host([data-view=mobile]) tr,:host([data-view=mobile]) td{display:block}:host([data-view=mobile]) table td:last-child,:host([data-view=mobile]) table td:first-child{padding-right:15px;padding-left:15px;width:100%}:host([data-view=mobile]) table .title+tr td{padding-top:5px}:host([data-view=mobile]) table .title+tr td:first-child{padding-top:15px}:host([data-view=mobile]) table td.monospace{width:100%;max-width:none}";
2008
-
2009
- const CsrViewer = class {
2010
- constructor(hostRef) {
2011
- index.registerInstance(this, hostRef);
2012
- this.isDecodeInProcess = true;
2013
- this.getAuthKeyIdParentLink = (value) => value;
2014
- this.getAuthKeyIdSiblingsLink = (value) => value;
2015
- this.getSubjectKeyIdChildrenLink = (value) => {
2016
- var _a;
2017
- return (_a = this.subjectKeyIdChildrenLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
2018
- };
2019
- this.getSubjectKeyIdSiblingsLink = (value) => {
2020
- var _a;
2021
- return (_a = this.subjectKeyIdSiblingsLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
2022
- };
2023
- }
2024
- componentWillLoad() {
2025
- this.decodeCertificate(this.certificate);
2026
- }
2027
- async decodeCertificate(certificate) {
2028
- this.isDecodeInProcess = true;
2029
- try {
2030
- if (certificate instanceof CSR) {
2031
- this.certificateDecoded = certificate;
2032
- }
2033
- else if (typeof certificate === 'string') {
2034
- this.certificateDecoded = new CSR(certificate);
2035
- }
2036
- else {
2037
- return;
2038
- }
2039
- this.certificateDecoded.parseAttributes();
2040
- await this.certificateDecoded.getThumbprint('SHA-1');
2041
- await this.certificateDecoded.getThumbprint('SHA-256');
2042
- }
2043
- catch (error) {
2044
- this.certificateDecodeError = error;
2045
- console.error('Error certificate parse:', error);
2046
- }
2047
- this.isDecodeInProcess = false;
2048
- }
2049
- /**
2050
- * Rerun decodeCertificate if previuos value not equal current value
2051
- */
2052
- watchCertificateAndDecode(newValue, oldValue) {
2053
- if (typeof newValue === 'string' && typeof oldValue === 'string') {
2054
- if (newValue !== oldValue) {
2055
- this.decodeCertificate(newValue);
2056
- }
2057
- return;
2058
- }
2059
- if (newValue instanceof CSR
2060
- && oldValue instanceof CSR) {
2061
- if (newValue.commonName !== oldValue.commonName) {
2062
- this.decodeCertificate(newValue);
2063
- }
2064
- }
2065
- }
2066
- // eslint-disable-next-line class-methods-use-this
2067
- renderErrorState() {
2068
- return (index.h("div", { class: "status_wrapper" }, index.h("peculiar-typography", { type: "b1", class: "interaction_text" }, "There was an error decoding this certificate request.")));
2069
- }
2070
- // eslint-disable-next-line class-methods-use-this
2071
- renderEmptyState() {
2072
- return (index.h("div", { class: "status_wrapper" }, index.h("peculiar-typography", { type: "b1", class: "interaction_text" }, "There is no certificate request available.")));
2073
- }
2074
- getExtensionRequestAttribute() {
2075
- if (!this.certificateDecoded) {
2076
- return undefined;
2077
- }
2078
- return this.certificateDecoded.attributes
2079
- .find((attribute) => attribute.asn.type === '1.2.840.113549.1.9.14');
2080
- }
2081
- render() {
2082
- if (this.certificateDecodeError) {
2083
- return this.renderErrorState();
2084
- }
2085
- if (!this.certificateDecoded) {
2086
- return this.renderEmptyState();
2087
- }
2088
- const extensionRequestAttribute = this.getExtensionRequestAttribute();
2089
- return (index.h(index.Host, { "data-view": this.view }, index.h("table", null, index.h(BasicInformation, Object.assign({}, this.certificateDecoded)), index.h(SubjectName, { name: this.certificateDecoded.subject }), index.h(PublicKey, { publicKey: this.certificateDecoded.publicKey }), index.h(Signature, { signature: this.certificateDecoded.signature }), index.h(Thumbprints, { thumbprints: this.certificateDecoded.thumbprints }), index.h(Attributes, { attributes: this.certificateDecoded.attributes, getLEILink: getLEILink, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink, getAuthKeyIdParentLink: this.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink: this.getAuthKeyIdSiblingsLink, getSubjectKeyIdChildrenLink: this.getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink: this.getSubjectKeyIdSiblingsLink }), index.h(Extensions, { extensions: extensionRequestAttribute === null || extensionRequestAttribute === void 0 ? void 0 : extensionRequestAttribute.value, title: "Extension Request", getLEILink: getLEILink, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink, getAuthKeyIdParentLink: this.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink: this.getAuthKeyIdSiblingsLink, getSubjectKeyIdChildrenLink: this.getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink: this.getSubjectKeyIdSiblingsLink }), this.download && (index.h(Miscellaneous, { certificate: this.certificateDecoded })))));
2090
- }
2091
- static get watchers() { return {
2092
- "certificate": ["watchCertificateAndDecode"]
2093
- }; }
2094
- };
2095
- CsrViewer.style = certificateViewerCss;
2096
-
2097
- const linkCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-user-drag:none;-ms-content-zooming:none;word-wrap:break-word;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;display:inline-block}.link{font-family:\"Open Sans\", \"Arial\", sans-serif;font-family:var(--pv-font-family);letter-spacing:0.03em;letter-spacing:var(--pv-letter-spacing-normal);line-height:1.4;line-height:var(--pv-line-height-normal);color:#3584f7;color:rgba(var(--pv-color-primary-rgb), 1);font-weight:400;margin:0;padding:0;word-break:break-all}.link_type_h4{font-size:17px;font-size:var(--pv-font-size-h4);font-weight:600}.link_type_h6{font-size:15px;font-size:var(--pv-font-size-h6);font-weight:600}.link_type_h7{font-size:14px;font-size:var(--pv-font-size-h7);font-weight:600}.link_type_b1{font-size:15px;font-size:var(--pv-font-size-b1)}.link_type_b3{font-size:13px;font-size:var(--pv-font-size-b3)}.link:hover{text-decoration:none}";
2098
-
2099
- const Link = class {
2100
- constructor(hostRef) {
2101
- index.registerInstance(this, hostRef);
2102
- /**
2103
- * Typography type.
2104
- */
2105
- this.type = 'b3';
2106
- }
2107
- render() {
2108
- return (index.h("a", { href: this.href, target: "_blank", rel: "noreferrer noopener", class: {
2109
- link: true,
2110
- [`link_type_${this.type || 'b3'}`]: true,
2111
- } }, index.h("slot", null)));
2112
- }
2113
- };
2114
- Link.style = linkCss;
2115
-
2116
- const textHiderCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%}.text{display:inline-block;width:calc(100% - 60px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.text.m_opened{white-space:initial}.action{vertical-align:top;display:inline-block;width:60px;text-align:right;position:relative;top:-6px}.button_action{width:30px}.expand_icon{width:7px;height:5px;display:inline-block}.m_opened .expand_icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}";
2117
-
2118
- const TextHider = class {
2119
- constructor(hostRef) {
2120
- index.registerInstance(this, hostRef);
2121
- this.textExpand = index.createEvent(this, "textExpand", 7);
2122
- this.opened = false;
2123
- }
2124
- textExpandHandler() {
2125
- this.opened = !this.opened;
2126
- }
2127
- render() {
2128
- return (index.h(index.Host, null, index.h("div", { class: "root" }, index.h("div", { class: {
2129
- text: true,
2130
- m_opened: this.opened,
2131
- } }, index.h("slot", null)), index.h("div", { class: "action" }, index.h("peculiar-button", { onClick: this.textExpand.emit, class: {
2132
- button_action: true,
2133
- m_opened: this.opened,
2134
- }, fill: this.opened ? 'fill' : 'stroke' }, index.h("svg", { viewBox: "0 0 7 5", xmlns: "http://www.w3.org/2000/svg", class: "expand_icon" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", fill: "currentColor", d: "M5.459.124c.934.001 1.442.994.84 1.644L4.425 3.794c-.44.475-1.244.475-1.684 0L.862 1.764C.26 1.115.77.12 1.705.122l3.754.003z" })))))));
2135
- }
2136
- };
2137
- TextHider.style = textHiderCss;
2138
-
2139
- const typographyCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-user-drag:none;-ms-content-zooming:none;word-wrap:break-word;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;display:block}.typography{font-family:\"Open Sans\", \"Arial\", sans-serif;font-family:var(--pv-font-family);letter-spacing:0.03em;letter-spacing:var(--pv-letter-spacing-normal);line-height:1.4;line-height:var(--pv-line-height-normal);font-weight:400;margin:0;padding:0;display:block}.typography_type_h4{font-size:17px;font-size:var(--pv-font-size-h4);font-weight:600}.typography_type_h6{font-size:15px;font-size:var(--pv-font-size-h6);font-weight:600}.typography_type_h7{font-size:14px;font-size:var(--pv-font-size-h7);font-weight:600}.typography_type_b1{font-size:15px;font-size:var(--pv-font-size-b1)}.typography_type_b3{font-size:13px;font-size:var(--pv-font-size-b3)}.typography_color_dark{color:#2a3134;color:rgba(var(--pv-color-dark-rgb), 1)}.typography_color_light{color:white;color:rgba(var(--pv-color-light-rgb), 1)}.typography_color_grey_3{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.typography_color_grey_5{color:#869196;color:rgba(var(--pv-color-grey_5-rgb), 1)}.typography_color_attention{color:#f7a831;color:rgba(var(--pv-color-attention-rgb), 1)}.typography_color_primary{color:#3584f7;color:rgba(var(--pv-color-primary-rgb), 1)}.typography_ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.typography_monospace{font-family:monospace}.typography_align_left{text-align:left}.typography_align_center{text-align:center}.typography_align_right{text-align:right}";
2140
-
2141
- const PeculiarTypography = class {
2142
- constructor(hostRef) {
2143
- index.registerInstance(this, hostRef);
2144
- /**
2145
- * Typography type.
2146
- */
2147
- this.type = 'b3';
2148
- /**
2149
- * Component color from theme.
2150
- */
2151
- this.color = 'dark';
2152
- }
2153
- render() {
2154
- const TagType = this.type && this.type.includes('h') ? this.type : 'p';
2155
- return (index.h(TagType, { class: {
2156
- typography: true,
2157
- [`typography_type_${this.type || 'b3'}`]: true,
2158
- [`typography_color_${this.color || 'dark'}`]: true,
2159
- [`typography_align_${this.align}`]: !!this.align,
2160
- typography_ellipsis: this.ellipsis,
2161
- typography_monospace: this.monospace,
2162
- } }, index.h("slot", null)));
2163
- }
2164
- };
2165
- PeculiarTypography.style = typographyCss;
2166
-
2167
- exports.peculiar_attribute_certificate_viewer = AttributeCertificateViewer;
2168
- exports.peculiar_button = Button;
2169
- exports.peculiar_button_split = ButtonSplit;
2170
- exports.peculiar_certificate_decoder = CertificateDecoder;
2171
- exports.peculiar_certificate_viewer = CertificateViewer;
2172
- exports.peculiar_csr_viewer = CsrViewer;
2173
- exports.peculiar_link = Link;
2174
- exports.peculiar_text_hider = TextHider;
2175
- exports.peculiar_typography = PeculiarTypography;