@peculiar/certificates-viewer 2.0.1 → 2.0.2-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cjs/_commonjsHelpers-cb1f949a.js +23 -0
- package/dist/cjs/{download-cd98aa01.js → certification_request-96951e7b.js} +2880 -3313
- package/dist/cjs/{dom-760f300f.js → dom-f57e260e.js} +4 -1
- package/dist/cjs/download-5e7d5455.js +438 -0
- package/dist/cjs/{index-2973f90a.js → index-064e95c7.js} +287 -634
- package/dist/cjs/index.cjs.js +12 -0
- package/dist/cjs/{l10n-e971a5ac.js → l10n-2e7def18.js} +72 -90
- package/dist/cjs/loader.cjs.js +12 -3
- package/dist/cjs/peculiar-attribute-certificate-viewer_9.cjs.entry.js +1426 -1391
- package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +66 -62
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +222 -217
- package/dist/cjs/peculiar.cjs.js +70 -3
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +220 -205
- package/dist/collection/components/attribute-certificate-viewer/holder.js +27 -24
- package/dist/collection/components/attribute-certificate-viewer/issuer.js +11 -8
- package/dist/collection/components/button/button.css +2 -7
- package/dist/collection/components/button/button.js +125 -122
- package/dist/collection/components/button-split/button-split.js +103 -100
- package/dist/collection/components/certificate-decoder/certificate-decoder.css +1 -3
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +158 -155
- package/dist/collection/components/certificate-summary/certificate-summary.js +75 -72
- package/dist/collection/components/certificate-viewer/attributes/activity_description_attribute.js +11 -8
- package/dist/collection/components/certificate-viewer/attributes/as_string_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/basic_attribute.js +11 -8
- package/dist/collection/components/certificate-viewer/attributes/challenge_password_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/index.js +45 -42
- package/dist/collection/components/certificate-viewer/attributes/insurance_value_attribute.js +7 -4
- package/dist/collection/components/certificate-viewer/attributes/name_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/name_part.js +8 -5
- package/dist/collection/components/certificate-viewer/attributes/type_relationship_attribute.js +5 -2
- package/dist/collection/components/certificate-viewer/attributes/unstructured_name_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/valuation_ranking_attribute.js +18 -15
- package/dist/collection/components/certificate-viewer/attributes/web_gdpr_attribute.js +13 -10
- package/dist/collection/components/certificate-viewer/basic_information.js +13 -10
- package/dist/collection/components/certificate-viewer/certificate-viewer.js +255 -240
- package/dist/collection/components/certificate-viewer/extensions/archive_rev_info_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/as_string_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/attribute_value.js +4 -1
- package/dist/collection/components/certificate-viewer/extensions/authority_key_identifier_extension.js +18 -15
- package/dist/collection/components/certificate-viewer/extensions/basic_constraints_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/basic_extension.js +12 -9
- package/dist/collection/components/certificate-viewer/extensions/biometric_syntax_extension.js +12 -9
- package/dist/collection/components/certificate-viewer/extensions/ca_version_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/certificate_policies_extension.js +28 -25
- package/dist/collection/components/certificate-viewer/extensions/certificate_template_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/certificate_transparency_extension.js +13 -10
- package/dist/collection/components/certificate-viewer/extensions/crl_distribution_points_extension.js +11 -8
- package/dist/collection/components/certificate-viewer/extensions/crl_reason_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/enroll_cert_type_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/entrust_version_info_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/extended_key_usage_extension.js +5 -2
- package/dist/collection/components/certificate-viewer/extensions/general_name_part.js +55 -52
- package/dist/collection/components/certificate-viewer/extensions/index.js +112 -109
- package/dist/collection/components/certificate-viewer/extensions/info_access_syntax_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/key_usage_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/lei_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/lei_role_extennsion.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/logotype_extension.js +49 -46
- package/dist/collection/components/certificate-viewer/extensions/name_constraints_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/netscape_cert_type_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/netscape_comment_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/policy_constraints_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/policy_mappings_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/private_key_usage_period_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/qc_statements_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/subject_alternative_name_extension.js +5 -2
- package/dist/collection/components/certificate-viewer/extensions/subject_directory_attributes_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/subject_key_identifier_extension.js +18 -15
- package/dist/collection/components/certificate-viewer/extensions/timestamp_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/tn_auth_list_extension.js +10 -7
- package/dist/collection/components/certificate-viewer/get_string_by_oid.js +8 -5
- package/dist/collection/components/certificate-viewer/issuer_name.js +9 -6
- package/dist/collection/components/certificate-viewer/miscellaneous.js +29 -26
- package/dist/collection/components/certificate-viewer/public_key.js +31 -28
- package/dist/collection/components/certificate-viewer/row.js +35 -32
- package/dist/collection/components/certificate-viewer/signature.js +12 -9
- package/dist/collection/components/certificate-viewer/subject_name.js +8 -5
- package/dist/collection/components/certificate-viewer/thumbprints.js +15 -12
- package/dist/collection/components/certificates-viewer/certificates-viewer.css +1 -19
- package/dist/collection/components/certificates-viewer/certificates-viewer.js +384 -381
- package/dist/collection/components/circular-progress/circular-progress.css +2 -24
- package/dist/collection/components/circular-progress/circular-progress.js +73 -70
- package/dist/collection/components/csr-viewer/csr-viewer.js +197 -188
- package/dist/collection/components/highlight-words/highlight-words.js +56 -53
- package/dist/collection/components/link/link.css +1 -3
- package/dist/collection/components/link/link.js +60 -57
- package/dist/collection/components/text-hider/text-hider.js +75 -72
- package/dist/collection/components/typography/typography.css +1 -3
- package/dist/collection/components/typography/typography.js +126 -123
- package/dist/collection/constants/logs.js +79 -76
- package/dist/collection/constants/oids.js +2301 -2298
- package/dist/collection/crypto/asn_data.js +33 -32
- package/dist/collection/crypto/attribute.js +52 -49
- package/dist/collection/crypto/csr.js +64 -61
- package/dist/collection/crypto/extension.js +126 -123
- package/dist/collection/crypto/index.js +3 -0
- package/dist/collection/crypto/name.js +33 -32
- package/dist/collection/crypto/provider.js +28 -25
- package/dist/collection/crypto/utils.js +24 -21
- package/dist/collection/crypto/x509_attribute_certificate.js +61 -58
- package/dist/collection/crypto/x509_certificate.js +107 -104
- package/dist/collection/index.js +5 -1
- package/dist/collection/utils/date_formatter.js +19 -16
- package/dist/collection/utils/download.js +18 -15
- package/dist/collection/utils/download_from_buffer.js +30 -25
- package/dist/collection/utils/history.js +5 -2
- package/dist/collection/utils/index.js +3 -0
- package/dist/collection/utils/is_link.js +4 -1
- package/dist/collection/utils/l10n.js +28 -25
- package/dist/collection/utils/parse_hash.js +16 -13
- package/dist/collection/utils/query_stringify.js +12 -9
- package/dist/collection/utils/read_file.js +43 -40
- package/dist/collection/utils/third_party_links.js +3 -0
- package/dist/collection/utils/validator.js +15 -12
- package/dist/esm/_commonjsHelpers-bfbd2ad8.js +20 -0
- package/dist/esm/{download-1ff0a3be.js → certification_request-48e8b956.js} +2898 -3328
- package/dist/esm/{dom-91ed8d21.js → dom-f1b08a97.js} +4 -1
- package/dist/esm/download-cf68ac2c.js +434 -0
- package/dist/esm/{index-5ef692cc.js → index-bbd484d9.js} +278 -624
- package/dist/esm/index.js +5 -0
- package/dist/esm/{l10n-c8cf6930.js → l10n-ead9928b.js} +71 -86
- package/dist/esm/{loader.mjs → loader.js} +11 -2
- package/dist/esm/peculiar-attribute-certificate-viewer_9.entry.js +1425 -1390
- package/dist/esm/peculiar-certificate-summary_3.entry.js +66 -62
- package/dist/esm/peculiar-certificates-viewer.entry.js +222 -217
- package/dist/esm/peculiar.js +73 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/polyfills/index.js +2 -2
- package/dist/esm-es5/_commonjsHelpers-bfbd2ad8.js +4 -0
- package/dist/esm-es5/certification_request-48e8b956.js +89 -0
- package/dist/esm-es5/dom-f1b08a97.js +24 -0
- package/dist/esm-es5/download-cf68ac2c.js +18 -0
- package/dist/esm-es5/index-bbd484d9.js +5 -0
- package/dist/esm-es5/index.js +4 -0
- package/dist/esm-es5/l10n-ead9928b.js +39 -0
- package/dist/esm-es5/loader.js +4 -0
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_9.entry.js +198 -1907
- package/dist/esm-es5/peculiar-certificate-summary_3.entry.js +4 -83
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js +4 -290
- package/dist/esm-es5/peculiar.js +4 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -1
- package/dist/peculiar/index.esm.js +4 -0
- package/dist/peculiar/p-047b12d9.system.js +89 -0
- package/dist/peculiar/p-13e9d17d.system.entry.js +460 -0
- package/dist/peculiar/p-29cdd256.system.js +18 -0
- package/dist/peculiar/{p-75076c56.system.js → p-3929074b.system.js} +18 -15
- package/dist/peculiar/p-452d69af.entry.js +113 -0
- package/dist/peculiar/p-4f52a24f.system.js +39 -0
- package/dist/peculiar/p-5f7fbf05.system.entry.js +4 -0
- package/dist/peculiar/p-82033e2e.system.entry.js +4 -0
- package/dist/peculiar/p-886e9c53.js +87 -0
- package/dist/peculiar/p-88fbaf05.system.js +4 -0
- package/dist/peculiar/p-8df391dc.system.js +4 -0
- package/dist/peculiar/p-9837be14.system.js +5 -0
- package/dist/peculiar/p-9ae6b1f8.entry.js +4 -0
- package/dist/peculiar/{p-3d1015c2.js → p-9f4ee110.js} +5 -2
- package/dist/peculiar/p-c774ec0b.js +18 -0
- package/dist/peculiar/p-d09b762f.js +33 -0
- package/dist/peculiar/p-d0b55fbb.js +4 -0
- package/dist/peculiar/p-e5f99586.entry.js +4 -0
- package/dist/peculiar/p-ee0e2707.system.js +4 -0
- package/dist/peculiar/p-f7683ba5.js +5 -0
- package/dist/peculiar/peculiar.esm.js +4 -1
- package/dist/peculiar/peculiar.js +1 -3
- package/dist/types/components/attribute-certificate-viewer/attribute-certificate-viewer.d.ts +56 -56
- package/dist/types/components/attribute-certificate-viewer/holder.d.ts +1 -1
- package/dist/types/components/attribute-certificate-viewer/issuer.d.ts +1 -1
- package/dist/types/components/button/button.d.ts +17 -17
- package/dist/types/components/button-split/button-split.d.ts +10 -10
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +16 -16
- package/dist/types/components/certificate-summary/certificate-summary.d.ts +4 -4
- package/dist/types/components/certificate-viewer/attributes/activity_description_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/as_string_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/basic_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/challenge_password_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/index.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/insurance_value_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/name_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/name_part.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/type_relationship_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/unstructured_name_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/valuation_ranking_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/web_gdpr_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/basic_information.d.ts +6 -6
- package/dist/types/components/certificate-viewer/certificate-viewer.d.ts +66 -66
- package/dist/types/components/certificate-viewer/extensions/archive_rev_info_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/as_string_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/authority_key_identifier_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/basic_constraints_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/basic_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/biometric_syntax_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/ca_version_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/certificate_policies_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/certificate_template_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/certificate_transparency_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/crl_distribution_points_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/crl_reason_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/enroll_cert_type_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/entrust_version_info_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/extended_key_usage_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/general_name_part.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/index.d.ts +2 -2
- package/dist/types/components/certificate-viewer/extensions/info_access_syntax_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/key_usage_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/lei_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/lei_role_extennsion.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/logotype_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/name_constraints_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/netscape_cert_type_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/netscape_comment_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/policy_constraints_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/policy_mappings_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/private_key_usage_period_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/qc_statements_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/subject_alternative_name_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/subject_directory_attributes_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/subject_key_identifier_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/timestamp_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/tn_auth_list_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/issuer_name.d.ts +2 -2
- package/dist/types/components/certificate-viewer/miscellaneous.d.ts +1 -1
- package/dist/types/components/certificate-viewer/public_key.d.ts +1 -1
- package/dist/types/components/certificate-viewer/row.d.ts +7 -7
- package/dist/types/components/certificate-viewer/signature.d.ts +1 -1
- package/dist/types/components/certificate-viewer/subject_name.d.ts +1 -1
- package/dist/types/components/certificate-viewer/thumbprints.d.ts +1 -1
- package/dist/types/components/certificate-viewer/types.d.ts +26 -0
- package/dist/types/components/certificates-viewer/certificates-viewer.d.ts +64 -64
- package/dist/types/components/circular-progress/circular-progress.d.ts +10 -10
- package/dist/types/components/csr-viewer/csr-viewer.d.ts +45 -45
- package/dist/types/components/highlight-words/highlight-words.d.ts +8 -8
- package/dist/types/components/link/link.d.ts +6 -6
- package/dist/types/components/text-hider/text-hider.d.ts +4 -4
- package/dist/types/components/typography/typography.d.ts +18 -18
- package/dist/types/components.d.ts +11 -3
- package/dist/types/constants/logs.d.ts +76 -76
- package/dist/types/constants/oids.d.ts +2293 -2293
- package/dist/types/crypto/asn_data.d.ts +6 -6
- package/dist/types/crypto/attribute.d.ts +3 -3
- package/dist/types/crypto/csr.d.ts +19 -19
- package/dist/types/crypto/extension.d.ts +3 -3
- package/dist/types/crypto/name.d.ts +7 -7
- package/dist/types/crypto/provider.d.ts +15 -15
- package/dist/types/crypto/x509_attribute_certificate.d.ts +22 -22
- package/dist/types/crypto/x509_certificate.d.ts +28 -28
- package/dist/types/index.d.ts +2 -1
- package/dist/types/interface.d.ts +3 -0
- package/dist/types/stencil-public-runtime.d.ts +230 -217
- package/dist/types/utils/download.d.ts +8 -8
- package/dist/types/utils/download_from_buffer.d.ts +3 -3
- package/dist/types/utils/l10n.d.ts +43 -43
- package/dist/types/utils/read_file.d.ts +7 -7
- package/loader/cdn.js +3 -1
- package/loader/index.cjs.js +3 -1
- package/loader/index.d.ts +0 -1
- package/loader/index.es2017.js +5 -0
- package/loader/{index.mjs → index.js} +4 -2
- package/loader/package.json +4 -5
- package/package.json +15 -16
- package/dist/cjs/css-shim-1b988199.js +0 -6
- package/dist/cjs/patch-15ea31af.js +0 -112
- package/dist/cjs/shadow-css-376763e9.js +0 -385
- package/dist/esm/css-shim-5ce2b5c4.js +0 -4
- package/dist/esm/index.mjs +0 -1
- package/dist/esm/patch-f8a17185.js +0 -109
- package/dist/esm/peculiar.mjs +0 -6
- package/dist/esm/shadow-css-95922619.js +0 -383
- package/dist/esm-es5/css-shim-5ce2b5c4.js +0 -122
- package/dist/esm-es5/dom-91ed8d21.js +0 -468
- package/dist/esm-es5/download-1ff0a3be.js +0 -12692
- package/dist/esm-es5/index-5ef692cc.js +0 -1839
- package/dist/esm-es5/index.mjs +0 -0
- package/dist/esm-es5/l10n-c8cf6930.js +0 -758
- package/dist/esm-es5/loader.mjs +0 -10
- package/dist/esm-es5/patch-f8a17185.js +0 -106
- package/dist/esm-es5/peculiar.mjs +0 -5
- package/dist/esm-es5/shadow-css-95922619.js +0 -408
- package/dist/index.mjs +0 -1
- package/dist/peculiar/p-0ad0b6e8.js +0 -1
- package/dist/peculiar/p-198d9121.js +0 -1
- package/dist/peculiar/p-294c4ef9.entry.js +0 -1
- package/dist/peculiar/p-3d339152.system.entry.js +0 -1
- package/dist/peculiar/p-4b7cd42f.js +0 -12
- package/dist/peculiar/p-50ea2036.system.js +0 -1
- package/dist/peculiar/p-557d912f.system.js +0 -1
- package/dist/peculiar/p-84e8326d.entry.js +0 -110
- package/dist/peculiar/p-94f96303.system.js +0 -100
- package/dist/peculiar/p-983b5210.system.entry.js +0 -1
- package/dist/peculiar/p-9f815f76.system.js +0 -1
- package/dist/peculiar/p-aa0a9b36.system.js +0 -1
- package/dist/peculiar/p-bd1f9066.system.js +0 -36
- package/dist/peculiar/p-bd949790.js +0 -1
- package/dist/peculiar/p-cf1841f8.js +0 -30
- package/dist/peculiar/p-dbdd61e7.entry.js +0 -1
- package/dist/peculiar/p-dc6b70b2.js +0 -100
- package/dist/peculiar/p-fb53799e.system.js +0 -1
- package/dist/peculiar/p-fc92385a.system.entry.js +0 -457
- package/dist/peculiar/p-fdad110e.system.js +0 -13
- package/dist/peculiar.js +0 -30
- package/loader/index.es2017.mjs +0 -3
- package/loader/node-main.js +0 -3
|
@@ -1,83 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var CertificateSummary =
|
|
5
|
-
function CertificateSummary(hostRef) {
|
|
6
|
-
registerInstance(this, hostRef);
|
|
7
|
-
this.showIssuer = true;
|
|
8
|
-
}
|
|
9
|
-
// eslint-disable-next-line class-methods-use-this
|
|
10
|
-
CertificateSummary.prototype.renderRow = function (name, value, monospace) {
|
|
11
|
-
return (h("tr", null, h("td", null, h("peculiar-typography", { color: "grey_5" }, name, ":")), h("td", null, h("peculiar-typography", { class: "meta_value", monospace: monospace }, value))));
|
|
12
|
-
};
|
|
13
|
-
CertificateSummary.prototype.render = function () {
|
|
14
|
-
return (h(Host, null, h("table", null, h("tbody", null, this.renderRow(l10n.getString('subjectName'), this.certificate.subjectToString()), this.showIssuer && this.renderRow(l10n.getString('issuerName'), this.certificate.issuerToString()), this.renderRow(l10n.getString('serialNumber'), this.certificate.serialNumber, true), this.renderRow(l10n.getString('version'), this.certificate.version), this.renderRow(l10n.getString('validity'), this.certificate.validity), this.renderRow(l10n.getString('issued'), dateShort(this.certificate.notBefore)), this.renderRow(l10n.getString('expired'), dateShort(this.certificate.notAfter))))));
|
|
15
|
-
};
|
|
16
|
-
return CertificateSummary;
|
|
17
|
-
}());
|
|
18
|
-
CertificateSummary.style = certificateSummaryCss;
|
|
19
|
-
var circularProgressCss = ":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%}@-webkit-keyframes circular-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes circular-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes circular-dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:100, 200;stroke-dashoffset:-15}to{stroke-dasharray:100, 200;stroke-dashoffset:-120}}@keyframes circular-dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:100, 200;stroke-dashoffset:-15}to{stroke-dasharray:100, 200;stroke-dashoffset:-120}}.circle_progress{margin:0 auto}.circle_progress_svg{-webkit-animation:circular-rotate 1.4s linear infinite;animation:circular-rotate 1.4s linear infinite}.circle_progress_circle{stroke-linecap:round;-webkit-animation:circular-dash 1.4s ease-in-out infinite;animation:circular-dash 1.4s ease-in-out infinite;stroke-dasharray:80, 200;stroke-dashoffset:0;stroke:#3584f7;stroke:rgba(var(--pv-color-primary-rgb), 1)}.circle_progress_backdrop{stroke:#d1d5d9;stroke:rgba(var(--pv-color-grey_3-rgb), 1)}";
|
|
20
|
-
var CircularProgress = /** @class */ (function () {
|
|
21
|
-
function CircularProgress(hostRef) {
|
|
22
|
-
registerInstance(this, hostRef);
|
|
23
|
-
/**
|
|
24
|
-
* Width/height of progress circle.
|
|
25
|
-
*/
|
|
26
|
-
this.size = 24;
|
|
27
|
-
/**
|
|
28
|
-
* Stroke width of progress bar circle.
|
|
29
|
-
*/
|
|
30
|
-
this.width = 4;
|
|
31
|
-
this.box = 50;
|
|
32
|
-
}
|
|
33
|
-
CircularProgress.prototype.render = function () {
|
|
34
|
-
return (h(Host, null, h("div", { class: "circle_progress", style: {
|
|
35
|
-
width: this.size + "px",
|
|
36
|
-
height: this.size + "px",
|
|
37
|
-
} }, h("svg", { class: "circle_progress_svg", viewBox: "0 0 " + this.box + " " + this.box }, h("circle", { class: "circle_progress_backdrop", cx: this.box / 2, cy: this.box / 2, r: (this.box / 2) - 5, fill: "none", style: {
|
|
38
|
-
strokeWidth: this.width + "px",
|
|
39
|
-
} }), h("circle", { class: "circle_progress_circle", cx: this.box / 2, cy: this.box / 2, r: (this.box / 2) - 5, fill: "none", style: {
|
|
40
|
-
strokeWidth: this.width + "px",
|
|
41
|
-
} })))));
|
|
42
|
-
};
|
|
43
|
-
return CircularProgress;
|
|
44
|
-
}());
|
|
45
|
-
CircularProgress.style = circularProgressCss;
|
|
46
|
-
var highlightWordsCss = ":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}::slotted(mark){background-color:rgba(247, 168, 49, 0.4);background-color:rgba(var(--pv-color-attention-rgb), 0.4)}";
|
|
47
|
-
var HighlightWords = /** @class */ (function () {
|
|
48
|
-
function HighlightWords(hostRef) {
|
|
49
|
-
registerInstance(this, hostRef);
|
|
50
|
-
this.tag = 'mark';
|
|
51
|
-
}
|
|
52
|
-
HighlightWords.prototype.componentDidLoad = function () {
|
|
53
|
-
this.handleHighlightSearch();
|
|
54
|
-
};
|
|
55
|
-
HighlightWords.prototype.componentDidUpdate = function () {
|
|
56
|
-
this.handleHighlightSearch();
|
|
57
|
-
};
|
|
58
|
-
HighlightWords.prototype.handleHighlightSearch = function () {
|
|
59
|
-
var basicString = this.resetHighlightSearch(this.host.innerHTML);
|
|
60
|
-
var result = basicString;
|
|
61
|
-
if (this.search) {
|
|
62
|
-
var substring = new RegExp("(" + this.search + ")", 'gi');
|
|
63
|
-
result = basicString.replace(substring, "<" + this.tag + ">$1</" + this.tag + ">");
|
|
64
|
-
}
|
|
65
|
-
this.host.innerHTML = result;
|
|
66
|
-
};
|
|
67
|
-
HighlightWords.prototype.resetHighlightSearch = function (source) {
|
|
68
|
-
// eslint-disable-next-line no-useless-escape
|
|
69
|
-
var substring = new RegExp("</?" + this.tag + ">", 'g');
|
|
70
|
-
return source.replace(substring, '');
|
|
71
|
-
};
|
|
72
|
-
HighlightWords.prototype.render = function () {
|
|
73
|
-
return (h(Host, null, h("slot", null)));
|
|
74
|
-
};
|
|
75
|
-
Object.defineProperty(HighlightWords.prototype, "host", {
|
|
76
|
-
get: function () { return getElement(this); },
|
|
77
|
-
enumerable: false,
|
|
78
|
-
configurable: true
|
|
79
|
-
});
|
|
80
|
-
return HighlightWords;
|
|
81
|
-
}());
|
|
82
|
-
HighlightWords.style = highlightWordsCss;
|
|
83
|
-
export { CertificateSummary as peculiar_certificate_summary, CircularProgress as peculiar_circular_progress, HighlightWords as peculiar_highlight_words };
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-bbd484d9.js";import{l as l10n,a as dateShort}from"./l10n-ead9928b.js";import"./_commonjsHelpers-bfbd2ad8.js";var certificateSummaryCss=":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%}td{border:none;padding:0}table{width:100%;border-spacing:0;border-collapse:collapse}td{vertical-align:top;padding-top:5px;padding-bottom:5px}table td:first-child{width:130px;padding-right:10px}table td:last-child{width:calc(100% - 130px)}@media (max-width: 900px){table,tr,td{display:block}table td:last-child,table td:first-child{width:100%}}";var CertificateSummary=function(){function t(t){registerInstance(this,t);this.showIssuer=true}t.prototype.renderRow=function(t,r,e){return h("tr",null,h("td",null,h("peculiar-typography",{color:"grey_5"},t,":")),h("td",null,h("peculiar-typography",{class:"meta_value",monospace:e},r)))};t.prototype.render=function(){return h(Host,null,h("table",null,h("tbody",null,this.renderRow(l10n.getString("subjectName"),this.certificate.subjectToString()),this.showIssuer&&this.renderRow(l10n.getString("issuerName"),this.certificate.issuerToString()),this.renderRow(l10n.getString("serialNumber"),this.certificate.serialNumber,true),this.renderRow(l10n.getString("version"),this.certificate.version),this.renderRow(l10n.getString("validity"),this.certificate.validity),this.renderRow(l10n.getString("issued"),dateShort(this.certificate.notBefore)),this.renderRow(l10n.getString("expired"),dateShort(this.certificate.notAfter)))))};return t}();CertificateSummary.style=certificateSummaryCss;var circularProgressCss=":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%}@-webkit-keyframes circular-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes circular-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes circular-dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:100, 200;stroke-dashoffset:-15}to{stroke-dasharray:100, 200;stroke-dashoffset:-120}}@keyframes circular-dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:100, 200;stroke-dashoffset:-15}to{stroke-dasharray:100, 200;stroke-dashoffset:-120}}.circle_progress{margin:0 auto}.circle_progress_svg{-webkit-animation:circular-rotate 1.4s linear infinite;animation:circular-rotate 1.4s linear infinite}.circle_progress_circle{stroke-linecap:round;-webkit-animation:circular-dash 1.4s ease-in-out infinite;animation:circular-dash 1.4s ease-in-out infinite;stroke-dasharray:80, 200;stroke-dashoffset:0;stroke:#3584f7;stroke:rgba(var(--pv-color-primary-rgb), 1)}.circle_progress_backdrop{stroke:#d1d5d9;stroke:rgba(var(--pv-color-grey_3-rgb), 1)}";var CircularProgress=function(){function t(t){registerInstance(this,t);this.size=24;this.width=4;this.box=50}t.prototype.render=function(){return h(Host,null,h("div",{class:"circle_progress",style:{width:"".concat(this.size,"px"),height:"".concat(this.size,"px")}},h("svg",{class:"circle_progress_svg",viewBox:"0 0 ".concat(this.box," ").concat(this.box)},h("circle",{class:"circle_progress_backdrop",cx:this.box/2,cy:this.box/2,r:this.box/2-5,fill:"none",style:{strokeWidth:"".concat(this.width,"px")}}),h("circle",{class:"circle_progress_circle",cx:this.box/2,cy:this.box/2,r:this.box/2-5,fill:"none",style:{strokeWidth:"".concat(this.width,"px")}}))))};return t}();CircularProgress.style=circularProgressCss;var highlightWordsCss=":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}::slotted(mark){background-color:rgba(247, 168, 49, 0.4);background-color:rgba(var(--pv-color-attention-rgb), 0.4)}";var HighlightWords=function(){function t(t){registerInstance(this,t);this.tag="mark"}t.prototype.componentDidLoad=function(){this.handleHighlightSearch()};t.prototype.componentDidUpdate=function(){this.handleHighlightSearch()};t.prototype.handleHighlightSearch=function(){var t=this.resetHighlightSearch(this.host.innerHTML);var r=t;if(this.search){var e=new RegExp("(".concat(this.search,")"),"gi");r=t.replace(e,"<".concat(this.tag,">$1</").concat(this.tag,">"))}this.host.innerHTML=r};t.prototype.resetHighlightSearch=function(t){var r=new RegExp("</?".concat(this.tag,">"),"g");return t.replace(r,"")};t.prototype.render=function(){return h(Host,null,h("slot",null))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();HighlightWords.style=highlightWordsCss;export{CertificateSummary as peculiar_certificate_summary,CircularProgress as peculiar_circular_progress,HighlightWords as peculiar_highlight_words};
|
|
@@ -1,290 +1,4 @@
|
|
|
1
|
-
var __awaiter = (this && this
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-5ef692cc.js';
|
|
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
|
-
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
|
-
var CertificatesViewer = /** @class */ (function () {
|
|
42
|
-
function class_1(hostRef) {
|
|
43
|
-
var _this = this;
|
|
44
|
-
registerInstance(this, hostRef);
|
|
45
|
-
this.detailsOpen = createEvent(this, "detailsOpen", 7);
|
|
46
|
-
this.detailsClose = createEvent(this, "detailsClose", 7);
|
|
47
|
-
/**
|
|
48
|
-
* List of certificates values for decode and show in the list.
|
|
49
|
-
* <br />
|
|
50
|
-
* **NOTE**: If you do not provide a `name` value when
|
|
51
|
-
* invocing the component it will take the first Subject CN value.
|
|
52
|
-
* <br />
|
|
53
|
-
* **NOTE**: If you do not provide a `tests` this column will be ommited from the rendered page.
|
|
54
|
-
* <br />
|
|
55
|
-
* **NOTE**: If the supplied certificates are self-signed the issuer column will be ommited.
|
|
56
|
-
*/
|
|
57
|
-
this.certificates = [];
|
|
58
|
-
/**
|
|
59
|
-
* Use filter in the list when search is changed.
|
|
60
|
-
*/
|
|
61
|
-
this.filterWithSearch = true;
|
|
62
|
-
/**
|
|
63
|
-
* Use highlight chapters in the list when search is changed.
|
|
64
|
-
*/
|
|
65
|
-
this.highlightWithSearch = true;
|
|
66
|
-
this.search = '';
|
|
67
|
-
this.certificatesDecoded = [];
|
|
68
|
-
this.isDecodeInProcess = true;
|
|
69
|
-
this.isHasTests = false;
|
|
70
|
-
this.isHasRoots = false;
|
|
71
|
-
this.handleClickDetails = function (certificate, e) {
|
|
72
|
-
e.stopPropagation();
|
|
73
|
-
_this.certificateSelectedForDetails = certificate;
|
|
74
|
-
_this.detailsOpen.emit(certificate);
|
|
75
|
-
};
|
|
76
|
-
this.handleModalClose = function () {
|
|
77
|
-
_this.certificateSelectedForDetails = undefined;
|
|
78
|
-
_this.detailsClose.emit();
|
|
79
|
-
};
|
|
80
|
-
this.handleSearch = function (e) {
|
|
81
|
-
_this.search = e.target.value.trim();
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
class_1.prototype.componentWillLoad = function () {
|
|
85
|
-
this.certificatesDecodeAndSet();
|
|
86
|
-
};
|
|
87
|
-
class_1.prototype.watchCertificates = function (newValue, oldValue) {
|
|
88
|
-
/**
|
|
89
|
-
* Prevent rerender after set the same `certificates` prop.
|
|
90
|
-
*/
|
|
91
|
-
if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
|
|
92
|
-
this.certificatesDecodeAndSet();
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
class_1.prototype.certificatesDecodeAndSet = function () {
|
|
96
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
-
var hasTests, hasRoots, data, _i, _a, certificate, decoded, error_1;
|
|
98
|
-
return __generator(this, function (_b) {
|
|
99
|
-
switch (_b.label) {
|
|
100
|
-
case 0:
|
|
101
|
-
hasTests = false;
|
|
102
|
-
hasRoots = false;
|
|
103
|
-
if (!Array.isArray(this.certificates)) {
|
|
104
|
-
return [2 /*return*/];
|
|
105
|
-
}
|
|
106
|
-
data = [];
|
|
107
|
-
_i = 0, _a = this.certificates;
|
|
108
|
-
_b.label = 1;
|
|
109
|
-
case 1:
|
|
110
|
-
if (!(_i < _a.length)) return [3 /*break*/, 6];
|
|
111
|
-
certificate = _a[_i];
|
|
112
|
-
_b.label = 2;
|
|
113
|
-
case 2:
|
|
114
|
-
_b.trys.push([2, 4, , 5]);
|
|
115
|
-
decoded = new X509Certificate(certificate.value);
|
|
116
|
-
return [4 /*yield*/, decoded.getThumbprint('SHA-1')];
|
|
117
|
-
case 3:
|
|
118
|
-
_b.sent();
|
|
119
|
-
data.push({
|
|
120
|
-
body: decoded,
|
|
121
|
-
tests: certificate.tests,
|
|
122
|
-
name: certificate.name,
|
|
123
|
-
});
|
|
124
|
-
if (!hasRoots && decoded.isRoot) {
|
|
125
|
-
hasRoots = true;
|
|
126
|
-
}
|
|
127
|
-
if (!hasTests) {
|
|
128
|
-
if (certificate.tests
|
|
129
|
-
&& (certificate.tests.expired || certificate.tests.revoked || certificate.tests.valid)) {
|
|
130
|
-
hasTests = true;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return [3 /*break*/, 5];
|
|
134
|
-
case 4:
|
|
135
|
-
error_1 = _b.sent();
|
|
136
|
-
console.error('Error certificate parse:', error_1);
|
|
137
|
-
return [3 /*break*/, 5];
|
|
138
|
-
case 5:
|
|
139
|
-
_i++;
|
|
140
|
-
return [3 /*break*/, 1];
|
|
141
|
-
case 6:
|
|
142
|
-
this.isHasTests = hasTests;
|
|
143
|
-
this.isHasRoots = hasRoots;
|
|
144
|
-
this.isDecodeInProcess = false;
|
|
145
|
-
this.certificatesDecoded = data;
|
|
146
|
-
return [2 /*return*/];
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
};
|
|
151
|
-
// eslint-disable-next-line class-methods-use-this
|
|
152
|
-
class_1.prototype.handleClickDownloadAsPem = function (certificate, e) {
|
|
153
|
-
e.stopPropagation();
|
|
154
|
-
Download.certificate.asPEM(certificate.body.exportAsPemFormatted(), certificate.name || certificate.body.commonName);
|
|
155
|
-
};
|
|
156
|
-
// eslint-disable-next-line class-methods-use-this
|
|
157
|
-
class_1.prototype.handleClickDownloadAsDer = function (certificate, e) {
|
|
158
|
-
e.stopPropagation();
|
|
159
|
-
Download.certificate.asPEM(certificate.body.exportAsHexFormatted(), certificate.name || certificate.body.commonName);
|
|
160
|
-
};
|
|
161
|
-
class_1.prototype.handleClickRow = function (index) {
|
|
162
|
-
var isExpandedRowClicked = this.expandedRow === index;
|
|
163
|
-
this.expandedRow = isExpandedRowClicked
|
|
164
|
-
? undefined
|
|
165
|
-
: index;
|
|
166
|
-
};
|
|
167
|
-
class_1.prototype.getMaxColSpanValue = function () {
|
|
168
|
-
var colSpan = 4;
|
|
169
|
-
if (this.isHasTests) {
|
|
170
|
-
colSpan += 1;
|
|
171
|
-
}
|
|
172
|
-
if (!this.isHasRoots) {
|
|
173
|
-
colSpan += 1;
|
|
174
|
-
}
|
|
175
|
-
return colSpan;
|
|
176
|
-
};
|
|
177
|
-
class_1.prototype.renderExpandedRow = function (certificate) {
|
|
178
|
-
var colSpan = this.getMaxColSpanValue();
|
|
179
|
-
return (h("tr", { class: "expanded_summary" }, h("td", { colSpan: colSpan }, h("peculiar-certificate-summary", { certificate: certificate, showIssuer: !certificate.isRoot }))));
|
|
180
|
-
};
|
|
181
|
-
// eslint-disable-next-line class-methods-use-this
|
|
182
|
-
class_1.prototype.renderCertificateTests = function (tests) {
|
|
183
|
-
if (!tests) {
|
|
184
|
-
return null;
|
|
185
|
-
}
|
|
186
|
-
var elems = [];
|
|
187
|
-
if (tests.valid) {
|
|
188
|
-
elems.push((h("peculiar-button", { class: "button_table_action", href: tests.valid, target: "_blank" }, l10n.getString('valid'))));
|
|
189
|
-
}
|
|
190
|
-
if (tests.revoked) {
|
|
191
|
-
elems.push((h("peculiar-button", { class: "button_table_action", href: tests.revoked, target: "_blank" }, l10n.getString('revoked'))));
|
|
192
|
-
}
|
|
193
|
-
if (tests.expired) {
|
|
194
|
-
elems.push((h("peculiar-button", { class: "button_table_action", href: tests.expired, target: "_blank" }, l10n.getString('expired'))));
|
|
195
|
-
}
|
|
196
|
-
return elems;
|
|
197
|
-
};
|
|
198
|
-
class_1.prototype.renderContentState = function () {
|
|
199
|
-
var _this = this;
|
|
200
|
-
var searchHighlight = this.highlightWithSearch
|
|
201
|
-
? this.search
|
|
202
|
-
: '';
|
|
203
|
-
var content = [];
|
|
204
|
-
this.certificatesDecoded.forEach(function (certificate, index) {
|
|
205
|
-
var isExpandedRow = index === _this.expandedRow;
|
|
206
|
-
var publicKeyValue = OIDs[certificate.body.signature.algorithm]
|
|
207
|
-
|| certificate.body.signature.algorithm;
|
|
208
|
-
if (_this.filterWithSearch && _this.search) {
|
|
209
|
-
var certificateStringForSearch = [
|
|
210
|
-
publicKeyValue,
|
|
211
|
-
certificate.body.issuerCommonName,
|
|
212
|
-
certificate.name,
|
|
213
|
-
certificate.body.commonName,
|
|
214
|
-
certificate.body.thumbprints['SHA-1'],
|
|
215
|
-
]
|
|
216
|
-
.join(' ')
|
|
217
|
-
.toLowerCase();
|
|
218
|
-
if (certificateStringForSearch.indexOf(_this.search.toLowerCase()) === -1) {
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
content.push([
|
|
223
|
-
h("tr", { class: {
|
|
224
|
-
expanded: isExpandedRow,
|
|
225
|
-
}, onClick: _this.handleClickRow.bind(_this, index),
|
|
226
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
227
|
-
key: index }, !_this.isHasRoots && (h("td", null, h("peculiar-typography", { class: "mobile_title", color: "grey_5" }, l10n.getString('issuer'), ":"), h("peculiar-typography", { class: "content" }, h("peculiar-highlight-words", { search: searchHighlight }, certificate.body.issuerCommonName)))), h("td", null, h("peculiar-typography", { class: "mobile_title", color: "grey_5" }, l10n.getString('name'), ":"), h("peculiar-typography", { class: "content" }, h("peculiar-highlight-words", { search: searchHighlight }, certificate.name || certificate.body.commonName))), h("td", null, h("peculiar-typography", { class: "mobile_title", color: "grey_5" }, l10n.getString('publicKey'), ":"), h("peculiar-typography", { class: "content" }, h("peculiar-highlight-words", { search: searchHighlight }, publicKeyValue))), h("td", null, h("peculiar-typography", { class: "mobile_title", color: "grey_5" }, l10n.getString('fingerprint'), "\u00A0 (SHA-1):"), h("peculiar-typography", { class: "content", monospace: true }, h("peculiar-highlight-words", { search: searchHighlight }, certificate.body.thumbprints['SHA-1']))), h("td", { class: "align_center" }, h("peculiar-typography", { class: "mobile_title", color: "grey_5" }, l10n.getString('actions'), ":"), h("span", { class: "content" }, h("peculiar-button", { onClick: _this.handleClickDetails.bind(_this, certificate.body), class: "button_table_action" }, l10n.getString('details')), h("peculiar-button-split", { onClick: _this.handleClickDownloadAsPem.bind(_this, certificate), actions: [{
|
|
228
|
-
text: l10n.getString('download.der'),
|
|
229
|
-
onClick: _this.handleClickDownloadAsDer.bind(_this, certificate),
|
|
230
|
-
}], class: "button_table_action" }, l10n.getString('download.pem')))), _this.isHasTests && (h("td", { class: "align_center" }, h("peculiar-typography", { class: "mobile_title", color: "grey_5" }, l10n.getString('testURLs'), ":"), h("span", { class: "content" }, _this.renderCertificateTests(certificate.tests))))),
|
|
231
|
-
isExpandedRow && _this.renderExpandedRow(certificate.body),
|
|
232
|
-
]);
|
|
233
|
-
});
|
|
234
|
-
return content;
|
|
235
|
-
};
|
|
236
|
-
class_1.prototype.renderCertificateDetailsModal = function () {
|
|
237
|
-
if (!this.certificateSelectedForDetails) {
|
|
238
|
-
return null;
|
|
239
|
-
}
|
|
240
|
-
return (h("div", { class: "modal_wrapper", role: "presentation", "aria-hidden": "false", part: "presentation" }, h("div", { class: "modal_backdrop", onClick: this.handleModalClose, "aria-hidden": "true" }), h("div", { class: "modal_container", role: "dialog", part: "presentation_container" }, h("header", { class: "modal_title" }, h("peculiar-typography", { type: "h4" }, l10n.getString('certificateDetails')), h("button", { class: "modal_close", onClick: this.handleModalClose, type: "button", "aria-label": "Close", title: "Close" }, h("svg", { width: "30", height: "30", viewBox: "0 0 30 30", xmlns: "http://www.w3.org/2000/svg" }, h("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" })))), h("div", { class: "modal_content" }, h("peculiar-certificate-viewer", { certificate: this.certificateSelectedForDetails })))));
|
|
241
|
-
};
|
|
242
|
-
class_1.prototype.renderSearch = function () {
|
|
243
|
-
if (!this.filterWithSearch && !this.highlightWithSearch) {
|
|
244
|
-
return null;
|
|
245
|
-
}
|
|
246
|
-
return (h("div", { class: "search_section" }, h("input", { onInput: this.handleSearch, type: "search", value: "", class: "input_search", disabled: !this.certificatesDecoded.length, placeholder: "Search" })));
|
|
247
|
-
};
|
|
248
|
-
class_1.prototype.renderEmptyState = function () {
|
|
249
|
-
var colSpan = this.getMaxColSpanValue();
|
|
250
|
-
return (h("tr", null, h("td", { class: "status_wrapper", colSpan: colSpan }, h("peculiar-typography", { type: "b1", align: "center" }, "There are no certificates available."))));
|
|
251
|
-
};
|
|
252
|
-
class_1.prototype.renderEmptySearchState = function () {
|
|
253
|
-
var colSpan = this.getMaxColSpanValue();
|
|
254
|
-
return (h("tr", null, h("td", { class: "status_wrapper", colSpan: colSpan }, h("peculiar-typography", { type: "b1", align: "center" }, "No results found for \u201C", this.search, "\u201C"))));
|
|
255
|
-
};
|
|
256
|
-
// eslint-disable-next-line class-methods-use-this
|
|
257
|
-
class_1.prototype.renderLoadingState = function () {
|
|
258
|
-
return (h("div", { class: "loading_container" }, h("peculiar-circular-progress", null)));
|
|
259
|
-
};
|
|
260
|
-
class_1.prototype.renderBody = function () {
|
|
261
|
-
if (this.isDecodeInProcess) {
|
|
262
|
-
return null;
|
|
263
|
-
}
|
|
264
|
-
if (!this.certificatesDecoded.length) {
|
|
265
|
-
return this.renderEmptyState();
|
|
266
|
-
}
|
|
267
|
-
var contentState = this.renderContentState();
|
|
268
|
-
if (this.search && !contentState.length) {
|
|
269
|
-
return this.renderEmptySearchState();
|
|
270
|
-
}
|
|
271
|
-
return contentState;
|
|
272
|
-
};
|
|
273
|
-
class_1.prototype.render = function () {
|
|
274
|
-
return (h(Host, null, this.renderSearch(), h("table", { class: {
|
|
275
|
-
m_extra: this.isHasTests || !this.isHasRoots,
|
|
276
|
-
} }, h("thead", null, h("tr", null, !this.isHasRoots && (h("th", { class: "col_issuer" }, h("peculiar-typography", { type: "h7", align: "left" }, l10n.getString('issuer')))), h("th", { class: "col_name" }, h("peculiar-typography", { type: "h7", align: "left" }, l10n.getString('name'))), h("th", { class: "col_public_key" }, h("peculiar-typography", { type: "h7", align: "left" }, l10n.getString('publicKey'))), h("th", { class: "col_fingerprint" }, h("peculiar-typography", { type: "h7", align: "left" }, l10n.getString('fingerprint'), "\u00A0 (SHA-1)")), h("th", { class: "col_actions" }, h("peculiar-typography", { type: "h7", align: "center" }, l10n.getString('actions'))), this.isHasTests && (h("th", { class: "col_tests" }, h("peculiar-typography", { type: "h7", align: "center" }, l10n.getString('testURLs')))))), h("tbody", null, this.renderBody())), this.renderCertificateDetailsModal(), this.isDecodeInProcess && this.renderLoadingState()));
|
|
277
|
-
};
|
|
278
|
-
Object.defineProperty(class_1, "watchers", {
|
|
279
|
-
get: function () {
|
|
280
|
-
return {
|
|
281
|
-
"certificates": ["watchCertificates"]
|
|
282
|
-
};
|
|
283
|
-
},
|
|
284
|
-
enumerable: false,
|
|
285
|
-
configurable: true
|
|
286
|
-
});
|
|
287
|
-
return class_1;
|
|
288
|
-
}());
|
|
289
|
-
CertificatesViewer.style = certificatesViewerCss;
|
|
290
|
-
export { CertificatesViewer as peculiar_certificates_viewer };
|
|
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(e){i(e)}}function l(e){try{s(o["throw"](e))}catch(e){i(e)}}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(e){n=[6,e];a=0}finally{o=i=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};
|
|
2
|
+
/*!
|
|
3
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,h,H as Host}from"./index-bbd484d9.js";import{as as X509Certificate,O as OIDs}from"./certification_request-48e8b956.js";import{D as Download}from"./download-cf68ac2c.js";import{l as l10n}from"./l10n-ead9928b.js";import"./_commonjsHelpers-bfbd2ad8.js";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::-webkit-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-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::-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 CertificatesViewer=function(){function e(e){var t=this;registerInstance(this,e);this.detailsOpen=createEvent(this,"detailsOpen",7);this.detailsClose=createEvent(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,r){r.stopPropagation();t.certificateSelectedForDetails=e;t.detailsOpen.emit(e)};this.handleModalClose=function(){t.certificateSelectedForDetails=undefined;t.detailsClose.emit()};this.handleSearch=function(e){t.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,n,l;return __generator(this,(function(s){switch(s.label){case 0:e=false;t=false;if(!Array.isArray(this.certificates)){return[2]}r=[];o=0,a=this.certificates;s.label=1;case 1:if(!(o<a.length))return[3,6];i=a[o];s.label=2;case 2:s.trys.push([2,4,,5]);n=new X509Certificate(i.value);return[4,n.getThumbprint("SHA-1")];case 3:s.sent();r.push({body:n,tests:i.tests,name:i.name});if(!t&&n.isRoot){t=true}if(!e){if(i.tests&&(i.tests.expired||i.tests.revoked||i.tests.valid)){e=true}}return[3,5];case 4:l=s.sent();console.error("Error certificate parse:",l);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();Download.x509.asPEM(e.body.exportAsPemFormatted(),e.name||e.body.commonName)};e.prototype.handleClickDownloadAsDer=function(e,t){t.stopPropagation();Download.x509.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 h("tr",{class:"expanded_summary"},h("td",{colSpan:t},h("peculiar-certificate-summary",{certificate:e,showIssuer:!e.isRoot})))};e.prototype.renderCertificateTests=function(e){if(!e){return null}var t=[];if(e.valid){t.push(h("peculiar-button",{class:"button_table_action",href:e.valid,target:"_blank"},l10n.getString("valid")))}if(e.revoked){t.push(h("peculiar-button",{class:"button_table_action",href:e.revoked,target:"_blank"},l10n.getString("revoked")))}if(e.expired){t.push(h("peculiar-button",{class:"button_table_action",href:e.expired,target:"_blank"},l10n.getString("expired")))}return t};e.prototype.renderContentState=function(){var e=this;var t=this.highlightWithSearch?this.search:"";var r=[];this.certificatesDecoded.forEach((function(o,a){var i=a===e.expandedRow;var n=OIDs[o.body.signature.algorithm]||o.body.signature.algorithm;if(e.filterWithSearch&&e.search){var l=[n,o.body.issuerCommonName,o.name,o.body.commonName,o.body.thumbprints["SHA-1"]].join(" ").toLowerCase();if(l.indexOf(e.search.toLowerCase())===-1){return}}r.push([h("tr",{class:{expanded:i},onClick:e.handleClickRow.bind(e,a),key:a},!e.isHasRoots&&h("td",null,h("peculiar-typography",{class:"mobile_title",color:"grey_5"},l10n.getString("issuer"),":"),h("peculiar-typography",{class:"content"},h("peculiar-highlight-words",{search:t},o.body.issuerCommonName))),h("td",null,h("peculiar-typography",{class:"mobile_title",color:"grey_5"},l10n.getString("name"),":"),h("peculiar-typography",{class:"content"},h("peculiar-highlight-words",{search:t},o.name||o.body.commonName))),h("td",null,h("peculiar-typography",{class:"mobile_title",color:"grey_5"},l10n.getString("publicKey"),":"),h("peculiar-typography",{class:"content"},h("peculiar-highlight-words",{search:t},n))),h("td",null,h("peculiar-typography",{class:"mobile_title",color:"grey_5"},l10n.getString("fingerprint")," (SHA-1):"),h("peculiar-typography",{class:"content",monospace:true},h("peculiar-highlight-words",{search:t},o.body.thumbprints["SHA-1"]))),h("td",{class:"align_center"},h("peculiar-typography",{class:"mobile_title",color:"grey_5"},l10n.getString("actions"),":"),h("span",{class:"content"},h("peculiar-button",{onClick:e.handleClickDetails.bind(e,o.body),class:"button_table_action"},l10n.getString("details")),h("peculiar-button-split",{onClick:e.handleClickDownloadAsPem.bind(e,o),actions:[{text:l10n.getString("download.der"),onClick:e.handleClickDownloadAsDer.bind(e,o)}],class:"button_table_action"},l10n.getString("download.pem")))),e.isHasTests&&h("td",{class:"align_center"},h("peculiar-typography",{class:"mobile_title",color:"grey_5"},l10n.getString("testURLs"),":"),h("span",{class:"content"},e.renderCertificateTests(o.tests)))),i&&e.renderExpandedRow(o.body)])}));return r};e.prototype.renderCertificateDetailsModal=function(){if(!this.certificateSelectedForDetails){return null}return h("div",{class:"modal_wrapper",role:"presentation","aria-hidden":"false",part:"presentation"},h("div",{class:"modal_backdrop",onClick:this.handleModalClose,"aria-hidden":"true"}),h("div",{class:"modal_container",role:"dialog",part:"presentation_container"},h("header",{class:"modal_title"},h("peculiar-typography",{type:"h4"},l10n.getString("certificateDetails")),h("button",{class:"modal_close",onClick:this.handleModalClose,type:"button","aria-label":"Close",title:"Close"},h("svg",{width:"30",height:"30",viewBox:"0 0 30 30",xmlns:"http://www.w3.org/2000/svg"},h("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"})))),h("div",{class:"modal_content"},h("peculiar-certificate-viewer",{certificate:this.certificateSelectedForDetails}))))};e.prototype.renderSearch=function(){if(!this.filterWithSearch&&!this.highlightWithSearch){return null}return h("div",{class:"search_section"},h("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 h("tr",null,h("td",{class:"status_wrapper",colSpan:e},h("peculiar-typography",{type:"b1",align:"center"},"There are no certificates available.")))};e.prototype.renderEmptySearchState=function(){var e=this.getMaxColSpanValue();return h("tr",null,h("td",{class:"status_wrapper",colSpan:e},h("peculiar-typography",{type:"b1",align:"center"},"No results found for “",this.search,"“")))};e.prototype.renderLoadingState=function(){return h("div",{class:"loading_container"},h("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 h(Host,null,this.renderSearch(),h("table",{class:{m_extra:this.isHasTests||!this.isHasRoots}},h("thead",null,h("tr",null,!this.isHasRoots&&h("th",{class:"col_issuer"},h("peculiar-typography",{type:"h7",align:"left"},l10n.getString("issuer"))),h("th",{class:"col_name"},h("peculiar-typography",{type:"h7",align:"left"},l10n.getString("name"))),h("th",{class:"col_public_key"},h("peculiar-typography",{type:"h7",align:"left"},l10n.getString("publicKey"))),h("th",{class:"col_fingerprint"},h("peculiar-typography",{type:"h7",align:"left"},l10n.getString("fingerprint")," (SHA-1)")),h("th",{class:"col_actions"},h("peculiar-typography",{type:"h7",align:"center"},l10n.getString("actions"))),this.isHasTests&&h("th",{class:"col_tests"},h("peculiar-typography",{type:"h7",align:"center"},l10n.getString("testURLs"))))),h("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}();CertificatesViewer.style=certificatesViewerCss;export{CertificatesViewer as peculiar_certificates_viewer};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import{d as doc,N as NAMESPACE,w as win,p as promiseResolve,b as bootstrapLazy}from"./index-bbd484d9.js";var getDynamicImportFunction=function(e){return"__sc_import_".concat(e.replace(/\s|-/g,"_"))};var patchBrowser=function(){var e=Array.from(doc.querySelectorAll("script")).find((function(e){return new RegExp("/".concat(NAMESPACE,"(\\.esm)?\\.js($|\\?|#)")).test(e.src)||e.getAttribute("data-stencil-namespace")===NAMESPACE}));var i="";var t=e["data-opts"]||{};if(i!==""){t.resourcesUrl=new URL(".",i).href}else{t.resourcesUrl=new URL(".",new URL(e.getAttribute("data-resources-url")||e.src,win.location.href)).href;{patchDynamicImport(t.resourcesUrl,e)}if(!win.customElements){return import("./dom-f1b08a97.js").then((function(){return t}))}}return promiseResolve(t)};var patchDynamicImport=function(e,i){var t=getDynamicImportFunction(NAMESPACE);try{win[t]=new Function("w","return import(w);//".concat(Math.random()))}catch(c){var r=new Map;win[t]=function(c){var n=new URL(c,e).href;var a=r.get(n);if(!a){var s=doc.createElement("script");s.type="module";s.crossOrigin=i.crossOrigin;s.src=URL.createObjectURL(new Blob(["import * as m from '".concat(n,"'; window.").concat(t,".m = m;")],{type:"application/javascript"}));a=new Promise((function(e){s.onload=function(){e(win[t].m);s.remove()}}));r.set(n,a);doc.head.appendChild(s)}return a}}};patchBrowser().then((function(e){return bootstrapLazy([["peculiar-attribute-certificate-viewer_9",[[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]}]]],["peculiar-certificate-summary_3",[[1,"peculiar-certificate-summary",{certificate:[16],showIssuer:[4,"show-issuer"]}],[1,"peculiar-circular-progress",{size:[2],width:[2]}],[1,"peculiar-highlight-words",{search:[1]}]]],["peculiar-certificates-viewer",[[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]}]]]],e)}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./cjs/index.cjs.js');
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export * from './esm-es5/index.js';
|