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