@peculiar/certificates-viewer 4.3.1 → 4.3.2
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/components/attribute-certificate-viewer.js +5 -5
- package/components/attribute-certificate-viewer.js.map +1 -1
- package/components/attribute.js +1 -1
- package/components/certificate-chain-viewer.js +66 -0
- package/components/certificate-chain-viewer.js.map +1 -0
- package/components/certificate-viewer.js +5 -5
- package/components/certificate-viewer.js.map +1 -1
- package/components/circular-progress.js +3 -3
- package/components/crl-viewer.js +5 -5
- package/components/crl-viewer.js.map +1 -1
- package/components/download.js +185 -45
- package/components/download.js.map +1 -1
- package/components/highlight-words.js +1 -1
- package/components/index2.js +1 -1
- package/components/issuer_name.js +1 -1
- package/components/miscellaneous.js +1 -1
- package/components/miscellaneous.js.map +1 -1
- package/components/peculiar-certificate-chain-viewer.d.ts +11 -0
- package/components/peculiar-certificate-chain-viewer.js +11 -0
- package/components/peculiar-certificate-chain-viewer.js.map +1 -0
- package/components/peculiar-certificate-decoder.js +105 -19
- package/components/peculiar-certificate-decoder.js.map +1 -1
- package/components/peculiar-certificates-viewer.js +2 -2
- package/components/peculiar-certificates-viewer.js.map +1 -1
- package/components/peculiar-text-hider.js +1 -1
- package/components/pkcs10_certificate_request.js +5 -5
- package/components/pkcs10_certificate_request.js.map +1 -1
- package/components/subject_name.js +1 -1
- package/dist/cjs/{actions-789906f5.js → actions-64ce3326.js} +2 -2
- package/dist/cjs/{actions-789906f5.js.map → actions-64ce3326.js.map} +1 -1
- package/dist/cjs/{arrow_top-76e4261e.js → arrow_top-b9b9f280.js} +2 -2
- package/dist/cjs/{arrow_top-76e4261e.js.map → arrow_top-b9b9f280.js.map} +1 -1
- package/dist/cjs/{button-87086210.js → button-61bb8305.js} +2 -2
- package/dist/cjs/{button-87086210.js.map → button-61bb8305.js.map} +1 -1
- package/dist/cjs/{certification_request-ad267278.js → certification_request-393a843d.js} +207 -65
- package/dist/cjs/certification_request-393a843d.js.map +1 -0
- package/dist/cjs/{cross-bd099933.js → cross-3aeffd04.js} +2 -2
- package/dist/cjs/{cross-bd099933.js.map → cross-3aeffd04.js.map} +1 -1
- package/dist/cjs/{download-820d66ba.js → download-c2836546.js} +2 -2
- package/dist/cjs/{download-820d66ba.js.map → download-c2836546.js.map} +1 -1
- package/dist/cjs/index-484a84a0.js +2113 -0
- package/dist/cjs/index-484a84a0.js.map +1 -0
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/{link-a3d3799d.js → link-dad7195a.js} +3 -3
- package/dist/cjs/{link-a3d3799d.js.map → link-dad7195a.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{miscellaneous-67439e59.js → miscellaneous-ca06fb81.js} +6 -6
- package/dist/cjs/{miscellaneous-67439e59.js.map → miscellaneous-ca06fb81.js.map} +1 -1
- package/dist/cjs/{peculiar-attribute-certificate-viewer_3.cjs.entry.js → peculiar-attribute-certificate-viewer_4.cjs.entry.js} +40 -9
- package/dist/cjs/peculiar-attribute-certificate-viewer_4.cjs.entry.js.map +1 -0
- package/dist/cjs/peculiar-button-menu_3.cjs.entry.js +7 -7
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +101 -21
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +7 -7
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +8 -8
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-text-hider.cjs.entry.js +4 -4
- package/dist/cjs/peculiar.cjs.js +10 -10
- package/dist/cjs/peculiar.cjs.js.map +1 -1
- package/dist/cjs/{pkcs10_certificate_request-64898c88.js → pkcs10_certificate_request-56990e4f.js} +6 -6
- package/dist/cjs/pkcs10_certificate_request-56990e4f.js.map +1 -0
- package/dist/cjs/{x509_certificate-4b0894c2.js → x509_certificate-d162984c.js} +6 -6
- package/dist/cjs/x509_certificate-d162984c.js.map +1 -0
- package/dist/cjs/{x509_crl-fc8d41a1.js → x509_crl-13322e13.js} +11 -11
- package/dist/cjs/x509_crl-13322e13.js.map +1 -0
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +14 -0
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js.map +1 -1
- package/dist/collection/components/button-menu/button-menu.js +2 -0
- package/dist/collection/components/button-menu/button-menu.js.map +1 -1
- package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.css +1019 -0
- package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js +101 -0
- package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js.map +1 -0
- package/dist/collection/components/certificate-decoder/certificate-decoder.css +1 -4
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +40 -18
- package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/miscellaneous.js.map +1 -1
- package/dist/collection/components/certificate-viewer/certificate-viewer.js +16 -0
- package/dist/collection/components/certificate-viewer/certificate-viewer.js.map +1 -1
- package/dist/collection/components/certificates-viewer/certificates-viewer.js +9 -1
- package/dist/collection/components/certificates-viewer/certificates-viewer.js.map +1 -1
- package/dist/collection/components/circular-progress/circular-progress.js +7 -3
- package/dist/collection/components/circular-progress/circular-progress.js.map +1 -1
- package/dist/collection/components/crl-viewer/crl-viewer.js +12 -0
- package/dist/collection/components/crl-viewer/crl-viewer.js.map +1 -1
- package/dist/collection/components/csr-viewer/csr-viewer.js +10 -0
- package/dist/collection/components/csr-viewer/csr-viewer.js.map +1 -1
- package/dist/collection/components/highlight-words/highlight-words.js +3 -1
- package/dist/collection/components/highlight-words/highlight-words.js.map +1 -1
- package/dist/collection/components/text-hider/text-hider.js +1 -1
- package/dist/collection/crypto/index.js +1 -0
- package/dist/collection/crypto/index.js.map +1 -1
- package/dist/collection/crypto/pem_converter.js +169 -0
- package/dist/collection/crypto/pem_converter.js.map +1 -0
- package/dist/collection/crypto/pkcs10_certificate_request.js +6 -5
- package/dist/collection/crypto/pkcs10_certificate_request.js.map +1 -1
- package/dist/collection/crypto/utils.js +18 -21
- package/dist/collection/crypto/utils.js.map +1 -1
- package/dist/collection/crypto/x509_attribute_certificate.js +6 -5
- package/dist/collection/crypto/x509_attribute_certificate.js.map +1 -1
- package/dist/collection/crypto/x509_certificate.js +6 -5
- package/dist/collection/crypto/x509_certificate.js.map +1 -1
- package/dist/collection/crypto/x509_certificates.js +69 -0
- package/dist/collection/crypto/x509_certificates.js.map +1 -0
- package/dist/collection/crypto/x509_crl.js +6 -5
- package/dist/collection/crypto/x509_crl.js.map +1 -1
- package/dist/collection/utils/index.js +0 -2
- package/dist/collection/utils/index.js.map +1 -1
- package/dist/collection/www-copy/index.js +123 -121
- package/dist/esm/{actions-aebcbc9d.js → actions-2e39a3b9.js} +2 -2
- package/dist/esm/{actions-aebcbc9d.js.map → actions-2e39a3b9.js.map} +1 -1
- package/dist/esm/{arrow_top-aee1ee02.js → arrow_top-72c7543a.js} +2 -2
- package/dist/esm/{arrow_top-aee1ee02.js.map → arrow_top-72c7543a.js.map} +1 -1
- package/dist/esm/{button-a2fabf9a.js → button-e0909687.js} +2 -2
- package/dist/esm/{button-a2fabf9a.js.map → button-e0909687.js.map} +1 -1
- package/dist/esm/{certification_request-a4699dcf.js → certification_request-714bd438.js} +186 -46
- package/dist/esm/certification_request-714bd438.js.map +1 -0
- package/dist/esm/{cross-1377606f.js → cross-0c62835f.js} +2 -2
- package/dist/esm/{cross-1377606f.js.map → cross-0c62835f.js.map} +1 -1
- package/dist/esm/{download-14dc1047.js → download-5686d86f.js} +2 -2
- package/dist/esm/{download-14dc1047.js.map → download-5686d86f.js.map} +1 -1
- package/dist/esm/index-38365508.js +2084 -0
- package/dist/esm/index-38365508.js.map +1 -0
- package/dist/esm/index.js +9 -9
- package/dist/esm/{link-7e4e9060.js → link-09718951.js} +3 -3
- package/dist/esm/{link-7e4e9060.js.map → link-09718951.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{miscellaneous-ba1fd2bd.js → miscellaneous-0657d00e.js} +6 -6
- package/dist/esm/{miscellaneous-ba1fd2bd.js.map → miscellaneous-0657d00e.js.map} +1 -1
- package/dist/esm/{peculiar-attribute-certificate-viewer_3.entry.js → peculiar-attribute-certificate-viewer_4.entry.js} +40 -10
- package/dist/esm/peculiar-attribute-certificate-viewer_4.entry.js.map +1 -0
- package/dist/esm/peculiar-button-menu_3.entry.js +7 -7
- package/dist/esm/peculiar-certificate-decoder.entry.js +101 -21
- package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-viewer.entry.js +7 -7
- package/dist/esm/peculiar-certificates-viewer.entry.js +8 -8
- package/dist/esm/peculiar-certificates-viewer.entry.js.map +1 -1
- package/dist/esm/peculiar-text-hider.entry.js +4 -4
- package/dist/esm/peculiar.js +11 -11
- package/dist/esm/peculiar.js.map +1 -1
- package/dist/esm/{pkcs10_certificate_request-785a4794.js → pkcs10_certificate_request-d3871050.js} +6 -6
- package/dist/esm/pkcs10_certificate_request-d3871050.js.map +1 -0
- package/dist/esm/{x509_certificate-05a23c0e.js → x509_certificate-d0d0c5c1.js} +6 -6
- package/dist/esm/x509_certificate-d0d0c5c1.js.map +1 -0
- package/dist/esm/{x509_crl-26081461.js → x509_crl-e837f4c3.js} +11 -11
- package/dist/esm/x509_crl-e837f4c3.js.map +1 -0
- package/dist/esm-es5/{actions-aebcbc9d.js → actions-2e39a3b9.js} +2 -2
- package/dist/esm-es5/{actions-aebcbc9d.js.map → actions-2e39a3b9.js.map} +1 -1
- package/dist/esm-es5/app-globals-5e9b67e0.js.map +1 -1
- package/dist/esm-es5/{arrow_top-aee1ee02.js → arrow_top-72c7543a.js} +2 -2
- package/dist/esm-es5/{arrow_top-aee1ee02.js.map → arrow_top-72c7543a.js.map} +1 -1
- package/dist/esm-es5/{button-a2fabf9a.js → button-e0909687.js} +2 -2
- package/dist/esm-es5/{button-a2fabf9a.js.map → button-e0909687.js.map} +1 -1
- package/dist/esm-es5/{certification_request-a4699dcf.js → certification_request-714bd438.js} +19 -12
- package/dist/esm-es5/certification_request-714bd438.js.map +1 -0
- package/dist/esm-es5/{cross-1377606f.js → cross-0c62835f.js} +2 -2
- package/dist/esm-es5/{cross-1377606f.js.map → cross-0c62835f.js.map} +1 -1
- package/dist/esm-es5/{download-14dc1047.js → download-5686d86f.js} +2 -2
- package/dist/esm-es5/{download-14dc1047.js.map → download-5686d86f.js.map} +1 -1
- package/dist/esm-es5/index-38365508.js +6 -0
- package/dist/esm-es5/index-38365508.js.map +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/index.js.map +1 -1
- package/dist/esm-es5/{link-7e4e9060.js → link-09718951.js} +3 -3
- package/dist/esm-es5/{link-7e4e9060.js.map → link-09718951.js.map} +1 -1
- package/dist/esm-es5/loader.js +2 -2
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/{miscellaneous-ba1fd2bd.js → miscellaneous-0657d00e.js} +2 -2
- package/dist/esm-es5/{miscellaneous-ba1fd2bd.js.map → miscellaneous-0657d00e.js.map} +1 -1
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_4.entry.js +110 -0
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_4.entry.js.map +1 -0
- package/dist/esm-es5/peculiar-button-menu_3.entry.js +1 -1
- package/dist/esm-es5/peculiar-button-menu_3.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js +2 -2
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificate-viewer.entry.js +1 -1
- package/dist/esm-es5/peculiar-certificate-viewer.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js +2 -2
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-text-hider.entry.js +1 -1
- package/dist/esm-es5/peculiar-text-hider.entry.js.map +1 -1
- package/dist/esm-es5/peculiar.js +2 -2
- package/dist/esm-es5/peculiar.js.map +1 -1
- package/dist/esm-es5/{pkcs10_certificate_request-785a4794.js → pkcs10_certificate_request-d3871050.js} +3 -3
- package/dist/esm-es5/pkcs10_certificate_request-d3871050.js.map +1 -0
- package/dist/esm-es5/read_file-bb0b1450.js.map +1 -1
- package/dist/esm-es5/x509_certificate-d0d0c5c1.js +12 -0
- package/dist/esm-es5/x509_certificate-d0d0c5c1.js.map +1 -0
- package/dist/esm-es5/x509_crl-e837f4c3.js +19 -0
- package/dist/esm-es5/x509_crl-e837f4c3.js.map +1 -0
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/index.esm.js.map +1 -1
- package/dist/peculiar/{p-5a662d6f.system.js → p-02529999.system.js} +2 -2
- package/dist/peculiar/{p-5a662d6f.system.js.map → p-02529999.system.js.map} +1 -1
- package/dist/peculiar/{p-9263e7ee.system.entry.js → p-04228f9c.system.entry.js} +3 -3
- package/dist/peculiar/{p-9263e7ee.system.entry.js.map → p-04228f9c.system.entry.js.map} +1 -1
- package/dist/peculiar/{p-1566ad92.system.entry.js → p-12bc3ebc.system.entry.js} +2 -2
- package/dist/peculiar/{p-1566ad92.system.entry.js.map → p-12bc3ebc.system.entry.js.map} +1 -1
- package/dist/peculiar/{p-afbd1c8e.entry.js → p-161f7f97.entry.js} +2 -2
- package/dist/peculiar/{p-afbd1c8e.entry.js.map → p-161f7f97.entry.js.map} +1 -1
- package/dist/peculiar/p-25a532a3.js.map +1 -1
- package/dist/peculiar/p-32cf293c.system.js +5 -0
- package/dist/peculiar/p-32cf293c.system.js.map +1 -0
- package/dist/peculiar/{p-2bc2abea.system.js → p-35cd359e.system.js} +2 -2
- package/dist/peculiar/{p-2bc2abea.system.js.map → p-35cd359e.system.js.map} +1 -1
- package/dist/peculiar/p-39bbe0b9.system.entry.js +5 -0
- package/dist/peculiar/{p-b5389885.system.entry.js.map → p-39bbe0b9.system.entry.js.map} +1 -1
- package/dist/peculiar/p-41eacbcd.system.entry.js +111 -0
- package/dist/peculiar/p-41eacbcd.system.entry.js.map +1 -0
- package/dist/peculiar/p-47b7dd9e.entry.js +110 -0
- package/dist/peculiar/p-47b7dd9e.entry.js.map +1 -0
- package/dist/peculiar/{p-8bbee8f4.system.js → p-4ee5beee.system.js} +2 -2
- package/dist/peculiar/{p-8bbee8f4.system.js.map → p-4ee5beee.system.js.map} +1 -1
- package/dist/peculiar/p-55303453.system.js.map +1 -1
- package/dist/peculiar/{p-ae91d778.js → p-562652dd.js} +2 -2
- package/dist/peculiar/{p-ae91d778.js.map → p-562652dd.js.map} +1 -1
- package/dist/peculiar/p-5b4db88b.system.js +5 -0
- package/dist/peculiar/p-5b4db88b.system.js.map +1 -0
- package/dist/peculiar/{p-e4ad4f13.system.entry.js → p-67452b74.system.entry.js} +2 -2
- package/dist/peculiar/{p-e4ad4f13.system.entry.js.map → p-67452b74.system.entry.js.map} +1 -1
- package/dist/peculiar/p-684b7f0f.system.js +142 -0
- package/dist/peculiar/p-684b7f0f.system.js.map +1 -0
- package/dist/peculiar/{p-bafd67f3.entry.js → p-6eb92f5a.entry.js} +2 -2
- package/dist/peculiar/{p-bafd67f3.entry.js.map → p-6eb92f5a.entry.js.map} +1 -1
- package/dist/peculiar/p-8dd6d1ee.entry.js +5 -0
- package/dist/peculiar/p-8dd6d1ee.entry.js.map +1 -0
- package/dist/peculiar/{p-a9487007.js → p-90c3a063.js} +2 -2
- package/dist/peculiar/{p-a9487007.js.map → p-90c3a063.js.map} +1 -1
- package/dist/peculiar/{p-6e2ad7eb.js → p-90f461c0.js} +13 -13
- package/dist/peculiar/{p-6e2ad7eb.js.map → p-90f461c0.js.map} +1 -1
- package/dist/peculiar/{p-99efefea.js → p-92f9641a.js} +2 -2
- package/dist/peculiar/{p-99efefea.js.map → p-92f9641a.js.map} +1 -1
- package/dist/peculiar/p-93e299aa.system.entry.js +5 -0
- package/dist/peculiar/p-93e299aa.system.entry.js.map +1 -0
- package/dist/peculiar/p-9987b899.js +19 -0
- package/dist/peculiar/{p-4bc5ddbe.js.map → p-9987b899.js.map} +1 -1
- package/dist/peculiar/p-9b64adaa.system.js +13 -0
- package/dist/peculiar/p-9b64adaa.system.js.map +1 -0
- package/dist/peculiar/{p-243244af.system.js → p-9ca02302.system.js} +2 -2
- package/dist/peculiar/{p-243244af.system.js.map → p-9ca02302.system.js.map} +1 -1
- package/dist/peculiar/p-a1adb881.js +6 -0
- package/dist/peculiar/p-a1adb881.js.map +1 -0
- package/dist/peculiar/{p-eea904d7.system.js → p-a3054d6e.system.js} +2 -2
- package/dist/peculiar/{p-eea904d7.system.js.map → p-a3054d6e.system.js.map} +1 -1
- package/dist/peculiar/{p-32807e5e.js → p-a55fd6f1.js} +19 -12
- package/dist/peculiar/p-a55fd6f1.js.map +1 -0
- package/dist/peculiar/p-a87e1a0e.js +12 -0
- package/dist/peculiar/{p-e6a6e602.js.map → p-a87e1a0e.js.map} +1 -1
- package/dist/peculiar/p-a9ea6c79.system.js +20 -0
- package/dist/peculiar/p-a9ea6c79.system.js.map +1 -0
- package/dist/peculiar/{p-67e82386.entry.js → p-b01c70cf.entry.js} +3 -3
- package/dist/peculiar/{p-67e82386.entry.js.map → p-b01c70cf.entry.js.map} +1 -1
- package/dist/peculiar/p-b5674f82.js +19 -0
- package/dist/peculiar/p-b5674f82.js.map +1 -0
- package/dist/peculiar/{p-27ca6743.js → p-ba3dfc03.js} +2 -2
- package/dist/peculiar/{p-27ca6743.js.map → p-ba3dfc03.js.map} +1 -1
- package/dist/peculiar/p-bc91996c.system.js +6 -0
- package/dist/peculiar/p-bc91996c.system.js.map +1 -0
- package/dist/peculiar/p-c2995a63.system.js.map +1 -1
- package/dist/peculiar/p-c5d3333c.system.js +19 -0
- package/dist/peculiar/p-c5d3333c.system.js.map +1 -0
- package/dist/peculiar/p-cb8a0b79.js +19 -0
- package/dist/peculiar/p-cb8a0b79.js.map +1 -0
- package/dist/peculiar/{p-c241e4ba.system.js → p-d46670fa.system.js} +2 -2
- package/dist/peculiar/{p-c241e4ba.system.js.map → p-d46670fa.system.js.map} +1 -1
- package/dist/peculiar/{p-9712b827.system.js → p-d9145ee8.system.js} +2 -2
- package/dist/peculiar/{p-9712b827.system.js.map → p-d9145ee8.system.js.map} +1 -1
- package/dist/peculiar/p-dac867e8.js.map +1 -1
- package/dist/peculiar/p-f456fe47.js +12 -0
- package/dist/peculiar/p-f456fe47.js.map +1 -0
- package/dist/peculiar/p-f6ec61db.entry.js +5 -0
- package/dist/peculiar/{p-713563fb.entry.js.map → p-f6ec61db.entry.js.map} +1 -1
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/peculiar/peculiar.esm.js.map +1 -1
- package/dist/peculiar/peculiar.js +1 -1
- package/dist/types/components/certificate-chain-viewer/certificate-chain-viewer.d.ts +21 -0
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +5 -4
- package/dist/types/components/certificate-details-parts/miscellaneous.d.ts +2 -2
- package/dist/types/components/typography/typography.d.ts +0 -1
- package/dist/types/components.d.ts +33 -4
- package/dist/types/crypto/index.d.ts +1 -0
- package/dist/types/crypto/pem_converter.d.ts +71 -0
- package/dist/types/crypto/pkcs10_certificate_request.d.ts +2 -2
- package/dist/types/crypto/utils.d.ts +7 -3
- package/dist/types/crypto/x509_attribute_certificate.d.ts +2 -2
- package/dist/types/crypto/x509_certificate.d.ts +2 -2
- package/dist/types/crypto/x509_certificates.d.ts +9 -0
- package/dist/types/crypto/x509_crl.d.ts +2 -2
- package/dist/types/stencil-public-runtime.d.ts +9 -10
- package/dist/types/utils/index.d.ts +0 -2
- package/hydrate/index.d.ts +36 -12
- package/hydrate/index.js +25131 -15090
- package/hydrate/index.mjs +34931 -0
- package/hydrate/package.json +7 -1
- package/loader/cdn.js +1 -1
- package/loader/index.cjs.js +1 -1
- package/loader/index.d.ts +3 -0
- package/loader/index.es2017.js +1 -1
- package/loader/index.js +1 -1
- package/package.json +13 -10
- package/dist/cjs/certification_request-ad267278.js.map +0 -1
- package/dist/cjs/index-e2ae280a.js +0 -2730
- package/dist/cjs/index-e2ae280a.js.map +0 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js.map +0 -1
- package/dist/cjs/pkcs10_certificate_request-64898c88.js.map +0 -1
- package/dist/cjs/x509_certificate-4b0894c2.js.map +0 -1
- package/dist/cjs/x509_crl-fc8d41a1.js.map +0 -1
- package/dist/collection/utils/validator.js +0 -25
- package/dist/collection/utils/validator.js.map +0 -1
- package/dist/esm/certification_request-a4699dcf.js.map +0 -1
- package/dist/esm/index-ae188432.js +0 -2701
- package/dist/esm/index-ae188432.js.map +0 -1
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js.map +0 -1
- package/dist/esm/pkcs10_certificate_request-785a4794.js.map +0 -1
- package/dist/esm/x509_certificate-05a23c0e.js.map +0 -1
- package/dist/esm/x509_crl-26081461.js.map +0 -1
- package/dist/esm-es5/certification_request-a4699dcf.js.map +0 -1
- package/dist/esm-es5/index-ae188432.js +0 -6
- package/dist/esm-es5/index-ae188432.js.map +0 -1
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +0 -110
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js.map +0 -1
- package/dist/esm-es5/pkcs10_certificate_request-785a4794.js.map +0 -1
- package/dist/esm-es5/x509_certificate-05a23c0e.js +0 -12
- package/dist/esm-es5/x509_certificate-05a23c0e.js.map +0 -1
- package/dist/esm-es5/x509_crl-26081461.js +0 -19
- package/dist/esm-es5/x509_crl-26081461.js.map +0 -1
- package/dist/peculiar/p-32807e5e.js.map +0 -1
- package/dist/peculiar/p-3cb79cd9.js +0 -6
- package/dist/peculiar/p-3cb79cd9.js.map +0 -1
- package/dist/peculiar/p-4bc5ddbe.js +0 -19
- package/dist/peculiar/p-5d1d4a96.entry.js +0 -110
- package/dist/peculiar/p-5d1d4a96.entry.js.map +0 -1
- package/dist/peculiar/p-713563fb.entry.js +0 -5
- package/dist/peculiar/p-7ddd9a82.system.js +0 -19
- package/dist/peculiar/p-7ddd9a82.system.js.map +0 -1
- package/dist/peculiar/p-821bdcdc.system.js +0 -6
- package/dist/peculiar/p-821bdcdc.system.js.map +0 -1
- package/dist/peculiar/p-8393399a.system.js +0 -5
- package/dist/peculiar/p-8393399a.system.js.map +0 -1
- package/dist/peculiar/p-98e3a016.system.js +0 -13
- package/dist/peculiar/p-98e3a016.system.js.map +0 -1
- package/dist/peculiar/p-9ad547d2.system.entry.js +0 -5
- package/dist/peculiar/p-9ad547d2.system.entry.js.map +0 -1
- package/dist/peculiar/p-a1a48332.system.js +0 -5
- package/dist/peculiar/p-a1a48332.system.js.map +0 -1
- package/dist/peculiar/p-ab5a4988.js +0 -12
- package/dist/peculiar/p-ab5a4988.js.map +0 -1
- package/dist/peculiar/p-ae44c2b0.system.js +0 -20
- package/dist/peculiar/p-ae44c2b0.system.js.map +0 -1
- package/dist/peculiar/p-b5389885.system.entry.js +0 -5
- package/dist/peculiar/p-cd1b1876.entry.js +0 -5
- package/dist/peculiar/p-cd1b1876.entry.js.map +0 -1
- package/dist/peculiar/p-d5ba4fc2.js +0 -19
- package/dist/peculiar/p-d5ba4fc2.js.map +0 -1
- package/dist/peculiar/p-e37e4df2.system.js +0 -135
- package/dist/peculiar/p-e37e4df2.system.js.map +0 -1
- package/dist/peculiar/p-e6a6e602.js +0 -12
- package/dist/peculiar/p-f8c91ee4.js +0 -19
- package/dist/peculiar/p-f8c91ee4.js.map +0 -1
- package/dist/peculiar/p-f9c07207.system.entry.js +0 -111
- package/dist/peculiar/p-f9c07207.system.entry.js.map +0 -1
- package/dist/types/utils/validator.d.ts +0 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,r,a){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,
|
|
1
|
+
var __extends=this&&this.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]};return t(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function a(){this.constructor=e}e.prototype=r===null?Object.create(r):(a.prototype=r.prototype,new a)}}();var __awaiter=this&&this.__awaiter||function(t,e,r,a){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function n(t){try{s(a.next(t))}catch(t){i(t)}}function c(t){try{s(a["throw"](t))}catch(t){i(t)}}function s(t){t.done?r(t.value):o(t.value).then(n,c)}s((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,o,i,n;return n={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function c(t){return function(e){return s([t,e])}}function s(c){if(a)throw new TypeError("Generator is already executing.");while(n&&(n=0,c[0]&&(r=0)),r)try{if(a=1,o&&(i=c[0]&2?o["return"]:c[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;if(o=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:r.label++;return{value:c[1],done:false};case 5:r.label++;o=c[1];c=[0];continue;case 7:c=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1];i=c;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(c);break}if(i[2])r.ops.pop();r.trys.pop();continue}c=e.call(t,r)}catch(t){c=[6,t];o=0}finally{a=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
4
|
-
*/import{r as registerInstance,c as createEvent,h,H as Host}from"./index-ae188432.js";import{a as readAsBinaryString}from"./read_file-bb0b1450.js";import"./certification_request-a4699dcf.js";import{X as X509Certificate}from"./x509_certificate-05a23c0e.js";import{X as X509AttributeCertificate,a as X509Crl}from"./x509_crl-26081461.js";import{P as Pkcs10CertificateRequest}from"./pkcs10_certificate_request-785a4794.js";import{T as Typography,B as Button}from"./button-a2fabf9a.js";var certificateDecoderCss="*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%}.textarea{min-height:300px;width:100%;border-radius:4px;border:1px solid var(--pv-color-gray-5);padding:14px;font-family:monospace;resize:vertical}.viewer{margin-top:var(--pv-size-base-12)}.controls{margin-top:var(--pv-size-base-2);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--pv-size-base-2)}.control_row{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--pv-size-base)}";var PeculiarCertificateDecoderStyle0=certificateDecoderCss;var CertificateDecoder=function(){function t(t){var e=this;registerInstance(this,t);this.successParse=createEvent(this,"successParse",7);this.clearCertificate=createEvent(this,"clearCertificate",7);this.handleClickDecode=function(){var t=e.inputPaste.value;if(t){e.decode(t)}};this.handleClickClear=function(){e.clearValue()};this.handleChangeInputFile=function(t){return __awaiter(e,void 0,void 0,(function(){var e,r;return __generator(this,(function(a){switch(a.label){case 0:e=t.target;if(!e.files)return[3,2];return[4,readAsBinaryString(e.files[0])];case 1:r=a.sent();if(typeof r.value==="string"){this.decode(r.value)}e.value="";a.label=2;case 2:return[2]}}))}))};this.handleChangeExample=function(t){if(t.target.value){e.decode(t.target.value)}else{e.clearValue()}};this.handleDropFile=function(t){return __awaiter(e,void 0,void 0,(function(){var e,r;return __generator(this,(function(a){switch(a.label){case 0:t.stopPropagation();t.preventDefault();e=t.dataTransfer;if(!e.files)return[3,2];return[4,readAsBinaryString(e.files[0])];case 1:r=a.sent();if(typeof r.value==="string"){this.decode(r.value)}a.label=2;case 2:return[2]}}))}))};this.certificateExamples=undefined;this.defaultCertificate=undefined;this.certificateDecoded=undefined}t.prototype.componentDidLoad=function(){var t=this;if(this.defaultCertificate){setTimeout((function(){return t.decode(t.defaultCertificate)}),100)}};t.prototype.clearValue=function(){this.inputPaste.value="";this.certificateDecoded=null;this.clearCertificate.emit()};t.prototype.setValue=function(t){this.certificateDecoded=t;this.inputPaste.value=t.toString("pem");this.successParse.emit(t.toString("base64"))};t.prototype.decode=function(t){var e=this;new Promise((function(e){e(new X509Certificate(t))})).catch((function(){return new X509AttributeCertificate(t)})).catch((function(){return new Pkcs10CertificateRequest(t)})).catch((function(){return new X509Crl(t)})).then((function(t){return e.setValue(t)})).catch((function(t){e.clearValue();console.log(t);alert("Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.")}))};t.prototype.render=function(){var t=this;var e;return h(Host,{key:"7c3bfca68882e39705e9640f76754cce2e5d6c6a"},h("textarea",{key:"4d24f4b914f7f118efde2144e7597e0767d59ce8",placeholder:"Certificate DER or PEM",class:"textarea t-b2 c-black",ref:function(e){t.inputPaste=e},onDrop:this.handleDropFile}),h("div",{key:"06ba6e2b5658225a585ec9711e6f3f945ef3a840",class:"controls"},h("div",{key:"df2e115ea04d4eae7985f6ee57bfe47354f50240",class:"control_row"},h(Typography,{key:"05c30b2956055455cdb1f52b40995752dd0d7da4",variant:"b3",color:"secondary-tint-2"},"Drag or load file:"),h("input",{key:"cca59d7c59d9917e728f9795bcfbd546d4cf75b8",type:"file",accept:"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl",onChange:this.handleChangeInputFile,value:""})),((e=this.certificateExamples)===null||e===void 0?void 0:e.length)&&h("div",{class:"control_row"},h(Typography,{variant:"b3",color:"secondary-tint-2"},"Load examples:"),h("select",{onChange:this.handleChangeExample},h("option",{value:""},"None"),this.certificateExamples.map((function(t){return h("option",{value:t.value},t.title)})))),h("div",{key:"6d1f010e03d7836459214e5c0abe1af7fbbe2a10",class:"control_row"},h(Button,{key:"4038db36b62ff11f592f380f5c98bebb0014585e",onClick:this.handleClickDecode},"Decode"),h(Button,{key:"fb7c30e61b10194b5f02a2cefa06191904f5ce46",onClick:this.handleClickClear},"Clear"))),this.certificateDecoded instanceof X509Certificate&&h("peculiar-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof X509AttributeCertificate&&h("peculiar-attribute-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof Pkcs10CertificateRequest&&h("peculiar-csr-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof X509Crl&&h("peculiar-crl-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}))};return t}();CertificateDecoder.style=PeculiarCertificateDecoderStyle0;export{CertificateDecoder as peculiar_certificate_decoder};
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,h,H as Host}from"./index-38365508.js";import{a as readAsBinaryString}from"./read_file-bb0b1450.js";import{P as PemConverter,C as Convert_1,S as SignedData,H as EncapsulatedContent,O as OctetString,J as CertificateSet,K as CertificateChoices,y as AsnConvert,L as Certificate,M as ContentInfo,D as Download}from"./certification_request-714bd438.js";import{X as X509Certificate}from"./x509_certificate-d0d0c5c1.js";import{X as X509AttributeCertificate,a as X509Crl}from"./x509_crl-e837f4c3.js";import{P as Pkcs10CertificateRequest}from"./pkcs10_certificate_request-d3871050.js";import{T as Typography,B as Button}from"./button-e0909687.js";var id_data="1.2.840.113549.1.7.1";var id_signedData="1.2.840.113549.1.7.2";var X509Certificates=function(t){__extends(e,t);function e(e){var r=t.call(this)||this;var a=PemConverter.isPem(e)?PemConverter.decode(e).map((function(t){return Convert_1.ToBase64Url(t)})):e.split(",");if(a.length<2){throw new Error("Unable to parse string. The array of elements is less than 2")}for(var o=0,i=a;o<i.length;o++){var n=i[o];r.push(new X509Certificate(n))}return r}Object.defineProperty(e.prototype,"commonName",{get:function(){return Array.from(this).map((function(t){return t.commonName})).join("_")},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"raw",{get:function(){var t=new SignedData;t.version=1;t.encapContentInfo.eContentType=id_data;t.encapContentInfo.eContent=new EncapsulatedContent({single:new OctetString});t.certificates=new CertificateSet(Array.from(this).map((function(t){return new CertificateChoices({certificate:AsnConvert.parse(t.raw,Certificate)})})));var e=new ContentInfo({contentType:id_signedData,content:AsnConvert.serialize(t)});return AsnConvert.serialize(e)},enumerable:false,configurable:true});e.prototype.toString=function(t){if(t===void 0){t="pem"}switch(t){case"pem":return Array.from(this).map((function(t){return t.toString("pem")})).join("\n");case"base64url":return Array.from(this).map((function(t){return t.toString("base64url")})).join(",");default:return Array.from(this).map((function(t){return t.toString("base64")})).join(",")}};e.prototype.downloadAsPEM=function(t){Download.cert.asPEM(this.toString("pem"),t||this.commonName)};e.prototype.downloadAsDER=function(t){Download.cert.asDER(this.raw,t||this.commonName)};return e}(Array);var certificateDecoderCss="*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%}.textarea{min-height:300px;width:100%;border-radius:4px;border:1px solid var(--pv-color-gray-5);padding:14px;font-family:monospace;resize:vertical}.controls{margin-top:var(--pv-size-base-2);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--pv-size-base-2);margin-bottom:var(--pv-size-base-12)}.control_row{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--pv-size-base)}";var PeculiarCertificateDecoderStyle0=certificateDecoderCss;var CertificateDecoder=function(){function t(t){var e=this;registerInstance(this,t);this.successParse=createEvent(this,"successParse",7);this.clearCertificate=createEvent(this,"clearCertificate",7);this.handleClickDecode=function(){var t=e.inputPaste.value;if(t){e.decode(t)}};this.handleClickClear=function(){e.clearValue()};this.handleChangeInputFile=function(t){return __awaiter(e,void 0,void 0,(function(){var e,r;return __generator(this,(function(a){switch(a.label){case 0:e=t.target;if(!e.files)return[3,2];return[4,readAsBinaryString(e.files[0])];case 1:r=a.sent();if(typeof r.value==="string"){this.decode(r.value)}e.value="";a.label=2;case 2:return[2]}}))}))};this.handleChangeExample=function(t){if(t.target.value){e.decode(t.target.value)}else{e.clearValue()}};this.handleDropFile=function(t){return __awaiter(e,void 0,void 0,(function(){var e,r;return __generator(this,(function(a){switch(a.label){case 0:t.stopPropagation();t.preventDefault();e=t.dataTransfer;if(!e.files)return[3,2];return[4,readAsBinaryString(e.files[0])];case 1:r=a.sent();if(typeof r.value==="string"){this.decode(r.value)}a.label=2;case 2:return[2]}}))}))};this.certificateExamples=undefined;this.certificateToDecode=undefined;this.certificateDecoded=undefined}t.prototype.componentDidLoad=function(){var t=this;if(this.certificateToDecode){setTimeout((function(){return t.decode(t.certificateToDecode)}),100)}};t.prototype.clearValue=function(){this.inputPaste.value="";this.certificateDecoded=null;this.clearCertificate.emit()};t.prototype.setValue=function(t){this.certificateDecoded=t;this.inputPaste.value=t.toString("pem");this.successParse.emit(t.toString("base64url"))};t.prototype.decode=function(t){var e=this;new Promise((function(e){e(new X509Certificates(t))})).catch((function(){return new X509Certificate(t)})).catch((function(){return new X509AttributeCertificate(t)})).catch((function(){return new Pkcs10CertificateRequest(t)})).catch((function(){return new X509Crl(t)})).then((function(t){return e.setValue(t)})).catch((function(e){console.log(e);alert('Error decoding certificate:\n"'.concat(t,'"\n\nPlease try to use Certificate/AttributeCertificate/CertificateRequest/CRL.'))}))};t.prototype.renderCertificate=function(){if(this.certificateDecoded instanceof X509Certificates){return h("peculiar-certificate-chain-viewer",{certificates:this.certificateDecoded,download:true})}if(this.certificateDecoded instanceof X509Certificate){return h("peculiar-certificate-viewer",{certificate:this.certificateDecoded,download:true})}if(this.certificateDecoded instanceof X509AttributeCertificate){return h("peculiar-attribute-certificate-viewer",{certificate:this.certificateDecoded,download:true})}if(this.certificateDecoded instanceof Pkcs10CertificateRequest){return h("peculiar-csr-viewer",{certificate:this.certificateDecoded,download:true})}if(this.certificateDecoded instanceof X509Crl){return h("peculiar-crl-viewer",{certificate:this.certificateDecoded,download:true})}return null};t.prototype.render=function(){var t=this;var e;return h(Host,{key:"466ae73c347d305938c8b5f7a9ca0fcc8ec000eb"},h("textarea",{key:"00d3552d847823c1e4e10162c5ac22de48062c47",placeholder:"Certificate DER or PEM",class:"textarea t-b2 c-black",ref:function(e){t.inputPaste=e},onDrop:this.handleDropFile}),h("div",{key:"2b45a534e3db2d4c879efcc849f439d494ad5adc",class:"controls"},h("div",{key:"c78db2ec219c7417c10c8aa4b99e72e1fc16499d",class:"control_row"},h(Typography,{key:"9e72c34b567870083b68fdaf082aae28f8899b24",variant:"b3",color:"secondary-tint-2"},"Drag or load file:"),h("input",{key:"7069e5db2f0de85126b4fdcace19e181ab407a16",type:"file",accept:"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl",onChange:this.handleChangeInputFile,value:""})),((e=this.certificateExamples)===null||e===void 0?void 0:e.length)&&h("div",{key:"e184a0864d8432e1f0aa26788e58f3c336abc598",class:"control_row"},h(Typography,{key:"19e3213a14ef0b24bb110df7a4e943bf1f2a8ebf",variant:"b3",color:"secondary-tint-2"},"Load examples:"),h("select",{key:"79082619d5d4bc82cf90afddf58ec58a5ae232b7",onChange:this.handleChangeExample},h("option",{key:"add23975d376914239389b621bd956bcd4fb52eb",value:""},"None"),this.certificateExamples.map((function(t){return h("option",{value:t.value},t.title)})))),h("div",{key:"876ccefd3125618d5c1e7c83e277349fa78da802",class:"control_row"},h(Button,{key:"bb890810c0895ba3fdcc22695e72cd8c2cf9645d",onClick:this.handleClickDecode},"Decode"),h(Button,{key:"dadc94b3e9e2e7211d993d99c127abfc8e593545",onClick:this.handleClickClear},"Clear"))),this.renderCertificate())};return t}();CertificateDecoder.style=PeculiarCertificateDecoderStyle0;export{CertificateDecoder as peculiar_certificate_decoder};
|
|
5
5
|
//# sourceMappingURL=peculiar-certificate-decoder.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["certificateDecoderCss","PeculiarCertificateDecoderStyle0","CertificateDecoder","this","handleClickDecode","value","_this","inputPaste","decode","handleClickClear","clearValue","handleChangeInputFile","event","__awaiter","element","target","files","readAsBinaryString","file","_b","sent","handleChangeExample","handleDropFile","stopPropagation","preventDefault","dataTransfer","class_1","prototype","componentDidLoad","defaultCertificate","setTimeout","certificateDecoded","clearCertificate","emit","setValue","toString","successParse","certificate","Promise","resolve","X509Certificate","catch","X509AttributeCertificate","Pkcs10CertificateRequest","X509Crl","then","res","err","console","log","alert","render","h","Host","key","placeholder","class","ref","el","onDrop","Typography","variant","color","type","accept","onChange","_a","certificateExamples","length","map","example","title","Button","onClick","download"],"sources":["src/components/certificate-decoder/certificate-decoder.scss?tag=peculiar-certificate-decoder&encapsulation=shadow","src/components/certificate-decoder/certificate-decoder.tsx"],"sourcesContent":["@import '../../css/base.scss';\n\n:host {\n display: block;\n width: 100%;\n}\n\n.textarea {\n min-height: 300px;\n width: 100%;\n border-radius: 4px;\n border: 1px solid var(--pv-color-gray-5);;\n padding: 14px;\n font-family: monospace;\n resize: vertical;\n}\n\n.viewer {\n margin-top: var(--pv-size-base-12);\n}\n\n.controls {\n margin-top: var(--pv-size-base-2);\n display: flex;\n flex-direction: column;\n gap: var(--pv-size-base-2);\n}\n\n.control_row {\n display: flex;\n align-items: center;\n gap: var(--pv-size-base);\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Host,\n h,\n State,\n Prop,\n Event,\n EventEmitter,\n} from '@stencil/core';\n\nimport { readAsBinaryString } from '../../utils';\nimport {\n X509Certificate,\n X509AttributeCertificate,\n Pkcs10CertificateRequest,\n X509Crl,\n} from '../../crypto';\nimport { Button } from '../button';\nimport { Typography } from '../typography';\n\n@Component({\n tag: 'peculiar-certificate-decoder',\n styleUrl: 'certificate-decoder.scss',\n shadow: true,\n})\nexport class CertificateDecoder {\n private inputPaste?: HTMLTextAreaElement;\n\n /**\n * The example certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() certificateExamples?: {\n title: string;\n value: string;\n }[];\n\n /**\n * The default certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() defaultCertificate?: string;\n\n @State() certificateDecoded: X509Certificate\n | X509AttributeCertificate\n | Pkcs10CertificateRequest\n | X509Crl;\n\n /**\n * Emitted when the certificate has been successfully parsed.\n */\n @Event() successParse!: EventEmitter<string>;\n\n /**\n * Emitted when the certificate has been removed.\n */\n @Event() clearCertificate!: EventEmitter<void>;\n\n componentDidLoad() {\n if (this.defaultCertificate) {\n /**\n * Prevent Stencil warning about re-render\n */\n setTimeout(() => this.decode(this.defaultCertificate), 100);\n }\n }\n\n private handleClickDecode = () => {\n const { value } = this.inputPaste;\n\n if (value) {\n this.decode(value);\n }\n };\n\n private handleClickClear = () => {\n this.clearValue();\n };\n\n private handleChangeInputFile = async (event: any) => {\n const element = event.target;\n\n if (element.files) {\n const file = await readAsBinaryString(element.files[0]);\n\n if (typeof file.value === 'string') {\n this.decode(file.value);\n }\n\n element.value = '';\n }\n };\n\n private handleChangeExample = (event: any) => {\n if (event.target.value) {\n this.decode(event.target.value);\n } else {\n this.clearValue();\n }\n };\n\n private handleDropFile = async (event: any) => {\n event.stopPropagation();\n event.preventDefault();\n\n const element = event.dataTransfer;\n\n if (element.files) {\n const file = await readAsBinaryString(element.files[0]);\n\n if (typeof file.value === 'string') {\n this.decode(file.value);\n }\n }\n };\n\n clearValue() {\n this.inputPaste.value = '';\n this.certificateDecoded = null;\n this.clearCertificate.emit();\n }\n\n setValue(value: typeof this.certificateDecoded) {\n this.certificateDecoded = value;\n this.inputPaste.value = value.toString('pem');\n this.successParse.emit(value.toString('base64'));\n }\n\n decode(certificate: string) {\n new Promise((resolve) => {\n resolve(new X509Certificate(certificate));\n })\n .catch(() => new X509AttributeCertificate(certificate))\n .catch(() => new Pkcs10CertificateRequest(certificate))\n .catch(() => new X509Crl(certificate))\n .then((res: typeof this.certificateDecoded) => this.setValue(res))\n .catch((err) => {\n this.clearValue();\n\n console.log(err);\n alert('Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.');\n });\n }\n\n render() {\n return (\n <Host>\n <textarea\n placeholder=\"Certificate DER or PEM\"\n class=\"textarea t-b2 c-black\"\n ref={(el) => { this.inputPaste = el; }}\n onDrop={this.handleDropFile}\n />\n <div class=\"controls\">\n <div class=\"control_row\">\n <Typography\n variant=\"b3\"\n color=\"secondary-tint-2\"\n >\n Drag or load file:\n </Typography>\n <input\n type=\"file\"\n accept=\"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl\"\n onChange={this.handleChangeInputFile}\n value=\"\"\n />\n </div>\n {this.certificateExamples?.length && (\n <div class=\"control_row\">\n <Typography\n variant=\"b3\"\n color=\"secondary-tint-2\"\n >\n Load examples:\n </Typography>\n <select onChange={this.handleChangeExample}>\n <option value=\"\">None</option>\n {this.certificateExamples.map((example) => (\n <option value={example.value}>\n {example.title}\n </option>\n ))}\n </select>\n </div>\n )}\n <div class=\"control_row\">\n <Button\n onClick={this.handleClickDecode}\n >\n Decode\n </Button>\n <Button\n onClick={this.handleClickClear}\n >\n Clear\n </Button>\n </div>\n </div>\n {this.certificateDecoded instanceof X509Certificate && (\n <peculiar-certificate-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n {this.certificateDecoded instanceof X509AttributeCertificate && (\n <peculiar-attribute-certificate-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n {this.certificateDecoded instanceof Pkcs10CertificateRequest && (\n <peculiar-csr-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n {this.certificateDecoded instanceof X509Crl && (\n <peculiar-crl-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n </Host>\n );\n }\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"names":["id_data","id_signedData","__extends","X509Certificates","_super","raw","_this","call","this","rawItems","PemConverter","isPem","decode","map","value","Convert","ToBase64Url","split","length","Error","_i","rawItems_1","item","push","X509Certificate","Object","defineProperty","prototype","Array","from","o","commonName","join","signedData","SignedData","version","encapContentInfo","eContentType","eContent","EncapsulatedContent","single","OctetString","certificates","CertificateSet","CertificateChoices","certificate","AsnConvert","parse","Certificate","cms","ContentInfo","contentType","content","serialize","toString","format","downloadAsPEM","name","Download","cert","asPEM","downloadAsDER","asDER","certificateDecoderCss","PeculiarCertificateDecoderStyle0","CertificateDecoder","handleClickDecode","inputPaste","handleClickClear","clearValue","handleChangeInputFile","event","__awaiter","element","target","files","readAsBinaryString","file","_b","sent","handleChangeExample","handleDropFile","stopPropagation","preventDefault","dataTransfer","class_1","componentDidLoad","certificateToDecode","setTimeout","certificateDecoded","clearCertificate","emit","setValue","successParse","Promise","resolve","catch","X509AttributeCertificate","Pkcs10CertificateRequest","X509Crl","then","res","error","console","log","alert","concat","renderCertificate","h","download","render","Host","key","placeholder","class","ref","el","onDrop","Typography","variant","color","type","accept","onChange","_a","certificateExamples","example","title","Button","onClick"],"sources":["../../node_modules/@peculiar/asn1-cms/build/es2015/object_identifiers.js","src/crypto/x509_certificates.ts","src/components/certificate-decoder/certificate-decoder.scss?tag=peculiar-certificate-decoder&encapsulation=shadow","src/components/certificate-decoder/certificate-decoder.tsx"],"sourcesContent":["export const id_ct_contentInfo = \"1.2.840.113549.1.9.16.1.6\";\nexport const id_data = \"1.2.840.113549.1.7.1\";\nexport const id_signedData = \"1.2.840.113549.1.7.2\";\nexport const id_envelopedData = \"1.2.840.113549.1.7.3\";\nexport const id_digestedData = \"1.2.840.113549.1.7.5\";\nexport const id_encryptedData = \"1.2.840.113549.1.7.6\";\nexport const id_authData = \"1.2.840.113549.1.9.16.1.2\";\n","import { Convert } from 'pvtsutils';\nimport {\n SignedData,\n id_data,\n EncapsulatedContent,\n CertificateSet,\n CertificateChoices,\n ContentInfo,\n id_signedData,\n} from '@peculiar/asn1-cms';\nimport { Certificate } from '@peculiar/asn1-x509';\nimport { AsnConvert, OctetString } from '@peculiar/asn1-schema';\n\nimport { Download } from '../utils';\n\nimport { PemConverter } from './pem_converter';\nimport { X509Certificate } from './x509_certificate';\n\nexport class X509Certificates extends Array<X509Certificate> {\n constructor(raw: string) {\n super();\n\n const rawItems = PemConverter.isPem(raw)\n ? PemConverter.decode(raw).map((value) => Convert.ToBase64Url(value))\n : raw.split(',');\n\n if (rawItems.length < 2) {\n throw new Error('Unable to parse string. The array of elements is less than 2');\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const item of rawItems) {\n this.push(new X509Certificate(item));\n }\n }\n\n public get commonName(): string {\n return Array.from(this)\n .map((o) => o.commonName)\n .join('_');\n }\n\n public get raw(): ArrayBuffer {\n const signedData = new SignedData();\n\n signedData.version = 1;\n signedData.encapContentInfo.eContentType = id_data;\n signedData.encapContentInfo.eContent = new EncapsulatedContent({\n single: new OctetString(),\n });\n signedData.certificates = new CertificateSet(\n Array.from(this).map((o) => new CertificateChoices({\n certificate: AsnConvert.parse(o.raw, Certificate),\n })),\n );\n\n const cms = new ContentInfo({\n contentType: id_signedData,\n content: AsnConvert.serialize(signedData),\n });\n\n return AsnConvert.serialize(cms);\n }\n\n public toString(format: 'pem' | 'base64' | 'base64url' = 'pem'): string {\n switch (format) {\n case 'pem':\n return Array.from(this)\n .map((o) => o.toString('pem'))\n .join('\\n');\n case 'base64url':\n return Array.from(this)\n .map((o) => o.toString('base64url'))\n .join(',');\n default:\n return Array.from(this)\n .map((o) => o.toString('base64'))\n .join(',');\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.cert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.cert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n","@import '../../css/base.scss';\n\n:host {\n display: block;\n width: 100%;\n}\n\n.textarea {\n min-height: 300px;\n width: 100%;\n border-radius: 4px;\n border: 1px solid var(--pv-color-gray-5);;\n padding: 14px;\n font-family: monospace;\n resize: vertical;\n}\n\n.controls {\n margin-top: var(--pv-size-base-2);\n display: flex;\n flex-direction: column;\n gap: var(--pv-size-base-2);\n margin-bottom: var(--pv-size-base-12);\n}\n\n.control_row {\n display: flex;\n align-items: center;\n gap: var(--pv-size-base);\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Host,\n h,\n State,\n Prop,\n Event,\n EventEmitter,\n} from '@stencil/core';\n\nimport { readAsBinaryString } from '../../utils';\nimport {\n X509Certificate,\n X509AttributeCertificate,\n Pkcs10CertificateRequest,\n X509Crl,\n X509Certificates,\n} from '../../crypto';\nimport { Button } from '../button';\nimport { Typography } from '../typography';\n\n@Component({\n tag: 'peculiar-certificate-decoder',\n styleUrl: 'certificate-decoder.scss',\n shadow: true,\n})\nexport class CertificateDecoder {\n private inputPaste?: HTMLTextAreaElement;\n\n /**\n * The example certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() certificateExamples?: {\n title: string;\n value: string;\n }[];\n\n /**\n * The default certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() certificateToDecode?: string;\n\n @State() certificateDecoded: X509Certificates\n | X509Certificate\n | X509AttributeCertificate\n | Pkcs10CertificateRequest\n | X509Crl;\n\n /**\n * Emitted when the certificate has been successfully parsed.\n */\n @Event() successParse!: EventEmitter<string>;\n\n /**\n * Emitted when the certificate has been removed.\n */\n @Event() clearCertificate!: EventEmitter<void>;\n\n componentDidLoad() {\n if (this.certificateToDecode) {\n /**\n * Prevent Stencil warning about re-render\n */\n setTimeout(() => this.decode(this.certificateToDecode), 100);\n }\n }\n\n private handleClickDecode = () => {\n const { value } = this.inputPaste;\n\n if (value) {\n this.decode(value);\n }\n };\n\n private handleClickClear = () => {\n this.clearValue();\n };\n\n private handleChangeInputFile = async (event: any) => {\n const element = event.target;\n\n if (element.files) {\n const file = await readAsBinaryString(element.files[0]);\n\n if (typeof file.value === 'string') {\n this.decode(file.value);\n }\n\n element.value = '';\n }\n };\n\n private handleChangeExample = (event: any) => {\n if (event.target.value) {\n this.decode(event.target.value);\n } else {\n this.clearValue();\n }\n };\n\n private handleDropFile = async (event: any) => {\n event.stopPropagation();\n event.preventDefault();\n\n const element = event.dataTransfer;\n\n if (element.files) {\n const file = await readAsBinaryString(element.files[0]);\n\n if (typeof file.value === 'string') {\n this.decode(file.value);\n }\n }\n };\n\n clearValue() {\n this.inputPaste.value = '';\n this.certificateDecoded = null;\n this.clearCertificate.emit();\n }\n\n setValue(value: typeof this.certificateDecoded) {\n this.certificateDecoded = value;\n this.inputPaste.value = value.toString('pem');\n this.successParse.emit(value.toString('base64url'));\n }\n\n decode(value: string) {\n new Promise<X509Certificates>((resolve) => {\n resolve(new X509Certificates(value));\n })\n .catch(() => new X509Certificate(value))\n .catch(() => new X509AttributeCertificate(value))\n .catch(() => new Pkcs10CertificateRequest(value))\n .catch(() => new X509Crl(value))\n .then((res: typeof this.certificateDecoded) => this.setValue(res))\n .catch((error) => {\n console.log(error);\n\n alert(`Error decoding certificate:\\n\"${value}\"\\n\\nPlease try to use Certificate/AttributeCertificate/CertificateRequest/CRL.`);\n });\n }\n\n renderCertificate() {\n if (this.certificateDecoded instanceof X509Certificates) {\n return (\n <peculiar-certificate-chain-viewer\n certificates={this.certificateDecoded}\n download\n />\n );\n }\n\n if (this.certificateDecoded instanceof X509Certificate) {\n return (\n <peculiar-certificate-viewer\n certificate={this.certificateDecoded}\n download\n />\n );\n }\n\n if (this.certificateDecoded instanceof X509AttributeCertificate) {\n return (\n <peculiar-attribute-certificate-viewer\n certificate={this.certificateDecoded}\n download\n />\n );\n }\n\n if (this.certificateDecoded instanceof Pkcs10CertificateRequest) {\n return (\n <peculiar-csr-viewer\n certificate={this.certificateDecoded}\n download\n />\n );\n }\n\n if (this.certificateDecoded instanceof X509Crl) {\n return (\n <peculiar-crl-viewer\n certificate={this.certificateDecoded}\n download\n />\n );\n }\n\n return null;\n }\n\n render() {\n return (\n <Host>\n <textarea\n placeholder=\"Certificate DER or PEM\"\n class=\"textarea t-b2 c-black\"\n ref={(el) => { this.inputPaste = el; }}\n onDrop={this.handleDropFile}\n />\n <div class=\"controls\">\n <div class=\"control_row\">\n <Typography\n variant=\"b3\"\n color=\"secondary-tint-2\"\n >\n Drag or load file:\n </Typography>\n <input\n type=\"file\"\n accept=\"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl\"\n onChange={this.handleChangeInputFile}\n value=\"\"\n />\n </div>\n {this.certificateExamples?.length && (\n <div class=\"control_row\">\n <Typography\n variant=\"b3\"\n color=\"secondary-tint-2\"\n >\n Load examples:\n </Typography>\n <select onChange={this.handleChangeExample}>\n <option value=\"\">None</option>\n {this.certificateExamples.map((example) => (\n <option value={example.value}>\n {example.title}\n </option>\n ))}\n </select>\n </div>\n )}\n <div class=\"control_row\">\n <Button\n onClick={this.handleClickDecode}\n >\n Decode\n </Button>\n <Button\n onClick={this.handleClickClear}\n >\n Clear\n </Button>\n </div>\n </div>\n {this.renderCertificate()}\n </Host>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,e,r,a){function i(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function s(t){try{c(a.next(t))}catch(t){o(t)}}function n(t){try{c(a["throw"](t))}catch(t){o(t)}}function c(t){t.done?r(t.value):i(t.value).then(s,n)}c((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a,i,o,s;return s={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function n(t){return function(e){return c([t,e])}}function c(n){if(a)throw new TypeError("Generator is already executing.");while(s&&(s=0,n[0]&&(r=0)),r)try{if(a=1,i&&(o=n[0]&2?i["return"]:n[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;if(i=0,o)n=[n[0]&2,o.value];switch(n[0]){case 0:case 1:o=n;break;case 4:r.label++;return{value:n[1],done:false};case 5:r.label++;i=n[1];n=[0];continue;case 7:n=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(n[0]===6||n[0]===2)){r=0;continue}if(n[0]===3&&(!o||n[1]>o[0]&&n[1]<o[3])){r.label=n[1];break}if(n[0]===6&&r.label<o[1]){r.label=o[1];o=n;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(n);break}if(o[2])r.ops.pop();r.trys.pop();continue}n=e.call(t,r)}catch(t){n=[6,t];i=0}finally{a=o=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
4
|
-
*/import{r as registerInstance,h,H as Host}from"./index-ae188432.js";import{X as X509Certificate}from"./x509_certificate-05a23c0e.js";import"./certification_request-a4699dcf.js";import{B as BasicInformation,h as SubjectName,I as IssuerName,P as PublicKey,S as Signature,b as Thumbprints,E as Extensions,d as getLEILink,e as getDNSNameLink,f as getIPAddressLink,M as Miscellaneous}from"./miscellaneous-ba1fd2bd.js";import{T as Typography}from"./button-a2fabf9a.js";import"./link-7e4e9060.js";import"./download-14dc1047.js";var certificateViewerCss="*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;position:relative;min-width:280px;min-height:300px;word-wrap:break-word;word-break:break-word}th,td{border:none}table{width:100%;border-spacing:0;border-collapse:collapse}table td{padding:var(--pv-size-base-2) var(--pv-size-base-4);vertical-align:top}table td:first-child{width:220px}table td:last-child{width:calc(100% - 220px)}table td.monospace{max-width:0}table td.divider{padding:var(--pv-size-base-2) 0}table td.divider span{height:1px;display:block;background-color:var(--pv-color-gray-4)}table .title td{padding-top:var(--pv-size-base-6);padding-bottom:var(--pv-size-base-2)}table table{border-left:1px solid var(--pv-color-gray-5)}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table tr.title{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table tr.title td{padding:0 var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table td{padding:0 var(--pv-size-base-4);width:100% !important;max-width:100% !important}:host([data-mobile-screen-view=true]) table td.divider{padding:0}";var PeculiarCertificateViewerStyle0=certificateViewerCss;var CertificateViewer=function(){function t(t){var e=this;registerInstance(this,t);this.getAuthKeyIdParentLink=function(t){var r;return(r=e.authKeyIdParentLink)===null||r===void 0?void 0:r.replace("{{authKeyId}}",t)};this.getAuthKeyIdSiblingsLink=function(t){var r;return(r=e.authKeyIdSiblingsLink)===null||r===void 0?void 0:r.replace("{{authKeyId}}",t)};this.getSubjectKeyIdChildrenLink=function(t){var r;return(r=e.subjectKeyIdChildrenLink)===null||r===void 0?void 0:r.replace("{{subjectKeyId}}",t)};this.getSubjectKeyIdSiblingsLink=function(t){var r;return(r=e.subjectKeyIdSiblingsLink)===null||r===void 0?void 0:r.replace("{{subjectKeyId}}",t)};this.certificate=undefined;this.download=undefined;this.authKeyIdParentLink=undefined;this.authKeyIdSiblingsLink=undefined;this.subjectKeyIdChildrenLink=undefined;this.subjectKeyIdSiblingsLink=undefined;this.issuerDnLink=undefined;this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.isDecodeInProcess=true}t.prototype.handleMediaQueryChange=function(t){this.mobileScreenView=t.matches};t.prototype.componentWillLoad=function(){this.decodeCertificate(this.certificate);{this.mobileMediaQuery=window.matchMedia(this.mobileMediaQueryString);this.mobileMediaQuery.addEventListener("change",this.handleMediaQueryChange.bind(this));this.mobileScreenView=this.mobileMediaQuery.matches}};t.prototype.disconnectedCallback=function(){this.mobileMediaQuery.removeEventListener("change",this.handleMediaQueryChange.bind(this))};t.prototype.decodeCertificate=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:this.isDecodeInProcess=true;r.label=1;case 1:r.trys.push([1,4,,5]);if(t instanceof X509Certificate){this.certificateDecoded=t}else if(typeof t==="string"){this.certificateDecoded=new X509Certificate(t)}else{return[2]}this.certificateDecoded.parseExtensions();return[4,this.certificateDecoded.getThumbprint("SHA-1")];case 2:r.sent();return[4,this.certificateDecoded.getThumbprint("SHA-256")];case 3:r.sent();return[3,5];case 4:e=r.sent();this.certificateDecodeError=e;console.error("Error certificate parse:",e);return[3,5];case 5:this.isDecodeInProcess=false;return[2]}}))}))};t.prototype.watchCertificateAndDecode=function(t,e){if(typeof t==="string"&&typeof e==="string"){if(t!==e){this.decodeCertificate(t)}return}if(t instanceof X509Certificate&&e instanceof X509Certificate){if(t.serialNumber!==e.serialNumber){this.decodeCertificate(t)}}};t.prototype.getIssuerDnLink=function(){return this.issuerDnLink};t.prototype.renderErrorState=function(){return h("div",{class:"status_wrapper"},h(Typography,null,"There was an error decoding this certificate."))};t.prototype.renderEmptyState=function(){return h("div",{class:"status_wrapper"},h(Typography,null,"There is no certificate available."))};t.prototype.render=function(){if(this.certificateDecodeError){return this.renderErrorState()}if(!this.certificateDecoded){return this.renderEmptyState()}return h(Host,{"data-mobile-screen-view":String(this.mobileScreenView)},h("table",null,h(BasicInformation,Object.assign({},this.certificateDecoded)),h(SubjectName,{name:this.certificateDecoded.subject}),h(IssuerName,{name:this.certificateDecoded.issuer,issuerDnLink:this.getIssuerDnLink()}),h(PublicKey,{publicKey:this.certificateDecoded.publicKey}),h(Signature,{signature:this.certificateDecoded.signature}),h(Thumbprints,{thumbprints:this.certificateDecoded.thumbprints}),h(Extensions,{extensions:this.certificateDecoded.extensions,getLEILink:getLEILink,getDNSNameLink:getDNSNameLink,getIPAddressLink:getIPAddressLink,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),this.download&&h(Miscellaneous,{certificate:this.certificateDecoded})))};Object.defineProperty(t,"watchers",{get:function(){return{certificate:["watchCertificateAndDecode"]}},enumerable:false,configurable:true});return t}();CertificateViewer.style=PeculiarCertificateViewerStyle0;export{CertificateViewer as peculiar_certificate_viewer};
|
|
4
|
+
*/import{r as registerInstance,h,H as Host}from"./index-38365508.js";import{X as X509Certificate}from"./x509_certificate-d0d0c5c1.js";import"./certification_request-714bd438.js";import{B as BasicInformation,h as SubjectName,I as IssuerName,P as PublicKey,S as Signature,b as Thumbprints,E as Extensions,d as getLEILink,e as getDNSNameLink,f as getIPAddressLink,M as Miscellaneous}from"./miscellaneous-0657d00e.js";import{T as Typography}from"./button-e0909687.js";import"./link-09718951.js";import"./download-5686d86f.js";var certificateViewerCss="*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;position:relative;min-width:280px;min-height:300px;word-wrap:break-word;word-break:break-word}th,td{border:none}table{width:100%;border-spacing:0;border-collapse:collapse}table td{padding:var(--pv-size-base-2) var(--pv-size-base-4);vertical-align:top}table td:first-child{width:220px}table td:last-child{width:calc(100% - 220px)}table td.monospace{max-width:0}table td.divider{padding:var(--pv-size-base-2) 0}table td.divider span{height:1px;display:block;background-color:var(--pv-color-gray-4)}table .title td{padding-top:var(--pv-size-base-6);padding-bottom:var(--pv-size-base-2)}table table{border-left:1px solid var(--pv-color-gray-5)}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table tr.title{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table tr.title td{padding:0 var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table td{padding:0 var(--pv-size-base-4);width:100% !important;max-width:100% !important}:host([data-mobile-screen-view=true]) table td.divider{padding:0}";var PeculiarCertificateViewerStyle0=certificateViewerCss;var CertificateViewer=function(){function t(t){var e=this;registerInstance(this,t);this.getAuthKeyIdParentLink=function(t){var r;return(r=e.authKeyIdParentLink)===null||r===void 0?void 0:r.replace("{{authKeyId}}",t)};this.getAuthKeyIdSiblingsLink=function(t){var r;return(r=e.authKeyIdSiblingsLink)===null||r===void 0?void 0:r.replace("{{authKeyId}}",t)};this.getSubjectKeyIdChildrenLink=function(t){var r;return(r=e.subjectKeyIdChildrenLink)===null||r===void 0?void 0:r.replace("{{subjectKeyId}}",t)};this.getSubjectKeyIdSiblingsLink=function(t){var r;return(r=e.subjectKeyIdSiblingsLink)===null||r===void 0?void 0:r.replace("{{subjectKeyId}}",t)};this.certificate=undefined;this.download=undefined;this.authKeyIdParentLink=undefined;this.authKeyIdSiblingsLink=undefined;this.subjectKeyIdChildrenLink=undefined;this.subjectKeyIdSiblingsLink=undefined;this.issuerDnLink=undefined;this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.isDecodeInProcess=true}t.prototype.handleMediaQueryChange=function(t){this.mobileScreenView=t.matches};t.prototype.componentWillLoad=function(){this.decodeCertificate(this.certificate);{this.mobileMediaQuery=window.matchMedia(this.mobileMediaQueryString);this.mobileMediaQuery.addEventListener("change",this.handleMediaQueryChange.bind(this));this.mobileScreenView=this.mobileMediaQuery.matches}};t.prototype.disconnectedCallback=function(){this.mobileMediaQuery.removeEventListener("change",this.handleMediaQueryChange.bind(this))};t.prototype.decodeCertificate=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:this.isDecodeInProcess=true;r.label=1;case 1:r.trys.push([1,4,,5]);if(t instanceof X509Certificate){this.certificateDecoded=t}else if(typeof t==="string"){this.certificateDecoded=new X509Certificate(t)}else{return[2]}this.certificateDecoded.parseExtensions();return[4,this.certificateDecoded.getThumbprint("SHA-1")];case 2:r.sent();return[4,this.certificateDecoded.getThumbprint("SHA-256")];case 3:r.sent();return[3,5];case 4:e=r.sent();this.certificateDecodeError=e;console.error("Error certificate parse:",e);return[3,5];case 5:this.isDecodeInProcess=false;return[2]}}))}))};t.prototype.watchCertificateAndDecode=function(t,e){if(typeof t==="string"&&typeof e==="string"){if(t!==e){this.decodeCertificate(t)}return}if(t instanceof X509Certificate&&e instanceof X509Certificate){if(t.serialNumber!==e.serialNumber){this.decodeCertificate(t)}}};t.prototype.getIssuerDnLink=function(){return this.issuerDnLink};t.prototype.renderErrorState=function(){return h("div",{class:"status_wrapper"},h(Typography,null,"There was an error decoding this certificate."))};t.prototype.renderEmptyState=function(){return h("div",{class:"status_wrapper"},h(Typography,null,"There is no certificate available."))};t.prototype.render=function(){if(this.certificateDecodeError){return this.renderErrorState()}if(!this.certificateDecoded){return this.renderEmptyState()}return h(Host,{"data-mobile-screen-view":String(this.mobileScreenView)},h("table",null,h(BasicInformation,Object.assign({},this.certificateDecoded)),h(SubjectName,{name:this.certificateDecoded.subject}),h(IssuerName,{name:this.certificateDecoded.issuer,issuerDnLink:this.getIssuerDnLink()}),h(PublicKey,{publicKey:this.certificateDecoded.publicKey}),h(Signature,{signature:this.certificateDecoded.signature}),h(Thumbprints,{thumbprints:this.certificateDecoded.thumbprints}),h(Extensions,{extensions:this.certificateDecoded.extensions,getLEILink:getLEILink,getDNSNameLink:getDNSNameLink,getIPAddressLink:getIPAddressLink,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),this.download&&h(Miscellaneous,{certificate:this.certificateDecoded})))};Object.defineProperty(t,"watchers",{get:function(){return{certificate:["watchCertificateAndDecode"]}},enumerable:false,configurable:true});return t}();CertificateViewer.style=PeculiarCertificateViewerStyle0;export{CertificateViewer as peculiar_certificate_viewer};
|
|
5
5
|
//# sourceMappingURL=peculiar-certificate-viewer.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["certificateViewerCss","PeculiarCertificateViewerStyle0","CertificateViewer","this","getAuthKeyIdParentLink","value","_a","_this","authKeyIdParentLink","replace","getAuthKeyIdSiblingsLink","authKeyIdSiblingsLink","getSubjectKeyIdChildrenLink","subjectKeyIdChildrenLink","getSubjectKeyIdSiblingsLink","subjectKeyIdSiblingsLink","class_1","prototype","handleMediaQueryChange","event","mobileScreenView","matches","componentWillLoad","decodeCertificate","certificate","mobileMediaQuery","window","matchMedia","mobileMediaQueryString","addEventListener","bind","disconnectedCallback","removeEventListener","isDecodeInProcess","X509Certificate","certificateDecoded","parseExtensions","getThumbprint","_b","sent","certificateDecodeError","error_1","console","error","watchCertificateAndDecode","newValue","oldValue","serialNumber","getIssuerDnLink","issuerDnLink","renderErrorState","h","class","Typography","renderEmptyState","render","Host","String","BasicInformation","Object","assign","SubjectName","name","subject","IssuerName","issuer","PublicKey","publicKey","Signature","signature","Thumbprints","thumbprints","Extensions","extensions","getLEILink","getDNSNameLink","getIPAddressLink","download","Miscellaneous"],"sources":["src/components/certificate-viewer/certificate-viewer.scss?tag=peculiar-certificate-viewer&encapsulation=shadow","src/components/certificate-viewer/certificate-viewer.tsx"],"sourcesContent":["@import '../../css/base.scss';\n\n:host {\n display: block;\n width: 100%;\n position: relative;\n min-width: 280px;\n min-height: 300px;\n word-wrap: break-word;\n word-break: break-word;\n}\n\nth, td {\n border: none;\n}\n\ntable {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n\n td {\n padding: var(--pv-size-base-2) var(--pv-size-base-4);\n vertical-align: top;\n\n &:first-child {\n width: 220px;\n }\n\n &:last-child {\n width: calc(100% - 220px)\n }\n\n &.monospace {\n max-width: 0;\n }\n\n &.divider {\n padding: var(--pv-size-base-2) 0;\n\n span {\n height: 1px;\n display: block;\n background-color: var(--pv-color-gray-4);\n }\n }\n }\n\n .title td {\n padding-top: var(--pv-size-base-6);\n padding-bottom: var(--pv-size-base-2);\n }\n\n table {\n border-left: 1px solid var(--pv-color-gray-5);\n }\n}\n\n.status_wrapper {\n min-height: inherit;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n:host([data-mobile-screen-view=\"true\"]) {\n table, tr, td {\n display: block;\n }\n\n table {\n tr {\n padding: var(--pv-size-base-2) 0;\n\n &.title {\n padding-top: var(--pv-size-base-6);\n\n td {\n padding: 0 var(--pv-size-base-4);\n }\n }\n }\n\n td {\n padding: 0 var(--pv-size-base-4);\n width: 100% !important;\n max-width: 100% !important;\n\n &.divider {\n padding: 0;\n }\n }\n }\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n h,\n Prop,\n State,\n Watch,\n Host,\n Build,\n} from '@stencil/core';\n\nimport {\n X509Certificate,\n} from '../../crypto';\nimport { getDNSNameLink, getIPAddressLink, getLEILink } from '../../utils/third_party_links';\nimport {\n BasicInformation,\n SubjectName,\n IssuerName,\n PublicKey,\n Signature,\n Thumbprints,\n Extensions,\n Miscellaneous,\n} from '../certificate-details-parts';\nimport { Typography } from '../typography';\n\nexport type CertificateProp = string | X509Certificate;\n\n@Component({\n tag: 'peculiar-certificate-viewer',\n styleUrl: 'certificate-viewer.scss',\n shadow: true,\n})\nexport class CertificateViewer {\n private certificateDecoded: X509Certificate;\n\n private certificateDecodeError: Error;\n\n private mobileMediaQuery: MediaQueryList;\n\n /**\n * The certificate value for decode and show details. Use PEM or DER.\n */\n @Prop({ reflect: true }) certificate: CertificateProp;\n\n /**\n * If `true` - component will show split-button to download certificate as PEM or DER.\n */\n @Prop({ reflect: true }) download?: boolean;\n\n /**\n * Authority Key Identifier extension parent link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.subject_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdParentLink?: string;\n\n /**\n * Authority Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdSiblingsLink?: string;\n\n /**\n * Subject Key Identifier extension children link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdChildrenLink?: string;\n\n /**\n * Subject Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://some.com/{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdSiblingsLink?: string;\n\n /**\n * Issuer DN link.\n * **NOTE**: HTML component attribute must be `issuer-dn-link`.\n */\n @Prop({ reflect: true }) issuerDnLink?: string;\n\n /**\n * Mobile media query string to control screen view change.\n * <br />\n * **NOTE**: Based on https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia.\n * @example\n * (max-width: 900px)\n */\n @Prop({ reflect: false }) mobileMediaQueryString?: string = '(max-width: 900px)';\n\n @State() mobileScreenView: boolean = false;\n\n @State() isDecodeInProcess: boolean = true;\n\n private handleMediaQueryChange(event: MediaQueryListEvent) {\n this.mobileScreenView = event.matches;\n }\n\n componentWillLoad() {\n this.decodeCertificate(this.certificate);\n\n if (Build.isBrowser) {\n this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);\n this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));\n this.mobileScreenView = this.mobileMediaQuery.matches;\n }\n }\n\n disconnectedCallback() {\n this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));\n }\n\n private async decodeCertificate(certificate: CertificateProp) {\n this.isDecodeInProcess = true;\n\n try {\n if (certificate instanceof X509Certificate) {\n this.certificateDecoded = certificate;\n } else if (typeof certificate === 'string') {\n this.certificateDecoded = new X509Certificate(certificate);\n } else {\n return;\n }\n\n this.certificateDecoded.parseExtensions();\n await this.certificateDecoded.getThumbprint('SHA-1');\n await this.certificateDecoded.getThumbprint('SHA-256');\n } catch (error) {\n this.certificateDecodeError = error;\n\n console.error('Error certificate parse:', error);\n }\n\n this.isDecodeInProcess = false;\n }\n\n /**\n * Rerun decodeCertificate if previuos value not equal current value\n */\n @Watch('certificate')\n watchCertificateAndDecode(newValue: CertificateProp, oldValue: CertificateProp) {\n if (typeof newValue === 'string' && typeof oldValue === 'string') {\n if (newValue !== oldValue) {\n this.decodeCertificate(newValue);\n }\n\n return;\n }\n\n if (newValue instanceof X509Certificate && oldValue instanceof X509Certificate) {\n if (newValue.serialNumber !== oldValue.serialNumber) {\n this.decodeCertificate(newValue);\n }\n }\n }\n\n private getAuthKeyIdParentLink = (value: string) => this.authKeyIdParentLink\n ?.replace('{{authKeyId}}', value);\n\n private getAuthKeyIdSiblingsLink = (value: string) => this.authKeyIdSiblingsLink\n ?.replace('{{authKeyId}}', value);\n\n private getSubjectKeyIdChildrenLink = (value: string) => this.subjectKeyIdChildrenLink\n ?.replace('{{subjectKeyId}}', value);\n\n private getSubjectKeyIdSiblingsLink = (value: string) => this.subjectKeyIdSiblingsLink\n ?.replace('{{subjectKeyId}}', value);\n\n private getIssuerDnLink() {\n return this.issuerDnLink;\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderErrorState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There was an error decoding this certificate.\n </Typography>\n </div>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderEmptyState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There is no certificate available.\n </Typography>\n </div>\n );\n }\n\n render() {\n if (this.certificateDecodeError) {\n return this.renderErrorState();\n }\n\n if (!this.certificateDecoded) {\n return this.renderEmptyState();\n }\n\n return (\n <Host\n data-mobile-screen-view={String(this.mobileScreenView)}\n >\n <table>\n <BasicInformation\n {...this.certificateDecoded}\n />\n\n <SubjectName\n name={this.certificateDecoded.subject}\n />\n\n <IssuerName\n name={this.certificateDecoded.issuer}\n issuerDnLink={this.getIssuerDnLink()}\n />\n\n <PublicKey\n publicKey={this.certificateDecoded.publicKey}\n />\n\n <Signature\n signature={this.certificateDecoded.signature}\n />\n\n <Thumbprints\n thumbprints={this.certificateDecoded.thumbprints}\n />\n\n <Extensions\n extensions={this.certificateDecoded.extensions}\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n getSubjectKeyIdChildrenLink={this.getSubjectKeyIdChildrenLink}\n getSubjectKeyIdSiblingsLink={this.getSubjectKeyIdSiblingsLink}\n />\n\n {this.download && (\n <Miscellaneous\n certificate={this.certificateDecoded}\n />\n )}\n </table>\n </Host>\n );\n }\n}\n"],"mappings":";;;2gBAAA,IAAMA,qBAAuB,mhSAC7B,IAAAC,gCAAeD,qB,ICwCFE,kBAAiB,W,kDAsIpBC,KAAAC,uBAAyB,SAACC,G,MAAkB,OAAAC,EAAAC,EAAKC,uBAAmB,MAAAF,SAAA,SAAAA,EACxEG,QAAQ,gBAAiBJ,E,EAErBF,KAAAO,yBAA2B,SAACL,G,MAAkB,OAAAC,EAAAC,EAAKI,yBAAqB,MAAAL,SAAA,SAAAA,EAC5EG,QAAQ,gBAAiBJ,E,EAErBF,KAAAS,4BAA8B,SAACP,G,MAAkB,OAAAC,EAAAC,EAAKM,4BAAwB,MAAAP,SAAA,SAAAA,EAClFG,QAAQ,mBAAoBJ,E,EAExBF,KAAAW,4BAA8B,SAACT,G,MAAkB,OAAAC,EAAAC,EAAKQ,4BAAwB,MAAAT,SAAA,SAAAA,EAClFG,QAAQ,mBAAoBJ,E,qQA9E4B,qB,sBAEvB,M,uBAEC,I,CAE9BW,EAAAC,UAAAC,uBAAA,SAAuBC,GAC7BhB,KAAKiB,iBAAmBD,EAAME,O,EAGhCL,EAAAC,UAAAK,kBAAA,WACEnB,KAAKoB,kBAAkBpB,KAAKqB,aAEP,CACnBrB,KAAKsB,iBAAmBC,OAAOC,WAAWxB,KAAKyB,wBAC/CzB,KAAKsB,iBAAiBI,iBAAiB,SAAU1B,KAAKe,uBAAuBY,KAAK3B,OAClFA,KAAKiB,iBAAmBjB,KAAKsB,iBAAiBJ,O,GAIlDL,EAAAC,UAAAc,qBAAA,WACE5B,KAAKsB,iBAAiBO,oBAAoB,SAAU7B,KAAKe,uBAAuBY,KAAK3B,M,EAGzEa,EAAAC,UAAAM,kBAAN,SAAwBC,G,kHAC9BrB,KAAK8B,kBAAoB,K,uCAGvB,GAAIT,aAAuBU,gBAAiB,CAC1C/B,KAAKgC,mBAAqBX,C,MACrB,UAAWA,IAAgB,SAAU,CAC1CrB,KAAKgC,mBAAqB,IAAID,gBAAgBV,E,KACzC,CACL,S,CAGFrB,KAAKgC,mBAAmBC,kBACxB,SAAMjC,KAAKgC,mBAAmBE,cAAc,U,OAA5CC,EAAAC,OACA,SAAMpC,KAAKgC,mBAAmBE,cAAc,Y,OAA5CC,EAAAC,O,8BAEApC,KAAKqC,uBAAyBC,EAE9BC,QAAQC,MAAM,2BAA4BF,G,mBAG5CtC,KAAK8B,kBAAoB,M,kBAO3BjB,EAAAC,UAAA2B,0BAAA,SAA0BC,EAA2BC,GACnD,UAAWD,IAAa,iBAAmBC,IAAa,SAAU,CAChE,GAAID,IAAaC,EAAU,CACzB3C,KAAKoB,kBAAkBsB,E,CAGzB,M,CAGF,GAAIA,aAAoBX,iBAAmBY,aAAoBZ,gBAAiB,CAC9E,GAAIW,EAASE,eAAiBD,EAASC,aAAc,CACnD5C,KAAKoB,kBAAkBsB,E,IAiBrB7B,EAAAC,UAAA+B,gBAAA,WACN,OAAO7C,KAAK8C,Y,EAINjC,EAAAC,UAAAiC,iBAAA,WACN,OACEC,EAAA,OAAKC,MAAM,kBACTD,EAACE,WAAU,sD,EAQTrC,EAAAC,UAAAqC,iBAAA,WACN,OACEH,EAAA,OAAKC,MAAM,kBACTD,EAACE,WAAU,2C,EAOjBrC,EAAAC,UAAAsC,OAAA,WACE,GAAIpD,KAAKqC,uBAAwB,CAC/B,OAAOrC,KAAK+C,kB,CAGd,IAAK/C,KAAKgC,mBAAoB,CAC5B,OAAOhC,KAAKmD,kB,CAGd,OACEH,EAACK,KAAI,2BACsBC,OAAOtD,KAAKiB,mBAErC+B,EAAA,aACEA,EAACO,iBAAgBC,OAAAC,OAAA,GACXzD,KAAKgC,qBAGXgB,EAACU,YAAW,CACVC,KAAM3D,KAAKgC,mBAAmB4B,UAGhCZ,EAACa,WAAU,CACTF,KAAM3D,KAAKgC,mBAAmB8B,OAC9BhB,aAAc9C,KAAK6C,oBAGrBG,EAACe,UAAS,CACRC,UAAWhE,KAAKgC,mBAAmBgC,YAGrChB,EAACiB,UAAS,CACRC,UAAWlE,KAAKgC,mBAAmBkC,YAGrClB,EAACmB,YAAW,CACVC,YAAapE,KAAKgC,mBAAmBoC,cAGvCpB,EAACqB,WAAU,CACTC,WAAYtE,KAAKgC,mBAAmBsC,WACpCC,WAAYA,WACZC,eAAgBA,eAChBC,iBAAkBA,iBAClBxE,uBAAwBD,KAAKC,uBAC7BM,yBAA0BP,KAAKO,yBAC/BE,4BAA6BT,KAAKS,4BAClCE,4BAA6BX,KAAKW,8BAGnCX,KAAK0E,UACJ1B,EAAC2B,cAAa,CACZtD,YAAarB,KAAKgC,sB,sJAhOF,G"}
|
|
1
|
+
{"version":3,"names":["certificateViewerCss","PeculiarCertificateViewerStyle0","CertificateViewer","this","getAuthKeyIdParentLink","value","_a","_this","authKeyIdParentLink","replace","getAuthKeyIdSiblingsLink","authKeyIdSiblingsLink","getSubjectKeyIdChildrenLink","subjectKeyIdChildrenLink","getSubjectKeyIdSiblingsLink","subjectKeyIdSiblingsLink","class_1","prototype","handleMediaQueryChange","event","mobileScreenView","matches","componentWillLoad","decodeCertificate","certificate","mobileMediaQuery","window","matchMedia","mobileMediaQueryString","addEventListener","bind","disconnectedCallback","removeEventListener","isDecodeInProcess","X509Certificate","certificateDecoded","parseExtensions","getThumbprint","_b","sent","certificateDecodeError","error_1","console","error","watchCertificateAndDecode","newValue","oldValue","serialNumber","getIssuerDnLink","issuerDnLink","renderErrorState","h","class","Typography","renderEmptyState","render","Host","String","BasicInformation","Object","assign","SubjectName","name","subject","IssuerName","issuer","PublicKey","publicKey","Signature","signature","Thumbprints","thumbprints","Extensions","extensions","getLEILink","getDNSNameLink","getIPAddressLink","download","Miscellaneous"],"sources":["src/components/certificate-viewer/certificate-viewer.scss?tag=peculiar-certificate-viewer&encapsulation=shadow","src/components/certificate-viewer/certificate-viewer.tsx"],"sourcesContent":["@import '../../css/base.scss';\n\n:host {\n display: block;\n width: 100%;\n position: relative;\n min-width: 280px;\n min-height: 300px;\n word-wrap: break-word;\n word-break: break-word;\n}\n\nth, td {\n border: none;\n}\n\ntable {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n\n td {\n padding: var(--pv-size-base-2) var(--pv-size-base-4);\n vertical-align: top;\n\n &:first-child {\n width: 220px;\n }\n\n &:last-child {\n width: calc(100% - 220px)\n }\n\n &.monospace {\n max-width: 0;\n }\n\n &.divider {\n padding: var(--pv-size-base-2) 0;\n\n span {\n height: 1px;\n display: block;\n background-color: var(--pv-color-gray-4);\n }\n }\n }\n\n .title td {\n padding-top: var(--pv-size-base-6);\n padding-bottom: var(--pv-size-base-2);\n }\n\n table {\n border-left: 1px solid var(--pv-color-gray-5);\n }\n}\n\n.status_wrapper {\n min-height: inherit;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n:host([data-mobile-screen-view=\"true\"]) {\n table, tr, td {\n display: block;\n }\n\n table {\n tr {\n padding: var(--pv-size-base-2) 0;\n\n &.title {\n padding-top: var(--pv-size-base-6);\n\n td {\n padding: 0 var(--pv-size-base-4);\n }\n }\n }\n\n td {\n padding: 0 var(--pv-size-base-4);\n width: 100% !important;\n max-width: 100% !important;\n\n &.divider {\n padding: 0;\n }\n }\n }\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n h,\n Prop,\n State,\n Watch,\n Host,\n Build,\n} from '@stencil/core';\n\nimport {\n X509Certificate,\n} from '../../crypto';\nimport { getDNSNameLink, getIPAddressLink, getLEILink } from '../../utils/third_party_links';\nimport {\n BasicInformation,\n SubjectName,\n IssuerName,\n PublicKey,\n Signature,\n Thumbprints,\n Extensions,\n Miscellaneous,\n} from '../certificate-details-parts';\nimport { Typography } from '../typography';\n\nexport type CertificateProp = string | X509Certificate;\n\n@Component({\n tag: 'peculiar-certificate-viewer',\n styleUrl: 'certificate-viewer.scss',\n shadow: true,\n})\nexport class CertificateViewer {\n private certificateDecoded: X509Certificate;\n\n private certificateDecodeError: Error;\n\n private mobileMediaQuery: MediaQueryList;\n\n /**\n * The certificate value for decode and show details. Use PEM or DER.\n */\n @Prop({ reflect: true }) certificate: CertificateProp;\n\n /**\n * If `true` - component will show split-button to download certificate as PEM or DER.\n */\n @Prop({ reflect: true }) download?: boolean;\n\n /**\n * Authority Key Identifier extension parent link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.subject_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdParentLink?: string;\n\n /**\n * Authority Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdSiblingsLink?: string;\n\n /**\n * Subject Key Identifier extension children link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdChildrenLink?: string;\n\n /**\n * Subject Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://some.com/{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdSiblingsLink?: string;\n\n /**\n * Issuer DN link.\n * **NOTE**: HTML component attribute must be `issuer-dn-link`.\n */\n @Prop({ reflect: true }) issuerDnLink?: string;\n\n /**\n * Mobile media query string to control screen view change.\n * <br />\n * **NOTE**: Based on https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia.\n * @example\n * (max-width: 900px)\n */\n @Prop({ reflect: false }) mobileMediaQueryString?: string = '(max-width: 900px)';\n\n @State() mobileScreenView: boolean = false;\n\n @State() isDecodeInProcess: boolean = true;\n\n private handleMediaQueryChange(event: MediaQueryListEvent) {\n this.mobileScreenView = event.matches;\n }\n\n componentWillLoad() {\n this.decodeCertificate(this.certificate);\n\n if (Build.isBrowser) {\n this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);\n this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));\n this.mobileScreenView = this.mobileMediaQuery.matches;\n }\n }\n\n disconnectedCallback() {\n this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));\n }\n\n private async decodeCertificate(certificate: CertificateProp) {\n this.isDecodeInProcess = true;\n\n try {\n if (certificate instanceof X509Certificate) {\n this.certificateDecoded = certificate;\n } else if (typeof certificate === 'string') {\n this.certificateDecoded = new X509Certificate(certificate);\n } else {\n return;\n }\n\n this.certificateDecoded.parseExtensions();\n await this.certificateDecoded.getThumbprint('SHA-1');\n await this.certificateDecoded.getThumbprint('SHA-256');\n } catch (error) {\n this.certificateDecodeError = error;\n\n console.error('Error certificate parse:', error);\n }\n\n this.isDecodeInProcess = false;\n }\n\n /**\n * Rerun decodeCertificate if previuos value not equal current value\n */\n @Watch('certificate')\n watchCertificateAndDecode(newValue: CertificateProp, oldValue: CertificateProp) {\n if (typeof newValue === 'string' && typeof oldValue === 'string') {\n if (newValue !== oldValue) {\n this.decodeCertificate(newValue);\n }\n\n return;\n }\n\n if (newValue instanceof X509Certificate && oldValue instanceof X509Certificate) {\n if (newValue.serialNumber !== oldValue.serialNumber) {\n this.decodeCertificate(newValue);\n }\n }\n }\n\n private getAuthKeyIdParentLink = (value: string) => this.authKeyIdParentLink\n ?.replace('{{authKeyId}}', value);\n\n private getAuthKeyIdSiblingsLink = (value: string) => this.authKeyIdSiblingsLink\n ?.replace('{{authKeyId}}', value);\n\n private getSubjectKeyIdChildrenLink = (value: string) => this.subjectKeyIdChildrenLink\n ?.replace('{{subjectKeyId}}', value);\n\n private getSubjectKeyIdSiblingsLink = (value: string) => this.subjectKeyIdSiblingsLink\n ?.replace('{{subjectKeyId}}', value);\n\n private getIssuerDnLink() {\n return this.issuerDnLink;\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderErrorState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There was an error decoding this certificate.\n </Typography>\n </div>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderEmptyState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There is no certificate available.\n </Typography>\n </div>\n );\n }\n\n render() {\n if (this.certificateDecodeError) {\n return this.renderErrorState();\n }\n\n if (!this.certificateDecoded) {\n return this.renderEmptyState();\n }\n\n return (\n <Host\n data-mobile-screen-view={String(this.mobileScreenView)}\n >\n <table>\n <BasicInformation\n {...this.certificateDecoded}\n />\n\n <SubjectName\n name={this.certificateDecoded.subject}\n />\n\n <IssuerName\n name={this.certificateDecoded.issuer}\n issuerDnLink={this.getIssuerDnLink()}\n />\n\n <PublicKey\n publicKey={this.certificateDecoded.publicKey}\n />\n\n <Signature\n signature={this.certificateDecoded.signature}\n />\n\n <Thumbprints\n thumbprints={this.certificateDecoded.thumbprints}\n />\n\n <Extensions\n extensions={this.certificateDecoded.extensions}\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n getSubjectKeyIdChildrenLink={this.getSubjectKeyIdChildrenLink}\n getSubjectKeyIdSiblingsLink={this.getSubjectKeyIdSiblingsLink}\n />\n\n {this.download && (\n <Miscellaneous\n certificate={this.certificateDecoded}\n />\n )}\n </table>\n </Host>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,e,r,a){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function n(t){try{c(a.next(t))}catch(t){i(t)}}function s(t){try{c(a["throw"](t))}catch(t){i(t)}}function c(t){t.done?r(t.value):o(t.value).then(n,s)}c((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,o,i,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(t){return function(e){return c([t,e])}}function c(s){if(a)throw new TypeError("Generator is already executing.");while(n&&(n=0,s[0]&&(r=0)),r)try{if(a=1,o&&(i=s[0]&2?o["return"]:s[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;if(o=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;o=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t];o=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var a=0,o=e.length,i;a<o;a++){if(i||!(a in e)){if(!i)i=Array.prototype.slice.call(e,0,a);i[a]=e[a]}}return t.concat(i||Array.prototype.slice.call(e))};
|
|
2
2
|
/*!
|
|
3
3
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
4
|
-
*/import{h,r as registerInstance,c as createEvent,H as Host}from"./index-
|
|
4
|
+
*/import{h,r as registerInstance,c as createEvent,H as Host}from"./index-38365508.js";import{X as X509Certificate}from"./x509_certificate-d0d0c5c1.js";import{a2 as l10n,a3 as dateShort,a4 as OIDs}from"./certification_request-714bd438.js";import{T as Typography,B as Button}from"./button-e0909687.js";import{D as DetailsIcon,L as LinkIcon,C as CrossIcon}from"./cross-0c62835f.js";import{D as DownloadIcon}from"./download-5686d86f.js";import{a as ArrowTopIcon,A as ArrowBottomIcon}from"./arrow_top-72c7543a.js";
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/var CertificateSummary=function(t){var e=t.certificate,r=t.showIssuer;var a=function(t,e){return h("tr",null,h("td",null,h(Typography,{variant:"b2",color:"gray-9"},t)),h("td",null,h(Typography,{variant:"b2",color:"black"},e)))};return h("table",null,h("tbody",null,a(l10n.getString("subjectName"),e.subjectToString()),r&&a(l10n.getString("issuerName"),e.issuerToString()),a(l10n.getString("serialNumber"),e.serialNumber),a(l10n.getString("version"),e.version),a(l10n.getString("validity"),e.validity),a(l10n.getString("issued"),dateShort(e.notBefore)),a(l10n.getString("expired"),dateShort(e.notAfter))))};var certificatesViewerCss="*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;word-wrap:break-word;min-width:280px;overflow:auto;position:relative}.search_section{padding:var(--pv-size-base-4);border-bottom:1px solid var(--pv-color-gray-4)}.input_search{height:var(--pv-size-base-8);width:100%;outline:none;background-color:var(--pv-color-gray-1);padding:0 var(--pv-size-base-2);border:1px solid var(--pv-color-gray-7);border-radius:4px;-webkit-transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s;transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s}.input_search::-webkit-input-placeholder{color:var(--pv-color-gray-9)}.input_search::-moz-placeholder{color:var(--pv-color-gray-9)}.input_search:-ms-input-placeholder{color:var(--pv-color-gray-9)}.input_search::-ms-input-placeholder{color:var(--pv-color-gray-9)}.input_search::placeholder{color:var(--pv-color-gray-9)}table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}table td,table th{border-bottom:1px solid var(--pv-color-gray-4);vertical-align:top;text-align:left}table td:first-child,table th:first-child{padding-right:0;width:var(--pv-size-base-10)}table td:last-child,table th:last-child{padding-left:0;width:var(--pv-size-base-10)}table th{padding:var(--pv-size-base-2) var(--pv-size-base-4)}table th.col_action{padding:0}table td{padding:var(--pv-size-base-4)}table tr.m_expanded{background:var(--pv-color-gray-1)}table tr.m_expanded>td{border-bottom:none}table tr.expanded_summary{background:var(--pv-color-gray-1)}table tr.expanded_summary table{table-layout:initial}table tr.expanded_summary table td{border-bottom:none;padding:var(--pv-size-base-2)}table tr.expanded_summary table td:first-child{width:200px}table tr.expanded_summary table td:last-child{width:auto}.button_table_cell{margin-top:-3px}.status_wrapper{text-align:center;height:var(--pv-size-base-16);vertical-align:middle}.modal_wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;-webkit-animation:fadeIn 200ms;animation:fadeIn 200ms;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.modal_backdrop{background:var(--pv-color-black);z-index:-1;position:fixed;top:0;right:0;bottom:0;left:0;opacity:0.5}.modal_container{background:var(--pv-color-white);width:100%;display:-ms-flexbox;display:flex;max-height:calc(100% - 60px);-ms-flex-direction:column;flex-direction:column;margin:var(--pv-size-base-6);position:relative;outline:none;-webkit-box-shadow:var(--pv-shadow-dark-hight);box-shadow:var(--pv-shadow-dark-hight);overflow:hidden;border:0px;padding:0px;max-width:640px;border-radius:4px}.modal_header{padding:var(--pv-size-base-3) var(--pv-size-base-4);display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;gap:var(--pv-size-base-2);border-bottom:1px solid var(--pv-color-gray-5)}.modal_content{-ms-flex:1 1 auto;flex:1 1 auto;overflow:auto}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tbody,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block;width:100% !important;padding:0;border:none}:host([data-mobile-screen-view=true]) thead{display:none}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table .expanded_summary{padding:0}:host([data-mobile-screen-view=true]) table .certificate_row{border-bottom:1px solid var(--pv-color-gray-5);padding:var(--pv-size-base-2) var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table .certificate_row_actions{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table .certificate_row_actions td{display:-ms-flexbox;display:flex;-ms-flex-pack:right;justify-content:right;gap:var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) .button_table_cell{margin-top:0}";var PeculiarCertificatesViewerStyle0=certificatesViewerCss;var CertificatesViewer=function(){function t(t){var e=this;registerInstance(this,t);this.detailsOpen=createEvent(this,"detailsOpen",7);this.detailsClose=createEvent(this,"detailsClose",7);this.isHasRoots=false;this.handleClickDetails=function(t){e.certificateSelectedForDetails=t;e.detailsOpen.emit(t)};this.handleModalClose=function(){e.certificateSelectedForDetails=undefined;e.detailsClose.emit()};this.handleSearch=function(t){e.search=t.target.value.trim()};this.certificates=[];this.filterWithSearch=true;this.highlightWithSearch=true;this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.search="";this.certificatesDecoded=[];this.expandedRow=undefined;this.certificateSelectedForDetails=undefined;this.isDecodeInProcess=true}t.prototype.handleMediaQueryChange=function(t){this.mobileScreenView=t.matches};t.prototype.componentWillLoad=function(){this.certificatesDecodeAndSet();{this.mobileMediaQuery=window.matchMedia(this.mobileMediaQueryString);this.mobileMediaQuery.addEventListener("change",this.handleMediaQueryChange.bind(this));this.mobileScreenView=this.mobileMediaQuery.matches}};t.prototype.disconnectedCallback=function(){this.mobileMediaQuery.removeEventListener("change",this.handleMediaQueryChange.bind(this))};t.prototype.watchCertificates=function(t,e){if(JSON.stringify(t)!==JSON.stringify(e)){this.certificatesDecodeAndSet()}};t.prototype.certificatesDecodeAndSet=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,a,o,i,n;return __generator(this,(function(s){switch(s.label){case 0:t=false;if(!Array.isArray(this.certificates)){return[2]}e=[];r=0,a=this.certificates;s.label=1;case 1:if(!(r<a.length))return[3,6];o=a[r];s.label=2;case 2:s.trys.push([2,4,,5]);i=new X509Certificate(o.value);return[4,i.getThumbprint("SHA-1")];case 3:s.sent();e.push({body:i,tests:o.tests,name:o.name});if(!t&&i.isRoot){t=true}return[3,5];case 4:n=s.sent();console.error("Error certificate parse:",n);return[3,5];case 5:r++;return[3,1];case 6:this.isHasRoots=t;this.isDecodeInProcess=false;this.certificatesDecoded=e;return[2]}}))}))};t.prototype.handleClickDownloadAsPem=function(t){t.body.downloadAsPEM(t.name||t.body.commonName)};t.prototype.handleClickDownloadAsDer=function(t){t.body.downloadAsDER(t.name||t.body.commonName)};t.prototype.handleClickRow=function(t){var e=this.expandedRow===t;this.expandedRow=e?undefined:t};t.prototype.getMaxColSpanValue=function(){var t=5;if(!this.isHasRoots){t+=1}return t};t.prototype.renderCertificateButtonActions=function(t){var e=this;var r,a,o;var i=t.tests&&(t.tests.expired||t.tests.revoked||t.tests.valid);return h("peculiar-button-menu",{class:"button_table_cell",groups:__spreadArray([{title:l10n.getString("previewCertificate"),options:[{text:l10n.getString("viewDetails"),startIcon:h(DetailsIcon,null),onClick:function(){return e.handleClickDetails(t.body)}}]},{title:l10n.getString("downloadOptions"),options:[{text:l10n.getString("download.pem"),startIcon:h(DownloadIcon,null),onClick:function(){return e.handleClickDownloadAsPem(t)}},{text:l10n.getString("download.der"),startIcon:h(DownloadIcon,null),onClick:function(){return e.handleClickDownloadAsDer(t)}}]}],i?[{title:l10n.getString("testURLs"),options:__spreadArray(__spreadArray(__spreadArray([],((r=t.tests)===null||r===void 0?void 0:r.valid)?[{text:l10n.getString("valid"),href:t.tests.valid,startIcon:h(LinkIcon,null)}]:[],true),((a=t.tests)===null||a===void 0?void 0:a.revoked)?[{text:l10n.getString("revoked"),href:t.tests.revoked,startIcon:h(LinkIcon,null)}]:[],true),((o=t.tests)===null||o===void 0?void 0:o.expired)?[{text:l10n.getString("expired"),href:t.tests.expired,startIcon:h(LinkIcon,null)}]:[],true)}]:[],true)})};t.prototype.renderExpandedRow=function(t){var e=this.getMaxColSpanValue()-2;return h("tr",{class:"expanded_summary"},h("td",null),h("td",{colSpan:e},h(CertificateSummary,{certificate:t,showIssuer:!t.isRoot})),h("td",null))};t.prototype.renderCertificatesRows=function(){var t=this;var e=this.highlightWithSearch?this.search:"";var r=[];this.certificatesDecoded.forEach((function(a,o){var i=o===t.expandedRow;var n=OIDs[a.body.signature.algorithm]||a.body.signature.algorithm;if(t.filterWithSearch&&t.search){var s=[n,a.body.issuerCommonName,a.name,a.body.commonName,a.body.thumbprints["SHA-1"]].join(" ").toLowerCase();if(s.indexOf(t.search.toLowerCase())===-1){return}}if(t.mobileScreenView){r.push([h("tr",{class:{certificate_row:true,m_expanded:i},key:a.body.thumbprints["SHA-1"]},h("td",null,h("table",null,h("tbody",null,!t.isHasRoots&&h("tr",null,h("td",null,h(Typography,{variant:"b2",color:"gray-9"},l10n.getString("issuer"))),h("td",null,h(Typography,{variant:"b2",color:"black"},h("peculiar-highlight-words",{search:e},a.body.issuerCommonName)))),h("tr",null,h("td",null,h(Typography,{variant:"b2",color:"gray-9"},l10n.getString("name"))),h("td",null,h(Typography,{variant:"b2",color:"black"},h("peculiar-highlight-words",{search:e},a.name||a.body.commonName)))),h("tr",null,h("td",null,h(Typography,{variant:"b2",color:"gray-9"},l10n.getString("publicKey"))),h("td",null,h(Typography,{variant:"b2",color:"black"},h("peculiar-highlight-words",{search:e},n)))),h("tr",null,h("td",null,h(Typography,{variant:"b2",color:"gray-9"},l10n.getString("fingerprint")," (SHA-1)")),h("td",null,h(Typography,{variant:"b2",color:"black"},h("peculiar-highlight-words",{search:e},a.body.thumbprints["SHA-1"])))),i&&t.renderExpandedRow(a.body),h("tr",{class:"certificate_row_actions"},h("td",null,t.renderCertificateButtonActions(a),h(Button,{onClick:t.handleClickRow.bind(t,o),startIcon:i?h(ArrowTopIcon,null):h(ArrowBottomIcon,null)})))))))]);return}r.push([h("tr",{class:{m_expanded:i},key:a.body.thumbprints["SHA-1"]},h("td",null,h(Button,{class:"button_table_cell",onClick:t.handleClickRow.bind(t,o),startIcon:i?h(ArrowTopIcon,null):h(ArrowBottomIcon,null)})),!t.isHasRoots&&h("td",null,h(Typography,null,h("peculiar-highlight-words",{search:e},a.body.issuerCommonName))),h("td",null,h(Typography,null,h("peculiar-highlight-words",{search:e},a.name||a.body.commonName))),h("td",null,h(Typography,null,h("peculiar-highlight-words",{search:e},n))),h("td",null,h(Typography,null,h("peculiar-highlight-words",{search:e},a.body.thumbprints["SHA-1"]))),h("td",null,t.renderCertificateButtonActions(a))),i&&t.renderExpandedRow(a.body)])}));return r};t.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_header"},h(Typography,{variant:"h4"},l10n.getString("certificateDetails")),h(Button,{onClick:this.handleModalClose,startIcon:h(CrossIcon,null)})),h("div",{class:"modal_content"},h("peculiar-certificate-viewer",{certificate:this.certificateSelectedForDetails,mobileMediaQueryString:this.mobileMediaQueryString}))))};t.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 t-b3 c-black",disabled:!this.certificatesDecoded.length,placeholder:"Search"}))};t.prototype.renderEmptyState=function(){var t=this.getMaxColSpanValue();return h("tr",null,h("td",{class:"status_wrapper",colSpan:t},h(Typography,{variant:"b1"},"There are no certificates available.")))};t.prototype.renderEmptySearchState=function(){var t=this.getMaxColSpanValue();return h("tr",null,h("td",{class:"status_wrapper",colSpan:t},h(Typography,{variant:"b1"},"No results found for “",this.search,"“")))};t.prototype.renderLoadingState=function(){return h("div",{class:"loading_container"},h("peculiar-circular-progress",null))};t.prototype.renderTableBody=function(){if(this.isDecodeInProcess){return null}if(!this.certificatesDecoded.length){return this.renderEmptyState()}var t=this.renderCertificatesRows();if(this.search&&!t.length){return this.renderEmptySearchState()}return t};t.prototype.render=function(){return h(Host,{key:"e10ac3070a3cb75cb9a281a999fec42ef28d593d","data-mobile-screen-view":String(this.mobileScreenView)},this.renderSearch(),h("table",{key:"abc765a09c9537c36500143c6caffa688910483e"},!this.mobileScreenView&&h("thead",null,h("tr",null,h("th",null),!this.isHasRoots&&h("th",{class:"col_issuer"},h(Typography,{variant:"s2"},l10n.getString("issuer"))),h("th",{class:"col_name"},h(Typography,{variant:"s2"},l10n.getString("name"))),h("th",{class:"col_public_key"},h(Typography,{variant:"s2"},l10n.getString("publicKey"))),h("th",{class:"col_fingerprint"},h(Typography,{variant:"s2"},l10n.getString("fingerprint")," (SHA-1)")),h("th",null))),h("tbody",{key:"e61dfb14836909b154cdbc359c8f04bef5a42df0"},this.renderTableBody())),this.renderCertificateDetailsModal(),this.isDecodeInProcess&&this.renderLoadingState())};Object.defineProperty(t,"watchers",{get:function(){return{certificates:["watchCertificates"]}},enumerable:false,configurable:true});return t}();CertificatesViewer.style=PeculiarCertificatesViewerStyle0;export{CertificatesViewer as peculiar_certificates_viewer};
|
|
11
|
+
*/var CertificateSummary=function(t){var e=t.certificate,r=t.showIssuer;var a=function(t,e){return h("tr",null,h("td",null,h(Typography,{variant:"b2",color:"gray-9"},t)),h("td",null,h(Typography,{variant:"b2",color:"black"},e)))};return h("table",null,h("tbody",null,a(l10n.getString("subjectName"),e.subjectToString()),r&&a(l10n.getString("issuerName"),e.issuerToString()),a(l10n.getString("serialNumber"),e.serialNumber),a(l10n.getString("version"),e.version),a(l10n.getString("validity"),e.validity),a(l10n.getString("issued"),dateShort(e.notBefore)),a(l10n.getString("expired"),dateShort(e.notAfter))))};var certificatesViewerCss="*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;word-wrap:break-word;min-width:280px;overflow:auto;position:relative}.search_section{padding:var(--pv-size-base-4);border-bottom:1px solid var(--pv-color-gray-4)}.input_search{height:var(--pv-size-base-8);width:100%;outline:none;background-color:var(--pv-color-gray-1);padding:0 var(--pv-size-base-2);border:1px solid var(--pv-color-gray-7);border-radius:4px;-webkit-transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s;transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s}.input_search::-webkit-input-placeholder{color:var(--pv-color-gray-9)}.input_search::-moz-placeholder{color:var(--pv-color-gray-9)}.input_search:-ms-input-placeholder{color:var(--pv-color-gray-9)}.input_search::-ms-input-placeholder{color:var(--pv-color-gray-9)}.input_search::placeholder{color:var(--pv-color-gray-9)}table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}table td,table th{border-bottom:1px solid var(--pv-color-gray-4);vertical-align:top;text-align:left}table td:first-child,table th:first-child{padding-right:0;width:var(--pv-size-base-10)}table td:last-child,table th:last-child{padding-left:0;width:var(--pv-size-base-10)}table th{padding:var(--pv-size-base-2) var(--pv-size-base-4)}table th.col_action{padding:0}table td{padding:var(--pv-size-base-4)}table tr.m_expanded{background:var(--pv-color-gray-1)}table tr.m_expanded>td{border-bottom:none}table tr.expanded_summary{background:var(--pv-color-gray-1)}table tr.expanded_summary table{table-layout:initial}table tr.expanded_summary table td{border-bottom:none;padding:var(--pv-size-base-2)}table tr.expanded_summary table td:first-child{width:200px}table tr.expanded_summary table td:last-child{width:auto}.button_table_cell{margin-top:-3px}.status_wrapper{text-align:center;height:var(--pv-size-base-16);vertical-align:middle}.modal_wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;-webkit-animation:fadeIn 200ms;animation:fadeIn 200ms;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.modal_backdrop{background:var(--pv-color-black);z-index:-1;position:fixed;top:0;right:0;bottom:0;left:0;opacity:0.5}.modal_container{background:var(--pv-color-white);width:100%;display:-ms-flexbox;display:flex;max-height:calc(100% - 60px);-ms-flex-direction:column;flex-direction:column;margin:var(--pv-size-base-6);position:relative;outline:none;-webkit-box-shadow:var(--pv-shadow-dark-hight);box-shadow:var(--pv-shadow-dark-hight);overflow:hidden;border:0px;padding:0px;max-width:640px;border-radius:4px}.modal_header{padding:var(--pv-size-base-3) var(--pv-size-base-4);display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;gap:var(--pv-size-base-2);border-bottom:1px solid var(--pv-color-gray-5)}.modal_content{-ms-flex:1 1 auto;flex:1 1 auto;overflow:auto}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tbody,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block;width:100% !important;padding:0;border:none}:host([data-mobile-screen-view=true]) thead{display:none}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table .expanded_summary{padding:0}:host([data-mobile-screen-view=true]) table .certificate_row{border-bottom:1px solid var(--pv-color-gray-5);padding:var(--pv-size-base-2) var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table .certificate_row_actions{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table .certificate_row_actions td{display:-ms-flexbox;display:flex;-ms-flex-pack:right;justify-content:right;gap:var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) .button_table_cell{margin-top:0}";var PeculiarCertificatesViewerStyle0=certificatesViewerCss;var CertificatesViewer=function(){function t(t){var e=this;registerInstance(this,t);this.detailsOpen=createEvent(this,"detailsOpen",7);this.detailsClose=createEvent(this,"detailsClose",7);this.isHasRoots=false;this.handleClickDetails=function(t){e.certificateSelectedForDetails=t;e.detailsOpen.emit(t)};this.handleModalClose=function(){e.certificateSelectedForDetails=undefined;e.detailsClose.emit()};this.handleSearch=function(t){e.search=t.target.value.trim()};this.certificates=[];this.filterWithSearch=true;this.highlightWithSearch=true;this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.search="";this.certificatesDecoded=[];this.expandedRow=undefined;this.certificateSelectedForDetails=undefined;this.isDecodeInProcess=true}t.prototype.handleMediaQueryChange=function(t){this.mobileScreenView=t.matches};t.prototype.componentWillLoad=function(){this.certificatesDecodeAndSet();{this.mobileMediaQuery=window.matchMedia(this.mobileMediaQueryString);this.mobileMediaQuery.addEventListener("change",this.handleMediaQueryChange.bind(this));this.mobileScreenView=this.mobileMediaQuery.matches}};t.prototype.disconnectedCallback=function(){this.mobileMediaQuery.removeEventListener("change",this.handleMediaQueryChange.bind(this))};t.prototype.watchCertificates=function(t,e){if(JSON.stringify(t)!==JSON.stringify(e)){this.certificatesDecodeAndSet()}};t.prototype.certificatesDecodeAndSet=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,a,o,i,n;return __generator(this,(function(s){switch(s.label){case 0:t=false;if(!Array.isArray(this.certificates)){return[2]}e=[];r=0,a=this.certificates;s.label=1;case 1:if(!(r<a.length))return[3,6];o=a[r];s.label=2;case 2:s.trys.push([2,4,,5]);i=new X509Certificate(o.value);return[4,i.getThumbprint("SHA-1")];case 3:s.sent();e.push({body:i,tests:o.tests,name:o.name});if(!t&&i.isRoot){t=true}return[3,5];case 4:n=s.sent();console.error("Error certificate parse:",n);return[3,5];case 5:r++;return[3,1];case 6:this.isHasRoots=t;this.isDecodeInProcess=false;this.certificatesDecoded=e;return[2]}}))}))};t.prototype.handleClickDownloadAsPem=function(t){t.body.downloadAsPEM(t.name||t.body.commonName)};t.prototype.handleClickDownloadAsDer=function(t){t.body.downloadAsDER(t.name||t.body.commonName)};t.prototype.handleClickRow=function(t){var e=this.expandedRow===t;this.expandedRow=e?undefined:t};t.prototype.getMaxColSpanValue=function(){var t=5;if(!this.isHasRoots){t+=1}return t};t.prototype.renderCertificateButtonActions=function(t){var e=this;var r,a,o;var i=t.tests&&(t.tests.expired||t.tests.revoked||t.tests.valid);return h("peculiar-button-menu",{class:"button_table_cell",groups:__spreadArray([{title:l10n.getString("previewCertificate"),options:[{text:l10n.getString("viewDetails"),startIcon:h(DetailsIcon,null),onClick:function(){return e.handleClickDetails(t.body)}}]},{title:l10n.getString("downloadOptions"),options:[{text:l10n.getString("download.pem"),startIcon:h(DownloadIcon,null),onClick:function(){return e.handleClickDownloadAsPem(t)}},{text:l10n.getString("download.der"),startIcon:h(DownloadIcon,null),onClick:function(){return e.handleClickDownloadAsDer(t)}}]}],i?[{title:l10n.getString("testURLs"),options:__spreadArray(__spreadArray(__spreadArray([],((r=t.tests)===null||r===void 0?void 0:r.valid)?[{text:l10n.getString("valid"),href:t.tests.valid,startIcon:h(LinkIcon,null)}]:[],true),((a=t.tests)===null||a===void 0?void 0:a.revoked)?[{text:l10n.getString("revoked"),href:t.tests.revoked,startIcon:h(LinkIcon,null)}]:[],true),((o=t.tests)===null||o===void 0?void 0:o.expired)?[{text:l10n.getString("expired"),href:t.tests.expired,startIcon:h(LinkIcon,null)}]:[],true)}]:[],true)})};t.prototype.renderExpandedRow=function(t){var e=this.getMaxColSpanValue()-2;return h("tr",{class:"expanded_summary"},h("td",null),h("td",{colSpan:e},h(CertificateSummary,{certificate:t,showIssuer:!t.isRoot})),h("td",null))};t.prototype.renderCertificatesRows=function(){var t=this;var e=this.highlightWithSearch?this.search:"";var r=[];this.certificatesDecoded.forEach((function(a,o){var i=o===t.expandedRow;var n=OIDs[a.body.signature.algorithm]||a.body.signature.algorithm;if(t.filterWithSearch&&t.search){var s=[n,a.body.issuerCommonName,a.name,a.body.commonName,a.body.thumbprints["SHA-1"]].join(" ").toLowerCase();if(s.indexOf(t.search.toLowerCase())===-1){return}}if(t.mobileScreenView){r.push([h("tr",{class:{certificate_row:true,m_expanded:i},key:a.body.thumbprints["SHA-1"]},h("td",null,h("table",null,h("tbody",null,!t.isHasRoots&&h("tr",null,h("td",null,h(Typography,{variant:"b2",color:"gray-9"},l10n.getString("issuer"))),h("td",null,h(Typography,{variant:"b2",color:"black"},h("peculiar-highlight-words",{search:e},a.body.issuerCommonName)))),h("tr",null,h("td",null,h(Typography,{variant:"b2",color:"gray-9"},l10n.getString("name"))),h("td",null,h(Typography,{variant:"b2",color:"black"},h("peculiar-highlight-words",{search:e},a.name||a.body.commonName)))),h("tr",null,h("td",null,h(Typography,{variant:"b2",color:"gray-9"},l10n.getString("publicKey"))),h("td",null,h(Typography,{variant:"b2",color:"black"},h("peculiar-highlight-words",{search:e},n)))),h("tr",null,h("td",null,h(Typography,{variant:"b2",color:"gray-9"},l10n.getString("fingerprint")," (SHA-1)")),h("td",null,h(Typography,{variant:"b2",color:"black"},h("peculiar-highlight-words",{search:e},a.body.thumbprints["SHA-1"])))),i&&t.renderExpandedRow(a.body),h("tr",{class:"certificate_row_actions"},h("td",null,t.renderCertificateButtonActions(a),h(Button,{onClick:t.handleClickRow.bind(t,o),startIcon:i?h(ArrowTopIcon,null):h(ArrowBottomIcon,null)})))))))]);return}r.push([h("tr",{class:{m_expanded:i},key:a.body.thumbprints["SHA-1"]},h("td",null,h(Button,{class:"button_table_cell",onClick:t.handleClickRow.bind(t,o),startIcon:i?h(ArrowTopIcon,null):h(ArrowBottomIcon,null)})),!t.isHasRoots&&h("td",null,h(Typography,null,h("peculiar-highlight-words",{search:e},a.body.issuerCommonName))),h("td",null,h(Typography,null,h("peculiar-highlight-words",{search:e},a.name||a.body.commonName))),h("td",null,h(Typography,null,h("peculiar-highlight-words",{search:e},n))),h("td",null,h(Typography,null,h("peculiar-highlight-words",{search:e},a.body.thumbprints["SHA-1"]))),h("td",null,t.renderCertificateButtonActions(a))),i&&t.renderExpandedRow(a.body)])}));return r};t.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_header"},h(Typography,{variant:"h4"},l10n.getString("certificateDetails")),h(Button,{onClick:this.handleModalClose,startIcon:h(CrossIcon,null)})),h("div",{class:"modal_content"},h("peculiar-certificate-viewer",{certificate:this.certificateSelectedForDetails,mobileMediaQueryString:this.mobileMediaQueryString}))))};t.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 t-b3 c-black",disabled:!this.certificatesDecoded.length,placeholder:"Search"}))};t.prototype.renderEmptyState=function(){var t=this.getMaxColSpanValue();return h("tr",null,h("td",{class:"status_wrapper",colSpan:t},h(Typography,{variant:"b1"},"There are no certificates available.")))};t.prototype.renderEmptySearchState=function(){var t=this.getMaxColSpanValue();return h("tr",null,h("td",{class:"status_wrapper",colSpan:t},h(Typography,{variant:"b1"},"No results found for “",this.search,"“")))};t.prototype.renderLoadingState=function(){return h("div",{class:"loading_container"},h("peculiar-circular-progress",null))};t.prototype.renderTableBody=function(){if(this.isDecodeInProcess){return null}if(!this.certificatesDecoded.length){return this.renderEmptyState()}var t=this.renderCertificatesRows();if(this.search&&!t.length){return this.renderEmptySearchState()}return t};t.prototype.render=function(){return h(Host,{key:"e10ac3070a3cb75cb9a281a999fec42ef28d593d","data-mobile-screen-view":String(this.mobileScreenView)},this.renderSearch(),h("table",{key:"abc765a09c9537c36500143c6caffa688910483e"},!this.mobileScreenView&&h("thead",{key:"c948fc3f9929deda81bfe9f1205b5c6f6032d256"},h("tr",{key:"7deae387a944910a82588698b61d55c0ba64ff55"},h("th",{key:"70927a2c00545a1c500e4312ed30022dc24df23a"}),!this.isHasRoots&&h("th",{key:"af4811bbd78a46f4ab1e96d9a2f3251e59d5d773",class:"col_issuer"},h(Typography,{key:"11064fc9659acfb8856ad96aba1192972b27e0e3",variant:"s2"},l10n.getString("issuer"))),h("th",{key:"7898e55528b973f8dddebff2e86763fc4f0ad013",class:"col_name"},h(Typography,{key:"e5bae939345bce44423efaaee774678a163d51a6",variant:"s2"},l10n.getString("name"))),h("th",{key:"83128f3a2812996df534b95690d6268bf0f096ec",class:"col_public_key"},h(Typography,{key:"05e7f862d2336e2144ddd9438bb2636625abed36",variant:"s2"},l10n.getString("publicKey"))),h("th",{key:"1387d00b085a524bd97d96e68e07f3e82ee57796",class:"col_fingerprint"},h(Typography,{key:"393eac698d27bb9a17a2ae5cec18a0658f510f78",variant:"s2"},l10n.getString("fingerprint")," (SHA-1)")),h("th",{key:"ffdba17371ff65a6df244edefe55bb81a9e821c8"}))),h("tbody",{key:"8e44c28a8d4bc64fe76c73d67054df3dcef7a7c1"},this.renderTableBody())),this.renderCertificateDetailsModal(),this.isDecodeInProcess&&this.renderLoadingState())};Object.defineProperty(t,"watchers",{get:function(){return{certificates:["watchCertificates"]}},enumerable:false,configurable:true});return t}();CertificatesViewer.style=PeculiarCertificatesViewerStyle0;export{CertificatesViewer as peculiar_certificates_viewer};
|
|
12
12
|
//# sourceMappingURL=peculiar-certificates-viewer.entry.js.map
|