@peculiar/certificates-viewer 4.5.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/actions.js.map +1 -1
- package/components/arrow_top.js.map +1 -1
- package/components/attribute-certificate-viewer.js +2 -4
- package/components/attribute-certificate-viewer.js.map +1 -1
- package/components/attribute.js.map +1 -1
- package/components/button-menu.js +1 -3
- package/components/button-menu.js.map +1 -1
- package/components/button.js +2 -2
- package/components/button.js.map +1 -1
- package/components/certificate-chain-viewer.js +0 -1
- package/components/certificate-chain-viewer.js.map +1 -1
- package/components/certificate-viewer.js +3 -8
- package/components/certificate-viewer.js.map +1 -1
- package/components/circular-progress.js +2 -6
- package/components/circular-progress.js.map +1 -1
- package/components/crl-viewer.js +0 -2
- package/components/crl-viewer.js.map +1 -1
- package/components/cross.js.map +1 -1
- package/components/csr-viewer.js +0 -4
- package/components/csr-viewer.js.map +1 -1
- package/components/download.js +32 -19
- package/components/download.js.map +1 -1
- package/components/highlight-words.js +1 -1
- package/components/highlight-words.js.map +1 -1
- package/components/index2.js +2 -1
- package/components/index2.js.map +1 -1
- package/components/issuer_name.js +3 -1
- package/components/issuer_name.js.map +1 -1
- package/components/miscellaneous.js +15 -16
- package/components/miscellaneous.js.map +1 -1
- package/components/peculiar-certificate-decoder.js +7 -8
- package/components/peculiar-certificate-decoder.js.map +1 -1
- package/components/peculiar-certificates-viewer.js +44 -43
- package/components/peculiar-certificates-viewer.js.map +1 -1
- package/components/peculiar-text-hider.js +1 -1
- package/components/peculiar-text-hider.js.map +1 -1
- package/components/pkcs10_certificate_request.js.map +1 -1
- package/components/read_file.js.map +1 -1
- package/components/subject_name.js.map +1 -1
- package/dist/cjs/actions-Dl4HXXlI.js.map +1 -1
- package/dist/cjs/arrow_top-DBMPHVlB.js.map +1 -1
- package/dist/cjs/{button-C5jDF-CZ.js → button-B0CduHSE.js} +4 -4
- package/dist/cjs/button-B0CduHSE.js.map +1 -0
- package/dist/cjs/{certification_request-DS5FED4F.js → certification_request-DaJSDP3R.js} +33 -20
- package/dist/cjs/certification_request-DaJSDP3R.js.map +1 -0
- package/dist/cjs/cross-pi7K0cHC.js.map +1 -1
- package/dist/cjs/download-D9skkVoT.js.map +1 -1
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/{link-CwLq-Nge.js → link-kgbgxxVh.js} +4 -4
- package/dist/cjs/link-kgbgxxVh.js.map +1 -0
- package/dist/cjs/{miscellaneous-UxtK1SWb.js → miscellaneous-Ce9aGjKB.js} +23 -22
- package/dist/cjs/miscellaneous-Ce9aGjKB.js.map +1 -0
- package/dist/cjs/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.cjs.js.map +1 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer_4.cjs.entry.js +8 -16
- package/dist/cjs/peculiar-attribute-certificate-viewer_4.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-button-menu.peculiar-circular-progress.peculiar-highlight-words.entry.cjs.js.map +1 -1
- package/dist/cjs/peculiar-button-menu_3.cjs.entry.js +5 -11
- package/dist/cjs/peculiar-button-menu_3.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +12 -13
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-decoder.entry.cjs.js.map +1 -1
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +5 -7
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-viewer.entry.cjs.js.map +1 -1
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +47 -46
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificates-viewer.entry.cjs.js.map +1 -1
- package/dist/cjs/peculiar-text-hider.cjs.entry.js +2 -2
- package/dist/cjs/peculiar-text-hider.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-text-hider.entry.cjs.js.map +1 -1
- package/dist/cjs/{pkcs10_certificate_request-DaWYvR0i.js → pkcs10_certificate_request-D13Ssi7Z.js} +3 -3
- package/dist/cjs/pkcs10_certificate_request-D13Ssi7Z.js.map +1 -0
- package/dist/cjs/read_file-DWtcn3zU.js.map +1 -1
- package/dist/cjs/{x509_certificate-DBpSGIUT.js → x509_certificate-h5GZArG6.js} +6 -9
- package/dist/cjs/x509_certificate-h5GZArG6.js.map +1 -0
- package/dist/cjs/{x509_crl-BBnJqOIF.js → x509_crl-CDPt6P1z.js} +6 -6
- package/dist/cjs/x509_crl-CDPt6P1z.js.map +1 -0
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +4 -6
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js.map +1 -1
- package/dist/collection/components/button/button.js +3 -3
- package/dist/collection/components/button/button.js.map +1 -1
- package/dist/collection/components/button/index.js.map +1 -1
- package/dist/collection/components/button-menu/button-menu.js +5 -7
- package/dist/collection/components/button-menu/button-menu.js.map +1 -1
- package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js +1 -2
- package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js.map +1 -1
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +4 -1
- package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/activity_description_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/as_string_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/basic_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/challenge_password_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/index.js +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/index.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/insurance_value_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/name_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/name_part.js +1 -0
- package/dist/collection/components/certificate-details-parts/attributes/name_part.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/type_relationship_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/unstructured_name_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/valuation_ranking_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/web_gdpr_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/basic_information.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/archive_rev_info_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/as_string_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/authority_key_identifier_extension.js +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/authority_key_identifier_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/basic_constraints_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/basic_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/biometric_syntax_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/ca_version_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/cabforganization_identifier_extension.js +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/cabforganization_identifier_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/certificate_policies_extension.js +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/certificate_policies_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/certificate_template_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/crl_distribution_points_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/crl_number_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/crl_reason_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/enroll_cert_type_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/entrust_version_info_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/extended_key_usage_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/general_name_part.js +3 -3
- package/dist/collection/components/certificate-details-parts/extensions/general_name_part.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/index.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/index.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/info_access_syntax_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/issuing_distribution_point_extension.js +0 -1
- package/dist/collection/components/certificate-details-parts/extensions/issuing_distribution_point_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/key_description_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/key_description_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/key_usage_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/lei_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/lei_role_extennsion.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/logotype_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/name_constraints_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/netscape_cert_type_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/netscape_comment_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/policy_constraints_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/policy_mappings_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/private_key_usage_period_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/subject_alternative_name_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/subject_directory_attributes_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/subject_key_identifier_extension.js +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/subject_key_identifier_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/timestamp_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/tn_auth_list_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/holder.js +1 -1
- package/dist/collection/components/certificate-details-parts/holder.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/issuer.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/issuer_name.js +3 -1
- package/dist/collection/components/certificate-details-parts/issuer_name.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/miscellaneous.js +2 -2
- package/dist/collection/components/certificate-details-parts/miscellaneous.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/public_key.js +1 -1
- package/dist/collection/components/certificate-details-parts/public_key.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/revoked_certificates.js +3 -3
- package/dist/collection/components/certificate-details-parts/revoked_certificates.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/row.js +3 -3
- package/dist/collection/components/certificate-details-parts/row.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/signature.js +1 -1
- package/dist/collection/components/certificate-details-parts/signature.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/subject_name.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/thumbprints.js.map +1 -1
- package/dist/collection/components/certificate-summary/certificate-summary.js.map +1 -1
- package/dist/collection/components/certificate-viewer/certificate-viewer.js +5 -7
- package/dist/collection/components/certificate-viewer/certificate-viewer.js.map +1 -1
- package/dist/collection/components/certificates-viewer/certificates-viewer.js +44 -43
- package/dist/collection/components/certificates-viewer/certificates-viewer.js.map +1 -1
- package/dist/collection/components/circular-progress/circular-progress.js +2 -6
- package/dist/collection/components/circular-progress/circular-progress.js.map +1 -1
- package/dist/collection/components/crl-viewer/crl-viewer.js +4 -6
- package/dist/collection/components/crl-viewer/crl-viewer.js.map +1 -1
- package/dist/collection/components/csr-viewer/csr-viewer.js +4 -8
- package/dist/collection/components/csr-viewer/csr-viewer.js.map +1 -1
- package/dist/collection/components/highlight-words/highlight-words.js +1 -1
- package/dist/collection/components/highlight-words/highlight-words.js.map +1 -1
- package/dist/collection/components/icons/actions.js.map +1 -1
- package/dist/collection/components/icons/arrow_bottom.js.map +1 -1
- package/dist/collection/components/icons/arrow_top.js.map +1 -1
- package/dist/collection/components/icons/cross.js.map +1 -1
- package/dist/collection/components/icons/details.js.map +1 -1
- package/dist/collection/components/icons/download.js.map +1 -1
- package/dist/collection/components/icons/link.js.map +1 -1
- package/dist/collection/components/link/link.js +1 -1
- package/dist/collection/components/link/link.js.map +1 -1
- package/dist/collection/components/text-hider/text-hider.js +1 -1
- package/dist/collection/components/text-hider/text-hider.js.map +1 -1
- package/dist/collection/components/typography/typography.js.map +1 -1
- package/dist/collection/constants/oids.js +5 -0
- package/dist/collection/constants/oids.js.map +1 -1
- package/dist/collection/crypto/asn_data.js +1 -1
- package/dist/collection/crypto/asn_data.js.map +1 -1
- package/dist/collection/crypto/attribute.js.map +1 -1
- package/dist/collection/crypto/extension.js.map +1 -1
- package/dist/collection/crypto/name.js.map +1 -1
- package/dist/collection/crypto/pem_converter.js +13 -8
- package/dist/collection/crypto/pem_converter.js.map +1 -1
- package/dist/collection/crypto/pkcs10_certificate_request.js.map +1 -1
- package/dist/collection/crypto/provider.js +7 -3
- package/dist/collection/crypto/provider.js.map +1 -1
- package/dist/collection/crypto/utils.js.map +1 -1
- package/dist/collection/crypto/x509_attribute_certificate.js +2 -2
- package/dist/collection/crypto/x509_attribute_certificate.js.map +1 -1
- package/dist/collection/crypto/x509_certificate.js +3 -6
- package/dist/collection/crypto/x509_certificate.js.map +1 -1
- package/dist/collection/crypto/x509_certificates.js +3 -7
- package/dist/collection/crypto/x509_certificates.js.map +1 -1
- package/dist/collection/crypto/x509_crl.js.map +1 -1
- package/dist/collection/utils/download.js +1 -0
- package/dist/collection/utils/download.js.map +1 -1
- package/dist/collection/utils/download_from_buffer.js +3 -3
- package/dist/collection/utils/download_from_buffer.js.map +1 -1
- package/dist/collection/utils/l10n.js +1 -3
- package/dist/collection/utils/l10n.js.map +1 -1
- package/dist/collection/utils/read_file.js.map +1 -1
- package/dist/esm/actions-DzoPRObK.js.map +1 -1
- package/dist/esm/arrow_top-CF9pv-tQ.js.map +1 -1
- package/dist/esm/{button-Djn8UI82.js → button-Do0R_8PZ.js} +4 -4
- package/dist/esm/button-Do0R_8PZ.js.map +1 -0
- package/dist/esm/{certification_request-Wtz6WM17.js → certification_request-DazysL_f.js} +33 -20
- package/dist/esm/certification_request-DazysL_f.js.map +1 -0
- package/dist/esm/cross-DdCuR1F2.js.map +1 -1
- package/dist/esm/download-Cqfc-Sxf.js.map +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/{link-BfDk078v.js → link-qg3yKAoS.js} +4 -4
- package/dist/esm/link-qg3yKAoS.js.map +1 -0
- package/dist/esm/{miscellaneous-CsGuJ6zr.js → miscellaneous-BJPX0Hs_.js} +23 -22
- package/dist/esm/miscellaneous-BJPX0Hs_.js.map +1 -0
- package/dist/esm/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.js.map +1 -1
- package/dist/esm/peculiar-attribute-certificate-viewer_4.entry.js +8 -16
- package/dist/esm/peculiar-attribute-certificate-viewer_4.entry.js.map +1 -1
- package/dist/esm/peculiar-button-menu.peculiar-circular-progress.peculiar-highlight-words.entry.js.map +1 -1
- package/dist/esm/peculiar-button-menu_3.entry.js +5 -11
- package/dist/esm/peculiar-button-menu_3.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-decoder.entry.js +12 -13
- package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-viewer.entry.js +5 -7
- package/dist/esm/peculiar-certificate-viewer.entry.js.map +1 -1
- package/dist/esm/peculiar-certificates-viewer.entry.js +47 -46
- package/dist/esm/peculiar-certificates-viewer.entry.js.map +1 -1
- package/dist/esm/peculiar-text-hider.entry.js +2 -2
- package/dist/esm/peculiar-text-hider.entry.js.map +1 -1
- package/dist/esm/{pkcs10_certificate_request-Cn7_Z7a1.js → pkcs10_certificate_request-SQcYKma2.js} +3 -3
- package/dist/esm/pkcs10_certificate_request-SQcYKma2.js.map +1 -0
- package/dist/esm/read_file-F2F0McJX.js.map +1 -1
- package/dist/esm/{x509_certificate-ObET7_Te.js → x509_certificate-Dmgw53TR.js} +6 -9
- package/dist/esm/x509_certificate-Dmgw53TR.js.map +1 -0
- package/dist/esm/{x509_crl-CeW7yzP9.js → x509_crl-B5TRu79b.js} +6 -6
- package/dist/esm/x509_crl-B5TRu79b.js.map +1 -0
- package/dist/esm-es5/actions-DzoPRObK.js.map +1 -1
- package/dist/esm-es5/arrow_top-CF9pv-tQ.js.map +1 -1
- package/dist/esm-es5/{button-Djn8UI82.js → button-Do0R_8PZ.js} +2 -2
- package/dist/esm-es5/button-Do0R_8PZ.js.map +1 -0
- package/dist/esm-es5/{certification_request-Wtz6WM17.js → certification_request-DazysL_f.js} +15 -15
- package/dist/esm-es5/certification_request-DazysL_f.js.map +1 -0
- package/dist/esm-es5/cross-DdCuR1F2.js.map +1 -1
- package/dist/esm-es5/download-Cqfc-Sxf.js.map +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{link-BfDk078v.js → link-qg3yKAoS.js} +3 -3
- package/dist/esm-es5/link-qg3yKAoS.js.map +1 -0
- package/dist/esm-es5/{miscellaneous-CsGuJ6zr.js → miscellaneous-BJPX0Hs_.js} +3 -3
- package/dist/esm-es5/miscellaneous-BJPX0Hs_.js.map +1 -0
- package/dist/esm-es5/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_4.entry.js +1 -1
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_4.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-button-menu.peculiar-circular-progress.peculiar-highlight-words.entry.js.map +1 -1
- 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 +1 -1
- 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/{pkcs10_certificate_request-Cn7_Z7a1.js → pkcs10_certificate_request-SQcYKma2.js} +2 -2
- package/dist/esm-es5/pkcs10_certificate_request-SQcYKma2.js.map +1 -0
- package/dist/esm-es5/read_file-F2F0McJX.js.map +1 -1
- package/dist/esm-es5/{x509_certificate-ObET7_Te.js → x509_certificate-Dmgw53TR.js} +3 -3
- package/dist/esm-es5/x509_certificate-Dmgw53TR.js.map +1 -0
- package/dist/esm-es5/{x509_crl-CeW7yzP9.js → x509_crl-B5TRu79b.js} +4 -4
- package/dist/esm-es5/x509_crl-B5TRu79b.js.map +1 -0
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/p--Pej0I-A.system.js.map +1 -0
- package/dist/peculiar/{p-t-yLLnfF.js → p-0HZUc9Ix.js} +3 -3
- package/dist/peculiar/p-0HZUc9Ix.js.map +1 -0
- package/dist/peculiar/p-15c2b820.entry.js +5 -0
- package/dist/peculiar/{p-f4490197.entry.js.map → p-15c2b820.entry.js.map} +1 -1
- package/dist/peculiar/{p-5b829829.system.entry.js → p-16aa5600.system.entry.js} +2 -2
- package/dist/peculiar/p-16aa5600.system.entry.js.map +1 -0
- package/dist/peculiar/{p-3e4062f6.entry.js → p-1cbb0d6b.entry.js} +16 -16
- package/dist/peculiar/p-1cbb0d6b.entry.js.map +1 -0
- package/dist/peculiar/{p-7a3bf94e.entry.js → p-218364f2.entry.js} +2 -2
- package/dist/peculiar/p-218364f2.entry.js.map +1 -0
- package/dist/peculiar/{p-B3myni_G.js → p-3zhoLQno.js} +4 -4
- package/dist/peculiar/p-3zhoLQno.js.map +1 -0
- package/dist/peculiar/{p-63aa01ad.system.entry.js → p-44648a8e.system.entry.js} +3 -3
- package/dist/peculiar/p-44648a8e.system.entry.js.map +1 -0
- package/dist/peculiar/{p-5608ba3e.system.entry.js → p-52444a44.system.entry.js} +2 -2
- package/dist/peculiar/p-52444a44.system.entry.js.map +1 -0
- package/dist/peculiar/{p-69b461b4.entry.js → p-5b843427.entry.js} +3 -3
- package/dist/peculiar/p-5b843427.entry.js.map +1 -0
- package/dist/peculiar/{p-12d2e080.entry.js → p-7b0e7f43.entry.js} +2 -2
- package/dist/peculiar/p-7b0e7f43.entry.js.map +1 -0
- package/dist/peculiar/p-B2YrZuK2.system.js.map +1 -1
- package/dist/peculiar/p-BA8os2l6.system.js.map +1 -0
- package/dist/peculiar/p-BAB4EyrL.system.js.map +1 -0
- package/dist/peculiar/{p-DPre0WhP.system.js → p-BBZwtkNN.system.js} +4 -4
- package/dist/peculiar/p-BBZwtkNN.system.js.map +1 -0
- package/dist/peculiar/p-BBgwMHRZ.system.js.map +1 -1
- package/dist/peculiar/p-BHBizfwo.js.map +1 -1
- package/dist/peculiar/{p-CKoxwzVA.system.js → p-BKKflyKt.system.js} +5 -5
- package/dist/peculiar/p-BKKflyKt.system.js.map +1 -0
- package/dist/peculiar/p-BOSH9vjy.system.js.map +1 -1
- package/dist/peculiar/p-BP2bmYR2.system.js.map +1 -1
- package/dist/peculiar/p-BcFnjn1R.system.js.map +1 -0
- package/dist/peculiar/{p-uFLk5hDd.system.js → p-BmIps4bV.system.js} +18 -18
- package/dist/peculiar/p-BmIps4bV.system.js.map +1 -0
- package/dist/peculiar/{p-DgcB4Nqx.system.js → p-CDh6shXP.system.js} +9 -9
- package/dist/peculiar/p-CDh6shXP.system.js.map +1 -0
- package/dist/peculiar/{p-BisXzAqN.js → p-CEHpBNWe.js} +3 -3
- package/dist/peculiar/p-CEHpBNWe.js.map +1 -0
- package/dist/peculiar/{p-CttQwkXH.js → p-CJro0Exb.js} +10 -10
- package/dist/peculiar/p-CJro0Exb.js.map +1 -0
- package/dist/peculiar/p-CWs-Ocvt.system.js.map +1 -0
- package/dist/peculiar/p-CeKqQ13Z.js.map +1 -1
- package/dist/peculiar/{p-BCATfe_H.js → p-CkwiD_ia.js} +2 -2
- package/dist/peculiar/p-CkwiD_ia.js.map +1 -0
- package/dist/peculiar/{p-BRhx1gbw.system.js → p-Cm-ylIxb.system.js} +2 -2
- package/dist/peculiar/p-Cm-ylIxb.system.js.map +1 -0
- package/dist/peculiar/p-D2QB-8Q6.system.js.map +1 -1
- package/dist/peculiar/p-D5BWI7FK.system.js +1 -1
- package/dist/peculiar/p-DJRm54BZ.system.js.map +1 -0
- package/dist/peculiar/{p-L1KL0R34.system.js → p-DRoyzOgk.system.js} +3 -3
- package/dist/peculiar/p-DRoyzOgk.system.js.map +1 -0
- package/dist/peculiar/{p-Wtz6WM17.js → p-DazysL_f.js} +4 -4
- package/dist/peculiar/p-DazysL_f.js.map +1 -0
- package/dist/peculiar/p-DhdG07f8.js.map +1 -1
- package/dist/peculiar/p-DkAhB3Vy.js.map +1 -1
- package/dist/peculiar/{p-lNFxlG5A.js → p-DzItK48Y.js} +4 -4
- package/dist/peculiar/p-DzItK48Y.js.map +1 -0
- package/dist/peculiar/p-F2F0McJX.js.map +1 -1
- package/dist/peculiar/{p-CcANm2qm.system.js → p-YHrZ3f_s.system.js} +2 -2
- package/dist/peculiar/p-YHrZ3f_s.system.js.map +1 -0
- package/dist/peculiar/p-a3c0f753.system.entry.js +5 -0
- package/dist/peculiar/{p-cae95996.system.entry.js.map → p-a3c0f753.system.entry.js.map} +1 -1
- package/dist/peculiar/{p-0e8ab957.entry.js → p-ab6a8a44.entry.js} +2 -2
- package/dist/peculiar/p-ab6a8a44.entry.js.map +1 -0
- package/dist/peculiar/{p-1af57833.system.entry.js → p-d16ddef8.system.entry.js} +2 -2
- package/dist/peculiar/p-d16ddef8.system.entry.js.map +1 -0
- package/dist/peculiar/{p-bafc3336.system.entry.js → p-d9013293.system.entry.js} +16 -16
- package/dist/peculiar/p-d9013293.system.entry.js.map +1 -0
- package/dist/peculiar/{p-B859JpGw.system.js → p-wYK0iVYg.system.js} +2 -2
- package/dist/peculiar/p-wYK0iVYg.system.js.map +1 -0
- package/dist/peculiar/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.esm.js.map +1 -1
- package/dist/peculiar/peculiar-button-menu.peculiar-circular-progress.peculiar-highlight-words.entry.esm.js.map +1 -1
- package/dist/peculiar/peculiar-certificate-decoder.entry.esm.js.map +1 -1
- package/dist/peculiar/peculiar-certificate-viewer.entry.esm.js.map +1 -1
- package/dist/peculiar/peculiar-certificates-viewer.entry.esm.js.map +1 -1
- package/dist/peculiar/peculiar-text-hider.entry.esm.js.map +1 -1
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/types/components/attribute-certificate-viewer/attribute-certificate-viewer.d.ts +3 -3
- package/dist/types/components/button/button.d.ts +2 -2
- package/dist/types/components/button/index.d.ts +1 -1
- package/dist/types/components/button-menu/button-menu.d.ts +5 -5
- package/dist/types/components/certificate-details-parts/miscellaneous.d.ts +2 -2
- package/dist/types/components/certificate-summary/certificate-summary.d.ts +2 -2
- package/dist/types/components/certificate-viewer/certificate-viewer.d.ts +3 -3
- package/dist/types/components/certificates-viewer/certificates-viewer.d.ts +3 -2
- package/dist/types/components/crl-viewer/crl-viewer.d.ts +3 -3
- package/dist/types/components/csr-viewer/csr-viewer.d.ts +3 -3
- package/dist/types/components/icons/actions.d.ts +2 -2
- package/dist/types/components/icons/arrow_bottom.d.ts +2 -2
- package/dist/types/components/icons/arrow_top.d.ts +2 -2
- package/dist/types/components/icons/cross.d.ts +2 -2
- package/dist/types/components/icons/details.d.ts +2 -2
- package/dist/types/components/icons/download.d.ts +2 -2
- package/dist/types/components/icons/link.d.ts +2 -2
- package/dist/types/components/link/link.d.ts +4 -4
- package/dist/types/components/typography/typography.d.ts +5 -5
- package/dist/types/components.d.ts +20 -20
- package/dist/types/constants/oids.d.ts +5 -0
- package/dist/types/crypto/asn_data.d.ts +1 -3
- package/dist/types/crypto/pem_converter.d.ts +7 -19
- package/dist/types/crypto/provider.d.ts +1 -6
- package/dist/types/interface.d.ts +3 -3
- package/dist/types/utils/l10n.d.ts +6 -6
- package/dist/types/utils/read_file.d.ts +7 -7
- package/hydrate/index.js +115 -120
- package/hydrate/index.mjs +115 -120
- package/package.json +2 -2
- package/dist/cjs/button-C5jDF-CZ.js.map +0 -1
- package/dist/cjs/certification_request-DS5FED4F.js.map +0 -1
- package/dist/cjs/link-CwLq-Nge.js.map +0 -1
- package/dist/cjs/miscellaneous-UxtK1SWb.js.map +0 -1
- package/dist/cjs/pkcs10_certificate_request-DaWYvR0i.js.map +0 -1
- package/dist/cjs/x509_certificate-DBpSGIUT.js.map +0 -1
- package/dist/cjs/x509_crl-BBnJqOIF.js.map +0 -1
- package/dist/esm/button-Djn8UI82.js.map +0 -1
- package/dist/esm/certification_request-Wtz6WM17.js.map +0 -1
- package/dist/esm/link-BfDk078v.js.map +0 -1
- package/dist/esm/miscellaneous-CsGuJ6zr.js.map +0 -1
- package/dist/esm/pkcs10_certificate_request-Cn7_Z7a1.js.map +0 -1
- package/dist/esm/x509_certificate-ObET7_Te.js.map +0 -1
- package/dist/esm/x509_crl-CeW7yzP9.js.map +0 -1
- package/dist/esm-es5/button-Djn8UI82.js.map +0 -1
- package/dist/esm-es5/certification_request-Wtz6WM17.js.map +0 -1
- package/dist/esm-es5/link-BfDk078v.js.map +0 -1
- package/dist/esm-es5/miscellaneous-CsGuJ6zr.js.map +0 -1
- package/dist/esm-es5/pkcs10_certificate_request-Cn7_Z7a1.js.map +0 -1
- package/dist/esm-es5/x509_certificate-ObET7_Te.js.map +0 -1
- package/dist/esm-es5/x509_crl-CeW7yzP9.js.map +0 -1
- package/dist/peculiar/p-0e8ab957.entry.js.map +0 -1
- package/dist/peculiar/p-12d2e080.entry.js.map +0 -1
- package/dist/peculiar/p-1af57833.system.entry.js.map +0 -1
- package/dist/peculiar/p-3e4062f6.entry.js.map +0 -1
- package/dist/peculiar/p-5608ba3e.system.entry.js.map +0 -1
- package/dist/peculiar/p-5b829829.system.entry.js.map +0 -1
- package/dist/peculiar/p-63aa01ad.system.entry.js.map +0 -1
- package/dist/peculiar/p-69b461b4.entry.js.map +0 -1
- package/dist/peculiar/p-7Nmqck4T.system.js.map +0 -1
- package/dist/peculiar/p-7a3bf94e.entry.js.map +0 -1
- package/dist/peculiar/p-B3myni_G.js.map +0 -1
- package/dist/peculiar/p-B859JpGw.system.js.map +0 -1
- package/dist/peculiar/p-BCATfe_H.js.map +0 -1
- package/dist/peculiar/p-BRhx1gbw.system.js.map +0 -1
- package/dist/peculiar/p-BX9qW3ww.system.js.map +0 -1
- package/dist/peculiar/p-BisXzAqN.js.map +0 -1
- package/dist/peculiar/p-CFhlbr47.system.js.map +0 -1
- package/dist/peculiar/p-CKoxwzVA.system.js.map +0 -1
- package/dist/peculiar/p-C_vT-OYk.system.js.map +0 -1
- package/dist/peculiar/p-CcANm2qm.system.js.map +0 -1
- package/dist/peculiar/p-CttQwkXH.js.map +0 -1
- package/dist/peculiar/p-DPre0WhP.system.js.map +0 -1
- package/dist/peculiar/p-DX5B2Msh.system.js.map +0 -1
- package/dist/peculiar/p-DgcB4Nqx.system.js.map +0 -1
- package/dist/peculiar/p-Dk86_qlM.system.js.map +0 -1
- package/dist/peculiar/p-L1KL0R34.system.js.map +0 -1
- package/dist/peculiar/p-Wtz6WM17.js.map +0 -1
- package/dist/peculiar/p-bafc3336.system.entry.js.map +0 -1
- package/dist/peculiar/p-cae95996.system.entry.js +0 -5
- package/dist/peculiar/p-f4490197.entry.js +0 -5
- package/dist/peculiar/p-lNFxlG5A.js.map +0 -1
- package/dist/peculiar/p-t-yLLnfF.js.map +0 -1
- package/dist/peculiar/p-uFLk5hDd.system.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
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-DDDrq3In.js";import{a as readAsBinaryString}from"./read_file-F2F0McJX.js";import{P as PemConverter,b as buildExports,$ as SignedData,a0 as EncapsulatedContent,a1 as OctetString,a2 as CertificateSet,a3 as CertificateChoices,e as AsnConvert,C as Certificate,a4 as ContentInfo,D as Download}from"./certification_request-Wtz6WM17.js";import{X as X509Certificate}from"./x509_certificate-ObET7_Te.js";import{X as X509AttributeCertificate,a as X509Crl}from"./x509_crl-CeW7yzP9.js";import{P as Pkcs10CertificateRequest}from"./pkcs10_certificate_request-Cn7_Z7a1.js";import{T as Typography,B as Button}from"./button-Djn8UI82.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 buildExports.Convert.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 CertificateDecoder=function(){function t(t){var e=this;registerInstance(this,t);this.successParse=createEvent(this,"successParse");this.clearCertificate=createEvent(this,"clearCertificate");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]}}))}))}}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=certificateDecoderCss;export{CertificateDecoder as peculiar_certificate_decoder};
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,h,H as Host}from"./index-DDDrq3In.js";import{a as readAsBinaryString}from"./read_file-F2F0McJX.js";import{P as PemConverter,b as buildExports,$ as SignedData,a0 as EncapsulatedContent,a1 as OctetString,a2 as CertificateSet,a3 as CertificateChoices,e as AsnConvert,C as Certificate,a4 as ContentInfo,D as Download}from"./certification_request-DazysL_f.js";import{X as X509Certificate}from"./x509_certificate-Dmgw53TR.js";import{X as X509AttributeCertificate,a as X509Crl}from"./x509_crl-B5TRu79b.js";import{P as Pkcs10CertificateRequest}from"./pkcs10_certificate_request-SQcYKma2.js";import{T as Typography,B as Button}from"./button-Do0R_8PZ.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 buildExports.Convert.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 CertificateDecoder=function(){function t(t){var e=this;registerInstance(this,t);this.successParse=createEvent(this,"successParse");this.clearCertificate=createEvent(this,"clearCertificate");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]}}))}))}}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:"2c4ec8c59145c494dee26f7e6eae99b10481f091"},h("textarea",{key:"88129c0b5c56b2458c4af2df6d746c25d4252fd2",placeholder:"Certificate DER or PEM",class:"textarea t-b2 c-black",ref:function(e){t.inputPaste=e},onDrop:this.handleDropFile}),h("div",{key:"3730b1bade8d27bb9bc1617018dc5bf01f9277ef",class:"controls"},h("div",{key:"b803986ab6d5bfaf5e61cd9df57428e6bff6bb55",class:"control_row"},h(Typography,{key:"e6ed2ea27f11d0957da4109e19483cd040febb01",variant:"b3",color:"secondary-tint-2"},"Drag or load file:"),h("input",{key:"898d0fdd1de5f204337ab8bf77ad1dafd25da882",type:"file",accept:"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl",value:"",onChange:this.handleChangeInputFile})),((e=this.certificateExamples)===null||e===void 0?void 0:e.length)&&h("div",{key:"d6cf99bfc145f44fdfef32e52eb6afa8ec3836cf",class:"control_row"},h(Typography,{key:"4f7ff1b34fe34837909e328afdf401a5826d89f5",variant:"b3",color:"secondary-tint-2"},"Load examples:"),h("select",{key:"47c7433eefc2e82fb5dd9a30f062cc71104f7f5b",onChange:this.handleChangeExample},h("option",{key:"667a68723f7a22b954c1c89e1e86b85ddc6b4fd5",value:""},"None"),this.certificateExamples.map((function(t){return h("option",{value:t.value},t.title)})))),h("div",{key:"e1fc1f00e7bb998d26a818fee955df9561f8e6c0",class:"control_row"},h(Button,{key:"254fdd5ff25e644ba5d233d9cec2508a28e023c9",onClick:this.handleClickDecode},"Decode"),h(Button,{key:"594d6e51c56a1b51440f6495eb85af0eda75bcef",onClick:this.handleClickClear},"Clear"))),this.renderCertificate())};return t}();CertificateDecoder.style=certificateDecoderCss;export{CertificateDecoder as peculiar_certificate_decoder};
|
|
5
5
|
//# sourceMappingURL=peculiar-certificate-decoder.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peculiar-certificate-decoder.entry.js","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"],"names":["Convert"],"mappings":";;;;;;;;;;;AACO,MAAM,OAAO,GAAG,sBAAsB;AACtC,MAAM,aAAa,GAAG,sBAAsB;;ACgB7C,MAAO,gBAAiB,SAAQ,KAAsB,CAAA;AAC1D,IAAA,WAAA,CAAY,GAAW,EAAA;AACrB,QAAA,KAAK,EAAE;AAEP,QAAA,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG;cACnC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,KAAKA,oBAAO,CAAC,WAAW,CAAC,KAAK,CAAC;AACpE,cAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC;AAElB,QAAA,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;AACvB,YAAA,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC;;;AAIjF,QAAA,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE;YAC3B,IAAI,CAAC,IAAI,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;;;AAIxC,IAAA,IAAW,UAAU,GAAA;AACnB,QAAA,OAAO,KAAK,CAAC,IAAI,C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,sIAAsI,EAC7I,QAAQ,EAAE,IAAI,CAAC,qBAAqB,EACpC,KAAK,EAAC,EAAE,GACR,CACE,EACL,CAAA,CAAA,EAAA,GAAA,IAAI,CAAC,mBAAmB,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,MAAM,MAC/B,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,aAAa,EAAA,EACtB,CAAC,CAAA,UAAU,qDACT,OAAO,EAAC,IAAI,EACZ,KAAK,EAAC,kBAAkB,EAGb,EAAA,gBAAA,CAAA,EACb,CAAA,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAQ,QAAQ,EAAE,IAAI,CAAC,mBAAmB,EAAA,EACxC,CAAQ,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,EAAE,EAAc,EAAA,MAAA,CAAA,EAC7B,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,OAAO,MACpC,CAAQ,CAAA,QAAA,EAAA,EAAA,KAAK,EAAE,OAAO,CAAC,KAAK,EAAA,EACzB,OAAO,CAAC,KAAK,CACP,CACV,CAAC,CACK,CACL,CACP,EACD,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,aAAa,EAAA,EACtB,CAAA,CAAC,MAAM,EACL,EAAA,GAAA,EAAA,0CAAA,EAAA,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAGxB,EAAA,QAAA,CAAA,EACT,CAAC,CAAA,MAAM,qDACL,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAGvB,EAAA,OAAA,CAAA,CACL,CACF,EACL,IAAI,CAAC,iBAAiB,EAAE,CACpB;;;;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"peculiar-certificate-decoder.entry.js","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';\nimport { Download } from '../utils';\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 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({ single: new OctetString() });\n signedData.certificates = new CertificateSet(\n Array.from(this)\n .map((o) => new CertificateChoices({ certificate: AsnConvert.parse(o.raw, Certificate) })),\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';\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\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 value=\"\"\n onChange={this.handleChangeInputFile}\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 <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,EAAA,0CAAA,EAAQ,QAAQ,EAAE,IAAI,CAAC,mBAAmB,EAAA,EACxC,CAAQ,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,EAAE,EAAc,EAAA,MAAA,CAAA,EAC7B,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,OAAO,MACpC,CAAQ,CAAA,QAAA,EAAA,EAAA,KAAK,EAAE,OAAO,CAAC,KAAK,EAAA,EACzB,OAAO,CAAC,KAAK,CACP,CACV,CAAC,CACK,CACL,CACP,EACD,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,aAAa,EAAA,EACtB,CAAA,CAAC,MAAM,EACL,EAAA,GAAA,EAAA,0CAAA,EAAA,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAGxB,EAAA,QAAA,CAAA,EACT,CAAC,CAAA,MAAM,qDACL,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAGvB,EAAA,OAAA,CAAA,CACL,CACF,EACL,IAAI,CAAC,iBAAiB,EAAE,CACpB;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,5 +1,5 @@
|
|
|
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 s(t){try{c(a.next(t))}catch(t){i(t)}}function n(t){try{c(a["throw"](t))}catch(t){i(t)}}function c(t){t.done?r(t.value):o(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(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,o,i,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,o&&(i=n[0]&2?o["return"]:n[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,n[1])).done)return i;if(o=0,i)n=[n[0]&2,i.value];switch(n[0]){case 0:case 1:i=n;break;case 4:r.label++;return{value:n[1],done:false};case 5:r.label++;o=n[1];n=[0];continue;case 7:n=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(n[0]===6||n[0]===2)){r=0;continue}if(n[0]===3&&(!i||n[1]>i[0]&&n[1]<i[3])){r.label=n[1];break}if(n[0]===6&&r.label<i[1]){r.label=i[1];i=n;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(n);break}if(i[2])r.ops.pop();r.trys.pop();continue}n=e.call(t,r)}catch(t){n=[6,t];o=0}finally{a=i=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-DDDrq3In.js";import{X as X509Certificate}from"./x509_certificate-ObET7_Te.js";import"./certification_request-Wtz6WM17.js";import{B as BasicInformation,S as SubjectName,I as IssuerName,P as PublicKey,a as Signature,T as Thumbprints,E as Extensions,g as getIPAddressLink,b as getDNSNameLink,c as getLEILink,M as Miscellaneous}from"./miscellaneous-CsGuJ6zr.js";import{T as Typography}from"./button-Djn8UI82.js";import"./link-BfDk078v.js";import"./download-Cqfc-Sxf.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 CertificateViewer=function(){function t(t){var e=this;registerInstance(this,t);this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.isDecodeInProcess=true;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)}}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=certificateViewerCss;export{CertificateViewer as peculiar_certificate_viewer};
|
|
4
|
+
*/import{r as registerInstance,h,H as Host}from"./index-DDDrq3In.js";import{X as X509Certificate}from"./x509_certificate-Dmgw53TR.js";import"./certification_request-DazysL_f.js";import{B as BasicInformation,S as SubjectName,I as IssuerName,P as PublicKey,a as Signature,T as Thumbprints,E as Extensions,g as getIPAddressLink,b as getDNSNameLink,c as getLEILink,M as Miscellaneous}from"./miscellaneous-BJPX0Hs_.js";import{T as Typography}from"./button-Do0R_8PZ.js";import"./link-qg3yKAoS.js";import"./download-Cqfc-Sxf.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 CertificateViewer=function(){function t(t){var e=this;registerInstance(this,t);this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.isDecodeInProcess=true;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)}}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=certificateViewerCss;export{CertificateViewer as peculiar_certificate_viewer};
|
|
5
5
|
//# sourceMappingURL=peculiar-certificate-viewer.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peculiar-certificate-viewer.entry.js","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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AA,CAAA,EAAA,EACX,IAAI,CAAC,kBAAkB,CAC3B,CAAA,EAEF,CAAC,CAAA,WAAW,IACV,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,OAAO,EACrC,CAAA,EAEF,CAAA,CAAC,UAAU,EACT,EAAA,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,MAAM,EACpC,YAAY,EAAE,IAAI,CAAC,eAAe,EAAE,EACpC,CAAA,EAEF,CAAC,CAAA,SAAS,IACR,SAAS,EAAE,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAC5C,CAAA,EAEF,CAAC,CAAA,SAAS,IACR,SAAS,EAAE,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAC5C,CAAA,EAEF,CAAC,CAAA,WAAW,IACV,WAAW,EAAE,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAChD,CAAA,EAEF,CAAC,CAAA,UAAU,IACT,UAAU,EAAE,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAC9C,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,EACnD,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,EACvD,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,EAC7D,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,EAC7D,CAAA,EAED,IAAI,CAAC,QAAQ,KACZ,CAAA,CAAC,aAAa,EACZ,EAAA,WAAW,EAAE,IAAI,CAAC,kBAAkB,EAAA,CACpC,CACH,CACK,CACH;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"peculiar-certificate-viewer.entry.js","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';\nimport { X509Certificate } from '../../crypto';\nimport {\n getDNSNameLink, getIPAddressLink, getLEILink,\n} 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 TCertificateProp = 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: TCertificateProp;\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 = false;\n\n @State() isDecodeInProcess = 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: TCertificateProp) {\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: TCertificateProp, oldValue: TCertificateProp) {\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 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 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"],"names":[],"mappings":";;;;;;;;;;;AAAA,MAAM,oBAAoB,GAAG,khSAAkhS;;MCwCliS,iBAAiB,GAAA,MAAA;AAL9B,IAAA,WAAA,CAAA,OAAA,EAAA;;AAgEE;;;;;;AAMG;AACuB,QAAA,IAAsB,CAAA,sBAAA,GAAY,oBAAoB;AAEvE,QAAA,IAAgB,CAAA,gBAAA,GAAG,KAAK;AAExB,QAAA,IAAiB,CAAA,iBAAA,GAAG,IAAI;AAgEzB,QAAA,IAAA,CAA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AC5C,CAAA,EAEF,CAAC,CAAA,SAAS,IACR,SAAS,EAAE,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAC5C,CAAA,EAEF,CAAC,CAAA,WAAW,IACV,WAAW,EAAE,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAChD,CAAA,EAEF,CAAC,CAAA,UAAU,IACT,UAAU,EAAE,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAC9C,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,EACnD,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,EACvD,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,EAC7D,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,EAC7D,CAAA,EAED,IAAI,CAAC,QAAQ,KACZ,CAAA,CAAC,aAAa,EACZ,EAAA,WAAW,EAAE,IAAI,CAAC,kBAAkB,EAAA,CACpC,CACH,CACK,CACH;;;;;;;;;;"}
|
|
@@ -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-DDDrq3In.js";import{X as X509Certificate}from"./x509_certificate-
|
|
4
|
+
*/import{h,r as registerInstance,c as createEvent,H as Host}from"./index-DDDrq3In.js";import{X as X509Certificate}from"./x509_certificate-Dmgw53TR.js";import{Y as l10n,Z as dateShort,_ as OIDs}from"./certification_request-DazysL_f.js";import{T as Typography,B as Button}from"./button-Do0R_8PZ.js";import{D as DetailsIcon,L as LinkIcon,C as CrossIcon}from"./cross-DdCuR1F2.js";import{D as DownloadIcon}from"./download-Cqfc-Sxf.js";import{a as ArrowTopIcon,A as ArrowBottomIcon}from"./arrow_top-CF9pv-tQ.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 CertificatesViewer=function(){function t(t){var e=this;registerInstance(this,t);this.detailsOpen=createEvent(this,"detailsOpen");this.detailsClose=createEvent(this,"detailsClose");this.isHasRoots=false;this.certificates=[];this.filterWithSearch=true;this.highlightWithSearch=true;this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.search="";this.certificatesDecoded=[];this.isDecodeInProcess=true;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()}}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=certificatesViewerCss;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 CertificatesViewer=function(){function t(t){var e=this;registerInstance(this,t);this.detailsOpen=createEvent(this,"detailsOpen");this.detailsClose=createEvent(this,"detailsClose");this.isHasRoots=false;this.certificates=[];this.filterWithSearch=true;this.highlightWithSearch=true;this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.search="";this.certificatesDecoded=[];this.isDecodeInProcess=true;this.handleClickDetails=function(t){e.certificateSelectedForDetails=t;e.detailsOpen.emit(t)};this.handleModalClose=function(){e.certificateSelectedForDetails=undefined;e.detailsClose.emit()};this.handleSearch=function(t){var r=t.target;e.search=r.value.trim()}}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.getCertificateName=function(t){if(typeof t.name==="function"){return t.name(t.body)}return t.name||t.body.commonName};t.prototype.handleClickDownloadAsPem=function(t){t.body.downloadAsPEM(this.getCertificateName(t))};t.prototype.handleClickDownloadAsDer=function(t){t.body.downloadAsDER(this.getCertificateName(t))};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,t.getCertificateName(a),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},t.getCertificateName(a))))),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,{startIcon:i?h(ArrowTopIcon,null):h(ArrowBottomIcon,null),onClick:t.handleClickRow.bind(t,o)})))))))]);return}r.push([h("tr",{class:{m_expanded:i},key:a.body.thumbprints["SHA-1"]},h("td",null,h(Button,{startIcon:i?h(ArrowTopIcon,null):h(ArrowBottomIcon,null),class:"button_table_cell",onClick:t.handleClickRow.bind(t,o)})),!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},t.getCertificateName(a)))),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","aria-hidden":"true",onClick:this.handleModalClose}),h("div",{class:"modal_container",role:"dialog",part:"presentation_container"},h("header",{class:"modal_header"},h(Typography,{variant:"h4"},l10n.getString("certificateDetails")),h(Button,{startIcon:h(CrossIcon,null),onClick:this.handleModalClose})),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",{type:"search",value:"",class:"input_search t-b3 c-black",disabled:!this.certificatesDecoded.length,placeholder:"Search",onInput:this.handleSearch}))};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:"894edb33a53c1128d812c2fd7a5b230a4b13493c","data-mobile-screen-view":String(this.mobileScreenView)},this.renderSearch(),h("table",{key:"998d37ab98be6743f1564fafb4ce9fc70b79e358"},!this.mobileScreenView&&h("thead",{key:"4728e09450b6285cbc2f69cf0a0e06135910558f"},h("tr",{key:"70bf5be60e50b9d7109e27128b661044778e0ded"},h("th",{key:"cf0fef5df1b42d0bce49d3bf0af2d91b82de6d05"}),!this.isHasRoots&&h("th",{key:"59f00d345883dfb3c81a97278583821543ce6808",class:"col_issuer"},h(Typography,{key:"54ce8fba1ab5355ac1f82ccc3aa62945351a3632",variant:"s2"},l10n.getString("issuer"))),h("th",{key:"9aea7911edafca1482f31e2ca3316d2cde40fd78",class:"col_name"},h(Typography,{key:"2a0145b0cc56543ed4b5170a8773c3c43e5e64f9",variant:"s2"},l10n.getString("name"))),h("th",{key:"9eab414d9b1558d6a5b9938f55165aeca5baa54e",class:"col_public_key"},h(Typography,{key:"cbdcb1013bbf12ac88e63ca2d268c55854803297",variant:"s2"},l10n.getString("publicKey"))),h("th",{key:"06adb89146693583a0dad86644b2c8b399e25c0e",class:"col_fingerprint"},h(Typography,{key:"eca0440721f16953219f014edb8d3742f312f704",variant:"s2"},l10n.getString("fingerprint")," (SHA-1)")),h("th",{key:"56b7fdf83f5c45cf524a8cce81dbca584b9b5fa8"}))),h("tbody",{key:"01ccda1abfa846a8b0cdc00588b106398358ed88"},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=certificatesViewerCss;export{CertificatesViewer as peculiar_certificates_viewer};
|
|
12
12
|
//# sourceMappingURL=peculiar-certificates-viewer.entry.js.map
|