@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,3 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
1
4
|
/**
|
|
2
5
|
* @license
|
|
3
6
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -11,405 +14,405 @@ import { OIDs } from '../../constants/oids';
|
|
|
11
14
|
import { Download } from '../../utils/download';
|
|
12
15
|
import { l10n } from '../../utils';
|
|
13
16
|
export class CertificatesViewer {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
17
|
+
constructor() {
|
|
18
|
+
/**
|
|
19
|
+
* List of certificates values for decode and show in the list.
|
|
20
|
+
* <br />
|
|
21
|
+
* **NOTE**: If you do not provide a `name` value when
|
|
22
|
+
* invocing the component it will take the first Subject CN value.
|
|
23
|
+
* <br />
|
|
24
|
+
* **NOTE**: If you do not provide a `tests` this column will be ommited from the rendered page.
|
|
25
|
+
* <br />
|
|
26
|
+
* **NOTE**: If the supplied certificates are self-signed the issuer column will be ommited.
|
|
27
|
+
*/
|
|
28
|
+
this.certificates = [];
|
|
29
|
+
/**
|
|
30
|
+
* Use filter in the list when search is changed.
|
|
31
|
+
*/
|
|
32
|
+
this.filterWithSearch = true;
|
|
33
|
+
/**
|
|
34
|
+
* Use highlight chapters in the list when search is changed.
|
|
35
|
+
*/
|
|
36
|
+
this.highlightWithSearch = true;
|
|
37
|
+
this.search = '';
|
|
38
|
+
this.certificatesDecoded = [];
|
|
39
|
+
this.isDecodeInProcess = true;
|
|
40
|
+
this.isHasTests = false;
|
|
41
|
+
this.isHasRoots = false;
|
|
42
|
+
this.handleClickDetails = (certificate, e) => {
|
|
43
|
+
e.stopPropagation();
|
|
44
|
+
this.certificateSelectedForDetails = certificate;
|
|
45
|
+
this.detailsOpen.emit(certificate);
|
|
46
|
+
};
|
|
47
|
+
this.handleModalClose = () => {
|
|
48
|
+
this.certificateSelectedForDetails = undefined;
|
|
49
|
+
this.detailsClose.emit();
|
|
50
|
+
};
|
|
51
|
+
this.handleSearch = (e) => {
|
|
52
|
+
this.search = e.target.value.trim();
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
componentWillLoad() {
|
|
56
|
+
this.certificatesDecodeAndSet();
|
|
57
|
+
}
|
|
58
|
+
watchCertificates(newValue, oldValue) {
|
|
59
|
+
/**
|
|
60
|
+
* Prevent rerender after set the same `certificates` prop.
|
|
61
|
+
*/
|
|
62
|
+
if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
|
|
63
|
+
this.certificatesDecodeAndSet();
|
|
54
64
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
65
|
+
}
|
|
66
|
+
async certificatesDecodeAndSet() {
|
|
67
|
+
let hasTests = false;
|
|
68
|
+
let hasRoots = false;
|
|
69
|
+
if (!Array.isArray(this.certificates)) {
|
|
70
|
+
return;
|
|
62
71
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
const data = [];
|
|
73
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
74
|
+
for (const certificate of this.certificates) {
|
|
75
|
+
try {
|
|
76
|
+
const decoded = new X509Certificate(certificate.value);
|
|
77
|
+
await decoded.getThumbprint('SHA-1');
|
|
78
|
+
data.push({
|
|
79
|
+
body: decoded,
|
|
80
|
+
tests: certificate.tests,
|
|
81
|
+
name: certificate.name,
|
|
82
|
+
});
|
|
83
|
+
if (!hasRoots && decoded.isRoot) {
|
|
84
|
+
hasRoots = true;
|
|
68
85
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
await decoded.getThumbprint('SHA-1');
|
|
75
|
-
data.push({
|
|
76
|
-
body: decoded,
|
|
77
|
-
tests: certificate.tests,
|
|
78
|
-
name: certificate.name,
|
|
79
|
-
});
|
|
80
|
-
if (!hasRoots && decoded.isRoot) {
|
|
81
|
-
hasRoots = true;
|
|
82
|
-
}
|
|
83
|
-
if (!hasTests) {
|
|
84
|
-
if (certificate.tests
|
|
85
|
-
&& (certificate.tests.expired || certificate.tests.revoked || certificate.tests.valid)) {
|
|
86
|
-
hasTests = true;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
console.error('Error certificate parse:', error);
|
|
92
|
-
}
|
|
86
|
+
if (!hasTests) {
|
|
87
|
+
if (certificate.tests
|
|
88
|
+
&& (certificate.tests.expired || certificate.tests.revoked || certificate.tests.valid)) {
|
|
89
|
+
hasTests = true;
|
|
90
|
+
}
|
|
93
91
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
console.error('Error certificate parse:', error);
|
|
95
|
+
}
|
|
98
96
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
this.isHasTests = hasTests;
|
|
98
|
+
this.isHasRoots = hasRoots;
|
|
99
|
+
this.isDecodeInProcess = false;
|
|
100
|
+
this.certificatesDecoded = data;
|
|
101
|
+
}
|
|
102
|
+
// eslint-disable-next-line class-methods-use-this
|
|
103
|
+
handleClickDownloadAsPem(certificate, e) {
|
|
104
|
+
e.stopPropagation();
|
|
105
|
+
Download.x509.asPEM(certificate.body.exportAsPemFormatted(), certificate.name || certificate.body.commonName);
|
|
106
|
+
}
|
|
107
|
+
// eslint-disable-next-line class-methods-use-this
|
|
108
|
+
handleClickDownloadAsDer(certificate, e) {
|
|
109
|
+
e.stopPropagation();
|
|
110
|
+
Download.x509.asPEM(certificate.body.exportAsHexFormatted(), certificate.name || certificate.body.commonName);
|
|
111
|
+
}
|
|
112
|
+
handleClickRow(index) {
|
|
113
|
+
const isExpandedRowClicked = this.expandedRow === index;
|
|
114
|
+
this.expandedRow = isExpandedRowClicked
|
|
115
|
+
? undefined
|
|
116
|
+
: index;
|
|
117
|
+
}
|
|
118
|
+
getMaxColSpanValue() {
|
|
119
|
+
let colSpan = 4;
|
|
120
|
+
if (this.isHasTests) {
|
|
121
|
+
colSpan += 1;
|
|
103
122
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
e.stopPropagation();
|
|
107
|
-
Download.certificate.asPEM(certificate.body.exportAsHexFormatted(), certificate.name || certificate.body.commonName);
|
|
123
|
+
if (!this.isHasRoots) {
|
|
124
|
+
colSpan += 1;
|
|
108
125
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
126
|
+
return colSpan;
|
|
127
|
+
}
|
|
128
|
+
renderExpandedRow(certificate) {
|
|
129
|
+
const colSpan = this.getMaxColSpanValue();
|
|
130
|
+
return (h("tr", { class: "expanded_summary" },
|
|
131
|
+
h("td", { colSpan: colSpan },
|
|
132
|
+
h("peculiar-certificate-summary", { certificate: certificate, showIssuer: !certificate.isRoot }))));
|
|
133
|
+
}
|
|
134
|
+
// eslint-disable-next-line class-methods-use-this
|
|
135
|
+
renderCertificateTests(tests) {
|
|
136
|
+
if (!tests) {
|
|
137
|
+
return null;
|
|
114
138
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
colSpan += 1;
|
|
119
|
-
}
|
|
120
|
-
if (!this.isHasRoots) {
|
|
121
|
-
colSpan += 1;
|
|
122
|
-
}
|
|
123
|
-
return colSpan;
|
|
139
|
+
const elems = [];
|
|
140
|
+
if (tests.valid) {
|
|
141
|
+
elems.push((h("peculiar-button", { class: "button_table_action", href: tests.valid, target: "_blank" }, l10n.getString('valid'))));
|
|
124
142
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
return (h("tr", { class: "expanded_summary" },
|
|
128
|
-
h("td", { colSpan: colSpan },
|
|
129
|
-
h("peculiar-certificate-summary", { certificate: certificate, showIssuer: !certificate.isRoot }))));
|
|
130
|
-
}
|
|
131
|
-
// eslint-disable-next-line class-methods-use-this
|
|
132
|
-
renderCertificateTests(tests) {
|
|
133
|
-
if (!tests) {
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
const elems = [];
|
|
137
|
-
if (tests.valid) {
|
|
138
|
-
elems.push((h("peculiar-button", { class: "button_table_action", href: tests.valid, target: "_blank" }, l10n.getString('valid'))));
|
|
139
|
-
}
|
|
140
|
-
if (tests.revoked) {
|
|
141
|
-
elems.push((h("peculiar-button", { class: "button_table_action", href: tests.revoked, target: "_blank" }, l10n.getString('revoked'))));
|
|
142
|
-
}
|
|
143
|
-
if (tests.expired) {
|
|
144
|
-
elems.push((h("peculiar-button", { class: "button_table_action", href: tests.expired, target: "_blank" }, l10n.getString('expired'))));
|
|
145
|
-
}
|
|
146
|
-
return elems;
|
|
143
|
+
if (tests.revoked) {
|
|
144
|
+
elems.push((h("peculiar-button", { class: "button_table_action", href: tests.revoked, target: "_blank" }, l10n.getString('revoked'))));
|
|
147
145
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
? this.search
|
|
151
|
-
: '';
|
|
152
|
-
const content = [];
|
|
153
|
-
this.certificatesDecoded.forEach((certificate, index) => {
|
|
154
|
-
const isExpandedRow = index === this.expandedRow;
|
|
155
|
-
const publicKeyValue = OIDs[certificate.body.signature.algorithm]
|
|
156
|
-
|| certificate.body.signature.algorithm;
|
|
157
|
-
if (this.filterWithSearch && this.search) {
|
|
158
|
-
const certificateStringForSearch = [
|
|
159
|
-
publicKeyValue,
|
|
160
|
-
certificate.body.issuerCommonName,
|
|
161
|
-
certificate.name,
|
|
162
|
-
certificate.body.commonName,
|
|
163
|
-
certificate.body.thumbprints['SHA-1'],
|
|
164
|
-
]
|
|
165
|
-
.join(' ')
|
|
166
|
-
.toLowerCase();
|
|
167
|
-
if (certificateStringForSearch.indexOf(this.search.toLowerCase()) === -1) {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
content.push([
|
|
172
|
-
h("tr", { class: {
|
|
173
|
-
expanded: isExpandedRow,
|
|
174
|
-
}, onClick: this.handleClickRow.bind(this, index),
|
|
175
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
176
|
-
key: index },
|
|
177
|
-
!this.isHasRoots && (h("td", null,
|
|
178
|
-
h("peculiar-typography", { class: "mobile_title", color: "grey_5" },
|
|
179
|
-
l10n.getString('issuer'),
|
|
180
|
-
":"),
|
|
181
|
-
h("peculiar-typography", { class: "content" },
|
|
182
|
-
h("peculiar-highlight-words", { search: searchHighlight }, certificate.body.issuerCommonName)))),
|
|
183
|
-
h("td", null,
|
|
184
|
-
h("peculiar-typography", { class: "mobile_title", color: "grey_5" },
|
|
185
|
-
l10n.getString('name'),
|
|
186
|
-
":"),
|
|
187
|
-
h("peculiar-typography", { class: "content" },
|
|
188
|
-
h("peculiar-highlight-words", { search: searchHighlight }, certificate.name || certificate.body.commonName))),
|
|
189
|
-
h("td", null,
|
|
190
|
-
h("peculiar-typography", { class: "mobile_title", color: "grey_5" },
|
|
191
|
-
l10n.getString('publicKey'),
|
|
192
|
-
":"),
|
|
193
|
-
h("peculiar-typography", { class: "content" },
|
|
194
|
-
h("peculiar-highlight-words", { search: searchHighlight }, publicKeyValue))),
|
|
195
|
-
h("td", null,
|
|
196
|
-
h("peculiar-typography", { class: "mobile_title", color: "grey_5" },
|
|
197
|
-
l10n.getString('fingerprint'),
|
|
198
|
-
"\u00A0 (SHA-1):"),
|
|
199
|
-
h("peculiar-typography", { class: "content", monospace: true },
|
|
200
|
-
h("peculiar-highlight-words", { search: searchHighlight }, certificate.body.thumbprints['SHA-1']))),
|
|
201
|
-
h("td", { class: "align_center" },
|
|
202
|
-
h("peculiar-typography", { class: "mobile_title", color: "grey_5" },
|
|
203
|
-
l10n.getString('actions'),
|
|
204
|
-
":"),
|
|
205
|
-
h("span", { class: "content" },
|
|
206
|
-
h("peculiar-button", { onClick: this.handleClickDetails.bind(this, certificate.body), class: "button_table_action" }, l10n.getString('details')),
|
|
207
|
-
h("peculiar-button-split", { onClick: this.handleClickDownloadAsPem.bind(this, certificate), actions: [{
|
|
208
|
-
text: l10n.getString('download.der'),
|
|
209
|
-
onClick: this.handleClickDownloadAsDer.bind(this, certificate),
|
|
210
|
-
}], class: "button_table_action" }, l10n.getString('download.pem')))),
|
|
211
|
-
this.isHasTests && (h("td", { class: "align_center" },
|
|
212
|
-
h("peculiar-typography", { class: "mobile_title", color: "grey_5" },
|
|
213
|
-
l10n.getString('testURLs'),
|
|
214
|
-
":"),
|
|
215
|
-
h("span", { class: "content" }, this.renderCertificateTests(certificate.tests))))),
|
|
216
|
-
isExpandedRow && this.renderExpandedRow(certificate.body),
|
|
217
|
-
]);
|
|
218
|
-
});
|
|
219
|
-
return content;
|
|
146
|
+
if (tests.expired) {
|
|
147
|
+
elems.push((h("peculiar-button", { class: "button_table_action", href: tests.expired, target: "_blank" }, l10n.getString('expired'))));
|
|
220
148
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
149
|
+
return elems;
|
|
150
|
+
}
|
|
151
|
+
renderContentState() {
|
|
152
|
+
const searchHighlight = this.highlightWithSearch
|
|
153
|
+
? this.search
|
|
154
|
+
: '';
|
|
155
|
+
const content = [];
|
|
156
|
+
this.certificatesDecoded.forEach((certificate, index) => {
|
|
157
|
+
const isExpandedRow = index === this.expandedRow;
|
|
158
|
+
const publicKeyValue = OIDs[certificate.body.signature.algorithm]
|
|
159
|
+
|| certificate.body.signature.algorithm;
|
|
160
|
+
if (this.filterWithSearch && this.search) {
|
|
161
|
+
const certificateStringForSearch = [
|
|
162
|
+
publicKeyValue,
|
|
163
|
+
certificate.body.issuerCommonName,
|
|
164
|
+
certificate.name,
|
|
165
|
+
certificate.body.commonName,
|
|
166
|
+
certificate.body.thumbprints['SHA-1'],
|
|
167
|
+
]
|
|
168
|
+
.join(' ')
|
|
169
|
+
.toLowerCase();
|
|
170
|
+
if (certificateStringForSearch.indexOf(this.search.toLowerCase()) === -1) {
|
|
171
|
+
return;
|
|
224
172
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
173
|
+
}
|
|
174
|
+
content.push([
|
|
175
|
+
h("tr", { class: {
|
|
176
|
+
expanded: isExpandedRow,
|
|
177
|
+
}, onClick: this.handleClickRow.bind(this, index),
|
|
178
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
179
|
+
key: index },
|
|
180
|
+
!this.isHasRoots && (h("td", null,
|
|
181
|
+
h("peculiar-typography", { class: "mobile_title", color: "grey_5" },
|
|
182
|
+
l10n.getString('issuer'),
|
|
183
|
+
":"),
|
|
184
|
+
h("peculiar-typography", { class: "content" },
|
|
185
|
+
h("peculiar-highlight-words", { search: searchHighlight }, certificate.body.issuerCommonName)))),
|
|
186
|
+
h("td", null,
|
|
187
|
+
h("peculiar-typography", { class: "mobile_title", color: "grey_5" },
|
|
188
|
+
l10n.getString('name'),
|
|
189
|
+
":"),
|
|
190
|
+
h("peculiar-typography", { class: "content" },
|
|
191
|
+
h("peculiar-highlight-words", { search: searchHighlight }, certificate.name || certificate.body.commonName))),
|
|
192
|
+
h("td", null,
|
|
193
|
+
h("peculiar-typography", { class: "mobile_title", color: "grey_5" },
|
|
194
|
+
l10n.getString('publicKey'),
|
|
195
|
+
":"),
|
|
196
|
+
h("peculiar-typography", { class: "content" },
|
|
197
|
+
h("peculiar-highlight-words", { search: searchHighlight }, publicKeyValue))),
|
|
198
|
+
h("td", null,
|
|
199
|
+
h("peculiar-typography", { class: "mobile_title", color: "grey_5" },
|
|
200
|
+
l10n.getString('fingerprint'),
|
|
201
|
+
"\u00A0 (SHA-1):"),
|
|
202
|
+
h("peculiar-typography", { class: "content", monospace: true },
|
|
203
|
+
h("peculiar-highlight-words", { search: searchHighlight }, certificate.body.thumbprints['SHA-1']))),
|
|
204
|
+
h("td", { class: "align_center" },
|
|
205
|
+
h("peculiar-typography", { class: "mobile_title", color: "grey_5" },
|
|
206
|
+
l10n.getString('actions'),
|
|
207
|
+
":"),
|
|
208
|
+
h("span", { class: "content" },
|
|
209
|
+
h("peculiar-button", { onClick: this.handleClickDetails.bind(this, certificate.body), class: "button_table_action" }, l10n.getString('details')),
|
|
210
|
+
h("peculiar-button-split", { onClick: this.handleClickDownloadAsPem.bind(this, certificate), actions: [{
|
|
211
|
+
text: l10n.getString('download.der'),
|
|
212
|
+
onClick: this.handleClickDownloadAsDer.bind(this, certificate),
|
|
213
|
+
}], class: "button_table_action" }, l10n.getString('download.pem')))),
|
|
214
|
+
this.isHasTests && (h("td", { class: "align_center" },
|
|
215
|
+
h("peculiar-typography", { class: "mobile_title", color: "grey_5" },
|
|
216
|
+
l10n.getString('testURLs'),
|
|
217
|
+
":"),
|
|
218
|
+
h("span", { class: "content" }, this.renderCertificateTests(certificate.tests))))),
|
|
219
|
+
isExpandedRow && this.renderExpandedRow(certificate.body),
|
|
220
|
+
]);
|
|
221
|
+
});
|
|
222
|
+
return content;
|
|
223
|
+
}
|
|
224
|
+
renderCertificateDetailsModal() {
|
|
225
|
+
if (!this.certificateSelectedForDetails) {
|
|
226
|
+
return null;
|
|
235
227
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
|
|
228
|
+
return (h("div", { class: "modal_wrapper", role: "presentation", "aria-hidden": "false", part: "presentation" },
|
|
229
|
+
h("div", { class: "modal_backdrop", onClick: this.handleModalClose, "aria-hidden": "true" }),
|
|
230
|
+
h("div", { class: "modal_container", role: "dialog", part: "presentation_container" },
|
|
231
|
+
h("header", { class: "modal_title" },
|
|
232
|
+
h("peculiar-typography", { type: "h4" }, l10n.getString('certificateDetails')),
|
|
233
|
+
h("button", { class: "modal_close", onClick: this.handleModalClose, type: "button", "aria-label": "Close", title: "Close" },
|
|
234
|
+
h("svg", { width: "30", height: "30", viewBox: "0 0 30 30", xmlns: "http://www.w3.org/2000/svg" },
|
|
235
|
+
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" })))),
|
|
236
|
+
h("div", { class: "modal_content" },
|
|
237
|
+
h("peculiar-certificate-viewer", { certificate: this.certificateSelectedForDetails })))));
|
|
238
|
+
}
|
|
239
|
+
renderSearch() {
|
|
240
|
+
if (!this.filterWithSearch && !this.highlightWithSearch) {
|
|
241
|
+
return null;
|
|
242
242
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
return (h("div", { class: "search_section" },
|
|
244
|
+
h("input", { onInput: this.handleSearch, type: "search", value: "", class: "input_search", disabled: !this.certificatesDecoded.length, placeholder: "Search" })));
|
|
245
|
+
}
|
|
246
|
+
renderEmptyState() {
|
|
247
|
+
const colSpan = this.getMaxColSpanValue();
|
|
248
|
+
return (h("tr", null,
|
|
249
|
+
h("td", { class: "status_wrapper", colSpan: colSpan },
|
|
250
|
+
h("peculiar-typography", { type: "b1", align: "center" }, "There are no certificates available."))));
|
|
251
|
+
}
|
|
252
|
+
renderEmptySearchState() {
|
|
253
|
+
const colSpan = this.getMaxColSpanValue();
|
|
254
|
+
return (h("tr", null,
|
|
255
|
+
h("td", { class: "status_wrapper", colSpan: colSpan },
|
|
256
|
+
h("peculiar-typography", { type: "b1", align: "center" },
|
|
257
|
+
"No results found for \u201C",
|
|
258
|
+
this.search,
|
|
259
|
+
"\u201C"))));
|
|
260
|
+
}
|
|
261
|
+
// eslint-disable-next-line class-methods-use-this
|
|
262
|
+
renderLoadingState() {
|
|
263
|
+
return (h("div", { class: "loading_container" },
|
|
264
|
+
h("peculiar-circular-progress", null)));
|
|
265
|
+
}
|
|
266
|
+
renderBody() {
|
|
267
|
+
if (this.isDecodeInProcess) {
|
|
268
|
+
return null;
|
|
248
269
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
return (h("tr", null,
|
|
252
|
-
h("td", { class: "status_wrapper", colSpan: colSpan },
|
|
253
|
-
h("peculiar-typography", { type: "b1", align: "center" },
|
|
254
|
-
"No results found for \u201C",
|
|
255
|
-
this.search,
|
|
256
|
-
"\u201C"))));
|
|
270
|
+
if (!this.certificatesDecoded.length) {
|
|
271
|
+
return this.renderEmptyState();
|
|
257
272
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
h("peculiar-circular-progress", null)));
|
|
273
|
+
const contentState = this.renderContentState();
|
|
274
|
+
if (this.search && !contentState.length) {
|
|
275
|
+
return this.renderEmptySearchState();
|
|
262
276
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
277
|
+
return contentState;
|
|
278
|
+
}
|
|
279
|
+
render() {
|
|
280
|
+
return (h(Host, null,
|
|
281
|
+
this.renderSearch(),
|
|
282
|
+
h("table", { class: {
|
|
283
|
+
m_extra: this.isHasTests || !this.isHasRoots,
|
|
284
|
+
} },
|
|
285
|
+
h("thead", null,
|
|
286
|
+
h("tr", null,
|
|
287
|
+
!this.isHasRoots && (h("th", { class: "col_issuer" },
|
|
288
|
+
h("peculiar-typography", { type: "h7", align: "left" }, l10n.getString('issuer')))),
|
|
289
|
+
h("th", { class: "col_name" },
|
|
290
|
+
h("peculiar-typography", { type: "h7", align: "left" }, l10n.getString('name'))),
|
|
291
|
+
h("th", { class: "col_public_key" },
|
|
292
|
+
h("peculiar-typography", { type: "h7", align: "left" }, l10n.getString('publicKey'))),
|
|
293
|
+
h("th", { class: "col_fingerprint" },
|
|
294
|
+
h("peculiar-typography", { type: "h7", align: "left" },
|
|
295
|
+
l10n.getString('fingerprint'),
|
|
296
|
+
"\u00A0 (SHA-1)")),
|
|
297
|
+
h("th", { class: "col_actions" },
|
|
298
|
+
h("peculiar-typography", { type: "h7", align: "center" }, l10n.getString('actions'))),
|
|
299
|
+
this.isHasTests && (h("th", { class: "col_tests" },
|
|
300
|
+
h("peculiar-typography", { type: "h7", align: "center" }, l10n.getString('testURLs')))))),
|
|
301
|
+
h("tbody", null, this.renderBody())),
|
|
302
|
+
this.renderCertificateDetailsModal(),
|
|
303
|
+
this.isDecodeInProcess && this.renderLoadingState()));
|
|
304
|
+
}
|
|
305
|
+
static get is() { return "peculiar-certificates-viewer"; }
|
|
306
|
+
static get encapsulation() { return "shadow"; }
|
|
307
|
+
static get originalStyleUrls() { return {
|
|
308
|
+
"$": ["certificates-viewer.scss"]
|
|
309
|
+
}; }
|
|
310
|
+
static get styleUrls() { return {
|
|
311
|
+
"$": ["certificates-viewer.css"]
|
|
312
|
+
}; }
|
|
313
|
+
static get properties() { return {
|
|
314
|
+
"certificates": {
|
|
315
|
+
"type": "unknown",
|
|
316
|
+
"mutable": false,
|
|
317
|
+
"complexType": {
|
|
318
|
+
"original": "ICertificate[]",
|
|
319
|
+
"resolved": "ICertificate[]",
|
|
320
|
+
"references": {
|
|
321
|
+
"ICertificate": {
|
|
322
|
+
"location": "local"
|
|
323
|
+
}
|
|
269
324
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
325
|
+
},
|
|
326
|
+
"required": false,
|
|
327
|
+
"optional": false,
|
|
328
|
+
"docs": {
|
|
329
|
+
"tags": [],
|
|
330
|
+
"text": "List of certificates values for decode and show in the list.\n<br />\n**NOTE**: If you do not provide a `name` value when\ninvocing the component it will take the first Subject CN value.\n<br />\n**NOTE**: If you do not provide a `tests` this column will be ommited from the rendered page.\n<br />\n**NOTE**: If the supplied certificates are self-signed the issuer column will be ommited."
|
|
331
|
+
},
|
|
332
|
+
"defaultValue": "[]"
|
|
333
|
+
},
|
|
334
|
+
"filterWithSearch": {
|
|
335
|
+
"type": "boolean",
|
|
336
|
+
"mutable": false,
|
|
337
|
+
"complexType": {
|
|
338
|
+
"original": "boolean",
|
|
339
|
+
"resolved": "boolean",
|
|
340
|
+
"references": {}
|
|
341
|
+
},
|
|
342
|
+
"required": false,
|
|
343
|
+
"optional": false,
|
|
344
|
+
"docs": {
|
|
345
|
+
"tags": [],
|
|
346
|
+
"text": "Use filter in the list when search is changed."
|
|
347
|
+
},
|
|
348
|
+
"attribute": "filter-with-search",
|
|
349
|
+
"reflect": false,
|
|
350
|
+
"defaultValue": "true"
|
|
351
|
+
},
|
|
352
|
+
"highlightWithSearch": {
|
|
353
|
+
"type": "boolean",
|
|
354
|
+
"mutable": false,
|
|
355
|
+
"complexType": {
|
|
356
|
+
"original": "boolean",
|
|
357
|
+
"resolved": "boolean",
|
|
358
|
+
"references": {}
|
|
359
|
+
},
|
|
360
|
+
"required": false,
|
|
361
|
+
"optional": false,
|
|
362
|
+
"docs": {
|
|
363
|
+
"tags": [],
|
|
364
|
+
"text": "Use highlight chapters in the list when search is changed."
|
|
365
|
+
},
|
|
366
|
+
"attribute": "highlight-with-search",
|
|
367
|
+
"reflect": false,
|
|
368
|
+
"defaultValue": "true"
|
|
301
369
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
"
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
},
|
|
329
|
-
"defaultValue": "[]"
|
|
330
|
-
},
|
|
331
|
-
"filterWithSearch": {
|
|
332
|
-
"type": "boolean",
|
|
333
|
-
"mutable": false,
|
|
334
|
-
"complexType": {
|
|
335
|
-
"original": "boolean",
|
|
336
|
-
"resolved": "boolean",
|
|
337
|
-
"references": {}
|
|
338
|
-
},
|
|
339
|
-
"required": false,
|
|
340
|
-
"optional": false,
|
|
341
|
-
"docs": {
|
|
342
|
-
"tags": [],
|
|
343
|
-
"text": "Use filter in the list when search is changed."
|
|
344
|
-
},
|
|
345
|
-
"attribute": "filter-with-search",
|
|
346
|
-
"reflect": false,
|
|
347
|
-
"defaultValue": "true"
|
|
348
|
-
},
|
|
349
|
-
"highlightWithSearch": {
|
|
350
|
-
"type": "boolean",
|
|
351
|
-
"mutable": false,
|
|
352
|
-
"complexType": {
|
|
353
|
-
"original": "boolean",
|
|
354
|
-
"resolved": "boolean",
|
|
355
|
-
"references": {}
|
|
356
|
-
},
|
|
357
|
-
"required": false,
|
|
358
|
-
"optional": false,
|
|
359
|
-
"docs": {
|
|
360
|
-
"tags": [],
|
|
361
|
-
"text": "Use highlight chapters in the list when search is changed."
|
|
362
|
-
},
|
|
363
|
-
"attribute": "highlight-with-search",
|
|
364
|
-
"reflect": false,
|
|
365
|
-
"defaultValue": "true"
|
|
370
|
+
}; }
|
|
371
|
+
static get states() { return {
|
|
372
|
+
"search": {},
|
|
373
|
+
"certificatesDecoded": {},
|
|
374
|
+
"expandedRow": {},
|
|
375
|
+
"certificateSelectedForDetails": {},
|
|
376
|
+
"isDecodeInProcess": {}
|
|
377
|
+
}; }
|
|
378
|
+
static get events() { return [{
|
|
379
|
+
"method": "detailsOpen",
|
|
380
|
+
"name": "detailsOpen",
|
|
381
|
+
"bubbles": true,
|
|
382
|
+
"cancelable": true,
|
|
383
|
+
"composed": true,
|
|
384
|
+
"docs": {
|
|
385
|
+
"tags": [],
|
|
386
|
+
"text": "Emitted when the user open certificate details modal."
|
|
387
|
+
},
|
|
388
|
+
"complexType": {
|
|
389
|
+
"original": "X509Certificate",
|
|
390
|
+
"resolved": "X509Certificate",
|
|
391
|
+
"references": {
|
|
392
|
+
"X509Certificate": {
|
|
393
|
+
"location": "import",
|
|
394
|
+
"path": "../../crypto"
|
|
395
|
+
}
|
|
366
396
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
"references": {
|
|
389
|
-
"X509Certificate": {
|
|
390
|
-
"location": "import",
|
|
391
|
-
"path": "../../crypto"
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
}, {
|
|
396
|
-
"method": "detailsClose",
|
|
397
|
-
"name": "detailsClose",
|
|
398
|
-
"bubbles": true,
|
|
399
|
-
"cancelable": true,
|
|
400
|
-
"composed": true,
|
|
401
|
-
"docs": {
|
|
402
|
-
"tags": [],
|
|
403
|
-
"text": "Emitted when the user close certificate details modal."
|
|
404
|
-
},
|
|
405
|
-
"complexType": {
|
|
406
|
-
"original": "void",
|
|
407
|
-
"resolved": "void",
|
|
408
|
-
"references": {}
|
|
409
|
-
}
|
|
410
|
-
}]; }
|
|
411
|
-
static get watchers() { return [{
|
|
412
|
-
"propName": "certificates",
|
|
413
|
-
"methodName": "watchCertificates"
|
|
414
|
-
}]; }
|
|
397
|
+
}
|
|
398
|
+
}, {
|
|
399
|
+
"method": "detailsClose",
|
|
400
|
+
"name": "detailsClose",
|
|
401
|
+
"bubbles": true,
|
|
402
|
+
"cancelable": true,
|
|
403
|
+
"composed": true,
|
|
404
|
+
"docs": {
|
|
405
|
+
"tags": [],
|
|
406
|
+
"text": "Emitted when the user close certificate details modal."
|
|
407
|
+
},
|
|
408
|
+
"complexType": {
|
|
409
|
+
"original": "void",
|
|
410
|
+
"resolved": "void",
|
|
411
|
+
"references": {}
|
|
412
|
+
}
|
|
413
|
+
}]; }
|
|
414
|
+
static get watchers() { return [{
|
|
415
|
+
"propName": "certificates",
|
|
416
|
+
"methodName": "watchCertificates"
|
|
417
|
+
}]; }
|
|
415
418
|
}
|