@peculiar/certificates-viewer 3.10.0 → 3.10.1-alpha.12
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/arrow_top.js +34 -0
- package/components/arrow_top.js.map +1 -0
- package/components/attribute-certificate-viewer.js +281 -0
- package/components/attribute-certificate-viewer.js.map +1 -0
- package/components/button-menu.js +64 -0
- package/components/button-menu.js.map +1 -0
- package/components/button.js +74 -0
- package/components/button.js.map +1 -0
- package/components/certificate-viewer.js +300 -0
- package/components/certificate-viewer.js.map +1 -0
- package/components/circular-progress.js +48 -0
- package/components/circular-progress.js.map +1 -0
- package/components/crl-viewer.js +263 -0
- package/components/crl-viewer.js.map +1 -0
- package/components/csr-viewer.js +233 -0
- package/components/csr-viewer.js.map +1 -0
- package/components/custom-elements.d.ts +2 -0
- package/{dist/esm/download-91511aeb.js → components/download.js} +2 -0
- package/components/download.js.map +1 -0
- package/components/highlight-words.js +60 -0
- package/components/highlight-words.js.map +1 -0
- package/components/index.d.ts +33 -0
- package/components/index.js +7 -0
- package/components/index.js.map +1 -0
- package/components/index2.js +299 -0
- package/components/index2.js.map +1 -0
- package/components/issuer_name.js +26 -0
- package/components/issuer_name.js.map +1 -0
- package/components/miscellaneous.js +13420 -0
- package/components/miscellaneous.js.map +1 -0
- package/components/package.json +9 -0
- package/components/peculiar-attribute-certificate-viewer.d.ts +11 -0
- package/components/peculiar-attribute-certificate-viewer.js +11 -0
- package/components/peculiar-attribute-certificate-viewer.js.map +1 -0
- package/components/peculiar-button-menu.d.ts +11 -0
- package/components/peculiar-button-menu.js +11 -0
- package/components/peculiar-button-menu.js.map +1 -0
- package/components/peculiar-certificate-decoder.d.ts +11 -0
- package/components/peculiar-certificate-decoder.js +234 -0
- package/components/peculiar-certificate-decoder.js.map +1 -0
- package/components/peculiar-certificate-viewer.d.ts +11 -0
- package/components/peculiar-certificate-viewer.js +11 -0
- package/components/peculiar-certificate-viewer.js.map +1 -0
- package/components/peculiar-certificates-viewer.d.ts +11 -0
- package/components/peculiar-certificates-viewer.js +382 -0
- package/components/peculiar-certificates-viewer.js.map +1 -0
- package/components/peculiar-circular-progress.d.ts +11 -0
- package/components/peculiar-circular-progress.js +11 -0
- package/components/peculiar-circular-progress.js.map +1 -0
- package/components/peculiar-crl-viewer.d.ts +11 -0
- package/components/peculiar-crl-viewer.js +11 -0
- package/components/peculiar-crl-viewer.js.map +1 -0
- package/components/peculiar-csr-viewer.d.ts +11 -0
- package/components/peculiar-csr-viewer.js +11 -0
- package/components/peculiar-csr-viewer.js.map +1 -0
- package/components/peculiar-highlight-words.d.ts +11 -0
- package/components/peculiar-highlight-words.js +11 -0
- package/components/peculiar-highlight-words.js.map +1 -0
- package/components/peculiar-text-hider.d.ts +11 -0
- package/components/peculiar-text-hider.js +42 -0
- package/components/peculiar-text-hider.js.map +1 -0
- package/components/subject_name.js +71 -0
- package/components/subject_name.js.map +1 -0
- package/dist/cjs/arrow_top-834fb7ec.js +37 -0
- package/dist/cjs/arrow_top-834fb7ec.js.map +1 -0
- package/dist/cjs/button-14e2b73f.js +77 -0
- package/dist/cjs/button-14e2b73f.js.map +1 -0
- package/dist/cjs/{certification_request-d5c6e32d.js → certification_request-c0cafa72.js} +236 -71
- package/dist/cjs/certification_request-c0cafa72.js.map +1 -0
- package/dist/cjs/{crl-5bce64c4.js → crl-b4322166.js} +8 -7
- package/dist/cjs/crl-b4322166.js.map +1 -0
- package/dist/cjs/download-254ddc57.js +23 -0
- package/dist/cjs/download-254ddc57.js.map +1 -0
- package/dist/cjs/{download-93f7b773.js → download-972dda8a.js} +2 -0
- package/dist/cjs/download-972dda8a.js.map +1 -0
- package/dist/cjs/index-efd561e9.js +2477 -0
- package/dist/cjs/index-efd561e9.js.map +1 -0
- package/dist/cjs/index.cjs.js +3 -1
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +6 -12
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/{miscellaneous-cac1cd8b.js → miscellaneous-806a04a5.js} +86 -70
- package/dist/cjs/miscellaneous-806a04a5.js.map +1 -0
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +92 -35
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js.map +1 -0
- package/dist/cjs/peculiar-button-menu_3.cjs.entry.js +110 -0
- package/dist/cjs/peculiar-button-menu_3.cjs.entry.js.map +1 -0
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +30 -19
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -0
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +34 -11
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js.map +1 -0
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +183 -85
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +1 -0
- package/dist/cjs/peculiar-text-hider.cjs.entry.js +7 -13
- package/dist/cjs/peculiar-text-hider.cjs.entry.js.map +1 -0
- package/dist/cjs/peculiar.cjs.js +10 -57
- package/dist/cjs/peculiar.cjs.js.map +1 -0
- package/dist/cjs/{x509_certificate-3760e0a8.js → x509_certificate-989b1435.js} +5 -4
- package/dist/cjs/x509_certificate-989b1435.js.map +1 -0
- package/dist/collection/collection-manifest.json +12 -16
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +189 -145
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js.map +1 -0
- package/dist/collection/components/button/button.js +14 -126
- package/dist/collection/components/button/button.js.map +1 -0
- package/dist/collection/components/button/index.js +5 -0
- package/dist/collection/components/button/index.js.map +1 -0
- package/dist/collection/components/button-menu/button-menu.css +46 -0
- package/dist/collection/components/button-menu/button-menu.js +78 -0
- package/dist/collection/components/button-menu/button-menu.js.map +1 -0
- package/dist/collection/components/certificate-decoder/certificate-decoder.css +456 -44
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +109 -101
- package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/attributes/activity_description_attribute.js +6 -11
- package/dist/collection/components/certificate-details-parts/attributes/activity_description_attribute.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/attributes/as_string_attribute.js +5 -5
- package/dist/collection/components/certificate-details-parts/attributes/as_string_attribute.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/attributes/basic_attribute.js +5 -6
- package/dist/collection/components/certificate-details-parts/attributes/basic_attribute.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/attributes/challenge_password_attribute.js +5 -5
- package/dist/collection/components/certificate-details-parts/attributes/challenge_password_attribute.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/attributes/index.js +16 -15
- package/dist/collection/components/certificate-details-parts/attributes/index.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/attributes/insurance_value_attribute.js +5 -5
- package/dist/collection/components/certificate-details-parts/attributes/insurance_value_attribute.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/attributes/name_attribute.js +5 -5
- package/dist/collection/components/certificate-details-parts/attributes/name_attribute.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/attributes/name_part.js +4 -3
- package/dist/collection/components/certificate-details-parts/attributes/name_part.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/attributes/type_relationship_attribute.js +5 -4
- package/dist/collection/components/certificate-details-parts/attributes/type_relationship_attribute.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/attributes/unstructured_name_attribute.js +5 -5
- package/dist/collection/components/certificate-details-parts/attributes/unstructured_name_attribute.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/attributes/valuation_ranking_attribute.js +5 -5
- package/dist/collection/components/certificate-details-parts/attributes/valuation_ranking_attribute.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/attributes/web_gdpr_attribute.js +6 -13
- package/dist/collection/components/certificate-details-parts/attributes/web_gdpr_attribute.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/basic_information.js +4 -3
- package/dist/collection/components/certificate-details-parts/basic_information.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/archive_rev_info_extension.js +5 -5
- package/dist/collection/components/certificate-details-parts/extensions/archive_rev_info_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/as_string_extension.js +5 -5
- package/dist/collection/components/certificate-details-parts/extensions/as_string_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/attribute_value.js +2 -1
- package/dist/collection/components/certificate-details-parts/extensions/attribute_value.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/authority_key_identifier_extension.js +10 -15
- package/dist/collection/components/certificate-details-parts/extensions/authority_key_identifier_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/basic_constraints_extension.js +6 -7
- package/dist/collection/components/certificate-details-parts/extensions/basic_constraints_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/basic_extension.js +5 -6
- package/dist/collection/components/certificate-details-parts/extensions/basic_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/biometric_syntax_extension.js +8 -12
- package/dist/collection/components/certificate-details-parts/extensions/biometric_syntax_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/ca_version_extension.js +5 -6
- package/dist/collection/components/certificate-details-parts/extensions/ca_version_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/certificate_policies_extension.js +26 -27
- package/dist/collection/components/certificate-details-parts/extensions/certificate_policies_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/certificate_template_extension.js +5 -7
- package/dist/collection/components/certificate-details-parts/extensions/certificate_template_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js +8 -13
- package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/crl_distribution_points_extension.js +4 -3
- package/dist/collection/components/certificate-details-parts/extensions/crl_distribution_points_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/crl_number_extension.js +6 -6
- package/dist/collection/components/certificate-details-parts/extensions/crl_number_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/crl_reason_extension.js +5 -5
- package/dist/collection/components/certificate-details-parts/extensions/crl_reason_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/enroll_cert_type_extension.js +5 -5
- package/dist/collection/components/certificate-details-parts/extensions/enroll_cert_type_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/entrust_version_info_extension.js +5 -6
- package/dist/collection/components/certificate-details-parts/extensions/entrust_version_info_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/extended_key_usage_extension.js +7 -7
- package/dist/collection/components/certificate-details-parts/extensions/extended_key_usage_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/general_name_part.js +7 -6
- package/dist/collection/components/certificate-details-parts/extensions/general_name_part.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/index.js +46 -45
- package/dist/collection/components/certificate-details-parts/extensions/index.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/info_access_syntax_extension.js +8 -9
- package/dist/collection/components/certificate-details-parts/extensions/info_access_syntax_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/issuing_distribution_point_extension.js +7 -11
- package/dist/collection/components/certificate-details-parts/extensions/issuing_distribution_point_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/key_usage_extension.js +5 -5
- package/dist/collection/components/certificate-details-parts/extensions/key_usage_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/lei_extension.js +5 -5
- package/dist/collection/components/certificate-details-parts/extensions/lei_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/lei_role_extennsion.js +5 -5
- package/dist/collection/components/certificate-details-parts/extensions/lei_role_extennsion.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/logotype_extension.js +8 -11
- package/dist/collection/components/certificate-details-parts/extensions/logotype_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/name_constraints_extension.js +4 -3
- package/dist/collection/components/certificate-details-parts/extensions/name_constraints_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/netscape_cert_type_extension.js +5 -5
- package/dist/collection/components/certificate-details-parts/extensions/netscape_cert_type_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/netscape_comment_extension.js +5 -5
- package/dist/collection/components/certificate-details-parts/extensions/netscape_comment_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/policy_constraints_extension.js +6 -7
- package/dist/collection/components/certificate-details-parts/extensions/policy_constraints_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/policy_mappings_extension.js +5 -4
- package/dist/collection/components/certificate-details-parts/extensions/policy_mappings_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/private_key_usage_period_extension.js +6 -7
- package/dist/collection/components/certificate-details-parts/extensions/private_key_usage_period_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js +13 -16
- package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/subject_alternative_name_extension.js +4 -3
- package/dist/collection/components/certificate-details-parts/extensions/subject_alternative_name_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/subject_directory_attributes_extension.js +8 -9
- package/dist/collection/components/certificate-details-parts/extensions/subject_directory_attributes_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/subject_key_identifier_extension.js +10 -15
- package/dist/collection/components/certificate-details-parts/extensions/subject_key_identifier_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/timestamp_extension.js +7 -9
- package/dist/collection/components/certificate-details-parts/extensions/timestamp_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/extensions/tn_auth_list_extension.js +4 -3
- package/dist/collection/components/certificate-details-parts/extensions/tn_auth_list_extension.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/holder.js +8 -11
- package/dist/collection/components/certificate-details-parts/holder.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/index.js +1 -0
- package/dist/collection/components/certificate-details-parts/index.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/issuer.js +5 -4
- package/dist/collection/components/certificate-details-parts/issuer.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/issuer_name.js +6 -4
- package/dist/collection/components/certificate-details-parts/issuer_name.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/miscellaneous.js +8 -13
- package/dist/collection/components/certificate-details-parts/miscellaneous.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/public_key.js +8 -7
- package/dist/collection/components/certificate-details-parts/public_key.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/revoked_certificates.js +9 -11
- package/dist/collection/components/certificate-details-parts/revoked_certificates.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/row.js +13 -18
- package/dist/collection/components/certificate-details-parts/row.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/signature.js +5 -4
- package/dist/collection/components/certificate-details-parts/signature.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/subject_name.js +4 -3
- package/dist/collection/components/certificate-details-parts/subject_name.js.map +1 -0
- package/dist/collection/components/certificate-details-parts/thumbprints.js +4 -3
- package/dist/collection/components/certificate-details-parts/thumbprints.js.map +1 -0
- package/dist/collection/components/certificate-summary/certificate-summary.js +9 -77
- package/dist/collection/components/certificate-summary/certificate-summary.js.map +1 -0
- package/dist/collection/components/certificate-summary/index.js +5 -0
- package/dist/collection/components/certificate-summary/index.js.map +1 -0
- package/dist/collection/components/certificate-viewer/certificate-viewer.css +470 -104
- package/dist/collection/components/certificate-viewer/certificate-viewer.js +206 -178
- package/dist/collection/components/certificate-viewer/certificate-viewer.js.map +1 -0
- package/dist/collection/components/certificates-viewer/certificates-viewer.css +540 -267
- package/dist/collection/components/certificates-viewer/certificates-viewer.js +261 -266
- package/dist/collection/components/certificates-viewer/certificates-viewer.js.map +1 -0
- package/dist/collection/components/circular-progress/circular-progress.css +2 -11
- package/dist/collection/components/circular-progress/circular-progress.js +60 -63
- package/dist/collection/components/circular-progress/circular-progress.js.map +1 -0
- package/dist/collection/components/crl-viewer/crl-viewer.js +166 -139
- package/dist/collection/components/crl-viewer/crl-viewer.js.map +1 -0
- package/dist/collection/components/csr-viewer/csr-viewer.js +149 -124
- package/dist/collection/components/csr-viewer/csr-viewer.js.map +1 -0
- package/dist/collection/components/highlight-words/highlight-words.css +1 -9
- package/dist/collection/components/highlight-words/highlight-words.js +35 -28
- package/dist/collection/components/highlight-words/highlight-words.js.map +1 -0
- package/dist/collection/components/icons/actions.js +16 -0
- package/dist/collection/components/icons/actions.js.map +1 -0
- package/dist/collection/components/icons/arrow_bottom.js +16 -0
- package/dist/collection/components/icons/arrow_bottom.js.map +1 -0
- package/dist/collection/components/icons/arrow_top.js +16 -0
- package/dist/collection/components/icons/arrow_top.js.map +1 -0
- package/dist/collection/components/icons/cross.js +16 -0
- package/dist/collection/components/icons/cross.js.map +1 -0
- package/dist/collection/components/icons/details.js +16 -0
- package/dist/collection/components/icons/details.js.map +1 -0
- package/dist/collection/components/icons/download.js +16 -0
- package/dist/collection/components/icons/download.js.map +1 -0
- package/dist/collection/components/icons/index.js +11 -0
- package/dist/collection/components/icons/index.js.map +1 -0
- package/dist/collection/components/icons/link.js +16 -0
- package/dist/collection/components/icons/link.js.map +1 -0
- package/dist/collection/components/link/index.js +5 -0
- package/dist/collection/components/link/index.js.map +1 -0
- package/dist/collection/components/link/link.js +9 -61
- package/dist/collection/components/link/link.js.map +1 -0
- package/dist/collection/components/text-hider/text-hider.css +9 -36
- package/dist/collection/components/text-hider/text-hider.js +21 -68
- package/dist/collection/components/text-hider/text-hider.js.map +1 -0
- package/dist/collection/components/typography/index.js +5 -0
- package/dist/collection/components/typography/index.js.map +1 -0
- package/dist/collection/components/typography/typography.js +39 -126
- package/dist/collection/components/typography/typography.js.map +1 -0
- package/dist/collection/constants/logs.js +1 -0
- package/dist/collection/constants/logs.js.map +1 -0
- package/dist/collection/constants/oids.js +1 -0
- package/dist/collection/constants/oids.js.map +1 -0
- package/dist/collection/crypto/asn_data.js +13 -7
- package/dist/collection/crypto/asn_data.js.map +1 -0
- package/dist/collection/crypto/attribute.js +11 -10
- package/dist/collection/crypto/attribute.js.map +1 -0
- package/dist/collection/crypto/crl.js +9 -8
- package/dist/collection/crypto/crl.js.map +1 -0
- package/dist/collection/crypto/csr.js +11 -10
- package/dist/collection/crypto/csr.js.map +1 -0
- package/dist/collection/crypto/extension.js +16 -15
- package/dist/collection/crypto/extension.js.map +1 -0
- package/dist/collection/crypto/index.js +1 -0
- package/dist/collection/crypto/index.js.map +1 -0
- package/dist/collection/crypto/name.js +15 -9
- package/dist/collection/crypto/name.js.map +1 -0
- package/dist/collection/crypto/provider.js +4 -3
- package/dist/collection/crypto/provider.js.map +1 -0
- package/dist/collection/crypto/utils.js +4 -3
- package/dist/collection/crypto/utils.js.map +1 -0
- package/dist/collection/crypto/x509_attribute_certificate.js +9 -8
- package/dist/collection/crypto/x509_attribute_certificate.js.map +1 -0
- package/dist/collection/crypto/x509_certificate.js +12 -11
- package/dist/collection/crypto/x509_certificate.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/locales/en.json +4 -3
- package/dist/collection/utils/date_formatter.js +3 -2
- package/dist/collection/utils/date_formatter.js.map +1 -0
- package/dist/collection/utils/download.js +3 -2
- package/dist/collection/utils/download.js.map +1 -0
- package/dist/collection/utils/download_from_buffer.js +1 -0
- package/dist/collection/utils/download_from_buffer.js.map +1 -0
- package/dist/collection/utils/get_string_by_oid.js +2 -1
- package/dist/collection/utils/get_string_by_oid.js.map +1 -0
- package/dist/collection/utils/index.js +2 -1
- package/dist/collection/utils/index.js.map +1 -0
- package/dist/collection/utils/is_link.js +1 -0
- package/dist/collection/utils/is_link.js.map +1 -0
- package/dist/collection/utils/l10n.js +2 -1
- package/dist/collection/utils/l10n.js.map +1 -0
- package/dist/collection/utils/read_file.js +1 -0
- package/dist/collection/utils/read_file.js.map +1 -0
- package/dist/collection/utils/third_party_links.js +1 -0
- package/dist/collection/utils/third_party_links.js.map +1 -0
- package/dist/collection/utils/validator.js +1 -0
- package/dist/collection/utils/validator.js.map +1 -0
- package/dist/collection/www-copy/index.js +138 -32
- package/dist/esm/arrow_top-efd3a56d.js +34 -0
- package/dist/esm/arrow_top-efd3a56d.js.map +1 -0
- package/dist/esm/button-35146bdd.js +74 -0
- package/dist/esm/button-35146bdd.js.map +1 -0
- package/dist/esm/{certification_request-23cd5124.js → certification_request-5cadde9f.js} +171 -9
- package/dist/esm/certification_request-5cadde9f.js.map +1 -0
- package/dist/esm/{crl-7f23c111.js → crl-11670c3e.js} +7 -6
- package/dist/esm/crl-11670c3e.js.map +1 -0
- package/dist/esm/download-0cc3077a.js +21 -0
- package/dist/esm/download-0cc3077a.js.map +1 -0
- package/dist/esm/download-57c5bf8f.js +470 -0
- package/dist/esm/download-57c5bf8f.js.map +1 -0
- package/dist/esm/index-4079bbb5.js +2448 -0
- package/dist/esm/index-4079bbb5.js.map +1 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +6 -12
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/{miscellaneous-c7c0d04a.js → miscellaneous-1d4e8b41.js} +53 -37
- package/dist/esm/miscellaneous-1d4e8b41.js.map +1 -0
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +80 -23
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -0
- package/dist/esm/peculiar-button-menu_3.entry.js +104 -0
- package/dist/esm/peculiar-button-menu_3.entry.js.map +1 -0
- package/dist/esm/peculiar-certificate-decoder.entry.js +30 -19
- package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -0
- package/dist/esm/peculiar-certificate-viewer.entry.js +34 -11
- package/dist/esm/peculiar-certificate-viewer.entry.js.map +1 -0
- package/dist/esm/peculiar-certificates-viewer.entry.js +183 -85
- package/dist/esm/peculiar-certificates-viewer.entry.js.map +1 -0
- package/dist/esm/peculiar-text-hider.entry.js +7 -13
- package/dist/esm/peculiar-text-hider.entry.js.map +1 -0
- package/dist/esm/peculiar.js +8 -58
- package/dist/esm/peculiar.js.map +1 -0
- package/dist/esm/{x509_certificate-d8e0af2d.js → x509_certificate-dfae6999.js} +4 -3
- package/dist/esm/x509_certificate-dfae6999.js.map +1 -0
- package/dist/esm-es5/arrow_top-efd3a56d.js +19 -0
- package/dist/esm-es5/arrow_top-efd3a56d.js.map +1 -0
- package/dist/esm-es5/button-35146bdd.js +19 -0
- package/dist/esm-es5/button-35146bdd.js.map +1 -0
- package/dist/esm-es5/certification_request-5cadde9f.js +97 -0
- package/dist/esm-es5/certification_request-5cadde9f.js.map +1 -0
- package/dist/esm-es5/crl-11670c3e.js +33 -0
- package/dist/esm-es5/crl-11670c3e.js.map +1 -0
- package/dist/esm-es5/download-0cc3077a.js +12 -0
- package/dist/esm-es5/download-0cc3077a.js.map +1 -0
- package/dist/esm-es5/download-57c5bf8f.js +19 -0
- package/dist/esm-es5/download-57c5bf8f.js.map +1 -0
- package/dist/esm-es5/index-4079bbb5.js +6 -0
- package/dist/esm-es5/index-4079bbb5.js.map +1 -0
- package/dist/esm-es5/index.js +5 -0
- package/dist/esm-es5/index.js.map +1 -0
- package/dist/esm-es5/loader.js +5 -0
- package/dist/esm-es5/loader.js.map +1 -0
- package/dist/esm-es5/miscellaneous-1d4e8b41.js +355 -0
- package/dist/esm-es5/miscellaneous-1d4e8b41.js.map +1 -0
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +110 -0
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -0
- package/dist/esm-es5/peculiar-button-menu_3.entry.js +12 -0
- package/dist/esm-es5/peculiar-button-menu_3.entry.js.map +1 -0
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js +12 -0
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -0
- package/dist/esm-es5/peculiar-certificate-viewer.entry.js +5 -0
- package/dist/esm-es5/peculiar-certificate-viewer.entry.js.map +1 -0
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js +33 -0
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js.map +1 -0
- package/dist/esm-es5/peculiar-text-hider.entry.js +5 -0
- package/dist/esm-es5/peculiar-text-hider.entry.js.map +1 -0
- package/dist/esm-es5/peculiar.js +5 -0
- package/dist/esm-es5/peculiar.js.map +1 -0
- package/dist/esm-es5/x509_certificate-dfae6999.js +12 -0
- package/dist/esm-es5/x509_certificate-dfae6999.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/peculiar/index.esm.js +2 -1
- package/dist/peculiar/index.esm.js.map +1 -0
- package/dist/peculiar/locales/en.json +4 -3
- package/dist/peculiar/p-0b356bb5.js +6 -0
- package/dist/peculiar/p-0b356bb5.js.map +1 -0
- package/dist/peculiar/p-0bdcdbf7.system.js +355 -0
- package/dist/peculiar/p-0bdcdbf7.system.js.map +1 -0
- package/dist/peculiar/p-17e3c47b.js +12 -0
- package/dist/peculiar/p-17e3c47b.js.map +1 -0
- package/dist/peculiar/p-23555789.system.entry.js +34 -0
- package/dist/peculiar/p-23555789.system.entry.js.map +1 -0
- package/dist/peculiar/p-2fcad8cb.system.js +20 -0
- package/dist/peculiar/p-2fcad8cb.system.js.map +1 -0
- package/dist/peculiar/p-31586b23.system.js +13 -0
- package/dist/peculiar/p-31586b23.system.js.map +1 -0
- package/dist/peculiar/p-43eb3721.js +33 -0
- package/dist/peculiar/p-43eb3721.js.map +1 -0
- package/dist/peculiar/p-5823e6e8.entry.js +12 -0
- package/dist/peculiar/p-5823e6e8.entry.js.map +1 -0
- package/dist/peculiar/p-596836a7.entry.js +33 -0
- package/dist/peculiar/p-596836a7.entry.js.map +1 -0
- package/dist/peculiar/p-5aabeba7.system.js +6 -0
- package/dist/peculiar/p-5aabeba7.system.js.map +1 -0
- package/dist/peculiar/p-6667fe6e.system.js +34 -0
- package/dist/peculiar/p-6667fe6e.system.js.map +1 -0
- package/dist/peculiar/p-6e79b9c8.js +12 -0
- package/dist/peculiar/p-6e79b9c8.js.map +1 -0
- package/dist/peculiar/p-709994c1.js +19 -0
- package/dist/peculiar/p-709994c1.js.map +1 -0
- package/dist/peculiar/p-74c241e7.js +97 -0
- package/dist/peculiar/p-74c241e7.js.map +1 -0
- package/dist/peculiar/p-7f9beaa8.js +19 -0
- package/dist/peculiar/p-7f9beaa8.js.map +1 -0
- package/dist/peculiar/p-80832207.system.js +5 -0
- package/dist/peculiar/p-80832207.system.js.map +1 -0
- package/dist/peculiar/p-8748391f.system.entry.js +5 -0
- package/dist/peculiar/p-8748391f.system.entry.js.map +1 -0
- package/dist/peculiar/p-882e1281.entry.js +12 -0
- package/dist/peculiar/p-882e1281.entry.js.map +1 -0
- package/dist/peculiar/p-90459cec.entry.js +5 -0
- package/dist/peculiar/p-90459cec.entry.js.map +1 -0
- package/dist/peculiar/p-97688065.js +355 -0
- package/dist/peculiar/p-97688065.js.map +1 -0
- package/dist/peculiar/p-99e3aa0c.system.entry.js +111 -0
- package/dist/peculiar/p-99e3aa0c.system.entry.js.map +1 -0
- package/dist/peculiar/p-9b4a8101.system.entry.js +5 -0
- package/dist/peculiar/p-9b4a8101.system.entry.js.map +1 -0
- package/dist/peculiar/p-a053c132.js +19 -0
- package/dist/peculiar/p-a053c132.js.map +1 -0
- package/dist/peculiar/p-a41ecd82.entry.js +5 -0
- package/dist/peculiar/p-a41ecd82.entry.js.map +1 -0
- package/dist/peculiar/p-ae9189f6.system.js +19 -0
- package/dist/peculiar/p-ae9189f6.system.js.map +1 -0
- package/dist/peculiar/p-bd485115.system.entry.js +13 -0
- package/dist/peculiar/p-bd485115.system.entry.js.map +1 -0
- package/dist/peculiar/p-c0a298fd.system.js +97 -0
- package/dist/peculiar/p-c0a298fd.system.js.map +1 -0
- package/dist/peculiar/p-daf23673.system.js +20 -0
- package/dist/peculiar/p-daf23673.system.js.map +1 -0
- package/dist/peculiar/p-e1960173.system.js +5 -0
- package/dist/peculiar/p-e1960173.system.js.map +1 -0
- package/dist/peculiar/p-e2cc7410.entry.js +110 -0
- package/dist/peculiar/p-e2cc7410.entry.js.map +1 -0
- package/dist/peculiar/p-e39de121.system.entry.js +13 -0
- package/dist/peculiar/p-e39de121.system.entry.js.map +1 -0
- package/dist/peculiar/p-e6a3b4d4.system.js +13 -0
- package/dist/peculiar/p-e6a3b4d4.system.js.map +1 -0
- package/dist/peculiar/peculiar.css +1 -1
- package/dist/peculiar/peculiar.esm.js +2 -1
- package/dist/peculiar/peculiar.esm.js.map +1 -0
- package/dist/peculiar/peculiar.js +127 -0
- package/dist/types/components/attribute-certificate-viewer/attribute-certificate-viewer.d.ts +15 -3
- package/dist/types/components/button/button.d.ts +5 -16
- package/dist/types/components/button/index.d.ts +2 -0
- package/dist/types/components/button-menu/button-menu.d.ts +21 -0
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +9 -6
- package/dist/types/components/certificate-details-parts/miscellaneous.d.ts +1 -1
- package/dist/types/components/certificate-summary/certificate-summary.d.ts +4 -3
- package/dist/types/components/certificate-summary/index.d.ts +1 -0
- package/dist/types/components/certificate-viewer/certificate-viewer.d.ts +13 -5
- package/dist/types/components/certificates-viewer/certificates-viewer.d.ts +22 -11
- package/dist/types/components/crl-viewer/crl-viewer.d.ts +13 -5
- package/dist/types/components/csr-viewer/csr-viewer.d.ts +13 -5
- package/dist/types/components/icons/actions.d.ts +12 -0
- package/dist/types/components/icons/arrow_bottom.d.ts +12 -0
- package/dist/types/components/icons/arrow_top.d.ts +12 -0
- package/dist/types/components/icons/cross.d.ts +12 -0
- package/dist/types/components/icons/details.d.ts +12 -0
- package/dist/types/components/icons/download.d.ts +12 -0
- package/dist/types/components/icons/index.d.ts +7 -0
- package/dist/types/components/icons/link.d.ts +12 -0
- package/dist/types/components/link/index.d.ts +1 -0
- package/dist/types/components/link/link.d.ts +6 -6
- package/dist/types/components/text-hider/text-hider.d.ts +0 -3
- package/dist/types/components/typography/index.d.ts +1 -0
- package/dist/types/components/typography/typography.d.ts +10 -20
- package/dist/types/components.d.ts +74 -175
- package/dist/types/crypto/attribute.d.ts +1 -1
- package/dist/types/crypto/extension.d.ts +1 -1
- package/dist/types/interface.d.ts +98 -6
- package/dist/types/stencil-public-runtime.d.ts +110 -23
- package/dist/types/utils/l10n.d.ts +5 -4
- package/dist/types/utils/read_file.d.ts +1 -1
- package/hydrate/index.d.ts +218 -0
- package/hydrate/index.js +22549 -0
- package/hydrate/package.json +6 -0
- package/loader/index.d.ts +10 -1
- package/loader/index.js +1 -1
- package/loader/package.json +1 -0
- package/package.json +6 -4
- package/dist/cjs/dom-f57e260e.js +0 -78
- package/dist/cjs/index-064e95c7.js +0 -1441
- package/dist/cjs/l10n-ddc7cff9.js +0 -169
- package/dist/cjs/peculiar-button-split_4.cjs.entry.js +0 -128
- package/dist/cjs/peculiar-button.cjs.entry.js +0 -40
- package/dist/cjs/peculiar-link.cjs.entry.js +0 -29
- package/dist/cjs/peculiar-typography.cjs.entry.js +0 -38
- package/dist/collection/components/button/button.css +0 -81
- package/dist/collection/components/button-split/button-split.css +0 -57
- package/dist/collection/components/button-split/button-split.js +0 -116
- package/dist/collection/components/certificate-summary/certificate-summary.css +0 -49
- package/dist/collection/components/link/link.css +0 -59
- package/dist/collection/components/typography/typography.css +0 -95
- package/dist/esm/dom-f1b08a97.js +0 -76
- package/dist/esm/index-bbd484d9.js +0 -1410
- package/dist/esm/l10n-d48f35ff.js +0 -165
- package/dist/esm/peculiar-button-split_4.entry.js +0 -121
- package/dist/esm/peculiar-button.entry.js +0 -36
- package/dist/esm/peculiar-link.entry.js +0 -25
- package/dist/esm/peculiar-typography.entry.js +0 -34
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/peculiar/p-01cea5c0.entry.js +0 -11
- package/dist/peculiar/p-3bfefa4a.entry.js +0 -18
- package/dist/peculiar/p-4e8169cb.entry.js +0 -4
- package/dist/peculiar/p-57b89412.entry.js +0 -4
- package/dist/peculiar/p-5b4eed12.entry.js +0 -4
- package/dist/peculiar/p-610b85e3.entry.js +0 -4
- package/dist/peculiar/p-6d37c8b5.entry.js +0 -4
- package/dist/peculiar/p-711b4e1e.js +0 -18
- package/dist/peculiar/p-81a88a33.js +0 -11
- package/dist/peculiar/p-918aeee4.entry.js +0 -4
- package/dist/peculiar/p-9f4ee110.js +0 -22
- package/dist/peculiar/p-a050e184.js +0 -69
- package/dist/peculiar/p-c24c26c2.js +0 -32
- package/dist/peculiar/p-df53fbcc.entry.js +0 -4
- package/dist/peculiar/p-ec250cc4.js +0 -12
- package/dist/peculiar/p-f7683ba5.js +0 -5
- package/dist/peculiar/p-fe05f51e.js +0 -79
- package/dist/types/components/button-split/button-split.d.ts +0 -21
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@peculiar/certificates-viewer/components",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Peculiar Components exported as custom elements, extending HTMLElement.",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"types": "./custom-elements.d.ts",
|
|
7
|
+
"private": true,
|
|
8
|
+
"sideEffects": false
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
+
|
|
3
|
+
interface PeculiarAttributeCertificateViewer extends Components.PeculiarAttributeCertificateViewer, HTMLElement {}
|
|
4
|
+
export const PeculiarAttributeCertificateViewer: {
|
|
5
|
+
prototype: PeculiarAttributeCertificateViewer;
|
|
6
|
+
new (): PeculiarAttributeCertificateViewer;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { A as AttributeCertificateViewer, d as defineCustomElement$1 } from './attribute-certificate-viewer.js';
|
|
5
|
+
|
|
6
|
+
const PeculiarAttributeCertificateViewer = AttributeCertificateViewer;
|
|
7
|
+
const defineCustomElement = defineCustomElement$1;
|
|
8
|
+
|
|
9
|
+
export { PeculiarAttributeCertificateViewer, defineCustomElement };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=peculiar-attribute-certificate-viewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"peculiar-attribute-certificate-viewer.js","mappings":";;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
+
|
|
3
|
+
interface PeculiarButtonMenu extends Components.PeculiarButtonMenu, HTMLElement {}
|
|
4
|
+
export const PeculiarButtonMenu: {
|
|
5
|
+
prototype: PeculiarButtonMenu;
|
|
6
|
+
new (): PeculiarButtonMenu;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { B as ButtonMenu, d as defineCustomElement$1 } from './button-menu.js';
|
|
5
|
+
|
|
6
|
+
const PeculiarButtonMenu = ButtonMenu;
|
|
7
|
+
const defineCustomElement = defineCustomElement$1;
|
|
8
|
+
|
|
9
|
+
export { PeculiarButtonMenu, defineCustomElement };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=peculiar-button-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"peculiar-button-menu.js","mappings":";;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
+
|
|
3
|
+
interface PeculiarCertificateDecoder extends Components.PeculiarCertificateDecoder, HTMLElement {}
|
|
4
|
+
export const PeculiarCertificateDecoder: {
|
|
5
|
+
prototype: PeculiarCertificateDecoder;
|
|
6
|
+
new (): PeculiarCertificateDecoder;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
5
|
+
import { Y as isPem, Z as isX509Pem, _ as isPkcs10Pem, $ as isX509AttributePem, a0 as isX509CRLPem } from './miscellaneous.js';
|
|
6
|
+
import './download.js';
|
|
7
|
+
import { X as X509Certificate, d as defineCustomElement$4 } from './certificate-viewer.js';
|
|
8
|
+
import { X as X509AttributeCertificate, d as defineCustomElement$5 } from './attribute-certificate-viewer.js';
|
|
9
|
+
import { C as CSR, d as defineCustomElement$2 } from './csr-viewer.js';
|
|
10
|
+
import { C as CRL, d as defineCustomElement$3 } from './crl-viewer.js';
|
|
11
|
+
import { T as Typography, B as Button } from './button.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @license
|
|
15
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the MIT license found in the
|
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Read file as Binary string
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```js
|
|
25
|
+
* const file = new File(['file'], 'file.pdf', { type: 'text/plain' });
|
|
26
|
+
* readAsBinaryString(file)
|
|
27
|
+
* .then(result => console.log('Readed success', result))
|
|
28
|
+
* .catch(err => console.log('An error occured when reading file', err));
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
function readAsBinaryString(file) {
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
const reader = new FileReader();
|
|
34
|
+
reader.onload = () => resolve({
|
|
35
|
+
value: reader.result,
|
|
36
|
+
fileName: file.name,
|
|
37
|
+
fileSize: file.size,
|
|
38
|
+
sourceMime: file.type,
|
|
39
|
+
});
|
|
40
|
+
reader.onerror = () => reject(reader.error);
|
|
41
|
+
reader.readAsBinaryString(file);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const certificateDecoderCss = "*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%}.textarea{min-height:300px;width:100%;border-radius:4px;border:1px solid var(--pv-color-gray-5);padding:14px;font-family:monospace;resize:vertical}.viewer{margin-top:var(--pv-size-base-12)}.controls{margin-top:var(--pv-size-base-2);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--pv-size-base-2)}.control_row{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--pv-size-base)}";
|
|
46
|
+
|
|
47
|
+
const CertificateDecoder = /*@__PURE__*/ proxyCustomElement(class CertificateDecoder extends HTMLElement {
|
|
48
|
+
constructor() {
|
|
49
|
+
super();
|
|
50
|
+
this.__registerHost();
|
|
51
|
+
this.__attachShadow();
|
|
52
|
+
this.successParse = createEvent(this, "successParse", 7);
|
|
53
|
+
this.clearCertificate = createEvent(this, "clearCertificate", 7);
|
|
54
|
+
this.handleClickDecode = () => {
|
|
55
|
+
const { value } = this.inputPaste;
|
|
56
|
+
if (value) {
|
|
57
|
+
this.decode(value);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
this.handleClickClear = () => {
|
|
61
|
+
this.clearValue();
|
|
62
|
+
};
|
|
63
|
+
this.handleChangeInputFile = async (event) => {
|
|
64
|
+
const element = event.target;
|
|
65
|
+
if (element.files) {
|
|
66
|
+
const file = await readAsBinaryString(element.files[0]);
|
|
67
|
+
if (typeof file.value === 'string') {
|
|
68
|
+
this.decode(file.value);
|
|
69
|
+
}
|
|
70
|
+
element.value = '';
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
this.handleChangeExample = (event) => {
|
|
74
|
+
if (event.target.value) {
|
|
75
|
+
this.decode(event.target.value);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
this.clearValue();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
this.handleDropFile = async (event) => {
|
|
82
|
+
event.stopPropagation();
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
const element = event.dataTransfer;
|
|
85
|
+
if (element.files) {
|
|
86
|
+
const file = await readAsBinaryString(element.files[0]);
|
|
87
|
+
if (typeof file.value === 'string') {
|
|
88
|
+
this.decode(file.value);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
this.certificateExamples = undefined;
|
|
93
|
+
this.defaultCertificate = undefined;
|
|
94
|
+
this.certificateDecoded = undefined;
|
|
95
|
+
}
|
|
96
|
+
componentDidLoad() {
|
|
97
|
+
if (this.defaultCertificate) {
|
|
98
|
+
/**
|
|
99
|
+
* Prevent Stencil warning about re-render
|
|
100
|
+
*/
|
|
101
|
+
setTimeout(() => this.decode(this.defaultCertificate), 100);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
clearValue() {
|
|
105
|
+
this.inputPaste.value = '';
|
|
106
|
+
this.certificateDecoded = null;
|
|
107
|
+
this.clearCertificate.emit();
|
|
108
|
+
}
|
|
109
|
+
setValue(value) {
|
|
110
|
+
this.certificateDecoded = value;
|
|
111
|
+
this.inputPaste.value = value.exportAsPemFormatted();
|
|
112
|
+
this.successParse.emit(value.exportAsBase64());
|
|
113
|
+
}
|
|
114
|
+
decode(certificate) {
|
|
115
|
+
const isPem$1 = isPem(certificate);
|
|
116
|
+
const isX509Pem$1 = isX509Pem(certificate);
|
|
117
|
+
const isPkcs10Pem$1 = isPkcs10Pem(certificate);
|
|
118
|
+
const isX509AttributePem$1 = isX509AttributePem(certificate);
|
|
119
|
+
const isX509CRLPem$1 = isX509CRLPem(certificate);
|
|
120
|
+
let decoded;
|
|
121
|
+
let decodeError;
|
|
122
|
+
if (isPem$1 && !(isX509Pem$1 || isX509AttributePem$1 || isPkcs10Pem$1 || isX509CRLPem$1)) {
|
|
123
|
+
this.clearValue();
|
|
124
|
+
alert('Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.');
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
try {
|
|
128
|
+
if (isX509Pem$1) {
|
|
129
|
+
decoded = new X509Certificate(certificate);
|
|
130
|
+
}
|
|
131
|
+
if (isX509AttributePem$1) {
|
|
132
|
+
decoded = new X509AttributeCertificate(certificate);
|
|
133
|
+
}
|
|
134
|
+
if (isPkcs10Pem$1) {
|
|
135
|
+
decoded = new CSR(certificate);
|
|
136
|
+
}
|
|
137
|
+
if (isX509CRLPem$1) {
|
|
138
|
+
decoded = new CRL(certificate);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
decodeError = error;
|
|
143
|
+
}
|
|
144
|
+
if (!decoded) {
|
|
145
|
+
try {
|
|
146
|
+
decoded = new X509Certificate(certificate);
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
decodeError = error;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (!decoded) {
|
|
153
|
+
try {
|
|
154
|
+
decoded = new X509AttributeCertificate(certificate);
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
decodeError = error;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (!decoded) {
|
|
161
|
+
try {
|
|
162
|
+
decoded = new CSR(certificate);
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
decodeError = error;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (!decoded) {
|
|
169
|
+
try {
|
|
170
|
+
decoded = new CRL(certificate);
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
decodeError = error;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (!decoded) {
|
|
177
|
+
this.clearValue();
|
|
178
|
+
console.log(decodeError);
|
|
179
|
+
alert('Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.');
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
this.setValue(decoded);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
render() {
|
|
186
|
+
var _a;
|
|
187
|
+
return (h(Host, null, h("textarea", { placeholder: "Certificate DER or PEM", class: "textarea t-b2 c-black", ref: (el) => { this.inputPaste = el; }, onDrop: this.handleDropFile }), h("div", { class: "controls" }, h("div", { class: "control_row" }, h(Typography, { variant: "b3", color: "secondary-tint-2" }, "Drag or load file:"), h("input", { type: "file", accept: "application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl", onChange: this.handleChangeInputFile, value: "" })), ((_a = this.certificateExamples) === null || _a === void 0 ? void 0 : _a.length) && (h("div", { class: "control_row" }, h(Typography, { variant: "b3", color: "secondary-tint-2" }, "Load examples:"), h("select", { onChange: this.handleChangeExample }, h("option", { value: "" }, "None"), this.certificateExamples.map((example) => (h("option", { value: example.value }, example.title)))))), h("div", { class: "control_row" }, h(Button, { onClick: this.handleClickDecode }, "Decode"), h(Button, { onClick: this.handleClickClear }, "Clear"))), this.certificateDecoded instanceof X509Certificate && (h("peculiar-certificate-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })), this.certificateDecoded instanceof X509AttributeCertificate && (h("peculiar-attribute-certificate-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })), this.certificateDecoded instanceof CSR && (h("peculiar-csr-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })), this.certificateDecoded instanceof CRL && (h("peculiar-crl-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true }))));
|
|
188
|
+
}
|
|
189
|
+
static get style() { return certificateDecoderCss; }
|
|
190
|
+
}, [1, "peculiar-certificate-decoder", {
|
|
191
|
+
"certificateExamples": [16],
|
|
192
|
+
"defaultCertificate": [1, "default-certificate"],
|
|
193
|
+
"certificateDecoded": [32]
|
|
194
|
+
}]);
|
|
195
|
+
function defineCustomElement$1() {
|
|
196
|
+
if (typeof customElements === "undefined") {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
const components = ["peculiar-certificate-decoder", "peculiar-attribute-certificate-viewer", "peculiar-certificate-viewer", "peculiar-crl-viewer", "peculiar-csr-viewer"];
|
|
200
|
+
components.forEach(tagName => { switch (tagName) {
|
|
201
|
+
case "peculiar-certificate-decoder":
|
|
202
|
+
if (!customElements.get(tagName)) {
|
|
203
|
+
customElements.define(tagName, CertificateDecoder);
|
|
204
|
+
}
|
|
205
|
+
break;
|
|
206
|
+
case "peculiar-attribute-certificate-viewer":
|
|
207
|
+
if (!customElements.get(tagName)) {
|
|
208
|
+
defineCustomElement$5();
|
|
209
|
+
}
|
|
210
|
+
break;
|
|
211
|
+
case "peculiar-certificate-viewer":
|
|
212
|
+
if (!customElements.get(tagName)) {
|
|
213
|
+
defineCustomElement$4();
|
|
214
|
+
}
|
|
215
|
+
break;
|
|
216
|
+
case "peculiar-crl-viewer":
|
|
217
|
+
if (!customElements.get(tagName)) {
|
|
218
|
+
defineCustomElement$3();
|
|
219
|
+
}
|
|
220
|
+
break;
|
|
221
|
+
case "peculiar-csr-viewer":
|
|
222
|
+
if (!customElements.get(tagName)) {
|
|
223
|
+
defineCustomElement$2();
|
|
224
|
+
}
|
|
225
|
+
break;
|
|
226
|
+
} });
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const PeculiarCertificateDecoder = CertificateDecoder;
|
|
230
|
+
const defineCustomElement = defineCustomElement$1;
|
|
231
|
+
|
|
232
|
+
export { PeculiarCertificateDecoder, defineCustomElement };
|
|
233
|
+
|
|
234
|
+
//# sourceMappingURL=peculiar-certificate-decoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"peculiar-certificate-decoder.js","mappings":";;;;;;;;;;;;AAAA;;;;;;;AAqBA;;;;;;;;;;;SAYgB,kBAAkB,CAAC,IAAmB;EACpD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM;IACjC,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAEhC,MAAM,CAAC,MAAM,GAAG,MAAM,OAAO,CAAC;MAC5B,KAAK,EAAE,MAAM,CAAC,MAAM;MACpB,QAAQ,EAAE,IAAI,CAAC,IAAI;MACnB,QAAQ,EAAE,IAAI,CAAC,IAAI;MACnB,UAAU,EAAE,IAAI,CAAC,IAAI;KACtB,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAE5C,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;GACjC,CAAC,CAAC;AACL;;AChDA,MAAM,qBAAqB,GAAG,inQAAinQ;;MCiCloQ,kBAAkB;;;;;;;IAqCrB,sBAAiB,GAAG;MAC1B,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;MAElC,IAAI,KAAK,EAAE;QACT,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;OACpB;KACF,CAAC;IAEM,qBAAgB,GAAG;MACzB,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB,CAAC;IAEM,0BAAqB,GAAG,OAAO,KAAU;MAC/C,MAAM,OAAO,GAAG,KAAK,CAAC,MA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ACI,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["isPem","validator.isPem","isX509Pem","validator.isX509Pem","isPkcs10Pem","validator.isPkcs10Pem","isX509AttributePem","validator.isX509AttributePem","isX509CRLPem","validator.isX509CRLPem"],"sources":["src/utils/read_file.ts","src/components/certificate-decoder/certificate-decoder.scss?tag=peculiar-certificate-decoder&encapsulation=shadow","src/components/certificate-decoder/certificate-decoder.tsx"],"sourcesContent":["/**\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\nexport type FileValue = string | ArrayBuffer | null;\nexport interface IFileDataType extends Blob {\n name?: string;\n mimeType?: string;\n lastModified?: number;\n}\nexport interface IReadFileResult {\n value: FileValue;\n fileName: string | undefined;\n fileSize: number | undefined;\n sourceMime: string | undefined;\n}\n\n/**\n * Read file as Binary string\n *\n * @example\n * ```js\n * const file = new File(['file'], 'file.pdf', { type: 'text/plain' });\n * readAsBinaryString(file)\n * .then(result => console.log('Readed success', result))\n * .catch(err => console.log('An error occured when reading file', err));\n * ```\n */\n\nexport function readAsBinaryString(file: IFileDataType): Promise<IReadFileResult> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = () => resolve({\n value: reader.result,\n fileName: file.name,\n fileSize: file.size,\n sourceMime: file.type,\n });\n\n reader.onerror = () => reject(reader.error);\n\n reader.readAsBinaryString(file);\n });\n}\n\n/**\n * Read file as ArrayBuffer\n *\n * @example\n * ```js\n * const file = new File(['file'], 'file.pdf', { type: 'text/plain' });\n * readAsArrayBuffer(file)\n * .then(result => console.log('Readed success', result))\n * .catch(err => console.log('An error occured when reading file', err));\n * ```\n */\n\nexport function readAsArrayBuffer(file: IFileDataType): Promise<IReadFileResult> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = () => resolve({\n value: reader.result,\n fileName: file.name,\n fileSize: file.size,\n sourceMime: file.type,\n });\n\n reader.onerror = () => reject(reader.error);\n\n reader.readAsArrayBuffer(file);\n });\n}\n\n/**\n * Read file as Data URL\n *\n * @example\n * ```js\n * const file = new File(['file'], 'file.pdf', { type: 'text/plain' });\n * readAsDataUrl(file)\n * .then(result => console.log('Readed success', result))\n * .catch(err => console.log('An error occured when reading file', err));\n * ```\n */\n\nexport function readAsDataUrl(file: IFileDataType): Promise<IReadFileResult> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = () => resolve({\n value: reader.result,\n fileName: file.name,\n fileSize: file.size,\n sourceMime: file.type,\n });\n\n reader.onerror = () => reject(reader.error);\n\n reader.readAsDataURL(file);\n });\n}\n\n/**\n * Read file as Text\n *\n * @example\n * ```js\n * const file = new File(['file'], 'file.pdf', { type: 'text/plain' });\n * readAsText(file)\n * .then(result => console.log('Readed success', result))\n * .catch(err => console.log('An error occured when reading file', err));\n * ```\n */\n\nexport function readAsText(file: IFileDataType, options?: string): Promise<IReadFileResult> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = () => resolve({\n value: reader.result,\n fileName: file.name,\n fileSize: file.size,\n sourceMime: file.type,\n });\n\n reader.onerror = () => reject(reader.error);\n\n reader.readAsText(file, options);\n });\n}\n","@import 'base';\n\n:host {\n display: block;\n width: 100%;\n}\n\n.textarea {\n min-height: 300px;\n width: 100%;\n border-radius: 4px;\n border: 1px solid var(--pv-color-gray-5);;\n padding: 14px;\n font-family: monospace;\n resize: vertical;\n}\n\n.viewer {\n margin-top: var(--pv-size-base-12);\n}\n\n.controls {\n margin-top: var(--pv-size-base-2);\n display: flex;\n flex-direction: column;\n gap: var(--pv-size-base-2);\n}\n\n.control_row {\n display: flex;\n align-items: center;\n gap: var(--pv-size-base);\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Host,\n h,\n State,\n Prop,\n Event,\n EventEmitter,\n} from '@stencil/core';\n\nimport { validator, readAsBinaryString } from '../../utils';\nimport {\n X509Certificate,\n X509AttributeCertificate,\n CSR,\n CRL,\n} from '../../crypto';\nimport { Button } from '../button';\nimport { Typography } from '../typography';\n\n@Component({\n tag: 'peculiar-certificate-decoder',\n styleUrl: 'certificate-decoder.scss',\n shadow: true,\n})\nexport class CertificateDecoder {\n private inputPaste?: HTMLTextAreaElement;\n\n /**\n * The example certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() certificateExamples?: {\n title: string;\n value: string;\n }[];\n\n /**\n * The default certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() defaultCertificate?: string;\n\n @State() certificateDecoded: X509Certificate | X509AttributeCertificate | CSR | CRL;\n\n /**\n * Emitted when the certificate has been successfully parsed.\n */\n @Event() successParse!: EventEmitter<string>;\n\n /**\n * Emitted when the certificate has been removed.\n */\n @Event() clearCertificate!: EventEmitter<void>;\n\n componentDidLoad() {\n if (this.defaultCertificate) {\n /**\n * Prevent Stencil warning about re-render\n */\n setTimeout(() => this.decode(this.defaultCertificate), 100);\n }\n }\n\n private handleClickDecode = () => {\n const { value } = this.inputPaste;\n\n if (value) {\n this.decode(value);\n }\n };\n\n private handleClickClear = () => {\n this.clearValue();\n };\n\n private handleChangeInputFile = async (event: any) => {\n const element = event.target;\n\n if (element.files) {\n const file = await readAsBinaryString(element.files[0]);\n\n if (typeof file.value === 'string') {\n this.decode(file.value);\n }\n\n element.value = '';\n }\n };\n\n private handleChangeExample = (event: any) => {\n if (event.target.value) {\n this.decode(event.target.value);\n } else {\n this.clearValue();\n }\n };\n\n private handleDropFile = async (event: any) => {\n event.stopPropagation();\n event.preventDefault();\n\n const element = event.dataTransfer;\n\n if (element.files) {\n const file = await readAsBinaryString(element.files[0]);\n\n if (typeof file.value === 'string') {\n this.decode(file.value);\n }\n }\n };\n\n clearValue() {\n this.inputPaste.value = '';\n this.certificateDecoded = null;\n this.clearCertificate.emit();\n }\n\n setValue(value: X509Certificate | X509AttributeCertificate | CSR | CRL) {\n this.certificateDecoded = value;\n this.inputPaste.value = value.exportAsPemFormatted();\n this.successParse.emit(value.exportAsBase64());\n }\n\n decode(certificate: string) {\n const isPem = validator.isPem(certificate);\n const isX509Pem = validator.isX509Pem(certificate);\n const isPkcs10Pem = validator.isPkcs10Pem(certificate);\n const isX509AttributePem = validator.isX509AttributePem(certificate);\n const isX509CRLPem = validator.isX509CRLPem(certificate);\n let decoded: X509Certificate | X509AttributeCertificate | CSR | CRL;\n let decodeError: Error;\n\n if (isPem && !(isX509Pem || isX509AttributePem || isPkcs10Pem || isX509CRLPem)) {\n this.clearValue();\n\n alert('Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.');\n\n return;\n }\n\n try {\n if (isX509Pem) {\n decoded = new X509Certificate(certificate);\n }\n\n if (isX509AttributePem) {\n decoded = new X509AttributeCertificate(certificate);\n }\n\n if (isPkcs10Pem) {\n decoded = new CSR(certificate);\n }\n\n if (isX509CRLPem) {\n decoded = new CRL(certificate);\n }\n } catch (error) {\n decodeError = error;\n }\n\n if (!decoded) {\n try {\n decoded = new X509Certificate(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n try {\n decoded = new X509AttributeCertificate(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n try {\n decoded = new CSR(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n try {\n decoded = new CRL(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n this.clearValue();\n\n console.log(decodeError);\n alert('Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.');\n } else {\n this.setValue(decoded);\n }\n }\n\n render() {\n return (\n <Host>\n <textarea\n placeholder=\"Certificate DER or PEM\"\n class=\"textarea t-b2 c-black\"\n ref={(el) => { this.inputPaste = el; }}\n onDrop={this.handleDropFile}\n />\n <div class=\"controls\">\n <div class=\"control_row\">\n <Typography\n variant=\"b3\"\n color=\"secondary-tint-2\"\n >\n Drag or load file:\n </Typography>\n <input\n type=\"file\"\n accept=\"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl\"\n onChange={this.handleChangeInputFile}\n value=\"\"\n />\n </div>\n {this.certificateExamples?.length && (\n <div class=\"control_row\">\n <Typography\n variant=\"b3\"\n color=\"secondary-tint-2\"\n >\n Load examples:\n </Typography>\n <select onChange={this.handleChangeExample}>\n <option value=\"\">None</option>\n {this.certificateExamples.map((example) => (\n <option value={example.value}>\n {example.title}\n </option>\n ))}\n </select>\n </div>\n )}\n <div class=\"control_row\">\n <Button\n onClick={this.handleClickDecode}\n >\n Decode\n </Button>\n <Button\n onClick={this.handleClickClear}\n >\n Clear\n </Button>\n </div>\n </div>\n {this.certificateDecoded instanceof X509Certificate && (\n <peculiar-certificate-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n {this.certificateDecoded instanceof X509AttributeCertificate && (\n <peculiar-attribute-certificate-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n {this.certificateDecoded instanceof CSR && (\n <peculiar-csr-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n {this.certificateDecoded instanceof CRL && (\n <peculiar-crl-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
+
|
|
3
|
+
interface PeculiarCertificateViewer extends Components.PeculiarCertificateViewer, HTMLElement {}
|
|
4
|
+
export const PeculiarCertificateViewer: {
|
|
5
|
+
prototype: PeculiarCertificateViewer;
|
|
6
|
+
new (): PeculiarCertificateViewer;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { C as CertificateViewer, d as defineCustomElement$1 } from './certificate-viewer.js';
|
|
5
|
+
|
|
6
|
+
const PeculiarCertificateViewer = CertificateViewer;
|
|
7
|
+
const defineCustomElement = defineCustomElement$1;
|
|
8
|
+
|
|
9
|
+
export { PeculiarCertificateViewer, defineCustomElement };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=peculiar-certificate-viewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"peculiar-certificate-viewer.js","mappings":";;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
+
|
|
3
|
+
interface PeculiarCertificatesViewer extends Components.PeculiarCertificatesViewer, HTMLElement {}
|
|
4
|
+
export const PeculiarCertificatesViewer: {
|
|
5
|
+
prototype: PeculiarCertificatesViewer;
|
|
6
|
+
new (): PeculiarCertificatesViewer;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|