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