@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
@@ -0,0 +1,1089 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
+ */
4
+ import { h } from './index-bbd484d9.js';
5
+ import { b as build } from './index-0ba131b0.js';
6
+ import { l as l10n, a as dateShort } from './l10n-ac28fa92.js';
7
+ import { O as OIDs, P as Name, Q as OtherName, p as AsnParser, S as DisplayText, X as UserNotice, Y as EDIPartyName, Z as AsnIntegerArrayBufferConverter, _ as KeyUsage, $ as BasicConstraints, a0 as ExtendedKeyUsage, a1 as SubjectKeyIdentifier, a2 as AuthorityKeyIdentifier, a3 as CRLDistributionPoints, a4 as AuthorityInfoAccessSyntax, a5 as SubjectInfoAccessSyntax, a6 as SubjectAlternativeName, a7 as CertificatePolicies, a8 as CertificateTransparency, a9 as NameConstraints, aa as CertificateTemplate, ab as EnrollCertTypeChoice, ac as CaVersion, ad as QCStatements, ae as NetscapeComment, af as NetscapeCertType, ag as LeiRole, ah as LeiChoice, ai as Timestamp, aj as ArchiveRevInfo, ak as CRLReason, al as SubjectDirectoryAttributes, am as PrivateKeyUsagePeriod, an as EntrustVersionInfo, ao as BiometricSyntax, ap as LogotypeExtn, aq as TNAuthorizationList, ar as PolicyConstraints, as as PolicyMappings } from './certification_request-c0674647.js';
8
+ import { C as CSR } from './csr-c1b6a176.js';
9
+ import { D as Download } from './download-735fb2eb.js';
10
+
11
+ /**
12
+ * @license
13
+ * Copyright (c) Peculiar Ventures, LLC.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */
18
+ function getStringByOID(value) {
19
+ const oid = OIDs[value];
20
+ if (oid) {
21
+ return `${oid} (${value})`;
22
+ }
23
+ return value;
24
+ }
25
+
26
+ /**
27
+ * @license
28
+ * Copyright (c) Peculiar Ventures, LLC.
29
+ *
30
+ * This source code is licensed under the MIT license found in the
31
+ * LICENSE file in the root directory of this source tree.
32
+ */
33
+ function isLink(value) {
34
+ return value.indexOf('http') === 0;
35
+ }
36
+
37
+ /**
38
+ * @license
39
+ * Copyright (c) Peculiar Ventures, LLC.
40
+ *
41
+ * This source code is licensed under the MIT license found in the
42
+ * LICENSE file in the root directory of this source tree.
43
+ */
44
+ const RowTitle = (props) => {
45
+ const { value } = props;
46
+ if (!value) {
47
+ return null;
48
+ }
49
+ return (h("tr", { class: "title" },
50
+ h("td", { colSpan: 2 },
51
+ h("peculiar-typography", { type: "h6" }, value))));
52
+ };
53
+ const RowValue = (props) => {
54
+ const { name, value, monospace, collapse, href, extraValue, } = props;
55
+ if (!name) {
56
+ return null;
57
+ }
58
+ if (value === undefined || value === null) {
59
+ return null;
60
+ }
61
+ let elementValue;
62
+ if (collapse) {
63
+ elementValue = (h("peculiar-text-hider", null, value));
64
+ }
65
+ else {
66
+ elementValue = value;
67
+ }
68
+ const hasValue = !!value.toString();
69
+ return (h("tr", null,
70
+ h("td", { colSpan: hasValue ? 1 : 2 },
71
+ h("peculiar-typography", { color: "grey_5" },
72
+ name,
73
+ hasValue ? ':' : '')),
74
+ hasValue && (h("td", { class: {
75
+ monospace,
76
+ } }, (isLink(value.toString()) || href) ? (h("peculiar-link", { href: href || value.toString() }, value)) : (h("peculiar-typography", { monospace: monospace },
77
+ elementValue,
78
+ extraValue))))));
79
+ };
80
+
81
+ /**
82
+ * @license
83
+ * Copyright (c) Peculiar Ventures, LLC.
84
+ *
85
+ * This source code is licensed under the MIT license found in the
86
+ * LICENSE file in the root directory of this source tree.
87
+ */
88
+ const Signature = (props) => {
89
+ const { signature } = props;
90
+ if (!signature) {
91
+ return null;
92
+ }
93
+ return [
94
+ h(RowTitle, { value: l10n.getString('signature') }),
95
+ h(RowValue, { name: l10n.getString('algorithm'), value: getStringByOID(signature.algorithm) }),
96
+ h(RowValue, { name: l10n.getString('value'), value: build.Convert.ToHex(signature.value), monospace: true, collapse: true }),
97
+ ];
98
+ };
99
+
100
+ /**
101
+ * @license
102
+ * Copyright (c) Peculiar Ventures, LLC.
103
+ *
104
+ * This source code is licensed under the MIT license found in the
105
+ * LICENSE file in the root directory of this source tree.
106
+ */
107
+ const names = {
108
+ otherName: 'Other Name',
109
+ rfc822Name: 'RFC 822 Name',
110
+ dNSName: 'DNS Name',
111
+ x400Address: 'X400 Address',
112
+ directoryName: 'Directory Name',
113
+ ediPartyName: 'Edi Party Name ',
114
+ uniformResourceIdentifier: 'URI',
115
+ iPAddress: 'IP Address',
116
+ registeredID: 'Registered ID',
117
+ };
118
+ const GeneralNamePart = (props) => {
119
+ const { generalName, getDNSNameLink, getIPAddressLink } = props;
120
+ if (!generalName) {
121
+ return null;
122
+ }
123
+ return Object.keys(generalName).map((name) => {
124
+ const value = generalName[name];
125
+ if (value instanceof Name) {
126
+ return [
127
+ h(RowValue, { name: names[name] || name, value: "" }),
128
+ value.map((relativeDistinguishedName) => (relativeDistinguishedName.map((attributeTypeAndValue) => (h(RowValue, { name: OIDs[attributeTypeAndValue.type] || attributeTypeAndValue.type, value: attributeTypeAndValue.value.toString() }))))),
129
+ ];
130
+ }
131
+ if (value instanceof OtherName) {
132
+ try {
133
+ const text = AsnParser.parse(value.value, DisplayText);
134
+ return (h(RowValue, { name: OIDs[value.typeId] || value.typeId, value: text.toString() }));
135
+ }
136
+ catch (error) {
137
+ //
138
+ }
139
+ try {
140
+ const text = AsnParser.parse(value.value, UserNotice);
141
+ if (text.explicitText) {
142
+ return (h(RowValue, { name: OIDs[value.typeId] || value.typeId, value: text.explicitText.toString() }));
143
+ }
144
+ }
145
+ catch (error) {
146
+ //
147
+ }
148
+ return (h(RowValue, { name: OIDs[value.typeId] || value.typeId, value: build.Convert.ToHex(value.value), monospace: true }));
149
+ }
150
+ if (build.BufferSourceConverter.isBufferSource(value)) {
151
+ return (h(RowValue, { name: names[name] || name, value: build.Convert.ToString(value) }));
152
+ }
153
+ if (value instanceof EDIPartyName) {
154
+ return (h(RowValue, { name: names[name] || name, value: build.Convert.ToString(value.partyName) }));
155
+ }
156
+ if (name === 'dNSName') {
157
+ return (h(RowValue, { name: names[name] || name, value: value, href: getDNSNameLink(value) }));
158
+ }
159
+ if (name === 'iPAddress') {
160
+ return (h(RowValue, { name: names[name] || name, value: value, href: getIPAddressLink(value) }));
161
+ }
162
+ return (h(RowValue, { name: names[name] || name, value: value }));
163
+ });
164
+ };
165
+
166
+ /**
167
+ * @license
168
+ * Copyright (c) Peculiar Ventures, LLC.
169
+ *
170
+ * This source code is licensed under the MIT license found in the
171
+ * LICENSE file in the root directory of this source tree.
172
+ */
173
+ const Thumbprints = (props) => {
174
+ const { thumbprints } = props;
175
+ if (!thumbprints) {
176
+ return null;
177
+ }
178
+ const keys = Object.keys(thumbprints);
179
+ if (!keys.length) {
180
+ return null;
181
+ }
182
+ return [
183
+ h(RowTitle, { value: l10n.getString('fingerprints') }),
184
+ keys.map((name) => (h(RowValue, { name: name, value: thumbprints[name], monospace: true }))),
185
+ ];
186
+ };
187
+
188
+ /**
189
+ * @license
190
+ * Copyright (c) Peculiar Ventures, LLC.
191
+ *
192
+ * This source code is licensed under the MIT license found in the
193
+ * LICENSE file in the root directory of this source tree.
194
+ */
195
+ const BasicExtension = (props, children) => {
196
+ const { extension } = props;
197
+ return ([
198
+ h(RowValue, { name: "Name", value: getStringByOID(extension.asn.extnID) }),
199
+ h(RowValue, { name: "Critical", value: extension.asn.critical ? 'YES' : 'NO' }),
200
+ children,
201
+ h("tr", null,
202
+ h("td", { colSpan: 2, class: "divider" },
203
+ h("span", { class: "bg_fill" }))),
204
+ ]);
205
+ };
206
+
207
+ /**
208
+ * @license
209
+ * Copyright (c) Peculiar Ventures, LLC.
210
+ *
211
+ * This source code is licensed under the MIT license found in the
212
+ * LICENSE file in the root directory of this source tree.
213
+ */
214
+ const KeyUsageExtension = (props) => {
215
+ const { extension } = props;
216
+ return (h(BasicExtension, { extension: extension },
217
+ h(RowValue, { name: "Usage", value: extension.value.toJSON().join(', ') })));
218
+ };
219
+
220
+ /**
221
+ * @license
222
+ * Copyright (c) Peculiar Ventures, LLC.
223
+ *
224
+ * This source code is licensed under the MIT license found in the
225
+ * LICENSE file in the root directory of this source tree.
226
+ */
227
+ const BasicConstraintsExtension = (props) => {
228
+ const { extension } = props;
229
+ return (h(BasicExtension, { extension: extension },
230
+ h(RowValue, { name: "Certificate Authority", value: extension.value.cA ? 'YES' : 'NO' }),
231
+ h(RowValue, { name: "Path Length Constraint", value: extension.value.pathLenConstraint })));
232
+ };
233
+
234
+ /**
235
+ * @license
236
+ * Copyright (c) Peculiar Ventures, LLC.
237
+ *
238
+ * This source code is licensed under the MIT license found in the
239
+ * LICENSE file in the root directory of this source tree.
240
+ */
241
+ const ExtendedKeyUsageExtension = (props) => {
242
+ const { extension } = props;
243
+ return (h(BasicExtension, { extension: extension }, extension.value.map((usage, arrayIndex) => (h(RowValue, { name: `Purpose #${arrayIndex + 1}`, value: getStringByOID(usage) })))));
244
+ };
245
+
246
+ /**
247
+ * @license
248
+ * Copyright (c) Peculiar Ventures, LLC.
249
+ *
250
+ * This source code is licensed under the MIT license found in the
251
+ * LICENSE file in the root directory of this source tree.
252
+ */
253
+ const SubjectKeyIdentifierExtension = (props) => {
254
+ const { extension, getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink } = props;
255
+ const keyId = build.Convert.ToHex(extension.value.buffer);
256
+ const childrenLink = getSubjectKeyIdChildrenLink(keyId);
257
+ const siblingsLink = getSubjectKeyIdSiblingsLink(keyId);
258
+ return (h(BasicExtension, { extension: extension },
259
+ h(RowValue, { name: "Key ID", value: keyId, monospace: true, extraValue: [
260
+ childrenLink && (h("span", null,
261
+ "\u00A0[",
262
+ h("peculiar-link", { href: childrenLink }, "children"),
263
+ "]")),
264
+ siblingsLink && (h("span", null,
265
+ "\u00A0[",
266
+ h("peculiar-link", { href: siblingsLink }, "siblings"),
267
+ "]")),
268
+ ] })));
269
+ };
270
+
271
+ /**
272
+ * @license
273
+ * Copyright (c) Peculiar Ventures, LLC.
274
+ *
275
+ * This source code is licensed under the MIT license found in the
276
+ * LICENSE file in the root directory of this source tree.
277
+ */
278
+ const AuthorityKeyIdentifierExtension = (props) => {
279
+ const { extension, getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink } = props;
280
+ const keyId = build.Convert.ToHex(extension.value.keyIdentifier.buffer);
281
+ const parentLink = getAuthKeyIdParentLink(keyId);
282
+ const siblingsLink = getAuthKeyIdSiblingsLink(keyId);
283
+ return (h(BasicExtension, { extension: extension },
284
+ h(RowValue, { name: "Key ID", value: keyId, monospace: true, extraValue: [
285
+ parentLink && (h("span", null,
286
+ "\u00A0[",
287
+ h("peculiar-link", { href: parentLink }, "parents"),
288
+ "]")),
289
+ siblingsLink && (h("span", null,
290
+ "\u00A0[",
291
+ h("peculiar-link", { href: siblingsLink }, "siblings"),
292
+ "]")),
293
+ ] })));
294
+ };
295
+
296
+ /**
297
+ * @license
298
+ * Copyright (c) Peculiar Ventures, LLC.
299
+ *
300
+ * This source code is licensed under the MIT license found in the
301
+ * LICENSE file in the root directory of this source tree.
302
+ */
303
+ const CRLDistributionPointsExtension = (props) => {
304
+ const { extension } = props;
305
+ return (h(BasicExtension, { extension: extension }, extension.value.map((point) => {
306
+ var _a, _b;
307
+ return ([
308
+ (_a = point.distributionPoint) === null || _a === void 0 ? void 0 : _a.fullName.map((gn) => (h(GeneralNamePart, Object.assign({ generalName: gn }, props)))),
309
+ (_b = point.cRLIssuer) === null || _b === void 0 ? void 0 : _b.map((gn) => (h(GeneralNamePart, Object.assign({ generalName: gn }, props)))),
310
+ ]);
311
+ })));
312
+ };
313
+
314
+ /**
315
+ * @license
316
+ * Copyright (c) Peculiar Ventures, LLC.
317
+ *
318
+ * This source code is licensed under the MIT license found in the
319
+ * LICENSE file in the root directory of this source tree.
320
+ */
321
+ const InfoAccessSyntaxExtension = (props) => {
322
+ const { extension } = props;
323
+ return (h(BasicExtension, { extension: extension }, extension.value.map((description, arrayIndex) => ([
324
+ h(RowValue, { name: `Description #${arrayIndex + 1}`, value: "" }),
325
+ h(RowValue, { name: "Method", value: getStringByOID(description.accessMethod) }),
326
+ h(GeneralNamePart, Object.assign({ generalName: description.accessLocation }, props)),
327
+ ]))));
328
+ };
329
+
330
+ /**
331
+ * @license
332
+ * Copyright (c) Peculiar Ventures, LLC.
333
+ *
334
+ * This source code is licensed under the MIT license found in the
335
+ * LICENSE file in the root directory of this source tree.
336
+ */
337
+ const SubjectAlternativeNameExtension = (props) => {
338
+ const { extension } = props;
339
+ return (h(BasicExtension, { extension: extension }, extension.value.map((gn) => (h(GeneralNamePart, Object.assign({ generalName: gn }, props))))));
340
+ };
341
+
342
+ /**
343
+ * @license
344
+ * Copyright (c) Peculiar Ventures, LLC.
345
+ *
346
+ * This source code is licensed under the MIT license found in the
347
+ * LICENSE file in the root directory of this source tree.
348
+ */
349
+ const CertificatePoliciesExtension = (props) => {
350
+ const { extension } = props;
351
+ return (h(BasicExtension, { extension: extension }, extension.value.map((policy, arrayIndex) => {
352
+ var _a;
353
+ return ([
354
+ h(RowValue, { name: `Policy #${arrayIndex + 1}`, value: "" }),
355
+ h(RowValue, { name: "ID", value: getStringByOID(policy.policyIdentifier) }),
356
+ (_a = policy.policyQualifiers) === null || _a === void 0 ? void 0 : _a.map((qualifierInfo, indexInfo) => {
357
+ const data = [
358
+ h(RowValue, { name: `Qualifier #${arrayIndex + 1}.${indexInfo + 1}`, value: "" }),
359
+ h(RowValue, { name: "ID", value: getStringByOID(qualifierInfo.policyQualifierId) }),
360
+ ];
361
+ if (qualifierInfo.policyQualifierId === '1.3.6.1.5.5.7.2.1') {
362
+ const value = AsnParser.parse(qualifierInfo.qualifier, DisplayText);
363
+ data.push(h(RowValue, { name: "Value", value: value.toString() }));
364
+ }
365
+ if (qualifierInfo.policyQualifierId === '1.3.6.1.5.5.7.2.2') {
366
+ const value = AsnParser.parse(qualifierInfo.qualifier, UserNotice);
367
+ if (value.explicitText) {
368
+ data.push(h(RowValue, { name: "Value", value: value.explicitText.toString() }));
369
+ }
370
+ }
371
+ return data;
372
+ }),
373
+ ]);
374
+ })));
375
+ };
376
+
377
+ /**
378
+ * @license
379
+ * Copyright (c) Peculiar Ventures, LLC.
380
+ *
381
+ * This source code is licensed under the MIT license found in the
382
+ * LICENSE file in the root directory of this source tree.
383
+ */
384
+ const logs = {
385
+ '9606c02c690033aa1d145f59c6e2648d0549f0df96aab8db915a70d8ecf390a5': 'Akamai CT',
386
+ '39376f545f7b4607f59742d768cd5d2437bf3473b6534a4834bcf72e681c83c9': 'Alpha CT',
387
+ a577ac9ced7548dd8f025b67a241089df86e0f476ec203c2ecbedb185f282638: 'CNNIC CT',
388
+ cdb5179b7fc1c046feea31136a3f8f002e6182faf8896fecc8b2f5b5ab604900: 'Certly.IO',
389
+ '1fbc36e002ede97f40199e86b3573b8a4217d80187746ad0da03a06054d20df4': 'Cloudflare “Nimbus2017”',
390
+ db74afeecb29ecb1feca3e716d2ce5b9aabb36f7847183c75d9d4f37b61fbf64: 'Cloudflare “Nimbus2018”',
391
+ '747eda8331ad331091219cce254f4270c2bffd5e422008c6373579e6107bcc56': 'Cloudflare “Nimbus2019”',
392
+ '5ea773f9df56c0e7b536487dd049e0327a919a0c84a112128418759681714558': 'Cloudflare “Nimbus2020”',
393
+ '4494652eb0eeceafc44007d8a8fe28c0dae682bed8cb31b53fd33396b5b681a8': 'Cloudflare “Nimbus2021”',
394
+ '41c8cab1df22464a10c6a13a0942875e4e318b1b03ebeb4bc768f090629606f6': 'Cloudflare “Nimbus2022”',
395
+ '7a328c54d8b72db620ea38e0521ee98416703213854d3bd22bc13a57a352eb52': 'Cloudflare “Nimbus2023”',
396
+ '6ff141b5647e4222f7ef052cefae7c21fd608e27d2af5a6e9f4b8a37d6633ee5': 'DigiCert Nessie2018',
397
+ fe446108b1d01ab78a62ccfeab6ab2b2babff3abdad80a4d8b30df2d0008830c: 'DigiCert Nessie2019',
398
+ c652a0ec48ceb3fcab170992c43a87413309e80065a26252401ba3362a17c565: 'DigiCert Nessie2020',
399
+ eec095ee8d72640f92e3c3b91bc712a3696a097b4b6a1a1438e647b2cbedc5f9: 'DigiCert Nessie2021',
400
+ '51a3b0f5fd01799c566db837788f0ca47acc1b27cbf79e88429a0dfed48b05e5': 'DigiCert Nessie2022',
401
+ b3737707e18450f86386d605a9dc11094a792db1670c0b87dcf0030e7936a59a: 'DigiCert Nessie2023',
402
+ '5614069a2fd7c2ecd3f5e1bd44b23ec74676b9bc99115cc0ef949855d689d0dd': 'DigiCert Server',
403
+ '8775bfe7597cf88c43995fbdf36eff568d475636ff4ab560c1b4eaff5ea0830f': 'DigiCert Server 2',
404
+ c1164ae0a772d2d4392dc80ac10770d4f0c49bde991a4840c1fa075164f63360: 'DigiCert Yeti2018',
405
+ e2694bae26e8e94009e8861bb63b83d43ee7fe7488fba48f2893019dddf1dbfe: 'DigiCert Yeti2019',
406
+ f095a459f200d18240102d2f93888ead4bfe1d47e399e1d034a6b0a8aa8eb273: 'DigiCert Yeti2020',
407
+ '5cdc4392fee6ab4544b15e9ad456e61037fbd5fa47dca17394b25ee6f6c70eca': 'DigiCert Yeti2021',
408
+ '2245450759552456963fa12ff1f76d86e0232663adc04b7f5dc6835c6ee20f02': 'DigiCert Yeti2022',
409
+ '35cf191bbfb16c57bf0fad4c6d42cbbbb627202651ea3fe12aefa803c33bd64c': 'DigiCert Yeti2023',
410
+ '717ea7420975be84a2723553f1777c26dd51af4e102144094d9019b462fb6668': 'GDCA 1',
411
+ '14308d90ccd030135005c01ca526d81e84e87624e39b6248e08f724aea3bb42a': 'GDCA 2',
412
+ c9cf890a21109c666cc17a3ed065c930d0e0135a9feba85af14210b8072421aa: 'GDCA CT #1',
413
+ '924a30f909336ff435d6993a10ac75a2c641728e7fc2d659ae6188ffad40ce01': 'GDCA CT #2',
414
+ fad4c97cc49ee2f8ac85c5ea5cea09d0220dbbf4e49c6b50662ff868f86b8c28: 'Google “Argon2017”',
415
+ a4501269055a15545e6211ab37bc103f62ae5576a45e4b1714453e1b22106a25: 'Google “Argon2018”',
416
+ '63f2dbcde83bcc2ccf0b728427576b33a48d61778fbd75a638b1c768544bd88d': 'Google “Argon2019”',
417
+ b21e05cc8ba2cd8a204e8766f92bb98a2520676bdafa70e7b249532def8b905e: 'Google “Argon2020”',
418
+ f65c942fd1773022145418083094568ee34d131933bfdf0c2f200bcc4ef164e3: 'Google “Argon2021”',
419
+ '2979bef09e393921f056739f63a577e5be577d9c600af8f94d5d265c255dc784': 'Google “Argon2022”',
420
+ '68f698f81f6482be3a8ceeb9281d4cfc71515d6793d444d10a67acbb4f4ffbc4': 'Google “Aviator”',
421
+ c3bf03a7e1ca8841c607bae3ff4270fca5ec45b186ebbe4e2cf3fc778630f5f6: 'Google “Crucible”',
422
+ '1d024b8eb1498b344dfd87ea3efc0996f7506f235d1d497061a4773c439c25fb': 'Google “Daedalus”',
423
+ '293c519654c83965baaa50fc5807d4b76fbf587a2972dca4c30cf4e54547f478': 'Google “Icarus”',
424
+ a4b90990b418581487bb13a2cc67700a3c359804f91bdfb8e377cd0ec80ddc10: 'Google “Pilot”',
425
+ ee4bbdb775ce60bae142691fabe19e66a30f7e5fb072d88300c47b897aa8fdcb: 'Google “Rocketeer”',
426
+ bbd9dfbc1f8a71b593942397aa927b473857950aab52e81a909664368e1ed185: 'Google “Skydiver”',
427
+ '52eb4b225ec896974850675f23e43bc1d021e3214ce52ecd5fa87c203cdfca03': 'Google “Solera2018”',
428
+ '0b760e9a8b9a682f88985b15e947501a56446bba8830785c3842994386450c00': 'Google “Solera2019”',
429
+ '1fc72ce5a1b799f400c359bff96ca3913548e8644220610952e9ba1774f7bac7': 'Google “Solera2020”',
430
+ a3c99845e80ab7ce00157b3742df0207dd272b2b602ecf98ee2c12db9c5ae7e7: 'Google “Solera2021”',
431
+ '697aafca1a6b536fae21205046debad7e0eaea13d2432e6e9d8fb379f2b9aaf3': 'Google “Solera2022”',
432
+ a899d8780c9290aaf462f31880ccfbd52451e970d0fbf591ef75b0d99b645681: 'Google “Submariner”',
433
+ b0cc83e5a5f97d6baf7c09cc284904872ac7e88b132c6350b7c6fd26e16c6c77: 'Google “Testtube”',
434
+ b10cd559a6d67846811f7df9a51532739ac48d703bea0323da5d38755bc0ad4e: 'Google “Xenon2018”',
435
+ '084114980071532c16190460bcfc47fdc2653afa292c72b37ff863ae29ccc9f0': 'Google “Xenon2019”',
436
+ '07b75c1be57d68fff1b0c61d2315c7bae6577c5794b76aeebc613a1a69d3a21c': 'Google “Xenon2020”',
437
+ '7d3ef2f88fff88556824c2c0ca9e5289792bc50e78097f2e6a9768997e22f0d7': 'Google “Xenon2021”',
438
+ '46a555eb75fa912030b5a28969f4f37d112c4174befd49b885abf2fc70fe6d47': 'Google “Xenon2022”',
439
+ '7461b4a09cfb3d41d75159575b2e7649a445a8d27709b0cc564a6482b7eb41a3': 'Izenpe',
440
+ '8941449c70742e06b9fc9ce7b116ba0024aa36d59af44f0204404f00f7ea8566': 'Izenpe “Argi”',
441
+ '296afa2d568bca0d2ea844956ae9721fc35fa355ecda99693aafd458a71aefdd': 'Let“s Encrypt ”Clicky”',
442
+ '537b69a3564335a9c04904e39593b2c298eb8d7a6e83023635c627248cd6b440': 'Nordu “flimsy”',
443
+ aae70b7f3cb8d566c86c2f16979c9f445f69ab0eb4535589b2f77a030104f3cd: 'Nordu “plausible”',
444
+ e0127629e90496564e3d0147984498aa48f8adb16600eb7902a1ef9909906273: 'PuChuangSiDa CT',
445
+ cf55e28923497c340d5206d05353aeb25834b52f1f8dc9526809f212efdd7ca6: 'SHECA CT 1',
446
+ '32dc59c2d4c41968d56e14bc61ac8f0e45db39faf3c155aa4252f5001fa0c623': 'SHECA CT 2',
447
+ db76fdadac65e7d09508886e2159bd8b90352f5fead3e3dc5e22eb350acc7b98: 'Sectigo (Comodo) “Dodo” CT',
448
+ '6f5376ac31f03119d89900a45115ff77151c11d902c10029068db2089a37d913': 'Sectigo (Comodo) “Mammoth” CT',
449
+ '5581d4c2169036014aea0b9b573c53f0c0e43878702508172fa3aa1d0713d30c': 'Sectigo (Comodo) “Sabre” CT',
450
+ '34bb6ad6c3df9c03eea8a499ff7891486c9d5e5cac92d01f7bfd1bce19db48ef': 'StartCom',
451
+ ddeb1d2b7a0d4fa6208b81ad8168707e2e8e9d01d55c888d3d11c4cdb6ecbecc: 'Symantec',
452
+ a7ce4a4e6207e0addee5fdaa4b1f86768767b5d002a55d47310e7e670a95eab2: 'Symantec Deneb',
453
+ '15970488d7b997a05beb52512adee8d2e8b4a3165264121a9fabfbd5f85ad93f': 'Symantec “Sirius”',
454
+ bc78e1dfc5f63c684649334da10fa15f0979692009c081b4f3f6917f3ed9b8a5: 'Symantec “Vega”',
455
+ b0b784bc81c0ddc47544e883f05985bb9077d134d8ab88b2b2e533980b8e508b: 'Up In The Air “Behind the Sofa”',
456
+ ac3b9aed7fa9674757159e6d7d575672f9d98100941e9bdeffeca1313b75782d: 'Venafi',
457
+ '03019df3fd85a69a8ebd1facc6da9ba73e469774fe77f579fc5a08b8328c1d6b': 'Venafi Gen2 CT',
458
+ '41b2dc2e89e63ce4af1ba7bb29bf68c6dee6f9f1cc047e30dffae3b3ba259263': 'WoSign',
459
+ '63d0006026dde10bb0601f452446965ee2b6ea2cd4fbc95ac866a550af9075b7': 'WoSign 2',
460
+ '9e4ff73dc3ce220b69217c899e468076abf8d78636d5ccfc85a31a75628ba88b': 'WoSign CT #1',
461
+ };
462
+
463
+ /**
464
+ * @license
465
+ * Copyright (c) Peculiar Ventures, LLC.
466
+ *
467
+ * This source code is licensed under the MIT license found in the
468
+ * LICENSE file in the root directory of this source tree.
469
+ */
470
+ const CertificateTransparencyExtension = (props) => {
471
+ const { extension } = props;
472
+ return (h(BasicExtension, { extension: extension }, extension.value.toJSON().map((signedCertificateTimestamp, arrayIndex) => ([
473
+ h(RowValue, { name: `SCT #${arrayIndex + 1}`, value: "" }),
474
+ h(RowValue, { name: "Version", value: signedCertificateTimestamp.version + 1 }),
475
+ h(RowValue, { name: "Log Operator", value: logs[signedCertificateTimestamp.logId] || signedCertificateTimestamp.logId }),
476
+ h(RowValue, { name: "Log Key ID", value: signedCertificateTimestamp.logId, monospace: true }),
477
+ h(RowValue, { name: "Timestamp", value: dateShort(signedCertificateTimestamp.timestamp) }),
478
+ h(RowValue, { name: "Signature Algorithm", value: `${signedCertificateTimestamp.hashAlgorithm} ${signedCertificateTimestamp.signatureAlgorithm}`.toUpperCase() }),
479
+ h(RowValue, { name: "Signature", value: signedCertificateTimestamp.signature, monospace: true }),
480
+ ]))));
481
+ };
482
+
483
+ /**
484
+ * @license
485
+ * Copyright (c) Peculiar Ventures, LLC.
486
+ *
487
+ * This source code is licensed under the MIT license found in the
488
+ * LICENSE file in the root directory of this source tree.
489
+ */
490
+ const NameConstraintsExtension = (props) => {
491
+ var _a, _b;
492
+ const { extension } = props;
493
+ return (h(BasicExtension, { extension: extension }, (_a = extension.value.excludedSubtrees) === null || _a === void 0 ? void 0 :
494
+ _a.map((generalSubtree) => (h(GeneralNamePart, Object.assign({ generalName: generalSubtree.base }, props)))), (_b = extension.value.permittedSubtrees) === null || _b === void 0 ? void 0 :
495
+ _b.map((generalSubtree) => (h(GeneralNamePart, Object.assign({ generalName: generalSubtree.base }, props))))));
496
+ };
497
+
498
+ /**
499
+ * @license
500
+ * Copyright (c) Peculiar Ventures, LLC.
501
+ *
502
+ * This source code is licensed under the MIT license found in the
503
+ * LICENSE file in the root directory of this source tree.
504
+ */
505
+ const CertificateTemplateExtension = (props) => {
506
+ const { extension } = props;
507
+ return (h(BasicExtension, { extension: extension },
508
+ h(RowValue, { name: "Template ID", value: extension.value.templateID }),
509
+ h(RowValue, { name: "Template Major Version", value: extension.value.templateMajorVersion }),
510
+ h(RowValue, { name: "Template Minor Version", value: extension.value.templateMinorVersion })));
511
+ };
512
+
513
+ /**
514
+ * @license
515
+ * Copyright (c) Peculiar Ventures, LLC.
516
+ *
517
+ * This source code is licensed under the MIT license found in the
518
+ * LICENSE file in the root directory of this source tree.
519
+ */
520
+ const EnrollCertTypeChoiceExtension = (props) => {
521
+ const { extension } = props;
522
+ return (h(BasicExtension, { extension: extension },
523
+ h(RowValue, { name: "Name", value: extension.value.toString() })));
524
+ };
525
+
526
+ /**
527
+ * @license
528
+ * Copyright (c) Peculiar Ventures, LLC.
529
+ *
530
+ * This source code is licensed under the MIT license found in the
531
+ * LICENSE file in the root directory of this source tree.
532
+ */
533
+ const CaVersionExtension = (props) => {
534
+ const { extension } = props;
535
+ const version = extension.value.getVersion();
536
+ return (h(BasicExtension, { extension: extension },
537
+ h(RowValue, { name: "Certificate Index", value: version.certificateIndex }),
538
+ h(RowValue, { name: "Key Index", value: version.keyIndex })));
539
+ };
540
+
541
+ /**
542
+ * @license
543
+ * Copyright (c) Peculiar Ventures, LLC.
544
+ *
545
+ * This source code is licensed under the MIT license found in the
546
+ * LICENSE file in the root directory of this source tree.
547
+ */
548
+ const QCStatementsExtension = (props) => {
549
+ const { extension } = props;
550
+ return (h(BasicExtension, { extension: extension }, extension.value.map((statement, arrayIndex) => ([
551
+ h(RowValue, { name: `Statement #${arrayIndex + 1}`, value: "" }),
552
+ h(RowValue, { name: "ID", value: getStringByOID(statement.statementId) }),
553
+ h(RowValue, { name: "Info", value: statement.statementInfo.byteLength ? build.Convert.ToHex(statement.statementInfo) : null, monospace: true }),
554
+ ]))));
555
+ };
556
+
557
+ /**
558
+ * @license
559
+ * Copyright (c) Peculiar Ventures, LLC.
560
+ *
561
+ * This source code is licensed under the MIT license found in the
562
+ * LICENSE file in the root directory of this source tree.
563
+ */
564
+ const NetscapeCommentExtension = (props) => {
565
+ const { extension } = props;
566
+ return (h(BasicExtension, { extension: extension },
567
+ h(RowValue, { name: "Comment", value: extension.value.value })));
568
+ };
569
+
570
+ /**
571
+ * @license
572
+ * Copyright (c) Peculiar Ventures, LLC.
573
+ *
574
+ * This source code is licensed under the MIT license found in the
575
+ * LICENSE file in the root directory of this source tree.
576
+ */
577
+ const NetscapeCertTypeExtension = (props) => {
578
+ const { extension } = props;
579
+ return (h(BasicExtension, { extension: extension },
580
+ h(RowValue, { name: "Type", value: extension.value.toJSON().join(', ') })));
581
+ };
582
+
583
+ /**
584
+ * @license
585
+ * Copyright (c) Peculiar Ventures, LLC.
586
+ *
587
+ * This source code is licensed under the MIT license found in the
588
+ * LICENSE file in the root directory of this source tree.
589
+ */
590
+ const LeiRoleExtension = (props) => {
591
+ const { extension } = props;
592
+ return (h(BasicExtension, { extension: extension },
593
+ h(RowValue, { name: "Role", value: extension.value.text })));
594
+ };
595
+
596
+ /**
597
+ * @license
598
+ * Copyright (c) Peculiar Ventures, LLC.
599
+ *
600
+ * This source code is licensed under the MIT license found in the
601
+ * LICENSE file in the root directory of this source tree.
602
+ */
603
+ const LeiExtension = (props) => {
604
+ const { extension, getLEILink } = props;
605
+ return (h(BasicExtension, { extension: extension },
606
+ h(RowValue, { name: "Identifier", value: extension.value.text, href: getLEILink(extension.value.text) })));
607
+ };
608
+
609
+ /**
610
+ * @license
611
+ * Copyright (c) Peculiar Ventures, LLC.
612
+ *
613
+ * This source code is licensed under the MIT license found in the
614
+ * LICENSE file in the root directory of this source tree.
615
+ */
616
+ const TimestampExtension = (props) => {
617
+ const { extension } = props;
618
+ return (h(BasicExtension, { extension: extension },
619
+ h(RowValue, { name: "Version", value: extension.value.version }),
620
+ h(GeneralNamePart, Object.assign({ generalName: extension.value.location }, props)),
621
+ h(RowValue, { name: "Requires Auth", value: extension.value.requiresAuth ? 'YES' : 'NO' })));
622
+ };
623
+
624
+ /**
625
+ * @license
626
+ * Copyright (c) Peculiar Ventures, LLC.
627
+ *
628
+ * This source code is licensed under the MIT license found in the
629
+ * LICENSE file in the root directory of this source tree.
630
+ */
631
+ const ArchiveRevInfoExtension = (props) => {
632
+ const { extension } = props;
633
+ return (h(BasicExtension, { extension: extension },
634
+ h(RowValue, { name: "Version", value: extension.value.version })));
635
+ };
636
+
637
+ /**
638
+ * @license
639
+ * Copyright (c) Peculiar Ventures, LLC.
640
+ *
641
+ * This source code is licensed under the MIT license found in the
642
+ * LICENSE file in the root directory of this source tree.
643
+ */
644
+ const CRLReasonExtension = (props) => {
645
+ const { extension } = props;
646
+ return (h(BasicExtension, { extension: extension },
647
+ h(RowValue, { name: "Reason", value: extension.value.toJSON() })));
648
+ };
649
+
650
+ /**
651
+ * @license
652
+ * Copyright (c) Peculiar Ventures, LLC.
653
+ *
654
+ * This source code is licensed under the MIT license found in the
655
+ * LICENSE file in the root directory of this source tree.
656
+ */
657
+ function getAttributeValue(attribute) {
658
+ return build.Convert.ToString(attribute.values[0]);
659
+ }
660
+
661
+ /**
662
+ * @license
663
+ * Copyright (c) Peculiar Ventures, LLC.
664
+ *
665
+ * This source code is licensed under the MIT license found in the
666
+ * LICENSE file in the root directory of this source tree.
667
+ */
668
+ const SubjectDirectoryAttributesExtension = (props) => {
669
+ const { extension } = props;
670
+ return (h(BasicExtension, { extension: extension }, extension.value.map((attribute, arrayIndex) => ([
671
+ h(RowValue, { name: `Attribute #${arrayIndex + 1}`, value: "" }),
672
+ h(RowValue, { name: "Type", value: getStringByOID(attribute.type) }),
673
+ h(RowValue, { name: "Value", value: getAttributeValue(attribute) }),
674
+ ]))));
675
+ };
676
+
677
+ /**
678
+ * @license
679
+ * Copyright (c) Peculiar Ventures, LLC.
680
+ *
681
+ * This source code is licensed under the MIT license found in the
682
+ * LICENSE file in the root directory of this source tree.
683
+ */
684
+ const AsStringExtension = (props) => {
685
+ const { extension } = props;
686
+ return (h(BasicExtension, { extension: extension },
687
+ h(RowValue, { name: "Value", value: extension.value, monospace: true })));
688
+ };
689
+
690
+ /**
691
+ * @license
692
+ * Copyright (c) Peculiar Ventures, LLC.
693
+ *
694
+ * This source code is licensed under the MIT license found in the
695
+ * LICENSE file in the root directory of this source tree.
696
+ */
697
+ const PrivateKeyUsagePeriodExtension = (props) => {
698
+ const { extension } = props;
699
+ return (h(BasicExtension, { extension: extension },
700
+ h(RowValue, { name: "Not Before", value: dateShort(extension.value.notBefore) }),
701
+ h(RowValue, { name: "Not After", value: dateShort(extension.value.notAfter) })));
702
+ };
703
+
704
+ /**
705
+ * @license
706
+ * Copyright (c) Peculiar Ventures, LLC.
707
+ *
708
+ * This source code is licensed under the MIT license found in the
709
+ * LICENSE file in the root directory of this source tree.
710
+ */
711
+ const EntrustVersionInfoExtension = (props) => {
712
+ const { extension } = props;
713
+ return (h(BasicExtension, { extension: extension },
714
+ h(RowValue, { name: "Version", value: extension.value.entrustVers }),
715
+ h(RowValue, { name: "Info Flags", value: extension.value.entrustInfoFlags.toJSON().join(', ') })));
716
+ };
717
+
718
+ /**
719
+ * @license
720
+ * Copyright (c) Peculiar Ventures, LLC.
721
+ *
722
+ * This source code is licensed under the MIT license found in the
723
+ * LICENSE file in the root directory of this source tree.
724
+ */
725
+ const BiometricSyntaxExtension = (props) => {
726
+ const { extension } = props;
727
+ return (h(BasicExtension, { extension: extension }, extension.value.map((data, arrayIndex) => ([
728
+ h(RowValue, { name: `Biometric #${arrayIndex + 1}`, value: "" }),
729
+ h(RowValue, { name: "OID", value: getStringByOID(data.typeOfBiometricData.biometricDataOid) }),
730
+ h(RowValue, { name: "Type", value: data.typeOfBiometricData.predefinedBiometricType }),
731
+ h(RowValue, { name: "Algorithm", value: getStringByOID(data.hashAlgorithm.algorithm) }),
732
+ h(RowValue, { name: "Hash", value: build.Convert.ToHex(data.biometricDataHash.buffer), monospace: true }),
733
+ h(RowValue, { name: "Source Uri", value: data.sourceDataUri }),
734
+ ]))));
735
+ };
736
+
737
+ /**
738
+ * @license
739
+ * Copyright (c) Peculiar Ventures, LLC.
740
+ *
741
+ * This source code is licensed under the MIT license found in the
742
+ * LICENSE file in the root directory of this source tree.
743
+ */
744
+ const LogotypeExtension = (props) => {
745
+ const { extension } = props;
746
+ const renderImage = (image) => {
747
+ if (!image) {
748
+ return null;
749
+ }
750
+ return image.map((img) => {
751
+ const { imageDetails } = img;
752
+ return [
753
+ h(RowValue, { name: "Image Type", value: imageDetails.mediaType }),
754
+ h(RowValue, { name: "Image Hash", value: build.Convert.ToHex(imageDetails.logotypeHash[0].hashValue), monospace: true }),
755
+ h(RowValue, { name: "Image URL", value: imageDetails.logotypeURI[0], monospace: true, collapse: true }),
756
+ h(RowValue, { name: "Image Hash Algorithm", value: getStringByOID(imageDetails.logotypeHash[0].hashAlg.algorithm) }),
757
+ ];
758
+ });
759
+ };
760
+ const renderAudio = (audio) => {
761
+ if (!audio) {
762
+ return null;
763
+ }
764
+ return audio.map((aud) => {
765
+ const { audioDetails } = aud;
766
+ return [
767
+ h(RowValue, { name: "Audio Type", value: audioDetails.mediaType }),
768
+ h(RowValue, { name: "Audio Hash", value: build.Convert.ToHex(audioDetails.logotypeHash[0].hashValue), monospace: true }),
769
+ h(RowValue, { name: "Audio URL", value: audioDetails.logotypeURI[0], monospace: true, collapse: true }),
770
+ h(RowValue, { name: "Audio Hash Algorithm", value: getStringByOID(audioDetails.logotypeHash[0].hashAlg.algorithm) }),
771
+ ];
772
+ });
773
+ };
774
+ const renderLogo = (title, info) => {
775
+ if (!info || !info.direct) {
776
+ return null;
777
+ }
778
+ const { image, audio } = info.direct;
779
+ return [
780
+ h(RowValue, { name: "Type", value: title }),
781
+ renderImage(image),
782
+ renderAudio(audio),
783
+ h("tr", null,
784
+ h("td", null),
785
+ h("td", null)),
786
+ ];
787
+ };
788
+ return (h(BasicExtension, { extension: extension },
789
+ renderLogo('Subject', extension.value.subjectLogo),
790
+ renderLogo('Issuer', extension.value.issuerLogo)));
791
+ };
792
+
793
+ /**
794
+ * @license
795
+ * Copyright (c) Peculiar Ventures, LLC.
796
+ *
797
+ * This source code is licensed under the MIT license found in the
798
+ * LICENSE file in the root directory of this source tree.
799
+ */
800
+ const TNAuthListExtension = (props) => {
801
+ const { extension } = props;
802
+ return (h(BasicExtension, { extension: extension }, extension.value.map((entry, arrayIndex) => ([
803
+ h(RowValue, { name: `Entry #${arrayIndex + 1}`, value: "" }),
804
+ h(RowValue, { name: "SPC", value: entry.spc }),
805
+ h(RowValue, { name: "Range", value: entry.range ? `start=${entry.range.start} count==${entry.range.count}` : null }),
806
+ h(RowValue, { name: "One", value: entry.one }),
807
+ ]))));
808
+ };
809
+
810
+ /**
811
+ * @license
812
+ * Copyright (c) Peculiar Ventures, LLC.
813
+ *
814
+ * This source code is licensed under the MIT license found in the
815
+ * LICENSE file in the root directory of this source tree.
816
+ */
817
+ const PolicyConstraintsExtension = (props) => {
818
+ const { extension } = props;
819
+ return (h(BasicExtension, { extension: extension },
820
+ extension.value.requireExplicitPolicy && (h(RowValue, { name: "Require Explicit Policy", value: AsnIntegerArrayBufferConverter.toASN(extension.value.requireExplicitPolicy).valueBlock.toString() })),
821
+ extension.value.inhibitPolicyMapping && (h(RowValue, { name: "Inhibit Policy Mapping", value: AsnIntegerArrayBufferConverter.toASN(extension.value.inhibitPolicyMapping).valueBlock.toString() }))));
822
+ };
823
+
824
+ /**
825
+ * @license
826
+ * Copyright (c) Peculiar Ventures, LLC.
827
+ *
828
+ * This source code is licensed under the MIT license found in the
829
+ * LICENSE file in the root directory of this source tree.
830
+ */
831
+ const PolicyMappingsExtension = (props) => {
832
+ const { extension } = props;
833
+ return (h(BasicExtension, { extension: extension }, extension.value.map((policy, arrayIndex) => ([
834
+ h(RowValue, { name: `Policy #${arrayIndex + 1}`, value: "" }),
835
+ h(RowValue, { name: "Issuer Domain", value: getStringByOID(policy.issuerDomainPolicy) }),
836
+ h(RowValue, { name: "Subject Domain", value: getStringByOID(policy.subjectDomainPolicy) }),
837
+ ]))));
838
+ };
839
+
840
+ /**
841
+ * @license
842
+ * Copyright (c) Peculiar Ventures, LLC.
843
+ *
844
+ * This source code is licensed under the MIT license found in the
845
+ * LICENSE file in the root directory of this source tree.
846
+ */
847
+ const Extensions = (props) => {
848
+ const { extensions, title } = props;
849
+ if (!extensions || !extensions.length) {
850
+ return null;
851
+ }
852
+ return ([
853
+ h(RowTitle, { value: title || 'Extensions' }),
854
+ extensions.map((extension) => {
855
+ try {
856
+ if (extension.value instanceof KeyUsage) {
857
+ return (h(KeyUsageExtension, { extension: extension }));
858
+ }
859
+ if (extension.value instanceof BasicConstraints) {
860
+ return (h(BasicConstraintsExtension, { extension: extension }));
861
+ }
862
+ if (extension.value instanceof ExtendedKeyUsage) {
863
+ return (h(ExtendedKeyUsageExtension, { extension: extension }));
864
+ }
865
+ if (extension.value instanceof SubjectKeyIdentifier) {
866
+ return (h(SubjectKeyIdentifierExtension, Object.assign({ extension: extension }, props)));
867
+ }
868
+ if (extension.value instanceof AuthorityKeyIdentifier) {
869
+ return (h(AuthorityKeyIdentifierExtension, Object.assign({ extension: extension }, props)));
870
+ }
871
+ if (extension.value instanceof CRLDistributionPoints) {
872
+ return (h(CRLDistributionPointsExtension, Object.assign({ extension: extension }, props)));
873
+ }
874
+ if (extension.value instanceof AuthorityInfoAccessSyntax
875
+ || extension.value instanceof SubjectInfoAccessSyntax) {
876
+ return (h(InfoAccessSyntaxExtension, Object.assign({ extension: extension }, props)));
877
+ }
878
+ if (extension.value instanceof SubjectAlternativeName) {
879
+ return (h(SubjectAlternativeNameExtension, Object.assign({ extension: extension }, props)));
880
+ }
881
+ if (extension.value instanceof CertificatePolicies) {
882
+ return (h(CertificatePoliciesExtension, { extension: extension }));
883
+ }
884
+ if (extension.value instanceof CertificateTransparency) {
885
+ return (h(CertificateTransparencyExtension, { extension: extension }));
886
+ }
887
+ if (extension.value instanceof NameConstraints) {
888
+ return (h(NameConstraintsExtension, Object.assign({ extension: extension }, props)));
889
+ }
890
+ if (extension.value instanceof CertificateTemplate) {
891
+ return (h(CertificateTemplateExtension, { extension: extension }));
892
+ }
893
+ if (extension.value instanceof EnrollCertTypeChoice) {
894
+ return (h(EnrollCertTypeChoiceExtension, { extension: extension }));
895
+ }
896
+ if (extension.value instanceof CaVersion) {
897
+ return (h(CaVersionExtension, { extension: extension }));
898
+ }
899
+ if (extension.value instanceof QCStatements) {
900
+ return (h(QCStatementsExtension, { extension: extension }));
901
+ }
902
+ if (extension.value instanceof NetscapeComment) {
903
+ return (h(NetscapeCommentExtension, { extension: extension }));
904
+ }
905
+ if (extension.value instanceof NetscapeCertType) {
906
+ return (h(NetscapeCertTypeExtension, { extension: extension }));
907
+ }
908
+ if (extension.value instanceof LeiRole) {
909
+ return (h(LeiRoleExtension, { extension: extension }));
910
+ }
911
+ if (extension.value instanceof LeiChoice) {
912
+ return (h(LeiExtension, Object.assign({ extension: extension }, props)));
913
+ }
914
+ if (extension.value instanceof Timestamp) {
915
+ return (h(TimestampExtension, Object.assign({ extension: extension }, props)));
916
+ }
917
+ if (extension.value instanceof ArchiveRevInfo) {
918
+ return (h(ArchiveRevInfoExtension, { extension: extension }));
919
+ }
920
+ if (extension.value instanceof CRLReason) {
921
+ return (h(CRLReasonExtension, { extension: extension }));
922
+ }
923
+ if (extension.value instanceof SubjectDirectoryAttributes) {
924
+ return (h(SubjectDirectoryAttributesExtension, { extension: extension }));
925
+ }
926
+ if (extension.value instanceof PrivateKeyUsagePeriod) {
927
+ return (h(PrivateKeyUsagePeriodExtension, { extension: extension }));
928
+ }
929
+ if (extension.value instanceof EntrustVersionInfo) {
930
+ return (h(EntrustVersionInfoExtension, { extension: extension }));
931
+ }
932
+ if (extension.value instanceof BiometricSyntax) {
933
+ return (h(BiometricSyntaxExtension, { extension: extension }));
934
+ }
935
+ if (extension.value instanceof LogotypeExtn) {
936
+ return (h(LogotypeExtension, { extension: extension }));
937
+ }
938
+ if (extension.value instanceof TNAuthorizationList) {
939
+ return (h(TNAuthListExtension, { extension: extension }));
940
+ }
941
+ if (extension.value instanceof PolicyConstraints) {
942
+ return (h(PolicyConstraintsExtension, { extension: extension }));
943
+ }
944
+ if (extension.value instanceof PolicyMappings) {
945
+ return (h(PolicyMappingsExtension, { extension: extension }));
946
+ }
947
+ if (typeof extension.value === 'string') {
948
+ return (h(AsStringExtension, { extension: extension }));
949
+ }
950
+ return (h(BasicExtension, { extension: extension }));
951
+ }
952
+ catch (error) {
953
+ console.error('Error render extension:', extension.asn.extnID);
954
+ return null;
955
+ }
956
+ }),
957
+ ]);
958
+ };
959
+
960
+ /**
961
+ * @license
962
+ * Copyright (c) Peculiar Ventures, LLC.
963
+ *
964
+ * This source code is licensed under the MIT license found in the
965
+ * LICENSE file in the root directory of this source tree.
966
+ */
967
+ const BasicInformation = (props) => {
968
+ const { serialNumber, version, validity, notBefore, notAfter, type, } = props;
969
+ return [
970
+ h(RowTitle, { value: l10n.getString('basicInformation') }),
971
+ h(RowValue, { name: l10n.getString('type'), value: type }),
972
+ h(RowValue, { name: l10n.getString('serialNumber'), value: serialNumber, monospace: true }),
973
+ h(RowValue, { name: l10n.getString('version'), value: version }),
974
+ h(RowValue, { name: l10n.getString('validity'), value: validity }),
975
+ h(RowValue, { name: l10n.getString('issued'), value: notBefore ? dateShort(notBefore) : undefined }),
976
+ h(RowValue, { name: l10n.getString('expired'), value: notAfter ? dateShort(notAfter) : undefined }),
977
+ ];
978
+ };
979
+
980
+ /**
981
+ * @license
982
+ * Copyright (c) Peculiar Ventures, LLC.
983
+ *
984
+ * This source code is licensed under the MIT license found in the
985
+ * LICENSE file in the root directory of this source tree.
986
+ */
987
+ function downloadCertificateAsPem(certificate) {
988
+ if (certificate instanceof CSR) {
989
+ Download.pkcs10.asPEM(certificate.exportAsPemFormatted(), certificate.commonName);
990
+ }
991
+ else {
992
+ Download.x509.asPEM(certificate.exportAsPemFormatted(), certificate.commonName);
993
+ }
994
+ }
995
+ function downloadCertificateAsDer(certificate) {
996
+ if (certificate instanceof CSR) {
997
+ Download.pkcs10.asDER(certificate.exportAsHexFormatted(), certificate.commonName);
998
+ }
999
+ else {
1000
+ Download.x509.asDER(certificate.exportAsHexFormatted(), certificate.commonName);
1001
+ }
1002
+ }
1003
+ const Miscellaneous = (props) => {
1004
+ const { certificate } = props;
1005
+ return [
1006
+ h(RowTitle, { value: l10n.getString('miscellaneous') }),
1007
+ h("tr", null,
1008
+ h("td", { class: "vertical_align_middle" },
1009
+ h("peculiar-typography", { color: "grey_5" },
1010
+ l10n.getString('download'),
1011
+ ":")),
1012
+ h("td", null,
1013
+ h("peculiar-button-split", { onClick: downloadCertificateAsPem.bind(undefined, certificate), actions: [{
1014
+ text: l10n.getString('download.der'),
1015
+ onClick: downloadCertificateAsDer.bind(undefined, certificate),
1016
+ }] }, l10n.getString('download.pem')))),
1017
+ ];
1018
+ };
1019
+
1020
+ /**
1021
+ * @license
1022
+ * Copyright (c) Peculiar Ventures, LLC.
1023
+ *
1024
+ * This source code is licensed under the MIT license found in the
1025
+ * LICENSE file in the root directory of this source tree.
1026
+ */
1027
+ const getLEILink = (lei) => `https://search.gleif.org/#/record/${lei}`;
1028
+ const getDNSNameLink = (dnsName) => `https://search.censys.io/search?resource=hosts&q=dns.names%3A${dnsName}`;
1029
+ const getIPAddressLink = (ipAddress) => `https://search.censys.io/search?resource=hosts&q=ip%3A${ipAddress}`;
1030
+
1031
+ /**
1032
+ * @license
1033
+ * Copyright (c) Peculiar Ventures, LLC.
1034
+ *
1035
+ * This source code is licensed under the MIT license found in the
1036
+ * LICENSE file in the root directory of this source tree.
1037
+ */
1038
+ const SubjectName = (props) => {
1039
+ const { name } = props;
1040
+ return [
1041
+ h(RowTitle, { value: l10n.getString('subjectName') }),
1042
+ name.map((n) => (h(RowValue, { name: n.name || n.type, value: n.value }))),
1043
+ ];
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
+ function getPublicKeyModulus(publicKey) {
1054
+ var _a;
1055
+ if ((_a = publicKey.params) === null || _a === void 0 ? void 0 : _a['modulus']) {
1056
+ let length = publicKey.params['modulus'].byteLength;
1057
+ if (length % 2) {
1058
+ length -= 1;
1059
+ }
1060
+ return length * 8;
1061
+ }
1062
+ return null;
1063
+ }
1064
+ function getPublicKeyExponent(publicKey) {
1065
+ var _a;
1066
+ if ((_a = publicKey.params) === null || _a === void 0 ? void 0 : _a['publicExponent']) {
1067
+ return publicKey.params['publicExponent'].byteLength === 3
1068
+ ? 65537
1069
+ : 3;
1070
+ }
1071
+ return null;
1072
+ }
1073
+ const PublicKey = (props) => {
1074
+ var _a;
1075
+ const { publicKey } = props;
1076
+ if (!publicKey) {
1077
+ return null;
1078
+ }
1079
+ return [
1080
+ h(RowTitle, { value: l10n.getString('publicKeyInfo') }),
1081
+ h(RowValue, { name: l10n.getString('algorithm'), value: getStringByOID(publicKey.algorithm) }),
1082
+ h(RowValue, { name: l10n.getString('namedCurve'), value: getStringByOID((_a = publicKey.params) === null || _a === void 0 ? void 0 : _a['namedCurve']) }),
1083
+ h(RowValue, { name: l10n.getString('exponent'), value: getPublicKeyExponent(publicKey) }),
1084
+ h(RowValue, { name: l10n.getString('modulus'), value: getPublicKeyModulus(publicKey) }),
1085
+ h(RowValue, { name: l10n.getString('value'), value: build.Convert.ToHex(publicKey.value), monospace: true, collapse: true }),
1086
+ ];
1087
+ };
1088
+
1089
+ export { BasicInformation as B, Extensions as E, GeneralNamePart as G, Miscellaneous as M, PublicKey as P, RowValue as R, Signature as S, Thumbprints as T, RowTitle as a, getLEILink as b, getDNSNameLink as c, getIPAddressLink as d, SubjectName as e, getStringByOID as g };