@peculiar/certificates-viewer 1.20.1 → 2.0.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/{download-061c8763.js → download-cd98aa01.js} +3709 -7081
- package/dist/cjs/peculiar-attribute-certificate-viewer_9.cjs.entry.js +24 -24
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +1 -1
- package/dist/esm/{download-250f9495.js → download-1ff0a3be.js} +3708 -7081
- package/dist/esm/peculiar-attribute-certificate-viewer_9.entry.js +24 -24
- package/dist/esm/peculiar-certificates-viewer.entry.js +1 -1
- package/dist/esm-es5/{download-250f9495.js → download-1ff0a3be.js} +2359 -4509
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_9.entry.js +24 -24
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js +1 -1
- package/dist/peculiar/{p-293edf5c.system.entry.js → p-3d339152.system.entry.js} +1 -1
- package/dist/peculiar/p-557d912f.system.js +1 -1
- package/dist/peculiar/p-84e8326d.entry.js +110 -0
- package/dist/peculiar/p-94f96303.system.js +100 -0
- package/dist/peculiar/{p-75793893.entry.js → p-dbdd61e7.entry.js} +1 -1
- package/dist/peculiar/p-dc6b70b2.js +100 -0
- package/dist/peculiar/p-fc92385a.system.entry.js +457 -0
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/package.json +20 -20
- package/dist/peculiar/p-31a15658.entry.js +0 -110
- package/dist/peculiar/p-636aea18.system.js +0 -78
- package/dist/peculiar/p-aece90c7.system.entry.js +0 -457
- package/dist/peculiar/p-e5769859.js +0 -77
|
@@ -48,8 +48,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
import { h, r as registerInstance, H as Host, c as createEvent } from './index-5ef692cc.js';
|
|
51
|
-
import { A as AsnData, a as Attribute$1, i as index, b as id_pkcs9_at_extensionRequest, c as AsnParser, E as ExtensionRequest, d as Extension, e as AsnConvert, f as id_pkcs9_at_unstructuredName, U as UnstructuredName, g as id_pkcs9_at_challengePassword, C as ChallengePassword, h as id_ValuationRanking, V as ValuationRanking, j as id_InsuranceValue, I as InsuranceValue, k as id_WebGDPR, W as WebGDPR, l as id_ActivityDescription, m as ActivityDescription, n as id_TypeRelationship, T as TypeRelationship, o as id_DomainNameTechnicalOperator, D as DomainNameTechnicalOperator, p as id_DomainNameOwner, q as DomainNameOwner, r as id_DomainNameLegalRepresentative, s as DomainNameLegalRepresentative, t as id_DomainNameBeneficiary, u as DomainNameBeneficiary, v as certificateRawToBuffer, w as AttributeCertificate, x as getCertificateThumbprint, y as hexFormat, z as base64Format, B as CertificationRequest, N as Name, F as id_ecPublicKey, G as ECParameters, H as id_rsaEncryption, R as RSAPublicKey, O as OIDs, J as Name$1, K as OtherName, L as DisplayText, M as UserNotice, P as EDIPartyName, Q as AsnIntegerArrayBufferConverter, S as KeyUsage, X as BasicConstraints, Y as ExtendedKeyUsage, Z as SubjectKeyIdentifier, _ as AuthorityKeyIdentifier, $ as CRLDistributionPoints, a0 as AuthorityInfoAccessSyntax, a1 as SubjectInfoAccessSyntax, a2 as SubjectAlternativeName, a3 as CertificatePolicies, a4 as CertificateTransparency, a5 as NameConstraints, a6 as CertificateTemplate, a7 as EnrollCertTypeChoice, a8 as CaVersion, a9 as QCStatements, aa as NetscapeComment, ab as NetscapeCertType, ac as LeiRole, ad as LeiChoice, ae as Timestamp, af as ArchiveRevInfo, ag as CRLReason, ah as SubjectDirectoryAttributes, ai as PrivateKeyUsagePeriod, aj as EntrustVersionInfo, ak as BiometricSyntax, al as LogotypeExtn, am as TNAuthorizationList, an as PolicyConstraints, ao as PolicyMappings, ap as Download, aq as isPem, ar as isX509Pem, as as isPkcs10Pem, at as isX509AttributePem, au as X509Certificate } from './download-250f9495.js';
|
|
52
51
|
import { d as dateDiff, l as l10n, a as dateShort, h as history } from './l10n-c8cf6930.js';
|
|
52
|
+
import { A as AsnData, a as Attribute$1, b as build_2, i as id_pkcs9_at_extensionRequest, c as AsnParser, E as ExtensionRequest, d as Extension, e as AsnConvert, f as id_pkcs9_at_unstructuredName, U as UnstructuredName, g as id_pkcs9_at_challengePassword, C as ChallengePassword, h as id_ValuationRanking, V as ValuationRanking, j as id_InsuranceValue, I as InsuranceValue, k as id_WebGDPR, W as WebGDPR, l as id_ActivityDescription, m as ActivityDescription, n as id_TypeRelationship, T as TypeRelationship, o as id_DomainNameTechnicalOperator, D as DomainNameTechnicalOperator, p as id_DomainNameOwner, q as DomainNameOwner, r as id_DomainNameLegalRepresentative, s as DomainNameLegalRepresentative, t as id_DomainNameBeneficiary, u as DomainNameBeneficiary, v as certificateRawToBuffer, w as AttributeCertificate, x as getCertificateThumbprint, y as hexFormat, z as base64Format, B as CertificationRequest, N as Name, F as id_ecPublicKey, G as ECParameters, H as id_rsaEncryption, R as RSAPublicKey, O as OIDs, J as Name$1, K as OtherName, L as DisplayText, M as UserNotice, P as build_1, Q as EDIPartyName, S as AsnIntegerArrayBufferConverter, X as KeyUsage, Y as BasicConstraints, Z as ExtendedKeyUsage, _ as SubjectKeyIdentifier, $ as AuthorityKeyIdentifier, a0 as CRLDistributionPoints, a1 as AuthorityInfoAccessSyntax, a2 as SubjectInfoAccessSyntax, a3 as SubjectAlternativeName, a4 as CertificatePolicies, a5 as CertificateTransparency, a6 as NameConstraints, a7 as CertificateTemplate, a8 as EnrollCertTypeChoice, a9 as CaVersion, aa as QCStatements, ab as NetscapeComment, ac as NetscapeCertType, ad as LeiRole, ae as LeiChoice, af as Timestamp, ag as ArchiveRevInfo, ah as CRLReason, ai as SubjectDirectoryAttributes, aj as PrivateKeyUsagePeriod, ak as EntrustVersionInfo, al as BiometricSyntax, am as LogotypeExtn, an as TNAuthorizationList, ao as PolicyConstraints, ap as PolicyMappings, aq as Download, ar as isPem, as as isX509Pem, at as isPkcs10Pem, au as isX509AttributePem, av as X509Certificate } from './download-1ff0a3be.js';
|
|
53
53
|
/**
|
|
54
54
|
* @license
|
|
55
55
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -134,7 +134,7 @@ var Attribute = /** @class */ (function (_super) {
|
|
|
134
134
|
break;
|
|
135
135
|
}
|
|
136
136
|
default:
|
|
137
|
-
_this.value =
|
|
137
|
+
_this.value = build_2.ToHex(asnExtnValue);
|
|
138
138
|
}
|
|
139
139
|
return _this;
|
|
140
140
|
}
|
|
@@ -159,7 +159,7 @@ var X509AttributeCertificate = /** @class */ (function (_super) {
|
|
|
159
159
|
_this.thumbprints = {};
|
|
160
160
|
_this.type = 'X.509 Attribute Certificate';
|
|
161
161
|
var acinfo = _this.asn.acinfo;
|
|
162
|
-
_this.serialNumber =
|
|
162
|
+
_this.serialNumber = build_2.ToHex(acinfo.serialNumber);
|
|
163
163
|
_this.version = acinfo.version;
|
|
164
164
|
var notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;
|
|
165
165
|
if (!notBefore) {
|
|
@@ -212,7 +212,7 @@ var X509AttributeCertificate = /** @class */ (function (_super) {
|
|
|
212
212
|
return [4 /*yield*/, getCertificateThumbprint(algorithm, this.raw)];
|
|
213
213
|
case 1:
|
|
214
214
|
thumbprint = _c.sent();
|
|
215
|
-
this.thumbprints[algorithm['name'] || algorithm] =
|
|
215
|
+
this.thumbprints[algorithm['name'] || algorithm] = build_2.ToHex(thumbprint);
|
|
216
216
|
return [3 /*break*/, 3];
|
|
217
217
|
case 2:
|
|
218
218
|
error_1 = _c.sent();
|
|
@@ -224,10 +224,10 @@ var X509AttributeCertificate = /** @class */ (function (_super) {
|
|
|
224
224
|
});
|
|
225
225
|
};
|
|
226
226
|
X509AttributeCertificate.prototype.exportAsBase64 = function () {
|
|
227
|
-
return
|
|
227
|
+
return build_2.ToBase64(this.raw);
|
|
228
228
|
};
|
|
229
229
|
X509AttributeCertificate.prototype.exportAsHexFormatted = function () {
|
|
230
|
-
return hexFormat(
|
|
230
|
+
return hexFormat(build_2.ToHex(this.raw));
|
|
231
231
|
};
|
|
232
232
|
X509AttributeCertificate.prototype.exportAsPemFormatted = function () {
|
|
233
233
|
return "-----BEGIN ATTRIBUTE CERTIFICATE-----\n" + base64Format(this.exportAsBase64()) + "\n-----END ATTRIBUTE CERTIFICATE-----";
|
|
@@ -317,7 +317,7 @@ var CSR = /** @class */ (function (_super) {
|
|
|
317
317
|
return [4 /*yield*/, getCertificateThumbprint(algorithm, this.raw)];
|
|
318
318
|
case 1:
|
|
319
319
|
thumbprint = _c.sent();
|
|
320
|
-
this.thumbprints[algorithm['name'] || algorithm] =
|
|
320
|
+
this.thumbprints[algorithm['name'] || algorithm] = build_2.ToHex(thumbprint);
|
|
321
321
|
return [3 /*break*/, 3];
|
|
322
322
|
case 2:
|
|
323
323
|
error_2 = _c.sent();
|
|
@@ -336,10 +336,10 @@ var CSR = /** @class */ (function (_super) {
|
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
CSR.prototype.exportAsBase64 = function () {
|
|
339
|
-
return
|
|
339
|
+
return build_2.ToBase64(this.raw);
|
|
340
340
|
};
|
|
341
341
|
CSR.prototype.exportAsHexFormatted = function () {
|
|
342
|
-
return hexFormat(
|
|
342
|
+
return hexFormat(build_2.ToHex(this.raw));
|
|
343
343
|
};
|
|
344
344
|
CSR.prototype.exportAsPemFormatted = function () {
|
|
345
345
|
return "-----BEGIN CERTIFICATE REQUEST-----\n" + base64Format(this.exportAsBase64()) + "\n-----END CERTIFICATE REQUEST-----";
|
|
@@ -419,7 +419,7 @@ var Signature = function (props) {
|
|
|
419
419
|
return [
|
|
420
420
|
h(RowTitle, { value: l10n.getString('signature') }),
|
|
421
421
|
h(RowValue, { name: l10n.getString('algorithm'), value: getStringByOID(signature.algorithm) }),
|
|
422
|
-
h(RowValue, { name: l10n.getString('value'), value:
|
|
422
|
+
h(RowValue, { name: l10n.getString('value'), value: build_2.ToHex(signature.value), monospace: true, collapse: true }),
|
|
423
423
|
];
|
|
424
424
|
};
|
|
425
425
|
/**
|
|
@@ -510,13 +510,13 @@ var GeneralNamePart = function (props) {
|
|
|
510
510
|
catch (error) {
|
|
511
511
|
//
|
|
512
512
|
}
|
|
513
|
-
return (h(RowValue, { name: OIDs[value.typeId] || value.typeId, value:
|
|
513
|
+
return (h(RowValue, { name: OIDs[value.typeId] || value.typeId, value: build_2.ToHex(value.value), monospace: true }));
|
|
514
514
|
}
|
|
515
|
-
if (
|
|
516
|
-
return (h(RowValue, { name: names[name] || name, value:
|
|
515
|
+
if (build_1.isBufferSource(value)) {
|
|
516
|
+
return (h(RowValue, { name: names[name] || name, value: build_2.ToString(value) }));
|
|
517
517
|
}
|
|
518
518
|
if (value instanceof EDIPartyName) {
|
|
519
|
-
return (h(RowValue, { name: names[name] || name, value:
|
|
519
|
+
return (h(RowValue, { name: names[name] || name, value: build_2.ToString(value.partyName) }));
|
|
520
520
|
}
|
|
521
521
|
if (name === 'dNSName') {
|
|
522
522
|
return (h(RowValue, { name: names[name] || name, value: value, href: getDNSNameLink(value) }));
|
|
@@ -761,7 +761,7 @@ var ExtendedKeyUsageExtension = function (props) {
|
|
|
761
761
|
*/
|
|
762
762
|
var SubjectKeyIdentifierExtension = function (props) {
|
|
763
763
|
var extension = props.extension, getSubjectKeyIdChildrenLink = props.getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink = props.getSubjectKeyIdSiblingsLink;
|
|
764
|
-
var keyId =
|
|
764
|
+
var keyId = build_2.ToHex(extension.value.buffer);
|
|
765
765
|
var childrenLink = getSubjectKeyIdChildrenLink(keyId);
|
|
766
766
|
var siblingsLink = getSubjectKeyIdSiblingsLink(keyId);
|
|
767
767
|
return (h(BasicExtension, { extension: extension }, h(RowValue, { name: "Key ID", value: keyId, monospace: true, extraValue: [
|
|
@@ -778,7 +778,7 @@ var SubjectKeyIdentifierExtension = function (props) {
|
|
|
778
778
|
*/
|
|
779
779
|
var AuthorityKeyIdentifierExtension = function (props) {
|
|
780
780
|
var extension = props.extension, getAuthKeyIdParentLink = props.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink = props.getAuthKeyIdSiblingsLink;
|
|
781
|
-
var keyId =
|
|
781
|
+
var keyId = build_2.ToHex(extension.value.keyIdentifier.buffer);
|
|
782
782
|
var parentLink = getAuthKeyIdParentLink(keyId);
|
|
783
783
|
var siblingsLink = getAuthKeyIdSiblingsLink(keyId);
|
|
784
784
|
return (h(BasicExtension, { extension: extension }, h(RowValue, { name: "Key ID", value: keyId, monospace: true, extraValue: [
|
|
@@ -1027,7 +1027,7 @@ var QCStatementsExtension = function (props) {
|
|
|
1027
1027
|
return (h(BasicExtension, { extension: extension }, extension.value.map(function (statement, arrayIndex) { return ([
|
|
1028
1028
|
h(RowValue, { name: "Statement #" + (arrayIndex + 1), value: "" }),
|
|
1029
1029
|
h(RowValue, { name: "ID", value: getStringByOID(statement.statementId) }),
|
|
1030
|
-
h(RowValue, { name: "Info", value: statement.statementInfo.byteLength ?
|
|
1030
|
+
h(RowValue, { name: "Info", value: statement.statementInfo.byteLength ? build_2.ToHex(statement.statementInfo) : null, monospace: true }),
|
|
1031
1031
|
]); })));
|
|
1032
1032
|
};
|
|
1033
1033
|
/**
|
|
@@ -1115,7 +1115,7 @@ var CRLReasonExtension = function (props) {
|
|
|
1115
1115
|
* LICENSE file in the root directory of this source tree.
|
|
1116
1116
|
*/
|
|
1117
1117
|
function getAttributeValue(attribute) {
|
|
1118
|
-
return
|
|
1118
|
+
return build_2.ToString(attribute.values[0]);
|
|
1119
1119
|
}
|
|
1120
1120
|
/**
|
|
1121
1121
|
* @license
|
|
@@ -1179,7 +1179,7 @@ var BiometricSyntaxExtension = function (props) {
|
|
|
1179
1179
|
h(RowValue, { name: "OID", value: getStringByOID(data.typeOfBiometricData.biometricDataOid) }),
|
|
1180
1180
|
h(RowValue, { name: "Type", value: data.typeOfBiometricData.predefinedBiometricType }),
|
|
1181
1181
|
h(RowValue, { name: "Algorithm", value: getStringByOID(data.hashAlgorithm.algorithm) }),
|
|
1182
|
-
h(RowValue, { name: "Hash", value:
|
|
1182
|
+
h(RowValue, { name: "Hash", value: build_2.ToHex(data.biometricDataHash.buffer), monospace: true }),
|
|
1183
1183
|
h(RowValue, { name: "Source Uri", value: data.sourceDataUri }),
|
|
1184
1184
|
]); })));
|
|
1185
1185
|
};
|
|
@@ -1200,7 +1200,7 @@ var LogotypeExtension = function (props) {
|
|
|
1200
1200
|
var imageDetails = img.imageDetails;
|
|
1201
1201
|
return [
|
|
1202
1202
|
h(RowValue, { name: "Image Type", value: imageDetails.mediaType }),
|
|
1203
|
-
h(RowValue, { name: "Image Hash", value:
|
|
1203
|
+
h(RowValue, { name: "Image Hash", value: build_2.ToHex(imageDetails.logotypeHash[0].hashValue), monospace: true }),
|
|
1204
1204
|
h(RowValue, { name: "Image URL", value: imageDetails.logotypeURI[0], monospace: true, collapse: true }),
|
|
1205
1205
|
h(RowValue, { name: "Image Hash Algorithm", value: getStringByOID(imageDetails.logotypeHash[0].hashAlg.algorithm) }),
|
|
1206
1206
|
];
|
|
@@ -1214,7 +1214,7 @@ var LogotypeExtension = function (props) {
|
|
|
1214
1214
|
var audioDetails = aud.audioDetails;
|
|
1215
1215
|
return [
|
|
1216
1216
|
h(RowValue, { name: "Audio Type", value: audioDetails.mediaType }),
|
|
1217
|
-
h(RowValue, { name: "Audio Hash", value:
|
|
1217
|
+
h(RowValue, { name: "Audio Hash", value: build_2.ToHex(audioDetails.logotypeHash[0].hashValue), monospace: true }),
|
|
1218
1218
|
h(RowValue, { name: "Audio URL", value: audioDetails.logotypeURI[0], monospace: true, collapse: true }),
|
|
1219
1219
|
h(RowValue, { name: "Audio Hash Algorithm", value: getStringByOID(audioDetails.logotypeHash[0].hashAlg.algorithm) }),
|
|
1220
1220
|
];
|
|
@@ -1492,13 +1492,13 @@ var Holder = function (props) {
|
|
|
1492
1492
|
baseCertificateID && ([
|
|
1493
1493
|
baseCertificateID.issuer.map(function (item) { return (h(GeneralNamePart, { generalName: item, getDNSNameLink: function () { return ''; }, getIPAddressLink: function () { return ''; } })); }),
|
|
1494
1494
|
h("tr", null, h("td", null), h("td", null)),
|
|
1495
|
-
h(RowValue, { name: l10n.getString('serialNumber'), value:
|
|
1495
|
+
h(RowValue, { name: l10n.getString('serialNumber'), value: build_2.ToHex(baseCertificateID.serial), monospace: true }),
|
|
1496
1496
|
h("tr", null, h("td", null), h("td", null)),
|
|
1497
1497
|
]),
|
|
1498
1498
|
objectDigestInfo && ([
|
|
1499
1499
|
h(RowValue, { name: l10n.getString('digestInfo'), value: "" }),
|
|
1500
1500
|
h(RowValue, { name: l10n.getString('algorithm'), value: getStringByOID(objectDigestInfo.digestAlgorithm.algorithm) }),
|
|
1501
|
-
h(RowValue, { name: l10n.getString('value'), value:
|
|
1501
|
+
h(RowValue, { name: l10n.getString('value'), value: build_2.ToHex(objectDigestInfo.objectDigest), monospace: true }),
|
|
1502
1502
|
h(RowValue, { name: l10n.getString('type'), value: objectDigestInfo.digestedObjectType }),
|
|
1503
1503
|
]),
|
|
1504
1504
|
];
|
|
@@ -1854,7 +1854,7 @@ var PublicKey = function (props) {
|
|
|
1854
1854
|
h(RowValue, { name: l10n.getString('namedCurve'), value: getStringByOID((_a = publicKey.params) === null || _a === void 0 ? void 0 : _a['namedCurve']) }),
|
|
1855
1855
|
h(RowValue, { name: l10n.getString('exponent'), value: getPublicKeyExponent(publicKey) }),
|
|
1856
1856
|
h(RowValue, { name: l10n.getString('modulus'), value: getPublicKeyModulus(publicKey) }),
|
|
1857
|
-
h(RowValue, { name: l10n.getString('value'), value:
|
|
1857
|
+
h(RowValue, { name: l10n.getString('value'), value: build_2.ToHex(publicKey.value), monospace: true, collapse: true }),
|
|
1858
1858
|
];
|
|
1859
1859
|
};
|
|
1860
1860
|
/**
|
|
@@ -35,8 +35,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-5ef692cc.js';
|
|
38
|
-
import { au as X509Certificate, ap as Download, O as OIDs } from './download-250f9495.js';
|
|
39
38
|
import { l as l10n } from './l10n-c8cf6930.js';
|
|
39
|
+
import { av as X509Certificate, aq as Download, O as OIDs } from './download-1ff0a3be.js';
|
|
40
40
|
var certificatesViewerCss = ":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;min-width:280px;overflow:auto;position:relative;background:white;background:rgba(var(--pv-color-light-rgb), 1)}table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}table thead{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07)}table tr td{vertical-align:middle}table tbody tr:not(.expanded_summary){cursor:pointer}table tr{border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table th{padding:15px 10px;border-width:1px;border-style:solid;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table td{padding:8px 10px;border-width:1px;border-style:solid;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table .col_issuer,table .col_name,table .col_public_key{width:16%}table .col_actions,table .col_tests{width:18%}table.m_extra .col_issuer,table.m_extra .col_name,table.m_extra .col_public_key{width:12%}table.m_extra .col_actions,table.m_extra .col_tests{width:17%}table tr.expanded td:not(:last-child){border-right-color:transparent}table tr.expanded td{border-bottom-color:transparent}.expanded{border-bottom-color:transparent;background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}table tr.expanded_summary{background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}table tr.expanded_summary td{vertical-align:top;padding:10px 20px 26px}@-webkit-keyframes fadeIn{0%{opacity:0.001}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0.001}100%{opacity:1}}.modal_wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;overflow:auto;text-align:center;-webkit-animation:fadeIn 200ms;animation:fadeIn 200ms;padding:30px 10px}.modal_wrapper:before{display:inline-block;vertical-align:middle;width:0;height:100%;content:\"\"}.modal_backdrop{background:rgba(42, 49, 52, 0.5);background:rgba(var(--pv-color-dark-rgb), 0.5);z-index:-1;position:fixed;top:0;right:0;bottom:0;left:0}.modal_container{position:relative;display:inline-block;vertical-align:middle;width:100%;max-width:900px;text-align:left;border-radius:3px;overflow:hidden;background-color:white;background-color:rgba(var(--pv-color-light-rgb), 1);height:100%}.modal_title{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);border-bottom-width:1px;border-bottom-style:solid;padding:20px 60px 16px 20px;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:60px}.modal_content{height:calc(100% - 60px);overflow-y:auto}.modal_close{cursor:pointer;border:none;background-color:transparent;position:absolute;top:0;bottom:0;right:0;padding:0 12px;-webkit-transition:opacity 100ms;transition:opacity 100ms;outline:none}.modal_close:hover{opacity:0.6}.modal_close svg{fill:#2a3134;fill:rgba(var(--pv-color-dark-rgb), 1)}.button_table_action{margin:2px}.mobile_title{display:none}.status_wrapper{height:85px;text-align:center;pointer-events:none}.search_section{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);height:50px;padding:10px;border-width:1px 1px 0 1px;border-style:solid}.input_search{height:100%;width:100%;border-radius:3px;border-width:1px;border-style:solid;padding:0 14px;font-size:12px;outline:none;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);color:#2a3134;color:rgba(var(--pv-color-dark-rgb), 1)}.input_search::-moz-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search:-ms-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::-webkit-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::-ms-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.loading_container{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(42, 49, 52, 0.3);background:rgba(var(--pv-color-dark-rgb), 0.3);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.align_center{text-align:center}@media (hover: hover){table tbody tr:not(.expanded_summary):hover{background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}}@media (max-width: 900px){table,tbody,tr,td{display:block}thead{display:none}tr{padding:0 15px;border-width:1px;border-style:solid}tr:not(:first-child){margin-top:-1px}tr:not(.expanded_summary) td:first-child{border:none !important}table td{padding-left:0;padding-right:0;border-width:1px 0 0 0 !important;border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr.expanded_summary td{padding:15px 0}.mobile_title{display:inline-block;width:90px;vertical-align:middle}.modal_title{padding:17px 60px 17px 15px}.content{display:inline-block;width:calc(100% - 90px);vertical-align:middle;text-align:left}.expanded_summary{border-top-color:transparent;padding-bottom:10px}.expanded_summary td:before{content:none}.status_wrapper{height:266px;display:table-cell}.search_section{height:60px;padding:15px}.align_center{text-align:inherit}}";
|
|
41
41
|
var CertificatesViewer = /** @class */ (function () {
|
|
42
42
|
function class_1(hostRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,r,o){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function n(e){try{s(o.next(e))}catch(t){i(t)}}function l(e){try{s(o["throw"](e))}catch(t){i(t)}}function s(e){e.done?r(e.value):a(e.value).then(n,l)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,a,i,n;return n={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function l(e){return function(t){return s([e,t])}}function s(n){if(o)throw new TypeError("Generator is already executing.");while(r)try{if(o=1,a&&(i=n[0]&2?a["return"]:n[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;if(a=0,i)n=[n[0]&2,i.value];switch(n[0]){case 0:case 1:i=n;break;case 4:r.label++;return{value:n[1],done:false};case 5:r.label++;a=n[1];n=[0];continue;case 7:n=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(n[0]===6||n[0]===2)){r=0;continue}if(n[0]===3&&(!i||n[1]>i[0]&&n[1]<i[3])){r.label=n[1];break}if(n[0]===6&&r.label<i[1]){r.label=i[1];i=n;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(n);break}if(i[2])r.ops.pop();r.trys.pop();continue}n=t.call(e,r)}catch(l){n=[6,l];a=0}finally{o=i=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};System.register(["./p-9f815f76.system.js","./p-636aea18.system.js","./p-bd1f9066.system.js"],(function(e){"use strict";var t,r,o,a,i,n,l,s;return{setters:[function(e){t=e.r;r=e.c;o=e.h;a=e.H},function(e){i=e.au;n=e.ap;l=e.O},function(e){s=e.l}],execute:function(){var c=':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;min-width:280px;overflow:auto;position:relative;background:white;background:rgba(var(--pv-color-light-rgb), 1)}table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}table thead{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07)}table tr td{vertical-align:middle}table tbody tr:not(.expanded_summary){cursor:pointer}table tr{border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table th{padding:15px 10px;border-width:1px;border-style:solid;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table td{padding:8px 10px;border-width:1px;border-style:solid;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table .col_issuer,table .col_name,table .col_public_key{width:16%}table .col_actions,table .col_tests{width:18%}table.m_extra .col_issuer,table.m_extra .col_name,table.m_extra .col_public_key{width:12%}table.m_extra .col_actions,table.m_extra .col_tests{width:17%}table tr.expanded td:not(:last-child){border-right-color:transparent}table tr.expanded td{border-bottom-color:transparent}.expanded{border-bottom-color:transparent;background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}table tr.expanded_summary{background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}table tr.expanded_summary td{vertical-align:top;padding:10px 20px 26px}@-webkit-keyframes fadeIn{0%{opacity:0.001}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0.001}100%{opacity:1}}.modal_wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;overflow:auto;text-align:center;-webkit-animation:fadeIn 200ms;animation:fadeIn 200ms;padding:30px 10px}.modal_wrapper:before{display:inline-block;vertical-align:middle;width:0;height:100%;content:""}.modal_backdrop{background:rgba(42, 49, 52, 0.5);background:rgba(var(--pv-color-dark-rgb), 0.5);z-index:-1;position:fixed;top:0;right:0;bottom:0;left:0}.modal_container{position:relative;display:inline-block;vertical-align:middle;width:100%;max-width:900px;text-align:left;border-radius:3px;overflow:hidden;background-color:white;background-color:rgba(var(--pv-color-light-rgb), 1);height:100%}.modal_title{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);border-bottom-width:1px;border-bottom-style:solid;padding:20px 60px 16px 20px;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:60px}.modal_content{height:calc(100% - 60px);overflow-y:auto}.modal_close{cursor:pointer;border:none;background-color:transparent;position:absolute;top:0;bottom:0;right:0;padding:0 12px;-webkit-transition:opacity 100ms;transition:opacity 100ms;outline:none}.modal_close:hover{opacity:0.6}.modal_close svg{fill:#2a3134;fill:rgba(var(--pv-color-dark-rgb), 1)}.button_table_action{margin:2px}.mobile_title{display:none}.status_wrapper{height:85px;text-align:center;pointer-events:none}.search_section{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);height:50px;padding:10px;border-width:1px 1px 0 1px;border-style:solid}.input_search{height:100%;width:100%;border-radius:3px;border-width:1px;border-style:solid;padding:0 14px;font-size:12px;outline:none;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);color:#2a3134;color:rgba(var(--pv-color-dark-rgb), 1)}.input_search::-moz-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search:-ms-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::-webkit-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::-ms-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.loading_container{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(42, 49, 52, 0.3);background:rgba(var(--pv-color-dark-rgb), 0.3);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.align_center{text-align:center}@media (hover: hover){table tbody tr:not(.expanded_summary):hover{background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}}@media (max-width: 900px){table,tbody,tr,td{display:block}thead{display:none}tr{padding:0 15px;border-width:1px;border-style:solid}tr:not(:first-child){margin-top:-1px}tr:not(.expanded_summary) td:first-child{border:none !important}table td{padding-left:0;padding-right:0;border-width:1px 0 0 0 !important;border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr.expanded_summary td{padding:15px 0}.mobile_title{display:inline-block;width:90px;vertical-align:middle}.modal_title{padding:17px 60px 17px 15px}.content{display:inline-block;width:calc(100% - 90px);vertical-align:middle;text-align:left}.expanded_summary{border-top-color:transparent;padding-bottom:10px}.expanded_summary td:before{content:none}.status_wrapper{height:266px;display:table-cell}.search_section{height:60px;padding:15px}.align_center{text-align:inherit}}';var d=e("peculiar_certificates_viewer",function(){function e(e){var o=this;t(this,e);this.detailsOpen=r(this,"detailsOpen",7);this.detailsClose=r(this,"detailsClose",7);this.certificates=[];this.filterWithSearch=true;this.highlightWithSearch=true;this.search="";this.certificatesDecoded=[];this.isDecodeInProcess=true;this.isHasTests=false;this.isHasRoots=false;this.handleClickDetails=function(e,t){t.stopPropagation();o.certificateSelectedForDetails=e;o.detailsOpen.emit(e)};this.handleModalClose=function(){o.certificateSelectedForDetails=undefined;o.detailsClose.emit()};this.handleSearch=function(e){o.search=e.target.value.trim()}}e.prototype.componentWillLoad=function(){this.certificatesDecodeAndSet()};e.prototype.watchCertificates=function(e,t){if(JSON.stringify(e)!==JSON.stringify(t)){this.certificatesDecodeAndSet()}};e.prototype.certificatesDecodeAndSet=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,o,a,n,l,s;return __generator(this,(function(c){switch(c.label){case 0:e=false;t=false;if(!Array.isArray(this.certificates)){return[2]}r=[];o=0,a=this.certificates;c.label=1;case 1:if(!(o<a.length))return[3,6];n=a[o];c.label=2;case 2:c.trys.push([2,4,,5]);l=new i(n.value);return[4,l.getThumbprint("SHA-1")];case 3:c.sent();r.push({body:l,tests:n.tests,name:n.name});if(!t&&l.isRoot){t=true}if(!e){if(n.tests&&(n.tests.expired||n.tests.revoked||n.tests.valid)){e=true}}return[3,5];case 4:s=c.sent();console.error("Error certificate parse:",s);return[3,5];case 5:o++;return[3,1];case 6:this.isHasTests=e;this.isHasRoots=t;this.isDecodeInProcess=false;this.certificatesDecoded=r;return[2]}}))}))};e.prototype.handleClickDownloadAsPem=function(e,t){t.stopPropagation();n.certificate.asPEM(e.body.exportAsPemFormatted(),e.name||e.body.commonName)};e.prototype.handleClickDownloadAsDer=function(e,t){t.stopPropagation();n.certificate.asPEM(e.body.exportAsHexFormatted(),e.name||e.body.commonName)};e.prototype.handleClickRow=function(e){var t=this.expandedRow===e;this.expandedRow=t?undefined:e};e.prototype.getMaxColSpanValue=function(){var e=4;if(this.isHasTests){e+=1}if(!this.isHasRoots){e+=1}return e};e.prototype.renderExpandedRow=function(e){var t=this.getMaxColSpanValue();return o("tr",{class:"expanded_summary"},o("td",{colSpan:t},o("peculiar-certificate-summary",{certificate:e,showIssuer:!e.isRoot})))};e.prototype.renderCertificateTests=function(e){if(!e){return null}var t=[];if(e.valid){t.push(o("peculiar-button",{class:"button_table_action",href:e.valid,target:"_blank"},s.getString("valid")))}if(e.revoked){t.push(o("peculiar-button",{class:"button_table_action",href:e.revoked,target:"_blank"},s.getString("revoked")))}if(e.expired){t.push(o("peculiar-button",{class:"button_table_action",href:e.expired,target:"_blank"},s.getString("expired")))}return t};e.prototype.renderContentState=function(){var e=this;var t=this.highlightWithSearch?this.search:"";var r=[];this.certificatesDecoded.forEach((function(a,i){var n=i===e.expandedRow;var c=l[a.body.signature.algorithm]||a.body.signature.algorithm;if(e.filterWithSearch&&e.search){var d=[c,a.body.issuerCommonName,a.name,a.body.commonName,a.body.thumbprints["SHA-1"]].join(" ").toLowerCase();if(d.indexOf(e.search.toLowerCase())===-1){return}}r.push([o("tr",{class:{expanded:n},onClick:e.handleClickRow.bind(e,i),key:i},!e.isHasRoots&&o("td",null,o("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("issuer"),":"),o("peculiar-typography",{class:"content"},o("peculiar-highlight-words",{search:t},a.body.issuerCommonName))),o("td",null,o("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("name"),":"),o("peculiar-typography",{class:"content"},o("peculiar-highlight-words",{search:t},a.name||a.body.commonName))),o("td",null,o("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("publicKey"),":"),o("peculiar-typography",{class:"content"},o("peculiar-highlight-words",{search:t},c))),o("td",null,o("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("fingerprint")," (SHA-1):"),o("peculiar-typography",{class:"content",monospace:true},o("peculiar-highlight-words",{search:t},a.body.thumbprints["SHA-1"]))),o("td",{class:"align_center"},o("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("actions"),":"),o("span",{class:"content"},o("peculiar-button",{onClick:e.handleClickDetails.bind(e,a.body),class:"button_table_action"},s.getString("details")),o("peculiar-button-split",{onClick:e.handleClickDownloadAsPem.bind(e,a),actions:[{text:s.getString("download.der"),onClick:e.handleClickDownloadAsDer.bind(e,a)}],class:"button_table_action"},s.getString("download.pem")))),e.isHasTests&&o("td",{class:"align_center"},o("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("testURLs"),":"),o("span",{class:"content"},e.renderCertificateTests(a.tests)))),n&&e.renderExpandedRow(a.body)])}));return r};e.prototype.renderCertificateDetailsModal=function(){if(!this.certificateSelectedForDetails){return null}return o("div",{class:"modal_wrapper",role:"presentation","aria-hidden":"false",part:"presentation"},o("div",{class:"modal_backdrop",onClick:this.handleModalClose,"aria-hidden":"true"}),o("div",{class:"modal_container",role:"dialog",part:"presentation_container"},o("header",{class:"modal_title"},o("peculiar-typography",{type:"h4"},s.getString("certificateDetails")),o("button",{class:"modal_close",onClick:this.handleModalClose,type:"button","aria-label":"Close",title:"Close"},o("svg",{width:"30",height:"30",viewBox:"0 0 30 30",xmlns:"http://www.w3.org/2000/svg"},o("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.7204 14.375L21.0654 19.7185C21.3115 19.9658 21.3115 20.3693 21.0654 20.6154L20.615 21.0645C20.3689 21.3118 19.9667 21.3118 19.7181 21.0645L14.3744 15.721L9.03194 21.0645C8.78327 21.3118 8.3811 21.3118 8.13371 21.0645L7.68459 20.6154C7.43847 20.3693 7.43847 19.9658 7.68459 19.7185L13.0296 14.375L7.68459 9.03155C7.43847 8.78417 7.43847 8.38074 7.68459 8.13463L8.13371 7.68554C8.3811 7.43815 8.78327 7.43815 9.03194 7.68554L14.3744 13.029L19.7181 7.68554C19.9667 7.43815 20.3689 7.43815 20.615 7.68554L21.0654 8.13463C21.3115 8.38074 21.3115 8.78417 21.0654 9.03155L15.7204 14.375Z"})))),o("div",{class:"modal_content"},o("peculiar-certificate-viewer",{certificate:this.certificateSelectedForDetails}))))};e.prototype.renderSearch=function(){if(!this.filterWithSearch&&!this.highlightWithSearch){return null}return o("div",{class:"search_section"},o("input",{onInput:this.handleSearch,type:"search",value:"",class:"input_search",disabled:!this.certificatesDecoded.length,placeholder:"Search"}))};e.prototype.renderEmptyState=function(){var e=this.getMaxColSpanValue();return o("tr",null,o("td",{class:"status_wrapper",colSpan:e},o("peculiar-typography",{type:"b1",align:"center"},"There are no certificates available.")))};e.prototype.renderEmptySearchState=function(){var e=this.getMaxColSpanValue();return o("tr",null,o("td",{class:"status_wrapper",colSpan:e},o("peculiar-typography",{type:"b1",align:"center"},"No results found for “",this.search,"“")))};e.prototype.renderLoadingState=function(){return o("div",{class:"loading_container"},o("peculiar-circular-progress",null))};e.prototype.renderBody=function(){if(this.isDecodeInProcess){return null}if(!this.certificatesDecoded.length){return this.renderEmptyState()}var e=this.renderContentState();if(this.search&&!e.length){return this.renderEmptySearchState()}return e};e.prototype.render=function(){return o(a,null,this.renderSearch(),o("table",{class:{m_extra:this.isHasTests||!this.isHasRoots}},o("thead",null,o("tr",null,!this.isHasRoots&&o("th",{class:"col_issuer"},o("peculiar-typography",{type:"h7",align:"left"},s.getString("issuer"))),o("th",{class:"col_name"},o("peculiar-typography",{type:"h7",align:"left"},s.getString("name"))),o("th",{class:"col_public_key"},o("peculiar-typography",{type:"h7",align:"left"},s.getString("publicKey"))),o("th",{class:"col_fingerprint"},o("peculiar-typography",{type:"h7",align:"left"},s.getString("fingerprint")," (SHA-1)")),o("th",{class:"col_actions"},o("peculiar-typography",{type:"h7",align:"center"},s.getString("actions"))),this.isHasTests&&o("th",{class:"col_tests"},o("peculiar-typography",{type:"h7",align:"center"},s.getString("testURLs"))))),o("tbody",null,this.renderBody())),this.renderCertificateDetailsModal(),this.isDecodeInProcess&&this.renderLoadingState())};Object.defineProperty(e,"watchers",{get:function(){return{certificates:["watchCertificates"]}},enumerable:false,configurable:true});return e}());d.style=c}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,r,o){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function n(e){try{s(o.next(e))}catch(t){i(t)}}function l(e){try{s(o["throw"](e))}catch(t){i(t)}}function s(e){e.done?r(e.value):a(e.value).then(n,l)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,a,i,n;return n={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function l(e){return function(t){return s([e,t])}}function s(n){if(o)throw new TypeError("Generator is already executing.");while(r)try{if(o=1,a&&(i=n[0]&2?a["return"]:n[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;if(a=0,i)n=[n[0]&2,i.value];switch(n[0]){case 0:case 1:i=n;break;case 4:r.label++;return{value:n[1],done:false};case 5:r.label++;a=n[1];n=[0];continue;case 7:n=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(n[0]===6||n[0]===2)){r=0;continue}if(n[0]===3&&(!i||n[1]>i[0]&&n[1]<i[3])){r.label=n[1];break}if(n[0]===6&&r.label<i[1]){r.label=i[1];i=n;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(n);break}if(i[2])r.ops.pop();r.trys.pop();continue}n=t.call(e,r)}catch(l){n=[6,l];a=0}finally{o=i=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};System.register(["./p-9f815f76.system.js","./p-bd1f9066.system.js","./p-94f96303.system.js"],(function(e){"use strict";var t,r,o,a,i,n,l,s;return{setters:[function(e){t=e.r;r=e.c;o=e.h;a=e.H},function(e){i=e.l},function(e){n=e.av;l=e.aq;s=e.O}],execute:function(){var c=':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;min-width:280px;overflow:auto;position:relative;background:white;background:rgba(var(--pv-color-light-rgb), 1)}table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}table thead{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07)}table tr td{vertical-align:middle}table tbody tr:not(.expanded_summary){cursor:pointer}table tr{border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table th{padding:15px 10px;border-width:1px;border-style:solid;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table td{padding:8px 10px;border-width:1px;border-style:solid;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table .col_issuer,table .col_name,table .col_public_key{width:16%}table .col_actions,table .col_tests{width:18%}table.m_extra .col_issuer,table.m_extra .col_name,table.m_extra .col_public_key{width:12%}table.m_extra .col_actions,table.m_extra .col_tests{width:17%}table tr.expanded td:not(:last-child){border-right-color:transparent}table tr.expanded td{border-bottom-color:transparent}.expanded{border-bottom-color:transparent;background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}table tr.expanded_summary{background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}table tr.expanded_summary td{vertical-align:top;padding:10px 20px 26px}@-webkit-keyframes fadeIn{0%{opacity:0.001}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0.001}100%{opacity:1}}.modal_wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;overflow:auto;text-align:center;-webkit-animation:fadeIn 200ms;animation:fadeIn 200ms;padding:30px 10px}.modal_wrapper:before{display:inline-block;vertical-align:middle;width:0;height:100%;content:""}.modal_backdrop{background:rgba(42, 49, 52, 0.5);background:rgba(var(--pv-color-dark-rgb), 0.5);z-index:-1;position:fixed;top:0;right:0;bottom:0;left:0}.modal_container{position:relative;display:inline-block;vertical-align:middle;width:100%;max-width:900px;text-align:left;border-radius:3px;overflow:hidden;background-color:white;background-color:rgba(var(--pv-color-light-rgb), 1);height:100%}.modal_title{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);border-bottom-width:1px;border-bottom-style:solid;padding:20px 60px 16px 20px;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:60px}.modal_content{height:calc(100% - 60px);overflow-y:auto}.modal_close{cursor:pointer;border:none;background-color:transparent;position:absolute;top:0;bottom:0;right:0;padding:0 12px;-webkit-transition:opacity 100ms;transition:opacity 100ms;outline:none}.modal_close:hover{opacity:0.6}.modal_close svg{fill:#2a3134;fill:rgba(var(--pv-color-dark-rgb), 1)}.button_table_action{margin:2px}.mobile_title{display:none}.status_wrapper{height:85px;text-align:center;pointer-events:none}.search_section{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);height:50px;padding:10px;border-width:1px 1px 0 1px;border-style:solid}.input_search{height:100%;width:100%;border-radius:3px;border-width:1px;border-style:solid;padding:0 14px;font-size:12px;outline:none;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);color:#2a3134;color:rgba(var(--pv-color-dark-rgb), 1)}.input_search::-moz-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search:-ms-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::-webkit-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::-ms-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.loading_container{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(42, 49, 52, 0.3);background:rgba(var(--pv-color-dark-rgb), 0.3);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.align_center{text-align:center}@media (hover: hover){table tbody tr:not(.expanded_summary):hover{background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}}@media (max-width: 900px){table,tbody,tr,td{display:block}thead{display:none}tr{padding:0 15px;border-width:1px;border-style:solid}tr:not(:first-child){margin-top:-1px}tr:not(.expanded_summary) td:first-child{border:none !important}table td{padding-left:0;padding-right:0;border-width:1px 0 0 0 !important;border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr.expanded_summary td{padding:15px 0}.mobile_title{display:inline-block;width:90px;vertical-align:middle}.modal_title{padding:17px 60px 17px 15px}.content{display:inline-block;width:calc(100% - 90px);vertical-align:middle;text-align:left}.expanded_summary{border-top-color:transparent;padding-bottom:10px}.expanded_summary td:before{content:none}.status_wrapper{height:266px;display:table-cell}.search_section{height:60px;padding:15px}.align_center{text-align:inherit}}';var d=e("peculiar_certificates_viewer",function(){function e(e){var o=this;t(this,e);this.detailsOpen=r(this,"detailsOpen",7);this.detailsClose=r(this,"detailsClose",7);this.certificates=[];this.filterWithSearch=true;this.highlightWithSearch=true;this.search="";this.certificatesDecoded=[];this.isDecodeInProcess=true;this.isHasTests=false;this.isHasRoots=false;this.handleClickDetails=function(e,t){t.stopPropagation();o.certificateSelectedForDetails=e;o.detailsOpen.emit(e)};this.handleModalClose=function(){o.certificateSelectedForDetails=undefined;o.detailsClose.emit()};this.handleSearch=function(e){o.search=e.target.value.trim()}}e.prototype.componentWillLoad=function(){this.certificatesDecodeAndSet()};e.prototype.watchCertificates=function(e,t){if(JSON.stringify(e)!==JSON.stringify(t)){this.certificatesDecodeAndSet()}};e.prototype.certificatesDecodeAndSet=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,o,a,i,l,s;return __generator(this,(function(c){switch(c.label){case 0:e=false;t=false;if(!Array.isArray(this.certificates)){return[2]}r=[];o=0,a=this.certificates;c.label=1;case 1:if(!(o<a.length))return[3,6];i=a[o];c.label=2;case 2:c.trys.push([2,4,,5]);l=new n(i.value);return[4,l.getThumbprint("SHA-1")];case 3:c.sent();r.push({body:l,tests:i.tests,name:i.name});if(!t&&l.isRoot){t=true}if(!e){if(i.tests&&(i.tests.expired||i.tests.revoked||i.tests.valid)){e=true}}return[3,5];case 4:s=c.sent();console.error("Error certificate parse:",s);return[3,5];case 5:o++;return[3,1];case 6:this.isHasTests=e;this.isHasRoots=t;this.isDecodeInProcess=false;this.certificatesDecoded=r;return[2]}}))}))};e.prototype.handleClickDownloadAsPem=function(e,t){t.stopPropagation();l.certificate.asPEM(e.body.exportAsPemFormatted(),e.name||e.body.commonName)};e.prototype.handleClickDownloadAsDer=function(e,t){t.stopPropagation();l.certificate.asPEM(e.body.exportAsHexFormatted(),e.name||e.body.commonName)};e.prototype.handleClickRow=function(e){var t=this.expandedRow===e;this.expandedRow=t?undefined:e};e.prototype.getMaxColSpanValue=function(){var e=4;if(this.isHasTests){e+=1}if(!this.isHasRoots){e+=1}return e};e.prototype.renderExpandedRow=function(e){var t=this.getMaxColSpanValue();return o("tr",{class:"expanded_summary"},o("td",{colSpan:t},o("peculiar-certificate-summary",{certificate:e,showIssuer:!e.isRoot})))};e.prototype.renderCertificateTests=function(e){if(!e){return null}var t=[];if(e.valid){t.push(o("peculiar-button",{class:"button_table_action",href:e.valid,target:"_blank"},i.getString("valid")))}if(e.revoked){t.push(o("peculiar-button",{class:"button_table_action",href:e.revoked,target:"_blank"},i.getString("revoked")))}if(e.expired){t.push(o("peculiar-button",{class:"button_table_action",href:e.expired,target:"_blank"},i.getString("expired")))}return t};e.prototype.renderContentState=function(){var e=this;var t=this.highlightWithSearch?this.search:"";var r=[];this.certificatesDecoded.forEach((function(a,n){var l=n===e.expandedRow;var c=s[a.body.signature.algorithm]||a.body.signature.algorithm;if(e.filterWithSearch&&e.search){var d=[c,a.body.issuerCommonName,a.name,a.body.commonName,a.body.thumbprints["SHA-1"]].join(" ").toLowerCase();if(d.indexOf(e.search.toLowerCase())===-1){return}}r.push([o("tr",{class:{expanded:l},onClick:e.handleClickRow.bind(e,n),key:n},!e.isHasRoots&&o("td",null,o("peculiar-typography",{class:"mobile_title",color:"grey_5"},i.getString("issuer"),":"),o("peculiar-typography",{class:"content"},o("peculiar-highlight-words",{search:t},a.body.issuerCommonName))),o("td",null,o("peculiar-typography",{class:"mobile_title",color:"grey_5"},i.getString("name"),":"),o("peculiar-typography",{class:"content"},o("peculiar-highlight-words",{search:t},a.name||a.body.commonName))),o("td",null,o("peculiar-typography",{class:"mobile_title",color:"grey_5"},i.getString("publicKey"),":"),o("peculiar-typography",{class:"content"},o("peculiar-highlight-words",{search:t},c))),o("td",null,o("peculiar-typography",{class:"mobile_title",color:"grey_5"},i.getString("fingerprint")," (SHA-1):"),o("peculiar-typography",{class:"content",monospace:true},o("peculiar-highlight-words",{search:t},a.body.thumbprints["SHA-1"]))),o("td",{class:"align_center"},o("peculiar-typography",{class:"mobile_title",color:"grey_5"},i.getString("actions"),":"),o("span",{class:"content"},o("peculiar-button",{onClick:e.handleClickDetails.bind(e,a.body),class:"button_table_action"},i.getString("details")),o("peculiar-button-split",{onClick:e.handleClickDownloadAsPem.bind(e,a),actions:[{text:i.getString("download.der"),onClick:e.handleClickDownloadAsDer.bind(e,a)}],class:"button_table_action"},i.getString("download.pem")))),e.isHasTests&&o("td",{class:"align_center"},o("peculiar-typography",{class:"mobile_title",color:"grey_5"},i.getString("testURLs"),":"),o("span",{class:"content"},e.renderCertificateTests(a.tests)))),l&&e.renderExpandedRow(a.body)])}));return r};e.prototype.renderCertificateDetailsModal=function(){if(!this.certificateSelectedForDetails){return null}return o("div",{class:"modal_wrapper",role:"presentation","aria-hidden":"false",part:"presentation"},o("div",{class:"modal_backdrop",onClick:this.handleModalClose,"aria-hidden":"true"}),o("div",{class:"modal_container",role:"dialog",part:"presentation_container"},o("header",{class:"modal_title"},o("peculiar-typography",{type:"h4"},i.getString("certificateDetails")),o("button",{class:"modal_close",onClick:this.handleModalClose,type:"button","aria-label":"Close",title:"Close"},o("svg",{width:"30",height:"30",viewBox:"0 0 30 30",xmlns:"http://www.w3.org/2000/svg"},o("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.7204 14.375L21.0654 19.7185C21.3115 19.9658 21.3115 20.3693 21.0654 20.6154L20.615 21.0645C20.3689 21.3118 19.9667 21.3118 19.7181 21.0645L14.3744 15.721L9.03194 21.0645C8.78327 21.3118 8.3811 21.3118 8.13371 21.0645L7.68459 20.6154C7.43847 20.3693 7.43847 19.9658 7.68459 19.7185L13.0296 14.375L7.68459 9.03155C7.43847 8.78417 7.43847 8.38074 7.68459 8.13463L8.13371 7.68554C8.3811 7.43815 8.78327 7.43815 9.03194 7.68554L14.3744 13.029L19.7181 7.68554C19.9667 7.43815 20.3689 7.43815 20.615 7.68554L21.0654 8.13463C21.3115 8.38074 21.3115 8.78417 21.0654 9.03155L15.7204 14.375Z"})))),o("div",{class:"modal_content"},o("peculiar-certificate-viewer",{certificate:this.certificateSelectedForDetails}))))};e.prototype.renderSearch=function(){if(!this.filterWithSearch&&!this.highlightWithSearch){return null}return o("div",{class:"search_section"},o("input",{onInput:this.handleSearch,type:"search",value:"",class:"input_search",disabled:!this.certificatesDecoded.length,placeholder:"Search"}))};e.prototype.renderEmptyState=function(){var e=this.getMaxColSpanValue();return o("tr",null,o("td",{class:"status_wrapper",colSpan:e},o("peculiar-typography",{type:"b1",align:"center"},"There are no certificates available.")))};e.prototype.renderEmptySearchState=function(){var e=this.getMaxColSpanValue();return o("tr",null,o("td",{class:"status_wrapper",colSpan:e},o("peculiar-typography",{type:"b1",align:"center"},"No results found for “",this.search,"“")))};e.prototype.renderLoadingState=function(){return o("div",{class:"loading_container"},o("peculiar-circular-progress",null))};e.prototype.renderBody=function(){if(this.isDecodeInProcess){return null}if(!this.certificatesDecoded.length){return this.renderEmptyState()}var e=this.renderContentState();if(this.search&&!e.length){return this.renderEmptySearchState()}return e};e.prototype.render=function(){return o(a,null,this.renderSearch(),o("table",{class:{m_extra:this.isHasTests||!this.isHasRoots}},o("thead",null,o("tr",null,!this.isHasRoots&&o("th",{class:"col_issuer"},o("peculiar-typography",{type:"h7",align:"left"},i.getString("issuer"))),o("th",{class:"col_name"},o("peculiar-typography",{type:"h7",align:"left"},i.getString("name"))),o("th",{class:"col_public_key"},o("peculiar-typography",{type:"h7",align:"left"},i.getString("publicKey"))),o("th",{class:"col_fingerprint"},o("peculiar-typography",{type:"h7",align:"left"},i.getString("fingerprint")," (SHA-1)")),o("th",{class:"col_actions"},o("peculiar-typography",{type:"h7",align:"center"},i.getString("actions"))),this.isHasTests&&o("th",{class:"col_tests"},o("peculiar-typography",{type:"h7",align:"center"},i.getString("testURLs"))))),o("tbody",null,this.renderBody())),this.renderCertificateDetailsModal(),this.isDecodeInProcess&&this.renderLoadingState())};Object.defineProperty(e,"watchers",{get:function(){return{certificates:["watchCertificates"]}},enumerable:false,configurable:true});return e}());d.style=c}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-9f815f76.system.js","./p-aa0a9b36.system.js"],(function(){"use strict";var e,i;return{setters:[function(i){e=i.b},function(e){i=e.p}],execute:function(){i().then((function(i){return e([["p-
|
|
1
|
+
System.register(["./p-9f815f76.system.js","./p-aa0a9b36.system.js"],(function(){"use strict";var e,i;return{setters:[function(i){e=i.b},function(e){i=e.p}],execute:function(){i().then((function(i){return e([["p-fc92385a.system",[[1,"peculiar-certificate-decoder",{certificateExample:[1,"certificate-example"],certificateDecoded:[32]}],[1,"peculiar-attribute-certificate-viewer",{certificate:[1],download:[4],authKeyIdParentLink:[513,"auth-key-id-parent-link"],authKeyIdSiblingsLink:[513,"auth-key-id-siblings-link"],subjectKeyIdChildrenLink:[513,"subject-key-id-children-link"],subjectKeyIdSiblingsLink:[513,"subject-key-id-siblings-link"],isDecodeInProcess:[32]}],[1,"peculiar-csr-viewer",{certificate:[513],download:[4],subjectKeyIdChildrenLink:[513,"subject-key-id-children-link"],subjectKeyIdSiblingsLink:[513,"subject-key-id-siblings-link"],view:[513],isDecodeInProcess:[32]}],[1,"peculiar-certificate-viewer",{certificate:[513],download:[516],authKeyIdParentLink:[513,"auth-key-id-parent-link"],authKeyIdSiblingsLink:[513,"auth-key-id-siblings-link"],subjectKeyIdChildrenLink:[513,"subject-key-id-children-link"],subjectKeyIdSiblingsLink:[513,"subject-key-id-siblings-link"],issuerDnLink:[513,"issuer-dn-link"],view:[513],isDecodeInProcess:[32]}],[1,"peculiar-button-split",{onClick:[16],fill:[1],actions:[16],open:[32]}],[1,"peculiar-text-hider",{opened:[1540]},[[0,"textExpand","textExpandHandler"]]],[1,"peculiar-link",{href:[513],type:[513]}],[1,"peculiar-typography",{type:[513],color:[1],align:[1],ellipsis:[4],monospace:[4]}],[1,"peculiar-button",{fill:[1],disabled:[516],href:[1],target:[1],onClick:[16]}]]],["p-983b5210.system",[[1,"peculiar-certificate-summary",{certificate:[16],showIssuer:[4,"show-issuer"]}],[1,"peculiar-circular-progress",{size:[2],width:[2]}],[1,"peculiar-highlight-words",{search:[1]}]]],["p-3d339152.system",[[1,"peculiar-certificates-viewer",{certificates:[16],filterWithSearch:[4,"filter-with-search"],highlightWithSearch:[4,"highlight-with-search"],search:[32],certificatesDecoded:[32],expandedRow:[32],certificateSelectedForDetails:[32],isDecodeInProcess:[32]}]]]],i)}))}}}));
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import{h as e,r as t,H as a,c as i}from"./p-bd949790.js";import{d as n,l as o,a as r,h as s}from"./p-cf1841f8.js";import{A as l,a as c,b as d,i as b,c as p,E as h,d as u,e as f,f as g,U as m,g as v,C as x,h as y,V as w,j as k,I as _,k as C,W as z,l as A,m as S,n as I,T as N,o as L,D,p as j,q as E,r as T,s as K,t as P,u as O,v as G,w as R,x as V,y as H,z as q,B as $,N as B,F,G as U,H as Y,R as M,O as X,J as W,K as Q,L as J,M as Z,P as ee,Q as te,S as ae,X as ie,Y as ne,Z as oe,_ as re,$ as se,a0 as le,a1 as ce,a2 as de,a3 as be,a4 as pe,a5 as he,a6 as ue,a7 as fe,a8 as ge,a9 as me,aa as ve,ab as xe,ac as ye,ad as we,ae as ke,af as _e,ag as Ce,ah as ze,ai as Ae,aj as Se,ak as Ie,al as Ne,am as Le,an as De,ao as je,ap as Ee,aq as Te,ar as Ke,as as Pe,at as Oe,au as Ge,av as Re}from"./p-dc6b70b2.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/function Ve(e){return new Promise((t,a)=>{const i=new FileReader;i.onload=()=>t({value:i.result,fileName:e.name,fileSize:e.size,sourceMime:e.type}),i.onerror=()=>a(i.error),i.readAsBinaryString(e)})}
|
|
9
|
+
/**
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the MIT license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/class He extends l{constructor(e){super(e,c);const t=this.getAsnExtnValue();switch(this.asn.type){case P:this.value=p.parse(t,O);break;case T:this.value=p.parse(t,K);break;case j:this.value=p.parse(t,E);break;case L:this.value=p.parse(t,D);break;case I:this.value=p.parse(t,N);break;case A:this.value=p.parse(t,S);break;case C:this.value=p.parse(t,z);break;case k:this.value=p.parse(t,_);break;case y:this.value=p.parse(t,w);break;case v:this.value=p.parse(t,x);break;case g:this.value=p.parse(t,m);break;case b:{const e=p.parse(t,h);this.value=e.map(e=>new u(f.serialize(e)));break}default:this.value=d.ToHex(t)}}getAsnExtnValue(){return this.asn.values[0]}}
|
|
16
|
+
/**
|
|
17
|
+
* @license
|
|
18
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
19
|
+
*
|
|
20
|
+
* This source code is licensed under the MIT license found in the
|
|
21
|
+
* LICENSE file in the root directory of this source tree.
|
|
22
|
+
*/class qe extends l{constructor(e){var t;super(G(e),R),this.thumbprints={},this.type="X.509 Attribute Certificate";const{acinfo:a}=this.asn;this.serialNumber=d.ToHex(a.serialNumber),this.version=a.version;const i=a.attrCertValidityPeriod.notBeforeTime;if(!i)throw new Error("Cannot get 'notBefore' value");this.notBefore=i;const o=a.attrCertValidityPeriod.notAfterTime;if(!o)throw new Error("Cannot get 'notAfter' value");this.notAfter=o,this.validity=n(this.notBefore,this.notAfter),this.issuer=a.issuer.v1Form||(null===(t=a.issuer.v2Form)||void 0===t?void 0:t.issuerName),this.holder=a.holder}get signature(){const{signatureValue:e,signatureAlgorithm:t}=this.asn;return{value:e,algorithm:t.algorithm}}parseExtensions(){const{acinfo:e}=this.asn;e.extensions&&(this.extensions=e.extensions.map(e=>new u(f.serialize(e))))}parseAttributes(){const{acinfo:e}=this.asn;e.attributes&&(this.attributes=e.attributes.map(e=>new He(f.serialize(e))))}async getThumbprint(e="SHA-1"){try{const t=await V(e,this.raw);this.thumbprints[e.name||e]=d.ToHex(t)}catch(t){console.error("Error thumbprint get:",t)}}exportAsBase64(){return d.ToBase64(this.raw)}exportAsHexFormatted(){return H(d.ToHex(this.raw))}exportAsPemFormatted(){return`-----BEGIN ATTRIBUTE CERTIFICATE-----\n${q(this.exportAsBase64())}\n-----END ATTRIBUTE CERTIFICATE-----`}get commonName(){return"attribute-certificate-"+this.thumbprints["SHA-1"]}}
|
|
23
|
+
/**
|
|
24
|
+
* @license
|
|
25
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
26
|
+
*
|
|
27
|
+
* This source code is licensed under the MIT license found in the
|
|
28
|
+
* LICENSE file in the root directory of this source tree.
|
|
29
|
+
*/class $e extends l{constructor(e){super(G(e),$),this.thumbprints={},this.type="PKCS#10 Certificate Request";const{certificationRequestInfo:t}=this.asn;this.subject=new B(t.subject).toJSON(),this.version=t.version}get publicKey(){const{subjectPublicKey:e,algorithm:t}=this.asn.certificationRequestInfo.subjectPKInfo;let a;return t.algorithm===F&&t.parameters&&(a=f.parse(t.parameters,U)),t.algorithm===Y&&(a=f.parse(e,M)),{params:a,value:f.serialize(this.asn.certificationRequestInfo.subjectPKInfo),algorithm:t.algorithm}}get signature(){const{signature:e,signatureAlgorithm:t}=this.asn;return{value:e,algorithm:t.algorithm}}get commonName(){if(!this.subject)return"";for(let e=0;e<this.subject.length;e+=1){const t=this.subject[e];if("CN"===t.shortName||"E"===t.shortName||"O"===t.shortName)return t.value}return""}async getThumbprint(e="SHA-1"){try{const t=await V(e,this.raw);this.thumbprints[e.name||e]=d.ToHex(t)}catch(t){console.error("Error thumbprint get:",t)}}parseAttributes(){const{certificationRequestInfo:e}=this.asn;e.attributes&&(this.attributes=e.attributes.map(e=>new He(f.serialize(e))))}exportAsBase64(){return d.ToBase64(this.raw)}exportAsHexFormatted(){return H(d.ToHex(this.raw))}exportAsPemFormatted(){return`-----BEGIN CERTIFICATE REQUEST-----\n${q(this.exportAsBase64())}\n-----END CERTIFICATE REQUEST-----`}}
|
|
30
|
+
/**
|
|
31
|
+
* @license
|
|
32
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the MIT license found in the
|
|
35
|
+
* LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/function Be(e){const t=X[e];return t?`${t} (${e})`:e}
|
|
37
|
+
/**
|
|
38
|
+
* @license
|
|
39
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the MIT license found in the
|
|
42
|
+
* LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* @license
|
|
46
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the MIT license found in the
|
|
49
|
+
* LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/
|
|
51
|
+
const Fe=t=>{const{value:a}=t;return a?e("tr",{class:"title"},e("td",{colSpan:2},e("peculiar-typography",{type:"h6"},a))):null},Ue=t=>{const{name:a,value:i,monospace:n,collapse:o,href:r,extraValue:s}=t;if(!a)return null;if(null==i)return null;let l;l=o?e("peculiar-text-hider",null,i):i;const c=!!i.toString();return e("tr",null,e("td",{colSpan:c?1:2},e("peculiar-typography",{color:"grey_5"},a,c?":":"")),c&&e("td",{class:{monospace:n}},function(e){return 0===e.indexOf("http")}(i.toString())||r?e("peculiar-link",{href:r||i.toString()},i):e("peculiar-typography",{monospace:n},l,s)))},Ye=t=>{const{signature:a}=t;return a?[e(Fe,{value:o.getString("signature")}),e(Ue,{name:o.getString("algorithm"),value:Be(a.algorithm)}),e(Ue,{name:o.getString("value"),value:d.ToHex(a.value),monospace:!0,collapse:!0})]:null},Me=(t,a)=>{const{attribute:i}=t;return[e(Ue,{name:"Name",value:Be(i.asn.type)}),a,e("tr",null,e("td",{colSpan:2,class:"divider"},e("span",{class:"bg_fill"})))]},Xe=t=>{const{name:a}=t;return a?a.map(t=>t.map(t=>e(Ue,{name:X[t.type]||t.type,value:t.value.toString()}))):null},We=t=>{const{attribute:a}=t;return e(Me,{attribute:a},e(Xe,{name:a.value}))},Qe={otherName:"Other Name",rfc822Name:"RFC 822 Name",dNSName:"DNS Name",x400Address:"X400 Address",directoryName:"Directory Name",ediPartyName:"Edi Party Name ",uniformResourceIdentifier:"URI",iPAddress:"IP Address",registeredID:"Registered ID"},Je=t=>{const{generalName:a,getDNSNameLink:i,getIPAddressLink:n}=t;return a?Object.keys(a).map(t=>{const o=a[t];if(o instanceof W)return[e(Ue,{name:Qe[t]||t,value:""}),o.map(t=>t.map(t=>e(Ue,{name:X[t.type]||t.type,value:t.value.toString()})))];if(o instanceof Q){try{const t=p.parse(o.value,J);return e(Ue,{name:X[o.typeId]||o.typeId,value:t.toString()})}catch(r){}try{const t=p.parse(o.value,Z);if(t.explicitText)return e(Ue,{name:X[o.typeId]||o.typeId,value:t.explicitText.toString()})}catch(r){}return e(Ue,{name:X[o.typeId]||o.typeId,value:d.ToHex(o.value),monospace:!0})}return ee.isBufferSource(o)?e(Ue,{name:Qe[t]||t,value:d.ToString(o)}):e(Ue,o instanceof te?{name:Qe[t]||t,value:d.ToString(o.partyName)}:"dNSName"===t?{name:Qe[t]||t,value:o,href:i(o)}:"iPAddress"===t?{name:Qe[t]||t,value:o,href:n(o)}:{name:Qe[t]||t,value:o})}):null},Ze=t=>{const{attribute:a}=t;return e(Me,{attribute:a},e(Ue,{name:"Code Authority",value:""}),e(Je,{generalName:a.value.codeAuthority,getDNSNameLink:()=>"",getIPAddressLink:()=>""}),e(Ue,{name:"Code Id",value:""}),e(Je,{generalName:a.value.codeId,getDNSNameLink:()=>"",getIPAddressLink:()=>""}),e(Ue,{name:"Short Name",value:a.value.shortName}),e(Ue,{name:"Short Description",value:a.value.shortDescription}))},et=t=>{const{attribute:a}=t;return e(Me,{attribute:a},e(Ue,{name:"Assessment Authority",value:""}),e(Je,{generalName:a.value.assessmentAuthority,getDNSNameLink:()=>"",getIPAddressLink:()=>""}),e(Ue,{name:"Assessment Location",value:""}),e(Je,{generalName:a.value.assessmentLocation,getDNSNameLink:()=>"",getIPAddressLink:()=>""}),e(Ue,{name:"Assessment Ref",value:""}),e(Je,{generalName:a.value.assessmentRef,getDNSNameLink:()=>"",getIPAddressLink:()=>""}),e(Ue,{name:"Data Storage Territory",value:a.value.dataStorageTerritory}),e(Ue,{name:"Description",value:a.value.description}))},tt=t=>{const{attribute:a}=t;return e(Me,{attribute:a},e(Ue,{name:"Value",value:`${a.value.base} * 10^${a.value.degree} ${a.value.location}`}))},at=t=>{const{attribute:a}=t;return e(Me,{attribute:a},Object.keys(a.value).map(t=>e(Ue,{name:t,value:a.value[t].toNumber()?"YES":"NO"})))},it=e=>{let t=1;return e/100>1?t=100:e/10>1&&(t=10),`${e}/${5*t}`},nt=t=>{const{attribute:a}=t,i=Object.keys(a.value).map(t=>[it(a.value[t]),e("br",null)]);return e(Me,{attribute:a},e(Ue,{name:"Value",value:i}))},ot=t=>{const{attribute:a}=t;return e(Me,{attribute:a},e(Ue,{name:"Value",value:a.value,monospace:!0}))},rt=t=>{const{attribute:a}=t;return e(Me,{attribute:a},e(Ue,{name:"Value",value:a.value.utf8String}))},st=t=>{const{attribute:a}=t;return e(Me,{attribute:a},e(Ue,{name:"Value",value:a.value.toString()}))},lt=t=>{const{attributes:a}=t;return a&&a.length?[e(Fe,{value:"Attributes"}),a.map(t=>{try{return e(t.value instanceof W?We:t.value instanceof S?Ze:t.value instanceof z?et:t.value instanceof _?tt:t.value instanceof N?at:t.value instanceof w?nt:t.value instanceof m?rt:t.value instanceof x?st:"string"==typeof t.value?ot:Me,{attribute:t})}catch(a){return console.error("Error render attribute:",t.asn.type),null}})]:null},ct=t=>{const{thumbprints:a}=t;if(!a)return null;const i=Object.keys(a);return i.length?[e(Fe,{value:o.getString("fingerprints")}),i.map(t=>e(Ue,{name:t,value:a[t],monospace:!0}))]:null},dt=(t,a)=>{const{extension:i}=t;return[e(Ue,{name:"Name",value:Be(i.asn.extnID)}),e(Ue,{name:"Critical",value:i.asn.critical?"YES":"NO"}),a,e("tr",null,e("td",{colSpan:2,class:"divider"},e("span",{class:"bg_fill"})))]},bt=t=>{const{extension:a}=t;return e(dt,{extension:a},e(Ue,{name:"Usage",value:a.value.toJSON().join(", ")}))},pt=t=>{const{extension:a}=t;return e(dt,{extension:a},e(Ue,{name:"Certificate Authority",value:a.value.cA?"YES":"NO"}),e(Ue,{name:"Path Length Constraint",value:a.value.pathLenConstraint}))},ht=t=>{const{extension:a}=t;return e(dt,{extension:a},a.value.map((t,a)=>e(Ue,{name:"Purpose #"+(a+1),value:Be(t)})))},ut=t=>{const{extension:a,getSubjectKeyIdChildrenLink:i,getSubjectKeyIdSiblingsLink:n}=t,o=d.ToHex(a.value.buffer),r=i(o),s=n(o);return e(dt,{extension:a},e(Ue,{name:"Key ID",value:o,monospace:!0,extraValue:[r&&e("span",null," [",e("peculiar-link",{href:r},"children"),"]"),s&&e("span",null," [",e("peculiar-link",{href:s},"siblings"),"]")]}))},ft=t=>{const{extension:a,getAuthKeyIdParentLink:i,getAuthKeyIdSiblingsLink:n}=t,o=d.ToHex(a.value.keyIdentifier.buffer),r=i(o),s=n(o);return e(dt,{extension:a},e(Ue,{name:"Key ID",value:o,monospace:!0,extraValue:[r&&e("span",null," [",e("peculiar-link",{href:r},"parents"),"]"),s&&e("span",null," [",e("peculiar-link",{href:s},"siblings"),"]")]}))},gt=t=>{const{extension:a}=t;return e(dt,{extension:a},a.value.map(a=>{var i,n;return[null===(i=a.distributionPoint)||void 0===i?void 0:i.fullName.map(a=>e(Je,Object.assign({generalName:a},t))),null===(n=a.cRLIssuer)||void 0===n?void 0:n.map(a=>e(Je,Object.assign({generalName:a},t)))]}))},mt=t=>{const{extension:a}=t;return e(dt,{extension:a},a.value.map((a,i)=>[e(Ue,{name:"Description #"+(i+1),value:""}),e(Ue,{name:"Method",value:Be(a.accessMethod)}),e(Je,Object.assign({generalName:a.accessLocation},t))]))},vt=t=>{const{extension:a}=t;return e(dt,{extension:a},a.value.map(a=>e(Je,Object.assign({generalName:a},t))))},xt=t=>{const{extension:a}=t;return e(dt,{extension:a},a.value.map((t,a)=>{var i;return[e(Ue,{name:"Policy #"+(a+1),value:""}),e(Ue,{name:"ID",value:Be(t.policyIdentifier)}),null===(i=t.policyQualifiers)||void 0===i?void 0:i.map((t,i)=>{const n=[e(Ue,{name:`Qualifier #${a+1}.${i+1}`,value:""}),e(Ue,{name:"ID",value:Be(t.policyQualifierId)})];if("1.3.6.1.5.5.7.2.1"===t.policyQualifierId){const a=p.parse(t.qualifier,J);n.push(e(Ue,{name:"Value",value:a.toString()}))}if("1.3.6.1.5.5.7.2.2"===t.policyQualifierId){const a=p.parse(t.qualifier,Z);a.explicitText&&n.push(e(Ue,{name:"Value",value:a.explicitText.toString()}))}return n})]}))},yt={"9606c02c690033aa1d145f59c6e2648d0549f0df96aab8db915a70d8ecf390a5":"Akamai CT","39376f545f7b4607f59742d768cd5d2437bf3473b6534a4834bcf72e681c83c9":"Alpha CT",a577ac9ced7548dd8f025b67a241089df86e0f476ec203c2ecbedb185f282638:"CNNIC CT",cdb5179b7fc1c046feea31136a3f8f002e6182faf8896fecc8b2f5b5ab604900:"Certly.IO","1fbc36e002ede97f40199e86b3573b8a4217d80187746ad0da03a06054d20df4":"Cloudflare “Nimbus2017”",db74afeecb29ecb1feca3e716d2ce5b9aabb36f7847183c75d9d4f37b61fbf64:"Cloudflare “Nimbus2018”","747eda8331ad331091219cce254f4270c2bffd5e422008c6373579e6107bcc56":"Cloudflare “Nimbus2019”","5ea773f9df56c0e7b536487dd049e0327a919a0c84a112128418759681714558":"Cloudflare “Nimbus2020”","4494652eb0eeceafc44007d8a8fe28c0dae682bed8cb31b53fd33396b5b681a8":"Cloudflare “Nimbus2021”","41c8cab1df22464a10c6a13a0942875e4e318b1b03ebeb4bc768f090629606f6":"Cloudflare “Nimbus2022”","7a328c54d8b72db620ea38e0521ee98416703213854d3bd22bc13a57a352eb52":"Cloudflare “Nimbus2023”","6ff141b5647e4222f7ef052cefae7c21fd608e27d2af5a6e9f4b8a37d6633ee5":"DigiCert Nessie2018",fe446108b1d01ab78a62ccfeab6ab2b2babff3abdad80a4d8b30df2d0008830c:"DigiCert Nessie2019",c652a0ec48ceb3fcab170992c43a87413309e80065a26252401ba3362a17c565:"DigiCert Nessie2020",eec095ee8d72640f92e3c3b91bc712a3696a097b4b6a1a1438e647b2cbedc5f9:"DigiCert Nessie2021","51a3b0f5fd01799c566db837788f0ca47acc1b27cbf79e88429a0dfed48b05e5":"DigiCert Nessie2022",b3737707e18450f86386d605a9dc11094a792db1670c0b87dcf0030e7936a59a:"DigiCert Nessie2023","5614069a2fd7c2ecd3f5e1bd44b23ec74676b9bc99115cc0ef949855d689d0dd":"DigiCert Server","8775bfe7597cf88c43995fbdf36eff568d475636ff4ab560c1b4eaff5ea0830f":"DigiCert Server 2",c1164ae0a772d2d4392dc80ac10770d4f0c49bde991a4840c1fa075164f63360:"DigiCert Yeti2018",e2694bae26e8e94009e8861bb63b83d43ee7fe7488fba48f2893019dddf1dbfe:"DigiCert Yeti2019",f095a459f200d18240102d2f93888ead4bfe1d47e399e1d034a6b0a8aa8eb273:"DigiCert Yeti2020","5cdc4392fee6ab4544b15e9ad456e61037fbd5fa47dca17394b25ee6f6c70eca":"DigiCert Yeti2021","2245450759552456963fa12ff1f76d86e0232663adc04b7f5dc6835c6ee20f02":"DigiCert Yeti2022","35cf191bbfb16c57bf0fad4c6d42cbbbb627202651ea3fe12aefa803c33bd64c":"DigiCert Yeti2023","717ea7420975be84a2723553f1777c26dd51af4e102144094d9019b462fb6668":"GDCA 1","14308d90ccd030135005c01ca526d81e84e87624e39b6248e08f724aea3bb42a":"GDCA 2",c9cf890a21109c666cc17a3ed065c930d0e0135a9feba85af14210b8072421aa:"GDCA CT #1","924a30f909336ff435d6993a10ac75a2c641728e7fc2d659ae6188ffad40ce01":"GDCA CT #2",fad4c97cc49ee2f8ac85c5ea5cea09d0220dbbf4e49c6b50662ff868f86b8c28:"Google “Argon2017”",a4501269055a15545e6211ab37bc103f62ae5576a45e4b1714453e1b22106a25:"Google “Argon2018”","63f2dbcde83bcc2ccf0b728427576b33a48d61778fbd75a638b1c768544bd88d":"Google “Argon2019”",b21e05cc8ba2cd8a204e8766f92bb98a2520676bdafa70e7b249532def8b905e:"Google “Argon2020”",f65c942fd1773022145418083094568ee34d131933bfdf0c2f200bcc4ef164e3:"Google “Argon2021”","2979bef09e393921f056739f63a577e5be577d9c600af8f94d5d265c255dc784":"Google “Argon2022”","68f698f81f6482be3a8ceeb9281d4cfc71515d6793d444d10a67acbb4f4ffbc4":"Google “Aviator”",c3bf03a7e1ca8841c607bae3ff4270fca5ec45b186ebbe4e2cf3fc778630f5f6:"Google “Crucible”","1d024b8eb1498b344dfd87ea3efc0996f7506f235d1d497061a4773c439c25fb":"Google “Daedalus”","293c519654c83965baaa50fc5807d4b76fbf587a2972dca4c30cf4e54547f478":"Google “Icarus”",a4b90990b418581487bb13a2cc67700a3c359804f91bdfb8e377cd0ec80ddc10:"Google “Pilot”",ee4bbdb775ce60bae142691fabe19e66a30f7e5fb072d88300c47b897aa8fdcb:"Google “Rocketeer”",bbd9dfbc1f8a71b593942397aa927b473857950aab52e81a909664368e1ed185:"Google “Skydiver”","52eb4b225ec896974850675f23e43bc1d021e3214ce52ecd5fa87c203cdfca03":"Google “Solera2018”","0b760e9a8b9a682f88985b15e947501a56446bba8830785c3842994386450c00":"Google “Solera2019”","1fc72ce5a1b799f400c359bff96ca3913548e8644220610952e9ba1774f7bac7":"Google “Solera2020”",a3c99845e80ab7ce00157b3742df0207dd272b2b602ecf98ee2c12db9c5ae7e7:"Google “Solera2021”","697aafca1a6b536fae21205046debad7e0eaea13d2432e6e9d8fb379f2b9aaf3":"Google “Solera2022”",a899d8780c9290aaf462f31880ccfbd52451e970d0fbf591ef75b0d99b645681:"Google “Submariner”",b0cc83e5a5f97d6baf7c09cc284904872ac7e88b132c6350b7c6fd26e16c6c77:"Google “Testtube”",b10cd559a6d67846811f7df9a51532739ac48d703bea0323da5d38755bc0ad4e:"Google “Xenon2018”","084114980071532c16190460bcfc47fdc2653afa292c72b37ff863ae29ccc9f0":"Google “Xenon2019”","07b75c1be57d68fff1b0c61d2315c7bae6577c5794b76aeebc613a1a69d3a21c":"Google “Xenon2020”","7d3ef2f88fff88556824c2c0ca9e5289792bc50e78097f2e6a9768997e22f0d7":"Google “Xenon2021”","46a555eb75fa912030b5a28969f4f37d112c4174befd49b885abf2fc70fe6d47":"Google “Xenon2022”","7461b4a09cfb3d41d75159575b2e7649a445a8d27709b0cc564a6482b7eb41a3":"Izenpe","8941449c70742e06b9fc9ce7b116ba0024aa36d59af44f0204404f00f7ea8566":"Izenpe “Argi”","296afa2d568bca0d2ea844956ae9721fc35fa355ecda99693aafd458a71aefdd":"Let“s Encrypt ”Clicky”","537b69a3564335a9c04904e39593b2c298eb8d7a6e83023635c627248cd6b440":"Nordu “flimsy”",aae70b7f3cb8d566c86c2f16979c9f445f69ab0eb4535589b2f77a030104f3cd:"Nordu “plausible”",e0127629e90496564e3d0147984498aa48f8adb16600eb7902a1ef9909906273:"PuChuangSiDa CT",cf55e28923497c340d5206d05353aeb25834b52f1f8dc9526809f212efdd7ca6:"SHECA CT 1","32dc59c2d4c41968d56e14bc61ac8f0e45db39faf3c155aa4252f5001fa0c623":"SHECA CT 2",db76fdadac65e7d09508886e2159bd8b90352f5fead3e3dc5e22eb350acc7b98:"Sectigo (Comodo) “Dodo” CT","6f5376ac31f03119d89900a45115ff77151c11d902c10029068db2089a37d913":"Sectigo (Comodo) “Mammoth” CT","5581d4c2169036014aea0b9b573c53f0c0e43878702508172fa3aa1d0713d30c":"Sectigo (Comodo) “Sabre” CT","34bb6ad6c3df9c03eea8a499ff7891486c9d5e5cac92d01f7bfd1bce19db48ef":"StartCom",ddeb1d2b7a0d4fa6208b81ad8168707e2e8e9d01d55c888d3d11c4cdb6ecbecc:"Symantec",a7ce4a4e6207e0addee5fdaa4b1f86768767b5d002a55d47310e7e670a95eab2:"Symantec Deneb","15970488d7b997a05beb52512adee8d2e8b4a3165264121a9fabfbd5f85ad93f":"Symantec “Sirius”",bc78e1dfc5f63c684649334da10fa15f0979692009c081b4f3f6917f3ed9b8a5:"Symantec “Vega”",b0b784bc81c0ddc47544e883f05985bb9077d134d8ab88b2b2e533980b8e508b:"Up In The Air “Behind the Sofa”",ac3b9aed7fa9674757159e6d7d575672f9d98100941e9bdeffeca1313b75782d:"Venafi","03019df3fd85a69a8ebd1facc6da9ba73e469774fe77f579fc5a08b8328c1d6b":"Venafi Gen2 CT","41b2dc2e89e63ce4af1ba7bb29bf68c6dee6f9f1cc047e30dffae3b3ba259263":"WoSign","63d0006026dde10bb0601f452446965ee2b6ea2cd4fbc95ac866a550af9075b7":"WoSign 2","9e4ff73dc3ce220b69217c899e468076abf8d78636d5ccfc85a31a75628ba88b":"WoSign CT #1"},wt=t=>{const{extension:a}=t;return e(dt,{extension:a},a.value.toJSON().map((t,a)=>[e(Ue,{name:"SCT #"+(a+1),value:""}),e(Ue,{name:"Version",value:t.version+1}),e(Ue,{name:"Log Operator",value:yt[t.logId]||t.logId}),e(Ue,{name:"Log Key ID",value:t.logId,monospace:!0}),e(Ue,{name:"Timestamp",value:r(t.timestamp)}),e(Ue,{name:"Signature Algorithm",value:`${t.hashAlgorithm} ${t.signatureAlgorithm}`.toUpperCase()}),e(Ue,{name:"Signature",value:t.signature,monospace:!0})]))},kt=t=>{var a,i;const{extension:n}=t;return e(dt,{extension:n},null===(a=n.value.excludedSubtrees)||void 0===a?void 0:a.map(a=>e(Je,Object.assign({generalName:a.base},t))),null===(i=n.value.permittedSubtrees)||void 0===i?void 0:i.map(a=>e(Je,Object.assign({generalName:a.base},t))))},_t=t=>{const{extension:a}=t;return e(dt,{extension:a},e(Ue,{name:"Template ID",value:a.value.templateID}),e(Ue,{name:"Template Major Version",value:a.value.templateMajorVersion}),e(Ue,{name:"Template Minor Version",value:a.value.templateMinorVersion}))},Ct=t=>{const{extension:a}=t;return e(dt,{extension:a},e(Ue,{name:"Name",value:a.value.toString()}))},zt=t=>{const{extension:a}=t,i=a.value.getVersion();return e(dt,{extension:a},e(Ue,{name:"Certificate Index",value:i.certificateIndex}),e(Ue,{name:"Key Index",value:i.keyIndex}))},At=t=>{const{extension:a}=t;return e(dt,{extension:a},a.value.map((t,a)=>[e(Ue,{name:"Statement #"+(a+1),value:""}),e(Ue,{name:"ID",value:Be(t.statementId)}),e(Ue,{name:"Info",value:t.statementInfo.byteLength?d.ToHex(t.statementInfo):null,monospace:!0})]))},St=t=>{const{extension:a}=t;return e(dt,{extension:a},e(Ue,{name:"Comment",value:a.value.value}))},It=t=>{const{extension:a}=t;return e(dt,{extension:a},e(Ue,{name:"Type",value:a.value.toJSON().join(", ")}))},Nt=t=>{const{extension:a}=t;return e(dt,{extension:a},e(Ue,{name:"Role",value:a.value.text}))},Lt=t=>{const{extension:a,getLEILink:i}=t;return e(dt,{extension:a},e(Ue,{name:"Identifier",value:a.value.text,href:i(a.value.text)}))},Dt=t=>{const{extension:a}=t;return e(dt,{extension:a},e(Ue,{name:"Version",value:a.value.version}),e(Je,Object.assign({generalName:a.value.location},t)),e(Ue,{name:"Requires Auth",value:a.value.requiresAuth?"YES":"NO"}))},jt=t=>{const{extension:a}=t;return e(dt,{extension:a},e(Ue,{name:"Version",value:a.value.version}))},Et=t=>{const{extension:a}=t;return e(dt,{extension:a},e(Ue,{name:"Reason",value:a.value.toJSON()}))};
|
|
52
|
+
/**
|
|
53
|
+
* @license
|
|
54
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the MIT license found in the
|
|
57
|
+
* LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/
|
|
59
|
+
function Tt(e){return d.ToString(e.values[0])}
|
|
60
|
+
/**
|
|
61
|
+
* @license
|
|
62
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the MIT license found in the
|
|
65
|
+
* LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const Kt=t=>{const{extension:a}=t;return e(dt,{extension:a},a.value.map((t,a)=>[e(Ue,{name:"Attribute #"+(a+1),value:""}),e(Ue,{name:"Type",value:Be(t.type)}),e(Ue,{name:"Value",value:Tt(t)})]))},Pt=t=>{const{extension:a}=t;return e(dt,{extension:a},e(Ue,{name:"Value",value:a.value,monospace:!0}))},Ot=t=>{const{extension:a}=t;return e(dt,{extension:a},e(Ue,{name:"Not Before",value:r(a.value.notBefore)}),e(Ue,{name:"Not After",value:r(a.value.notAfter)}))},Gt=t=>{const{extension:a}=t;return e(dt,{extension:a},e(Ue,{name:"Version",value:a.value.entrustVers}),e(Ue,{name:"Info Flags",value:a.value.entrustInfoFlags.toJSON().join(", ")}))},Rt=t=>{const{extension:a}=t;return e(dt,{extension:a},a.value.map((t,a)=>[e(Ue,{name:"Biometric #"+(a+1),value:""}),e(Ue,{name:"OID",value:Be(t.typeOfBiometricData.biometricDataOid)}),e(Ue,{name:"Type",value:t.typeOfBiometricData.predefinedBiometricType}),e(Ue,{name:"Algorithm",value:Be(t.hashAlgorithm.algorithm)}),e(Ue,{name:"Hash",value:d.ToHex(t.biometricDataHash.buffer),monospace:!0}),e(Ue,{name:"Source Uri",value:t.sourceDataUri})]))},Vt=t=>{const{extension:a}=t,i=t=>t?t.map(t=>{const{imageDetails:a}=t;return[e(Ue,{name:"Image Type",value:a.mediaType}),e(Ue,{name:"Image Hash",value:d.ToHex(a.logotypeHash[0].hashValue),monospace:!0}),e(Ue,{name:"Image URL",value:a.logotypeURI[0],monospace:!0,collapse:!0}),e(Ue,{name:"Image Hash Algorithm",value:Be(a.logotypeHash[0].hashAlg.algorithm)})]}):null,n=t=>t?t.map(t=>{const{audioDetails:a}=t;return[e(Ue,{name:"Audio Type",value:a.mediaType}),e(Ue,{name:"Audio Hash",value:d.ToHex(a.logotypeHash[0].hashValue),monospace:!0}),e(Ue,{name:"Audio URL",value:a.logotypeURI[0],monospace:!0,collapse:!0}),e(Ue,{name:"Audio Hash Algorithm",value:Be(a.logotypeHash[0].hashAlg.algorithm)})]}):null,o=(t,a)=>{if(!a||!a.direct)return null;const{image:o,audio:r}=a.direct;return[e(Ue,{name:"Type",value:t}),i(o),n(r),e("tr",null,e("td",null),e("td",null))]};return e(dt,{extension:a},o("Subject",a.value.subjectLogo),o("Issuer",a.value.issuerLogo))},Ht=t=>{const{extension:a}=t;return e(dt,{extension:a},a.value.map((t,a)=>[e(Ue,{name:"Entry #"+(a+1),value:""}),e(Ue,{name:"SPC",value:t.spc}),e(Ue,{name:"Range",value:t.range?`start=${t.range.start} count==${t.range.count}`:null}),e(Ue,{name:"One",value:t.one})]))},qt=t=>{const{extension:a}=t;return e(dt,{extension:a},a.value.requireExplicitPolicy&&e(Ue,{name:"Require Explicit Policy",value:ae.toASN(a.value.requireExplicitPolicy).valueBlock.toString()}),a.value.inhibitPolicyMapping&&e(Ue,{name:"Inhibit Policy Mapping",value:ae.toASN(a.value.inhibitPolicyMapping).valueBlock.toString()}))},$t=t=>{const{extension:a}=t;return e(dt,{extension:a},a.value.map((t,a)=>[e(Ue,{name:"Policy #"+(a+1),value:""}),e(Ue,{name:"Issuer Domain",value:Be(t.issuerDomainPolicy)}),e(Ue,{name:"Subject Domain",value:Be(t.subjectDomainPolicy)})]))},Bt=t=>{const{extensions:a,title:i}=t;return a&&a.length?[e(Fe,{value:i||"Extensions"}),a.map(a=>{try{return a.value instanceof ie?e(bt,{extension:a}):a.value instanceof ne?e(pt,{extension:a}):a.value instanceof oe?e(ht,{extension:a}):a.value instanceof re?e(ut,Object.assign({extension:a},t)):a.value instanceof se?e(ft,Object.assign({extension:a},t)):a.value instanceof le?e(gt,Object.assign({extension:a},t)):a.value instanceof ce||a.value instanceof de?e(mt,Object.assign({extension:a},t)):a.value instanceof be?e(vt,Object.assign({extension:a},t)):a.value instanceof pe?e(xt,{extension:a}):a.value instanceof he?e(wt,{extension:a}):a.value instanceof ue?e(kt,Object.assign({extension:a},t)):a.value instanceof fe?e(_t,{extension:a}):a.value instanceof ge?e(Ct,{extension:a}):a.value instanceof me?e(zt,{extension:a}):a.value instanceof ve?e(At,{extension:a}):a.value instanceof xe?e(St,{extension:a}):a.value instanceof ye?e(It,{extension:a}):a.value instanceof we?e(Nt,{extension:a}):a.value instanceof ke?e(Lt,Object.assign({extension:a},t)):a.value instanceof _e?e(Dt,Object.assign({extension:a},t)):e(a.value instanceof Ce?jt:a.value instanceof ze?Et:a.value instanceof Ae?Kt:a.value instanceof Se?Ot:a.value instanceof Ie?Gt:a.value instanceof Ne?Rt:a.value instanceof Le?Vt:a.value instanceof De?Ht:a.value instanceof je?qt:a.value instanceof Ee?$t:"string"==typeof a.value?Pt:dt,{extension:a})}catch(i){return console.error("Error render extension:",a.asn.extnID),null}})]:null},Ft=t=>{const{serialNumber:a,version:i,validity:n,notBefore:s,notAfter:l,type:c}=t;return[e(Fe,{value:o.getString("basicInformation")}),e(Ue,{name:o.getString("type"),value:c}),e(Ue,{name:o.getString("serialNumber"),value:a,monospace:!0}),e(Ue,{name:o.getString("version"),value:i}),e(Ue,{name:o.getString("validity"),value:n}),e(Ue,{name:o.getString("issued"),value:s?r(s):void 0}),e(Ue,{name:o.getString("expired"),value:l?r(l):void 0})]};
|
|
67
|
+
/**
|
|
68
|
+
* @license
|
|
69
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the MIT license found in the
|
|
72
|
+
* LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/
|
|
74
|
+
/**
|
|
75
|
+
* @license
|
|
76
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the MIT license found in the
|
|
79
|
+
* LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/
|
|
81
|
+
function Ut(e){e instanceof $e?Te.certificateRequest.asPEM(e.exportAsPemFormatted(),e.commonName):Te.certificate.asPEM(e.exportAsPemFormatted(),e.commonName)}function Yt(e){e instanceof $e?Te.certificateRequest.asDER(e.exportAsHexFormatted(),e.commonName):Te.certificate.asDER(e.exportAsHexFormatted(),e.commonName)}const Mt=t=>{const{certificate:a}=t;return[e(Fe,{value:o.getString("miscellaneous")}),e("tr",null,e("td",{class:"vertical_align_middle"},e("peculiar-typography",{color:"grey_5"},o.getString("download"),":")),e("td",null,e("peculiar-button-split",{onClick:Ut.bind(void 0,a),actions:[{text:o.getString("download.der"),onClick:Yt.bind(void 0,a)}]},o.getString("download.pem"))))]},Xt=e=>"https://search.gleif.org/#/record/"+e,Wt=e=>"https://search.censys.io/search?resource=hosts&q=dns.names%3A"+e,Qt=e=>"https://search.censys.io/search?resource=hosts&q=ip%3A"
|
|
82
|
+
/**
|
|
83
|
+
* @license
|
|
84
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the MIT license found in the
|
|
87
|
+
* LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/+e,Jt=t=>{const{issuer:a}=t;return a?[e(Fe,{value:o.getString("issuer")}),a.map(t=>e(Je,{generalName:t,getDNSNameLink:()=>"",getIPAddressLink:()=>""}))]:null},Zt=t=>{const{holder:a}=t;if(!a)return null;const{baseCertificateID:i,objectDigestInfo:n}=a;return[e(Fe,{value:o.getString("holder")}),i&&[i.issuer.map(t=>e(Je,{generalName:t,getDNSNameLink:()=>"",getIPAddressLink:()=>""})),e("tr",null,e("td",null),e("td",null)),e(Ue,{name:o.getString("serialNumber"),value:d.ToHex(i.serial),monospace:!0}),e("tr",null,e("td",null),e("td",null))],n&&[e(Ue,{name:o.getString("digestInfo"),value:""}),e(Ue,{name:o.getString("algorithm"),value:Be(n.digestAlgorithm.algorithm)}),e(Ue,{name:o.getString("value"),value:d.ToHex(n.objectDigest),monospace:!0}),e(Ue,{name:o.getString("type"),value:n.digestedObjectType})]]},ea=class{constructor(e){t(this,e),this.isDecodeInProcess=!0,this.getAuthKeyIdParentLink=e=>{var t;return null===(t=this.authKeyIdParentLink)||void 0===t?void 0:t.replace("{{authKeyId}}",e)},this.getAuthKeyIdSiblingsLink=e=>{var t;return null===(t=this.authKeyIdSiblingsLink)||void 0===t?void 0:t.replace("{{authKeyId}}",e)},this.getSubjectKeyIdChildrenLink=e=>{var t;return null===(t=this.subjectKeyIdChildrenLink)||void 0===t?void 0:t.replace("{{subjectKeyId}}",e)},this.getSubjectKeyIdSiblingsLink=e=>{var t;return null===(t=this.subjectKeyIdSiblingsLink)||void 0===t?void 0:t.replace("{{subjectKeyId}}",e)}}componentWillLoad(){this.decodeCertificate(this.certificate)}async decodeCertificate(e){this.isDecodeInProcess=!0;try{if(e instanceof qe)this.certificateDecoded=e;else{if("string"!=typeof e)return;this.certificateDecoded=new qe(e)}this.certificateDecoded.parseExtensions(),this.certificateDecoded.parseAttributes(),await this.certificateDecoded.getThumbprint("SHA-1"),await this.certificateDecoded.getThumbprint("SHA-256")}catch(t){this.certificateDecodeError=t,console.error("Error certificate parse:",t)}this.isDecodeInProcess=!1}watchCertificateAndDecode(e,t){"string"!=typeof e||"string"!=typeof t?e instanceof qe&&t instanceof qe&&e.serialNumber!==t.serialNumber&&this.decodeCertificate(e):e!==t&&this.decodeCertificate(e)}renderErrorState(){return e("div",{class:"status_wrapper"},e("peculiar-typography",{type:"b1",class:"interaction_text"},"There was an error decoding this attribute certificate."))}renderEmptyState(){return e("div",{class:"status_wrapper"},e("peculiar-typography",{type:"b1",class:"interaction_text"},"There is no attribute certificate available."))}render(){return this.certificateDecodeError?this.renderErrorState():this.certificateDecoded?e(a,null,e("table",null,e(Ft,Object.assign({},this.certificateDecoded)),e(Jt,{issuer:this.certificateDecoded.issuer}),e(Zt,{holder:this.certificateDecoded.holder}),e(Ye,{signature:this.certificateDecoded.signature}),e(ct,{thumbprints:this.certificateDecoded.thumbprints}),e(lt,{attributes:this.certificateDecoded.attributes,getLEILink:Xt,getDNSNameLink:Wt,getIPAddressLink:Qt,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),e(Bt,{extensions:this.certificateDecoded.extensions,getLEILink:Xt,getDNSNameLink:Wt,getIPAddressLink:Qt,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),this.download&&e(Mt,{certificate:this.certificateDecoded}))):this.renderEmptyState()}static get watchers(){return{certificate:["watchCertificateAndDecode"]}}};
|
|
89
|
+
/**
|
|
90
|
+
* @license
|
|
91
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the MIT license found in the
|
|
94
|
+
* LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/ea.style=":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}";const ta=class{constructor(e){t(this,e),this.fill="stroke",this.handleClick=e=>{if(this.disabled)return e.preventDefault(),void e.stopPropagation();this.onClick&&this.onClick(e)}}render(){const t=!!this.href;return e(t?"a":"button",{class:{button:!0,button_stroke:"stroke"===this.fill,button_fill:"fill"===this.fill,button_disabled:this.disabled},disabled:this.disabled,type:!t&&"button",href:t&&this.href,target:t&&this.target?this.target:null,rel:t&&"noreferrer noopener",onClick:this.handleClick,part:"base"},e("span",{part:"label",class:"button_label"},e("slot",null)))}};ta.style=':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}';const aa=class{constructor(e){t(this,e),this.fill="stroke",this.actions=[],this.open=!1,this.onClickSplitButton=e=>{e.stopPropagation(),this.open=!this.open}}onClickActiveButton(e,t){this.open=!1,e(t)}renderActiveSplitState(){return this.open?e("div",{class:"button_split_container"},this.actions.map(t=>e("peculiar-button",{fill:"fill",class:"button_split_action",onClick:this.onClickActiveButton.bind(this,t.onClick)},t.text))):null}render(){return e("div",{class:{button_split:!0}},e("peculiar-button",{fill:this.fill,onClick:this.onClick},e("slot",null)),e("peculiar-button",{fill:this.fill,onClick:this.onClickSplitButton,class:{button_split_with_icon:!0,m_open:this.open}},e("svg",{viewBox:"0 0 7 5",xmlns:"http://www.w3.org/2000/svg",class:"button_split_icon"},e("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())}};aa.style=':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}';const ia=class{constructor(e){t(this,e),this.onClickDecode=()=>{const{value:e}=this.inputPaste;e&&this.decode(e)},this.onClickExample=()=>{this.decode(this.certificateExample)},this.onClickClear=()=>{this.clearValue()},this.onChangeInputFile=async e=>{const t=e.target;if(t.files){const e=await Ve(t.files[0]);"string"==typeof e.value&&this.decode(e.value),t.value=""}},this.onDropFile=async e=>{e.stopPropagation(),e.preventDefault();const t=e.dataTransfer;if(t.files){const e=await Ve(t.files[0]);"string"==typeof e.value&&this.decode(e.value)}}}componentDidLoad(){const e=s.parseHash(window.location.search);e.cert&&setTimeout(()=>this.decode(e.cert),100)}clearValue(){this.inputPaste.value="",this.certificateDecoded=null,s.replace({search:""})}setValue(e){this.certificateDecoded=e,this.inputPaste.value=e.exportAsPemFormatted(),s.replace({search:s.queryStringify({cert:e.exportAsBase64()})})}decode(e){const t=Ke(e),a=Pe(e),i=Oe(e),n=Ge(e);let o,r;if(t&&!(a||n||i))return this.clearValue(),void alert("Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest.");try{a&&(o=new Re(e)),n&&(o=new qe(e)),i&&(o=new $e(e))}catch(s){r=s}if(!o)try{o=new Re(e)}catch(s){r=s}if(!o)try{o=new qe(e)}catch(s){r=s}if(!o)try{o=new $e(e)}catch(s){r=s}o?this.setValue(o):(this.clearValue(),console.log(r),alert("Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest."))}render(){return e(a,null,e("textarea",{placeholder:"Certificate DER or PEM",class:"textarea",ref:e=>{this.inputPaste=e},onDrop:this.onDropFile}),e("div",{class:"controls"},e("peculiar-button",{fill:"fill",class:"button",onClick:this.onClickDecode},"Decode"),e("peculiar-button",{class:"button"},"Choose file",e("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:""})),e("peculiar-button",{class:"button",onClick:this.onClickClear},"Clear"),this.certificateExample&&e("peculiar-button",{class:"button",onClick:this.onClickExample},"Example")),this.certificateDecoded instanceof Re&&e("peculiar-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:!0}),this.certificateDecoded instanceof qe&&e("peculiar-attribute-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:!0}),this.certificateDecoded instanceof $e&&e("peculiar-csr-viewer",{certificate:this.certificateDecoded,class:"viewer",download:!0}))}};
|
|
96
|
+
/**
|
|
97
|
+
* @license
|
|
98
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the MIT license found in the
|
|
101
|
+
* LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/
|
|
103
|
+
function na(e){var t;if(null===(t=e.params)||void 0===t?void 0:t.modulus){let t=e.params.modulus.byteLength;return t%2&&(t-=1),8*t}return null}function oa(e){var t;return(null===(t=e.params)||void 0===t?void 0:t.publicExponent)?3===e.params.publicExponent.byteLength?65537:3:null}ia.style=":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}";const ra=t=>{var a;const{publicKey:i}=t;return i?[e(Fe,{value:o.getString("publicKeyInfo")}),e(Ue,{name:o.getString("algorithm"),value:Be(i.algorithm)}),e(Ue,{name:o.getString("namedCurve"),value:Be(null===(a=i.params)||void 0===a?void 0:a.namedCurve)}),e(Ue,{name:o.getString("exponent"),value:oa(i)}),e(Ue,{name:o.getString("modulus"),value:na(i)}),e(Ue,{name:o.getString("value"),value:d.ToHex(i.value),monospace:!0,collapse:!0})]:null},sa=t=>{const{name:a}=t;return[e(Fe,{value:o.getString("subjectName")}),a.map(t=>e(Ue,{name:t.name||t.type,value:t.value}))]},la=t=>{const{name:a,issuerDnLink:i}=t,n=o.getString("issuerName");return[e(Fe,{value:i?e("peculiar-link",{href:i,type:"h6"},n):n}),a.map(t=>e(Ue,{name:t.name||t.type,value:t.value}))]},ca=class{constructor(e){t(this,e),this.isDecodeInProcess=!0,this.getAuthKeyIdParentLink=e=>{var t;return null===(t=this.authKeyIdParentLink)||void 0===t?void 0:t.replace("{{authKeyId}}",e)},this.getAuthKeyIdSiblingsLink=e=>{var t;return null===(t=this.authKeyIdSiblingsLink)||void 0===t?void 0:t.replace("{{authKeyId}}",e)},this.getSubjectKeyIdChildrenLink=e=>{var t;return null===(t=this.subjectKeyIdChildrenLink)||void 0===t?void 0:t.replace("{{subjectKeyId}}",e)},this.getSubjectKeyIdSiblingsLink=e=>{var t;return null===(t=this.subjectKeyIdSiblingsLink)||void 0===t?void 0:t.replace("{{subjectKeyId}}",e)}}componentWillLoad(){this.decodeCertificate(this.certificate)}async decodeCertificate(e){this.isDecodeInProcess=!0;try{if(e instanceof Re)this.certificateDecoded=e;else{if("string"!=typeof e)return;this.certificateDecoded=new Re(e)}this.certificateDecoded.parseExtensions(),await this.certificateDecoded.getThumbprint("SHA-1"),await this.certificateDecoded.getThumbprint("SHA-256")}catch(t){this.certificateDecodeError=t,console.error("Error certificate parse:",t)}this.isDecodeInProcess=!1}watchCertificateAndDecode(e,t){"string"!=typeof e||"string"!=typeof t?e instanceof Re&&t instanceof Re&&e.serialNumber!==t.serialNumber&&this.decodeCertificate(e):e!==t&&this.decodeCertificate(e)}getIssuerDnLink(){return this.issuerDnLink}renderErrorState(){return e("div",{class:"status_wrapper"},e("peculiar-typography",{type:"b1",class:"interaction_text"},"There was an error decoding this certificate."))}renderEmptyState(){return e("div",{class:"status_wrapper"},e("peculiar-typography",{type:"b1",class:"interaction_text"},"There is no certificate available."))}render(){return this.certificateDecodeError?this.renderErrorState():this.certificateDecoded?e(a,{"data-view":this.view},e("table",null,e(Ft,Object.assign({},this.certificateDecoded)),e(sa,{name:this.certificateDecoded.subject}),e(la,{name:this.certificateDecoded.issuer,issuerDnLink:this.getIssuerDnLink()}),e(ra,{publicKey:this.certificateDecoded.publicKey}),e(Ye,{signature:this.certificateDecoded.signature}),e(ct,{thumbprints:this.certificateDecoded.thumbprints}),e(Bt,{extensions:this.certificateDecoded.extensions,getLEILink:Xt,getDNSNameLink:Wt,getIPAddressLink:Qt,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),this.download&&e(Mt,{certificate:this.certificateDecoded}))):this.renderEmptyState()}static get watchers(){return{certificate:["watchCertificateAndDecode"]}}};
|
|
104
|
+
/**
|
|
105
|
+
* @license
|
|
106
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the MIT license found in the
|
|
109
|
+
* LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/ca.style=":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}";const da=class{constructor(e){t(this,e),this.isDecodeInProcess=!0,this.getAuthKeyIdParentLink=e=>e,this.getAuthKeyIdSiblingsLink=e=>e,this.getSubjectKeyIdChildrenLink=e=>{var t;return null===(t=this.subjectKeyIdChildrenLink)||void 0===t?void 0:t.replace("{{subjectKeyId}}",e)},this.getSubjectKeyIdSiblingsLink=e=>{var t;return null===(t=this.subjectKeyIdSiblingsLink)||void 0===t?void 0:t.replace("{{subjectKeyId}}",e)}}componentWillLoad(){this.decodeCertificate(this.certificate)}async decodeCertificate(e){this.isDecodeInProcess=!0;try{if(e instanceof $e)this.certificateDecoded=e;else{if("string"!=typeof e)return;this.certificateDecoded=new $e(e)}this.certificateDecoded.parseAttributes(),await this.certificateDecoded.getThumbprint("SHA-1"),await this.certificateDecoded.getThumbprint("SHA-256")}catch(t){this.certificateDecodeError=t,console.error("Error certificate parse:",t)}this.isDecodeInProcess=!1}watchCertificateAndDecode(e,t){"string"!=typeof e||"string"!=typeof t?e instanceof $e&&t instanceof $e&&e.commonName!==t.commonName&&this.decodeCertificate(e):e!==t&&this.decodeCertificate(e)}renderErrorState(){return e("div",{class:"status_wrapper"},e("peculiar-typography",{type:"b1",class:"interaction_text"},"There was an error decoding this certificate request."))}renderEmptyState(){return e("div",{class:"status_wrapper"},e("peculiar-typography",{type:"b1",class:"interaction_text"},"There is no certificate request available."))}getExtensionRequestAttribute(){if(this.certificateDecoded)return this.certificateDecoded.attributes.find(e=>"1.2.840.113549.1.9.14"===e.asn.type)}render(){if(this.certificateDecodeError)return this.renderErrorState();if(!this.certificateDecoded)return this.renderEmptyState();const t=this.getExtensionRequestAttribute();return e(a,{"data-view":this.view},e("table",null,e(Ft,Object.assign({},this.certificateDecoded)),e(sa,{name:this.certificateDecoded.subject}),e(ra,{publicKey:this.certificateDecoded.publicKey}),e(Ye,{signature:this.certificateDecoded.signature}),e(ct,{thumbprints:this.certificateDecoded.thumbprints}),e(lt,{attributes:this.certificateDecoded.attributes,getLEILink:Xt,getDNSNameLink:Wt,getIPAddressLink:Qt,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),e(Bt,{extensions:null==t?void 0:t.value,title:"Extension Request",getLEILink:Xt,getDNSNameLink:Wt,getIPAddressLink:Qt,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),this.download&&e(Mt,{certificate:this.certificateDecoded})))}static get watchers(){return{certificate:["watchCertificateAndDecode"]}}};da.style=":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}";const ba=class{constructor(e){t(this,e),this.type="b3"}render(){return e("a",{href:this.href,target:"_blank",rel:"noreferrer noopener",class:{link:!0,["link_type_"+(this.type||"b3")]:!0}},e("slot",null))}};ba.style=':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}';const pa=class{constructor(e){t(this,e),this.textExpand=i(this,"textExpand",7),this.opened=!1}textExpandHandler(){this.opened=!this.opened}render(){return e(a,null,e("div",{class:"root"},e("div",{class:{text:!0,m_opened:this.opened}},e("slot",null)),e("div",{class:"action"},e("peculiar-button",{onClick:this.textExpand.emit,class:{button_action:!0,m_opened:this.opened},fill:this.opened?"fill":"stroke"},e("svg",{viewBox:"0 0 7 5",xmlns:"http://www.w3.org/2000/svg",class:"expand_icon"},e("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"}))))))}};pa.style=":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)}";const ha=class{constructor(e){t(this,e),this.type="b3",this.color="dark"}render(){const t=this.type&&this.type.includes("h")?this.type:"p";return e(t,{class:{typography:!0,["typography_type_"+(this.type||"b3")]:!0,["typography_color_"+(this.color||"dark")]:!0,["typography_align_"+this.align]:!!this.align,typography_ellipsis:this.ellipsis,typography_monospace:this.monospace}},e("slot",null))}};ha.style=':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}';export{ea as peculiar_attribute_certificate_viewer,ta as peculiar_button,aa as peculiar_button_split,ia as peculiar_certificate_decoder,ca as peculiar_certificate_viewer,da as peculiar_csr_viewer,ba as peculiar_link,pa as peculiar_text_hider,ha as peculiar_typography}
|