@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
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-DDDrq3In.js';
|
|
5
5
|
import { a as readAsBinaryString } from './read_file-F2F0McJX.js';
|
|
6
|
-
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-
|
|
7
|
-
import { X as X509Certificate } from './x509_certificate-
|
|
8
|
-
import { X as X509AttributeCertificate, a as X509Crl } from './x509_crl-
|
|
9
|
-
import { P as Pkcs10CertificateRequest } from './pkcs10_certificate_request-
|
|
10
|
-
import { T as Typography, B as Button } from './button-
|
|
6
|
+
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';
|
|
7
|
+
import { X as X509Certificate } from './x509_certificate-Dmgw53TR.js';
|
|
8
|
+
import { X as X509AttributeCertificate, a as X509Crl } from './x509_crl-B5TRu79b.js';
|
|
9
|
+
import { P as Pkcs10CertificateRequest } from './pkcs10_certificate_request-SQcYKma2.js';
|
|
10
|
+
import { T as Typography, B as Button } from './button-Do0R_8PZ.js';
|
|
11
11
|
|
|
12
12
|
const id_data = "1.2.840.113549.1.7.1";
|
|
13
13
|
const id_signedData = "1.2.840.113549.1.7.2";
|
|
@@ -21,7 +21,6 @@ class X509Certificates extends Array {
|
|
|
21
21
|
if (rawItems.length < 2) {
|
|
22
22
|
throw new Error('Unable to parse string. The array of elements is less than 2');
|
|
23
23
|
}
|
|
24
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
25
24
|
for (const item of rawItems) {
|
|
26
25
|
this.push(new X509Certificate(item));
|
|
27
26
|
}
|
|
@@ -35,12 +34,9 @@ class X509Certificates extends Array {
|
|
|
35
34
|
const signedData = new SignedData();
|
|
36
35
|
signedData.version = 1;
|
|
37
36
|
signedData.encapContentInfo.eContentType = id_data;
|
|
38
|
-
signedData.encapContentInfo.eContent = new EncapsulatedContent({
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
signedData.certificates = new CertificateSet(Array.from(this).map((o) => new CertificateChoices({
|
|
42
|
-
certificate: AsnConvert.parse(o.raw, Certificate),
|
|
43
|
-
})));
|
|
37
|
+
signedData.encapContentInfo.eContent = new EncapsulatedContent({ single: new OctetString() });
|
|
38
|
+
signedData.certificates = new CertificateSet(Array.from(this)
|
|
39
|
+
.map((o) => new CertificateChoices({ certificate: AsnConvert.parse(o.raw, Certificate) })));
|
|
44
40
|
const cms = new ContentInfo({
|
|
45
41
|
contentType: id_signedData,
|
|
46
42
|
content: AsnConvert.serialize(signedData),
|
|
@@ -87,6 +83,7 @@ const CertificateDecoder = class {
|
|
|
87
83
|
this.handleClickClear = () => {
|
|
88
84
|
this.clearValue();
|
|
89
85
|
};
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
90
87
|
this.handleChangeInputFile = async (event) => {
|
|
91
88
|
const element = event.target;
|
|
92
89
|
if (element.files) {
|
|
@@ -97,6 +94,7 @@ const CertificateDecoder = class {
|
|
|
97
94
|
element.value = '';
|
|
98
95
|
}
|
|
99
96
|
};
|
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
100
98
|
this.handleChangeExample = (event) => {
|
|
101
99
|
if (event.target.value) {
|
|
102
100
|
this.decode(event.target.value);
|
|
@@ -105,6 +103,7 @@ const CertificateDecoder = class {
|
|
|
105
103
|
this.clearValue();
|
|
106
104
|
}
|
|
107
105
|
};
|
|
106
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
108
107
|
this.handleDropFile = async (event) => {
|
|
109
108
|
event.stopPropagation();
|
|
110
109
|
event.preventDefault();
|
|
@@ -169,7 +168,7 @@ const CertificateDecoder = class {
|
|
|
169
168
|
}
|
|
170
169
|
render() {
|
|
171
170
|
var _a;
|
|
172
|
-
return (h(Host, { key: '
|
|
171
|
+
return (h(Host, { key: '2c4ec8c59145c494dee26f7e6eae99b10481f091' }, h("textarea", { key: '88129c0b5c56b2458c4af2df6d746c25d4252fd2', placeholder: "Certificate DER or PEM", class: "textarea t-b2 c-black", ref: (el) => { this.inputPaste = el; }, 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 })), ((_a = this.certificateExamples) === null || _a === void 0 ? void 0 : _a.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((example) => (h("option", { value: example.value }, example.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()));
|
|
173
172
|
}
|
|
174
173
|
};
|
|
175
174
|
CertificateDecoder.style = certificateDecoderCss;
|
|
@@ -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,CAAC,IAAI;aACnB,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU;aACvB,IAAI,CAAC,GAAG,CAAC;;AAGd,IAAA,IAAW,GAAG,GAAA;AACZ,QAAA,MAA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AA,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 <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,s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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]}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, h, H as Host } from './index-DDDrq3In.js';
|
|
5
|
-
import { X as X509Certificate } from './x509_certificate-
|
|
6
|
-
import './certification_request-
|
|
7
|
-
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-
|
|
8
|
-
import { T as Typography } from './button-
|
|
9
|
-
import './link-
|
|
5
|
+
import { X as X509Certificate } from './x509_certificate-Dmgw53TR.js';
|
|
6
|
+
import './certification_request-DazysL_f.js';
|
|
7
|
+
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';
|
|
8
|
+
import { T as Typography } from './button-Do0R_8PZ.js';
|
|
9
|
+
import './link-qg3yKAoS.js';
|
|
10
10
|
import './download-Cqfc-Sxf.js';
|
|
11
11
|
|
|
12
12
|
const 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}";
|
|
@@ -96,11 +96,9 @@ const CertificateViewer = class {
|
|
|
96
96
|
getIssuerDnLink() {
|
|
97
97
|
return this.issuerDnLink;
|
|
98
98
|
}
|
|
99
|
-
// eslint-disable-next-line class-methods-use-this
|
|
100
99
|
renderErrorState() {
|
|
101
100
|
return (h("div", { class: "status_wrapper" }, h(Typography, null, "There was an error decoding this certificate.")));
|
|
102
101
|
}
|
|
103
|
-
// eslint-disable-next-line class-methods-use-this
|
|
104
102
|
renderEmptyState() {
|
|
105
103
|
return (h("div", { class: "status_wrapper" }, h(Typography, null, "There is no certificate available.")));
|
|
106
104
|
}
|
|
@@ -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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AA,CAAC,gBAAgB,EAAA,MAAA,CAAA,MAAA,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,iBAA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AAE,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;;;;;;;;;;"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { h, r as registerInstance, c as createEvent, H as Host } from './index-DDDrq3In.js';
|
|
5
|
-
import { X as X509Certificate } from './x509_certificate-
|
|
6
|
-
import { Y as l10n, Z as dateShort, _ as OIDs } from './certification_request-
|
|
7
|
-
import { T as Typography, B as Button } from './button-
|
|
5
|
+
import { X as X509Certificate } from './x509_certificate-Dmgw53TR.js';
|
|
6
|
+
import { Y as l10n, Z as dateShort, _ as OIDs } from './certification_request-DazysL_f.js';
|
|
7
|
+
import { T as Typography, B as Button } from './button-Do0R_8PZ.js';
|
|
8
8
|
import { D as DetailsIcon, L as LinkIcon, C as CrossIcon } from './cross-DdCuR1F2.js';
|
|
9
9
|
import { D as DownloadIcon } from './download-Cqfc-Sxf.js';
|
|
10
10
|
import { a as ArrowTopIcon, A as ArrowBottomIcon } from './arrow_top-CF9pv-tQ.js';
|
|
@@ -82,7 +82,8 @@ const CertificatesViewer = class {
|
|
|
82
82
|
this.detailsClose.emit();
|
|
83
83
|
};
|
|
84
84
|
this.handleSearch = (event) => {
|
|
85
|
-
|
|
85
|
+
const target = event.target;
|
|
86
|
+
this.search = target.value.trim();
|
|
86
87
|
};
|
|
87
88
|
}
|
|
88
89
|
handleMediaQueryChange(event) {
|
|
@@ -113,7 +114,6 @@ const CertificatesViewer = class {
|
|
|
113
114
|
return;
|
|
114
115
|
}
|
|
115
116
|
const data = [];
|
|
116
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
117
117
|
for (const certificate of this.certificates) {
|
|
118
118
|
try {
|
|
119
119
|
const decoded = new X509Certificate(certificate.value);
|
|
@@ -135,13 +135,17 @@ const CertificatesViewer = class {
|
|
|
135
135
|
this.isDecodeInProcess = false;
|
|
136
136
|
this.certificatesDecoded = data;
|
|
137
137
|
}
|
|
138
|
-
|
|
138
|
+
getCertificateName(certificate) {
|
|
139
|
+
if (typeof certificate.name === 'function') {
|
|
140
|
+
return certificate.name(certificate.body);
|
|
141
|
+
}
|
|
142
|
+
return certificate.name || certificate.body.commonName;
|
|
143
|
+
}
|
|
139
144
|
handleClickDownloadAsPem(certificate) {
|
|
140
|
-
certificate.body.downloadAsPEM(
|
|
145
|
+
certificate.body.downloadAsPEM(this.getCertificateName(certificate));
|
|
141
146
|
}
|
|
142
|
-
// eslint-disable-next-line class-methods-use-this
|
|
143
147
|
handleClickDownloadAsDer(certificate) {
|
|
144
|
-
certificate.body.downloadAsDER(
|
|
148
|
+
certificate.body.downloadAsDER(this.getCertificateName(certificate));
|
|
145
149
|
}
|
|
146
150
|
handleClickRow(index) {
|
|
147
151
|
const isExpandedRowClicked = this.expandedRow === index;
|
|
@@ -186,26 +190,34 @@ const CertificatesViewer = class {
|
|
|
186
190
|
},
|
|
187
191
|
],
|
|
188
192
|
},
|
|
189
|
-
...(isHasTestURLs
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
193
|
+
...(isHasTestURLs
|
|
194
|
+
? [{
|
|
195
|
+
title: l10n.getString('testURLs'),
|
|
196
|
+
options: [
|
|
197
|
+
...(((_a = certificate.tests) === null || _a === void 0 ? void 0 : _a.valid)
|
|
198
|
+
? [{
|
|
199
|
+
text: l10n.getString('valid'),
|
|
200
|
+
href: certificate.tests.valid,
|
|
201
|
+
startIcon: h(LinkIcon, null),
|
|
202
|
+
}]
|
|
203
|
+
: []),
|
|
204
|
+
...(((_b = certificate.tests) === null || _b === void 0 ? void 0 : _b.revoked)
|
|
205
|
+
? [{
|
|
206
|
+
text: l10n.getString('revoked'),
|
|
207
|
+
href: certificate.tests.revoked,
|
|
208
|
+
startIcon: h(LinkIcon, null),
|
|
209
|
+
}]
|
|
210
|
+
: []),
|
|
211
|
+
...(((_c = certificate.tests) === null || _c === void 0 ? void 0 : _c.expired)
|
|
212
|
+
? [{
|
|
213
|
+
text: l10n.getString('expired'),
|
|
214
|
+
href: certificate.tests.expired,
|
|
215
|
+
startIcon: h(LinkIcon, null),
|
|
216
|
+
}]
|
|
217
|
+
: []),
|
|
218
|
+
],
|
|
219
|
+
}]
|
|
220
|
+
: []),
|
|
209
221
|
] }));
|
|
210
222
|
}
|
|
211
223
|
renderExpandedRow(certificate) {
|
|
@@ -225,8 +237,7 @@ const CertificatesViewer = class {
|
|
|
225
237
|
const certificateStringForSearch = [
|
|
226
238
|
publicKeyValue,
|
|
227
239
|
certificate.body.issuerCommonName,
|
|
228
|
-
certificate
|
|
229
|
-
certificate.body.commonName,
|
|
240
|
+
this.getCertificateName(certificate),
|
|
230
241
|
certificate.body.thumbprints['SHA-1'],
|
|
231
242
|
]
|
|
232
243
|
.join(' ')
|
|
@@ -240,21 +251,12 @@ const CertificatesViewer = class {
|
|
|
240
251
|
h("tr", { class: {
|
|
241
252
|
certificate_row: true,
|
|
242
253
|
m_expanded: isExpandedRow,
|
|
243
|
-
}, key: certificate.body.thumbprints['SHA-1'] }, h("td", null, h("table", null, h("tbody", null, !this.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: searchHighlight }, certificate.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: searchHighlight },
|
|
244
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
245
|
-
, {
|
|
246
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
247
|
-
onClick: this.handleClickRow.bind(this, index), startIcon: isExpandedRow ? h(ArrowTopIcon, null) : h(ArrowBottomIcon, null)
|
|
248
|
-
}))))))),
|
|
254
|
+
}, key: certificate.body.thumbprints['SHA-1'] }, h("td", null, h("table", null, h("tbody", null, !this.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: searchHighlight }, certificate.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: searchHighlight }, this.getCertificateName(certificate))))), 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: searchHighlight }, publicKeyValue)))), h("tr", null, h("td", null, h(Typography, { variant: "b2", color: "gray-9" }, l10n.getString('fingerprint'), "\u00A0 (SHA-1)")), h("td", null, h(Typography, { variant: "b2", color: "black" }, h("peculiar-highlight-words", { search: searchHighlight }, certificate.body.thumbprints['SHA-1'])))), isExpandedRow && this.renderExpandedRow(certificate.body), h("tr", { class: "certificate_row_actions" }, h("td", null, this.renderCertificateButtonActions(certificate), h(Button, { startIcon: isExpandedRow ? h(ArrowTopIcon, null) : h(ArrowBottomIcon, null), onClick: this.handleClickRow.bind(this, index) }))))))),
|
|
249
255
|
]);
|
|
250
256
|
return;
|
|
251
257
|
}
|
|
252
258
|
content.push([
|
|
253
|
-
h("tr", { class: {
|
|
254
|
-
m_expanded: isExpandedRow,
|
|
255
|
-
}, key: certificate.body.thumbprints['SHA-1'] }, h("td", null, h(Button, { class: "button_table_cell",
|
|
256
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
257
|
-
onClick: this.handleClickRow.bind(this, index), startIcon: isExpandedRow ? h(ArrowTopIcon, null) : h(ArrowBottomIcon, null) })), !this.isHasRoots && (h("td", null, h(Typography, null, h("peculiar-highlight-words", { search: searchHighlight }, certificate.body.issuerCommonName)))), h("td", null, h(Typography, null, h("peculiar-highlight-words", { search: searchHighlight }, certificate.name || certificate.body.commonName))), h("td", null, h(Typography, null, h("peculiar-highlight-words", { search: searchHighlight }, publicKeyValue))), h("td", null, h(Typography, null, h("peculiar-highlight-words", { search: searchHighlight }, certificate.body.thumbprints['SHA-1']))), h("td", null, this.renderCertificateButtonActions(certificate))),
|
|
259
|
+
h("tr", { class: { m_expanded: isExpandedRow }, key: certificate.body.thumbprints['SHA-1'] }, h("td", null, h(Button, { startIcon: isExpandedRow ? h(ArrowTopIcon, null) : h(ArrowBottomIcon, null), class: "button_table_cell", onClick: this.handleClickRow.bind(this, index) })), !this.isHasRoots && (h("td", null, h(Typography, null, h("peculiar-highlight-words", { search: searchHighlight }, certificate.body.issuerCommonName)))), h("td", null, h(Typography, null, h("peculiar-highlight-words", { search: searchHighlight }, this.getCertificateName(certificate)))), h("td", null, h(Typography, null, h("peculiar-highlight-words", { search: searchHighlight }, publicKeyValue))), h("td", null, h(Typography, null, h("peculiar-highlight-words", { search: searchHighlight }, certificate.body.thumbprints['SHA-1']))), h("td", null, this.renderCertificateButtonActions(certificate))),
|
|
258
260
|
isExpandedRow && this.renderExpandedRow(certificate.body),
|
|
259
261
|
]);
|
|
260
262
|
});
|
|
@@ -264,13 +266,13 @@ const CertificatesViewer = class {
|
|
|
264
266
|
if (!this.certificateSelectedForDetails) {
|
|
265
267
|
return null;
|
|
266
268
|
}
|
|
267
|
-
return (h("div", { class: "modal_wrapper", role: "presentation", "aria-hidden": "false", part: "presentation" }, h("div", { class: "modal_backdrop",
|
|
269
|
+
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 })))));
|
|
268
270
|
}
|
|
269
271
|
renderSearch() {
|
|
270
272
|
if (!this.filterWithSearch && !this.highlightWithSearch) {
|
|
271
273
|
return null;
|
|
272
274
|
}
|
|
273
|
-
return (h("div", { class: "search_section" }, h("input", {
|
|
275
|
+
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 })));
|
|
274
276
|
}
|
|
275
277
|
renderEmptyState() {
|
|
276
278
|
const colSpan = this.getMaxColSpanValue();
|
|
@@ -280,7 +282,6 @@ const CertificatesViewer = class {
|
|
|
280
282
|
const colSpan = this.getMaxColSpanValue();
|
|
281
283
|
return (h("tr", null, h("td", { class: "status_wrapper", colSpan: colSpan }, h(Typography, { variant: "b1" }, "No results found for \u201C", this.search, "\u201C"))));
|
|
282
284
|
}
|
|
283
|
-
// eslint-disable-next-line class-methods-use-this
|
|
284
285
|
renderLoadingState() {
|
|
285
286
|
return (h("div", { class: "loading_container" }, h("peculiar-circular-progress", null)));
|
|
286
287
|
}
|
|
@@ -298,7 +299,7 @@ const CertificatesViewer = class {
|
|
|
298
299
|
return certificatesRows;
|
|
299
300
|
}
|
|
300
301
|
render() {
|
|
301
|
-
return (h(Host, { key: '
|
|
302
|
+
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'), "\u00A0 (SHA-1)")), h("th", { key: '56b7fdf83f5c45cf524a8cce81dbca584b9b5fa8' })))), h("tbody", { key: '01ccda1abfa846a8b0cdc00588b106398358ed88' }, this.renderTableBody())), this.renderCertificateDetailsModal(), this.isDecodeInProcess && this.renderLoadingState()));
|
|
302
303
|
}
|
|
303
304
|
static get watchers() { return {
|
|
304
305
|
"certificates": ["watchCertificates"]
|