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