@peculiar/certificates-viewer 3.10.1 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -64
- 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 +471 -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-26981468.system.entry.js +5 -0
- package/dist/peculiar/p-26981468.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-7ed7cd97.system.entry.js +111 -0
- package/dist/peculiar/p-7ed7cd97.system.entry.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-a053c132.js +19 -0
- package/dist/peculiar/p-a053c132.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-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/p-f3d85a5f.entry.js +110 -0
- package/dist/peculiar/p-f3d85a5f.entry.js.map +1 -0
- package/dist/peculiar/p-fd4b9a50.entry.js +5 -0
- package/dist/peculiar/p-fd4b9a50.entry.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 -1486
- 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 -1455
- 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
package/README.md
CHANGED
|
@@ -1,87 +1,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @peculiar/certificates-viewer
|
|
2
2
|
|
|
3
3
|
Peculiar Certificate Viewer web-components makes it easy for you to display certificate related details in your web application.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## CDN
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
npm install @peculiar/certificates-viewer
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
#### cdn
|
|
7
|
+
It's recommended to use [jsdelivr](https://www.jsdelivr.com/) to access the web-components from a CDN. To get the latest version, add the following inside the <head> element in an HTML file, or where external assets are included in the online code editor:
|
|
14
8
|
|
|
15
9
|
```html
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
<html>
|
|
11
|
+
<head>
|
|
12
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@peculiar/certificates-viewer/dist/peculiar/peculiar.esm.js"></script>
|
|
13
|
+
<script nomodule src="https://cdn.jsdelivr.net/npm/@peculiar/certificates-viewer/dist/peculiar/peculiar.js"></script>
|
|
14
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@peculiar/certificates-viewer/dist/peculiar/peculiar.css" />
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
<peculiar-certificate-viewer
|
|
18
|
+
certificate="MIIFWjCCA0KgAwIBAgIQbkepxUtHDA3sM9CJuRz04TANBgkqhkiG9w0BAQwFADBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2EQKLHuOhd5s73L+UPreVp0A8of2C+X0yBoJx9vaMf/vo27xqLpeXo4xL+Sv2sfnOhB2x+cWX3u+58qPpvBKJXqeqUqv4IyfLpLGcY9vXmX7wCl7raKb0xlpHDU0QM+NOsROjyBhsS+z8CZDfnWQpJSMHobTSPS5g4M/SCYe7zUjwTcLCeoiKu7rPWRnWr4+wB7CeMfGCwcDfLqZtbBkOtdh+JhpFAz2weaSUKK0PfyblqAj+lug8aJRT7oM6iCsVlgmy4HqMLnXWnOunVmSPlk9orj2XwoSPwLxAwAtcvfaHszVsrBhQf4TgTM2S0yDpM7xSma8ytSmzJSq0SPly4cpk9+aCEI3oncKKiPo4Zor8Y/kB+Xj9e1x3+naH+uzfsQ55lVe0vSbv1gHR6xYKu44LtcXFilWr06zqkUspzBmkMiVOKvFlRNACzqrOSbTqn3yDsEB750Orp2yjj32JgfpMpf/VjsPOS+C12LOORc92wO1AK/1TD7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
-
Then you can use the element anywhere in your template, JSX, html, etc.
|
|
24
|
+
## NPM
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
To get started with using components install the `@peculiar/certificates-viewer` package:
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
```html
|
|
32
|
-
<script>
|
|
33
|
-
var pvCertificatesViewer = document.createElement('peculiar-certificates-viewer');
|
|
34
|
-
|
|
35
|
-
pvCertificatesViewer.certificates = [
|
|
36
|
-
{
|
|
37
|
-
value: "MIIFWjCCA0KgAwIBAgIQbkepxUtHDA3sM9CJuRz04TANBgkqhkiG9w0BAQwFADBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2EQKLHuOhd5s73L+UPreVp0A8of2C+X0yBoJx9vaMf/vo27xqLpeXo4xL+Sv2sfnOhB2x+cWX3u+58qPpvBKJXqeqUqv4IyfLpLGcY9vXmX7wCl7raKb0xlpHDU0QM+NOsROjyBhsS+z8CZDfnWQpJSMHobTSPS5g4M/SCYe7zUjwTcLCeoiKu7rPWRnWr4+wB7CeMfGCwcDfLqZtbBkOtdh+JhpFAz2weaSUKK0PfyblqAj+lug8aJRT7oM6iCsVlgmy4HqMLnXWnOunVmSPlk9orj2XwoSPwLxAwAtcvfaHszVsrBhQf4TgTM2S0yDpM7xSma8ytSmzJSq0SPly4cpk9+aCEI3oncKKiPo4Zor8Y/kB+Xj9e1x3+naH+uzfsQ55lVe0vSbv1gHR6xYKu44LtcXFilWr06zqkUspzBmkMiVOKvFlRNACzqrOSbTqn3yDsEB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"https://good.r1demo.pki.goog/",
|
|
41
|
-
revoked: "https://revoked.r1demo.pki.goog/",
|
|
42
|
-
expired: "https://expired.r1demo.pki.goog/",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
value: "MIIFWjCCA0KgAwIBAgIQbkepxlqz5yDFMJo/aFLybzANBgkqhkiG9w0BAQwFADBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjIwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDO3v2m++zsFDQ8BwZabFn3GTXd98GdVarTzTukk3LvCvptnfbwhYBboUhSnznFt+4orO/LdmgUud+tAWyZH8QiHZ/+cnfgLFuv5AS/T3KgGjSY6Dlo7JUle3ah5mm5hRm9iYz+re026nO8/4Piy33B0s5Ks40FnotJk9/BW9BuXvAuMC6C/Pq8tBcKSOWIm8Wba96wyrQD8Nr0kLhlZPdcTK3ofmZemde4wj7I0BOdre7kRXuJVfeKH2JShBKzwkCX44ofR5GmdFrS+LFjKBC4swm4VndAoiaYecb+3yXuPuWgf9RhD1FLPD+M2uFwdNjCaKH5wQzpoeJ/u1U8dgbuak7MkogwTZq9TwtImoS1mKPV+3PBV2HdKFZ1E66HjucMUQkQdYhMvI35ezzUIkgfKtzra7tEscszcTJGr61K8YzodDqs5xoic4DSMPclQsciOzsSrZYuxsN2B6ogtzVJV+mSSeh2FnIxZyuWfoqjx5RWIr9qS34BIbIjMt/kmkRtWVtd9QCgHJvGeJeNkP+byKq0rxFROV7Z+2et1VsRnTKaG73VululycslaVNVJ1zgyjbLiGH7HrfQy+4W+9OmTN6SpdTi3/UGVN4unUu0kzCqgc7dGtxRcw1PcOnlthYhGXmy5okLdWTK1au8CcEYof/UVKGFPP0UJAOyh9OktwIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUu//KjiOfT5nK2+JopqUVJxce2Q4wDQYJKoZIhvcNAQEMBQADggIBALZp8KZ3/p7uC4Gt4cCpx/k1HUCCq+YEtN/L9x0Pg/B+E02NjO7jMyLDOfxA325BS0JTvhaI8dI4XsRomRyYUpOM52jtG2pzegVATX9lO9ZY8c6DR2Dj/5epnGB3GFW1fgiTz9D2PGcDFWEJ+YF59exTpJ/JjwGLc8R3dtyDovUMSRqodt6Sm2T4syzFJ9MHwAiApJiS4wGWAqoC7o87xdFtCjMwc3i5T1QWvwsHoaRc5svJXISPD+AVdyx+Jn7axEvbpxZ3B7DNdehyQtaVhJ2Gg/LkkM0JR9SLA3DaWsYDQvTtN6LwG1BUSw7YhN4ZKJmBR64JGz9I0cNv4rBgF/XuIwKl2gBbbZCr7qLpGzvpx0QnRY5rn/WkhLx3+WuXrD5RRaIRpsyF7gpo8j5QOHokYh4XIDdtak23CZvJ/KRY9bb7nE4Yu5UC56GtmwfuNmsk0jmGwZODUNKBRqhfYlcsu2xkiAhu7xNUX90txGdj08+JN7+dIPT7eoOboB6BAFDC5AwiWVIQ7UNWhwD4FFKnHYuTjKJNRn8nxnGbJN7k2oaLDX5rIMHAnuFl2GqjpuiFizoHCBy69Y9Vmhh1fuXsgWbRIXOhNUQLgD1bnF5vKheW0YMjiGZt5obicDIvUiLnyOd/xCxgXS/Dr55FBcOEArf9LAhST4Ldo/DUhgkC",
|
|
47
|
-
},
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
document.body.appendChild(pvCertificatesViewer);
|
|
51
|
-
</script>
|
|
28
|
+
```
|
|
29
|
+
npm install @peculiar/certificates-viewer
|
|
52
30
|
```
|
|
53
31
|
|
|
54
|
-
|
|
32
|
+
Import the components and stylesheets from peculiar in your main app file:
|
|
55
33
|
|
|
56
|
-
|
|
34
|
+
```ts
|
|
35
|
+
import { defineCustomElements } from '@peculiar/certificates-viewer/loader';
|
|
36
|
+
import '@peculiar/certificates-viewer/dist/peculiar/peculiar.css';
|
|
37
|
+
|
|
38
|
+
defineCustomElements();
|
|
39
|
+
```
|
|
57
40
|
|
|
58
|
-
|
|
41
|
+
Then you can use a components anywhere in your HTML.
|
|
59
42
|
|
|
60
43
|
```html
|
|
61
|
-
<
|
|
62
|
-
certificate
|
|
63
|
-
|
|
44
|
+
<body>
|
|
45
|
+
<peculiar-certificate-viewer
|
|
46
|
+
certificate="MIIFWjCCA0KgAwIBAgIQbkepxUtHDA3sM9CJuRz04TANBgkqhkiG9w0BAQwFADBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2EQKLHuOhd5s73L+UPreVp0A8of2C+X0yBoJx9vaMf/vo27xqLpeXo4xL+Sv2sfnOhB2x+cWX3u+58qPpvBKJXqeqUqv4IyfLpLGcY9vXmX7wCl7raKb0xlpHDU0QM+NOsROjyBhsS+z8CZDfnWQpJSMHobTSPS5g4M/SCYe7zUjwTcLCeoiKu7rPWRnWr4+wB7CeMfGCwcDfLqZtbBkOtdh+JhpFAz2weaSUKK0PfyblqAj+lug8aJRT7oM6iCsVlgmy4HqMLnXWnOunVmSPlk9orj2XwoSPwLxAwAtcvfaHszVsrBhQf4TgTM2S0yDpM7xSma8ytSmzJSq0SPly4cpk9+aCEI3oncKKiPo4Zor8Y/kB+Xj9e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emGhmW/HGY0dVHLqlCFF1pkgl"
|
|
47
|
+
/>
|
|
48
|
+
</body>
|
|
64
49
|
```
|
|
65
50
|
|
|
66
|
-
|
|
51
|
+
## Certificates viewer + React
|
|
67
52
|
|
|
68
|
-
|
|
53
|
+
To add the `@peculiar/certificates-viewer` to an already existing React project see the [react](../webcomponents-react/README.md) using guide.
|
|
69
54
|
|
|
70
|
-
|
|
55
|
+
## Examples
|
|
71
56
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
--pv-color-light-rgb: 255, 255, 255;
|
|
76
|
-
--pv-color-grey_3-rgb: 209, 213, 217;
|
|
77
|
-
--pv-color-grey_5-rgb: 134, 145, 150;
|
|
78
|
-
--pv-color-attention-rgb: 247, 168, 49;
|
|
79
|
-
--pv-color-primary-rgb: 53, 132, 247;
|
|
80
|
-
}
|
|
81
|
-
```
|
|
57
|
+
- [Root CAs](https://codepen.io/donskov/pen/gOpQGYa)
|
|
58
|
+
- [Subordinate CAs](https://codepen.io/donskov/pen/poJQWea)
|
|
59
|
+
- [Certificate details](https://codepen.io/donskov/pen/RwPqLLa)
|
|
82
60
|
|
|
83
|
-
|
|
61
|
+
### Customize the theme
|
|
84
62
|
|
|
85
|
-
|
|
86
|
-
- [Subordinate CAs](https://understandingwebpki.com/examples.html#subordinate-cas)
|
|
87
|
-
- [Certificate details](https://understandingwebpki.com/examples.html#certificate-details)
|
|
63
|
+
To customize the look and feel of the components, components have CSS variables you can override to provide a theme for your components. See the supported CSS variables in [peculiar.scss](./src/css/peculiar.scss) file.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { h } from '@stencil/core/internal/client';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
const ArrowBottomIcon = (props) => {
|
|
14
|
+
const { color = 'gray-10' } = props;
|
|
15
|
+
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", fill: "none" },
|
|
16
|
+
h("path", { stroke: `var(--pv-color-${color})`, "stroke-linecap": "round", "stroke-width": "1.5", d: "m19.222 12.778-3.851 4.279a.2.2 0 0 1-.297 0l-3.852-4.28" })));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/
|
|
26
|
+
const ArrowTopIcon = (props) => {
|
|
27
|
+
const { color = 'gray-10' } = props;
|
|
28
|
+
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", fill: "none" },
|
|
29
|
+
h("path", { stroke: `var(--pv-color-${color})`, "stroke-linecap": "round", "stroke-width": "1.5", d: "m11.222 17.722 3.852-4.28a.2.2 0 0 1 .297 0l3.851 4.28" })));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { ArrowTopIcon as A, ArrowBottomIcon as a };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=arrow_top.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"arrow_top.js","mappings":";;;;;AAAA;;;;;;;MAWa,eAAe,GAA+C,CAAC,KAAK;EAC/E,MAAM,EAAE,KAAK,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;EAEpC,QACE,WACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,IAAI,EAAC,MAAM;IAEX,YACE,MAAM,EAAE,kBAAkB,KAAK,GAAG,oBAEnB,OAAO,kBACT,KAAK,EAClB,CAAC,EAAC,0DAA0D,GAC5D,CACE,EACN;AACJ;;AC9BA;;;;;;;MAWa,YAAY,GAA+C,CAAC,KAAK;EAC5E,MAAM,EAAE,KAAK,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;EAEpC,QACE,WACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,IAAI,EAAC,MAAM;IAEX,YACE,MAAM,EAAE,kBAAkB,KAAK,GAAG,oBAEnB,OAAO,kBACT,KAAK,EAClB,CAAC,EAAC,wDAAwD,GAC1D,CACE,EACN;AACJ;;;;","names":[],"sources":["src/components/icons/arrow_bottom.tsx","src/components/icons/arrow_top.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\nimport { FunctionalComponent, h } from '@stencil/core';\nimport type { ColorType } from '../../interface';\n\nexport const ArrowBottomIcon: FunctionalComponent<{ color?: ColorType }> = (props) => {\n const { color = 'gray-10' } = props;\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"30\"\n height=\"30\"\n fill=\"none\"\n >\n <path\n stroke={`var(--pv-color-${color})`}\n // eslint-disable-next-line react/no-unknown-property\n stroke-linecap=\"round\"\n stroke-width=\"1.5\"\n d=\"m19.222 12.778-3.851 4.279a.2.2 0 0 1-.297 0l-3.852-4.28\"\n />\n </svg>\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 { FunctionalComponent, h } from '@stencil/core';\nimport type { ColorType } from '../../interface';\n\nexport const ArrowTopIcon: FunctionalComponent<{ color?: ColorType }> = (props) => {\n const { color = 'gray-10' } = props;\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"30\"\n height=\"30\"\n fill=\"none\"\n >\n <path\n stroke={`var(--pv-color-${color})`}\n // eslint-disable-next-line react/no-unknown-property\n stroke-linecap=\"round\"\n stroke-width=\"1.5\"\n d=\"m11.222 17.722 3.852-4.28a.2.2 0 0 1 .297 0l3.851 4.28\"\n />\n </svg>\n );\n};\n"],"version":3}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { h, proxyCustomElement, HTMLElement, Build, Host } from '@stencil/core/internal/client';
|
|
5
|
+
import { A as AsnData, c as certificateRawToBuffer, a as AttributeCertificate, d as dateDiff, E as Extension, b as AsnConvert, g as getCertificateThumbprint, h as hexFormat, e as base64Format, R as RowTitle, l as l10n, G as GeneralNamePart, f as RowValue, i as getStringByOID, B as BasicInformation, S as Signature, T as Thumbprints, j as getLEILink, k as getDNSNameLink, m as getIPAddressLink, n as Extensions, M as Miscellaneous } from './miscellaneous.js';
|
|
6
|
+
import { b as build, D as Download } from './download.js';
|
|
7
|
+
import { A as Attribute, a as Attributes } from './index2.js';
|
|
8
|
+
import { T as Typography } from './button.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @license
|
|
12
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the MIT license found in the
|
|
15
|
+
* LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/
|
|
17
|
+
class X509AttributeCertificate extends AsnData {
|
|
18
|
+
constructor(raw) {
|
|
19
|
+
var _a;
|
|
20
|
+
super(certificateRawToBuffer(raw), AttributeCertificate);
|
|
21
|
+
this.thumbprints = {};
|
|
22
|
+
this.type = 'X.509 Attribute Certificate';
|
|
23
|
+
const { acinfo } = this.asn;
|
|
24
|
+
this.serialNumber = build.Convert.ToHex(acinfo.serialNumber);
|
|
25
|
+
this.version = acinfo.version;
|
|
26
|
+
const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;
|
|
27
|
+
if (!notBefore) {
|
|
28
|
+
throw new Error("Cannot get 'notBefore' value");
|
|
29
|
+
}
|
|
30
|
+
this.notBefore = notBefore;
|
|
31
|
+
const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;
|
|
32
|
+
if (!notAfter) {
|
|
33
|
+
throw new Error("Cannot get 'notAfter' value");
|
|
34
|
+
}
|
|
35
|
+
this.notAfter = notAfter;
|
|
36
|
+
this.validity = dateDiff(this.notBefore, this.notAfter);
|
|
37
|
+
this.issuer = acinfo.issuer.v1Form || ((_a = acinfo.issuer.v2Form) === null || _a === void 0 ? void 0 : _a.issuerName);
|
|
38
|
+
this.holder = acinfo.holder;
|
|
39
|
+
}
|
|
40
|
+
get signature() {
|
|
41
|
+
const { signatureValue, signatureAlgorithm } = this.asn;
|
|
42
|
+
return {
|
|
43
|
+
value: signatureValue,
|
|
44
|
+
algorithm: signatureAlgorithm.algorithm,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
parseExtensions() {
|
|
48
|
+
const { acinfo } = this.asn;
|
|
49
|
+
if (acinfo.extensions) {
|
|
50
|
+
this.extensions = acinfo.extensions
|
|
51
|
+
.map((e) => new Extension(AsnConvert.serialize(e)));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
parseAttributes() {
|
|
55
|
+
const { acinfo } = this.asn;
|
|
56
|
+
if (acinfo.attributes) {
|
|
57
|
+
this.attributes = acinfo.attributes
|
|
58
|
+
.map((e) => new Attribute(AsnConvert.serialize(e)));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async getThumbprint(algorithm = 'SHA-1') {
|
|
62
|
+
try {
|
|
63
|
+
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
64
|
+
if (thumbprint) {
|
|
65
|
+
this.thumbprints[algorithm] = build.Convert.ToHex(thumbprint);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
console.error('Error thumbprint get:', error);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exportAsBase64() {
|
|
73
|
+
return build.Convert.ToBase64(this.raw);
|
|
74
|
+
}
|
|
75
|
+
exportAsHexFormatted() {
|
|
76
|
+
return hexFormat(build.Convert.ToHex(this.raw));
|
|
77
|
+
}
|
|
78
|
+
exportAsPemFormatted() {
|
|
79
|
+
return `-----BEGIN ATTRIBUTE CERTIFICATE-----\n${base64Format(this.exportAsBase64())}\n-----END ATTRIBUTE CERTIFICATE-----`;
|
|
80
|
+
}
|
|
81
|
+
get commonName() {
|
|
82
|
+
return `attribute-certificate-${this.thumbprints['SHA-1']}`;
|
|
83
|
+
}
|
|
84
|
+
downloadAsPEM(name) {
|
|
85
|
+
Download.attrCert.asPEM(this.exportAsPemFormatted(), name || this.commonName);
|
|
86
|
+
}
|
|
87
|
+
downloadAsDER(name) {
|
|
88
|
+
Download.attrCert.asDER(this.exportAsHexFormatted(), name || this.commonName);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @license
|
|
94
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the MIT license found in the
|
|
97
|
+
* LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/
|
|
99
|
+
const Holder = (props) => {
|
|
100
|
+
const { holder } = props;
|
|
101
|
+
if (!holder) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
const { baseCertificateID, objectDigestInfo } = holder;
|
|
105
|
+
return [
|
|
106
|
+
h(RowTitle, { value: l10n.getString('holder') }),
|
|
107
|
+
baseCertificateID && ([
|
|
108
|
+
baseCertificateID.issuer.map((item) => (h(GeneralNamePart, { generalName: item, getDNSNameLink: () => '', getIPAddressLink: () => '' }))),
|
|
109
|
+
h("tr", null,
|
|
110
|
+
h("td", null),
|
|
111
|
+
h("td", null)),
|
|
112
|
+
h(RowValue, { name: l10n.getString('serialNumber'), value: build.Convert.ToHex(baseCertificateID.serial), monospace: true }),
|
|
113
|
+
h("tr", null,
|
|
114
|
+
h("td", null),
|
|
115
|
+
h("td", null)),
|
|
116
|
+
]),
|
|
117
|
+
objectDigestInfo && ([
|
|
118
|
+
h(RowValue, { name: l10n.getString('digestInfo'), value: "" }),
|
|
119
|
+
h(RowValue, { name: l10n.getString('algorithm'), value: getStringByOID(objectDigestInfo.digestAlgorithm.algorithm) }),
|
|
120
|
+
h(RowValue, { name: l10n.getString('value'), value: build.Convert.ToHex(objectDigestInfo.objectDigest), monospace: true }),
|
|
121
|
+
h(RowValue, { name: l10n.getString('type'), value: objectDigestInfo.digestedObjectType }),
|
|
122
|
+
]),
|
|
123
|
+
];
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @license
|
|
128
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the MIT license found in the
|
|
131
|
+
* LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/
|
|
133
|
+
const Issuer = (props) => {
|
|
134
|
+
const { issuer } = props;
|
|
135
|
+
if (!issuer) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
return [
|
|
139
|
+
h(RowTitle, { value: l10n.getString('issuer') }),
|
|
140
|
+
issuer.map((item) => (h(GeneralNamePart, { generalName: item, getDNSNameLink: () => '', getIPAddressLink: () => '' }))),
|
|
141
|
+
];
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
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}";
|
|
145
|
+
|
|
146
|
+
const AttributeCertificateViewer = /*@__PURE__*/ proxyCustomElement(class AttributeCertificateViewer extends HTMLElement {
|
|
147
|
+
constructor() {
|
|
148
|
+
super();
|
|
149
|
+
this.__registerHost();
|
|
150
|
+
this.__attachShadow();
|
|
151
|
+
this.getAuthKeyIdParentLink = (value) => {
|
|
152
|
+
var _a;
|
|
153
|
+
return (_a = this.authKeyIdParentLink) === null || _a === void 0 ? void 0 : _a.replace('{{authKeyId}}', value);
|
|
154
|
+
};
|
|
155
|
+
this.getAuthKeyIdSiblingsLink = (value) => {
|
|
156
|
+
var _a;
|
|
157
|
+
return (_a = this.authKeyIdSiblingsLink) === null || _a === void 0 ? void 0 : _a.replace('{{authKeyId}}', value);
|
|
158
|
+
};
|
|
159
|
+
this.getSubjectKeyIdChildrenLink = (value) => {
|
|
160
|
+
var _a;
|
|
161
|
+
return (_a = this.subjectKeyIdChildrenLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
|
|
162
|
+
};
|
|
163
|
+
this.getSubjectKeyIdSiblingsLink = (value) => {
|
|
164
|
+
var _a;
|
|
165
|
+
return (_a = this.subjectKeyIdSiblingsLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
|
|
166
|
+
};
|
|
167
|
+
this.certificate = undefined;
|
|
168
|
+
this.download = undefined;
|
|
169
|
+
this.authKeyIdParentLink = undefined;
|
|
170
|
+
this.authKeyIdSiblingsLink = undefined;
|
|
171
|
+
this.subjectKeyIdChildrenLink = undefined;
|
|
172
|
+
this.subjectKeyIdSiblingsLink = undefined;
|
|
173
|
+
this.mobileMediaQueryString = '(max-width: 900px)';
|
|
174
|
+
this.mobileScreenView = false;
|
|
175
|
+
this.isDecodeInProcess = true;
|
|
176
|
+
}
|
|
177
|
+
handleMediaQueryChange(event) {
|
|
178
|
+
this.mobileScreenView = event.matches;
|
|
179
|
+
}
|
|
180
|
+
componentWillLoad() {
|
|
181
|
+
this.decodeCertificate(this.certificate);
|
|
182
|
+
if (Build.isBrowser) {
|
|
183
|
+
this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);
|
|
184
|
+
this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));
|
|
185
|
+
this.mobileScreenView = this.mobileMediaQuery.matches;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
disconnectedCallback() {
|
|
189
|
+
this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));
|
|
190
|
+
}
|
|
191
|
+
async decodeCertificate(certificate) {
|
|
192
|
+
this.isDecodeInProcess = true;
|
|
193
|
+
try {
|
|
194
|
+
if (certificate instanceof X509AttributeCertificate) {
|
|
195
|
+
this.certificateDecoded = certificate;
|
|
196
|
+
}
|
|
197
|
+
else if (typeof certificate === 'string') {
|
|
198
|
+
this.certificateDecoded = new X509AttributeCertificate(certificate);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
this.certificateDecoded.parseExtensions();
|
|
204
|
+
this.certificateDecoded.parseAttributes();
|
|
205
|
+
await this.certificateDecoded.getThumbprint('SHA-1');
|
|
206
|
+
await this.certificateDecoded.getThumbprint('SHA-256');
|
|
207
|
+
}
|
|
208
|
+
catch (error) {
|
|
209
|
+
this.certificateDecodeError = error;
|
|
210
|
+
console.error('Error certificate parse:', error);
|
|
211
|
+
}
|
|
212
|
+
this.isDecodeInProcess = false;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Rerun decodeCertificate if previuos value not equal current value
|
|
216
|
+
*/
|
|
217
|
+
watchCertificateAndDecode(newValue, oldValue) {
|
|
218
|
+
if (typeof newValue === 'string' && typeof oldValue === 'string') {
|
|
219
|
+
if (newValue !== oldValue) {
|
|
220
|
+
this.decodeCertificate(newValue);
|
|
221
|
+
}
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
if (newValue instanceof X509AttributeCertificate
|
|
225
|
+
&& oldValue instanceof X509AttributeCertificate) {
|
|
226
|
+
if (newValue.serialNumber !== oldValue.serialNumber) {
|
|
227
|
+
this.decodeCertificate(newValue);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
// eslint-disable-next-line class-methods-use-this
|
|
232
|
+
renderErrorState() {
|
|
233
|
+
return (h("div", { class: "status_wrapper" }, h(Typography, null, "There was an error decoding this attribute certificate.")));
|
|
234
|
+
}
|
|
235
|
+
// eslint-disable-next-line class-methods-use-this
|
|
236
|
+
renderEmptyState() {
|
|
237
|
+
return (h("div", { class: "status_wrapper" }, h(Typography, null, "There is no attribute certificate available.")));
|
|
238
|
+
}
|
|
239
|
+
render() {
|
|
240
|
+
if (this.certificateDecodeError) {
|
|
241
|
+
return this.renderErrorState();
|
|
242
|
+
}
|
|
243
|
+
if (!this.certificateDecoded) {
|
|
244
|
+
return this.renderEmptyState();
|
|
245
|
+
}
|
|
246
|
+
return (h(Host, { "data-mobile-screen-view": String(this.mobileScreenView) }, h("table", null, h(BasicInformation, Object.assign({}, this.certificateDecoded)), h(Issuer, { issuer: this.certificateDecoded.issuer }), h(Holder, { holder: this.certificateDecoded.holder }), h(Signature, { signature: this.certificateDecoded.signature }), h(Thumbprints, { thumbprints: this.certificateDecoded.thumbprints }), h(Attributes, { attributes: this.certificateDecoded.attributes, getLEILink: getLEILink, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink, getAuthKeyIdParentLink: this.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink: this.getAuthKeyIdSiblingsLink, getSubjectKeyIdChildrenLink: this.getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink: this.getSubjectKeyIdSiblingsLink }), h(Extensions, { extensions: this.certificateDecoded.extensions, getLEILink: getLEILink, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink, getAuthKeyIdParentLink: this.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink: this.getAuthKeyIdSiblingsLink, getSubjectKeyIdChildrenLink: this.getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink: this.getSubjectKeyIdSiblingsLink }), this.download && (h(Miscellaneous, { certificate: this.certificateDecoded })))));
|
|
247
|
+
}
|
|
248
|
+
static get watchers() { return {
|
|
249
|
+
"certificate": ["watchCertificateAndDecode"]
|
|
250
|
+
}; }
|
|
251
|
+
static get style() { return certificateViewerCss; }
|
|
252
|
+
}, [1, "peculiar-attribute-certificate-viewer", {
|
|
253
|
+
"certificate": [1],
|
|
254
|
+
"download": [4],
|
|
255
|
+
"authKeyIdParentLink": [513, "auth-key-id-parent-link"],
|
|
256
|
+
"authKeyIdSiblingsLink": [513, "auth-key-id-siblings-link"],
|
|
257
|
+
"subjectKeyIdChildrenLink": [513, "subject-key-id-children-link"],
|
|
258
|
+
"subjectKeyIdSiblingsLink": [513, "subject-key-id-siblings-link"],
|
|
259
|
+
"mobileMediaQueryString": [1, "mobile-media-query-string"],
|
|
260
|
+
"mobileScreenView": [32],
|
|
261
|
+
"isDecodeInProcess": [32]
|
|
262
|
+
}, undefined, {
|
|
263
|
+
"certificate": ["watchCertificateAndDecode"]
|
|
264
|
+
}]);
|
|
265
|
+
function defineCustomElement() {
|
|
266
|
+
if (typeof customElements === "undefined") {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
const components = ["peculiar-attribute-certificate-viewer"];
|
|
270
|
+
components.forEach(tagName => { switch (tagName) {
|
|
271
|
+
case "peculiar-attribute-certificate-viewer":
|
|
272
|
+
if (!customElements.get(tagName)) {
|
|
273
|
+
customElements.define(tagName, AttributeCertificateViewer);
|
|
274
|
+
}
|
|
275
|
+
break;
|
|
276
|
+
} });
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export { AttributeCertificateViewer as A, X509AttributeCertificate as X, defineCustomElement as d };
|
|
280
|
+
|
|
281
|
+
//# sourceMappingURL=attribute-certificate-viewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"attribute-certificate-viewer.js","mappings":";;;;;;;;;AAAA;;;;;;;MA8Ba,wBAAyB,SAAQ,OAA6B;EAuBzE,YAAY,GAAW;;IACrB,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,EAAE,oBAAoB,CAAC,CAAC;IATpD,gBAAW,GAA2B,EAAE,CAAC;IAMzC,SAAI,GAAW,6BAA6B,CAAC;IAKlD,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;IAE5B,IAAI,CAAC,YAAY,GAAGA,aAAO,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAE9B,MAAM,SAAS,GAAG,MAAM,CAAC,sBAAsB,CAAC,aAAa,CAAC;IAE9D,IAAI,CAAC,SAAS,EAAE;MACd,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;KACjD;IAED,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAE3B,MAAM,QAAQ,GAAG,MAAM,CAAC,sBAAsB,CAAC,YAAY,CAAC;IAE5D,IAAI,CAAC,QAAQ,EAA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,CAAC,sBAAsB,EACnD,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,EACvD,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,EAC7D,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,GAC7D,EAEF,EAAC,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,GAC7D,EAED,IAAI,CAAC,QAAQ,KACZ,EAAC,aAAa,IACZ,WAAW,EAAE,IAAI,CAAC,kBAAkB,GACpC,CACH,CACK,CACH,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["Convert"],"sources":["src/crypto/x509_attribute_certificate.ts","src/components/certificate-details-parts/holder.tsx","src/components/certificate-details-parts/issuer.tsx","src/components/certificate-viewer/certificate-viewer.scss?tag=peculiar-attribute-certificate-viewer&encapsulation=shadow","src/components/attribute-certificate-viewer/attribute-certificate-viewer.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\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport type { GeneralName } from '@peculiar/asn1-x509';\nimport { AttributeCertificate, Holder } from '@peculiar/asn1-x509-attr';\nimport { Convert } from 'pvtsutils';\n\nimport { dateDiff, Download } from '../utils';\n\nimport { AsnData } from './asn_data';\nimport { Extension, TExtensionValue } from './extension';\nimport { Attribute, TAttributeValue } from './attribute';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\nexport class X509AttributeCertificate extends AsnData<AttributeCertificate> {\n public readonly serialNumber: string;\n\n public readonly version: number;\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public attributes: Attribute<TAttributeValue>[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly issuer: GeneralName[];\n\n public holder: Holder;\n\n public type: string = 'X.509 Attribute Certificate';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), AttributeCertificate);\n\n const { acinfo } = this.asn;\n\n this.serialNumber = Convert.ToHex(acinfo.serialNumber);\n this.version = acinfo.version;\n\n const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;\n\n if (!notBefore) {\n throw new Error(\"Cannot get 'notBefore' value\");\n }\n\n this.notBefore = notBefore;\n\n const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;\n\n if (!notAfter) {\n throw new Error(\"Cannot get 'notAfter' value\");\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n this.issuer = acinfo.issuer.v1Form || acinfo.issuer.v2Form?.issuerName;\n this.holder = acinfo.holder;\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n\n return {\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public parseExtensions() {\n const { acinfo } = this.asn;\n\n if (acinfo.extensions) {\n this.extensions = acinfo.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n public parseAttributes() {\n const { acinfo } = this.asn;\n\n if (acinfo.attributes) {\n this.attributes = acinfo.attributes\n .map((e) => new Attribute(AsnConvert.serialize(e)));\n }\n }\n\n public async getThumbprint(\n algorithm: string = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public exportAsBase64() {\n return Convert.ToBase64(this.raw);\n }\n\n public exportAsHexFormatted() {\n return hexFormat(Convert.ToHex(this.raw));\n }\n\n public exportAsPemFormatted() {\n return `-----BEGIN ATTRIBUTE CERTIFICATE-----\\n${base64Format(this.exportAsBase64())}\\n-----END ATTRIBUTE CERTIFICATE-----`;\n }\n\n public get commonName(): string {\n return `attribute-certificate-${this.thumbprints['SHA-1']}`;\n }\n\n public downloadAsPEM(name?: string) {\n Download.attrCert.asPEM(\n this.exportAsPemFormatted(),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.attrCert.asDER(\n this.exportAsHexFormatted(),\n name || this.commonName,\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 { h, FunctionalComponent } from '@stencil/core';\nimport { Convert } from 'pvtsutils';\n\nimport type { X509AttributeCertificate } from '../../crypto';\nimport { l10n, getStringByOID } from '../../utils';\nimport { RowTitle, RowValue } from './row';\nimport { GeneralNamePart } from './extensions/general_name_part';\n\ninterface IHolderProps {\n holder: X509AttributeCertificate['holder'];\n}\n\nexport const Holder: FunctionalComponent<IHolderProps> = (props) => {\n const { holder } = props;\n\n if (!holder) {\n return null;\n }\n\n const { baseCertificateID, objectDigestInfo } = holder;\n\n return [\n <RowTitle\n value={l10n.getString('holder')}\n />,\n baseCertificateID && ([\n baseCertificateID.issuer.map((item) => (\n <GeneralNamePart\n generalName={item}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n )),\n <tr>\n <td />\n <td />\n </tr>,\n <RowValue\n name={l10n.getString('serialNumber')}\n value={Convert.ToHex(baseCertificateID.serial)}\n monospace\n />,\n <tr>\n <td />\n <td />\n </tr>,\n ]),\n objectDigestInfo && ([\n <RowValue\n name={l10n.getString('digestInfo')}\n value=\"\"\n />,\n <RowValue\n name={l10n.getString('algorithm')}\n value={getStringByOID(objectDigestInfo.digestAlgorithm.algorithm)}\n />,\n <RowValue\n name={l10n.getString('value')}\n value={Convert.ToHex(objectDigestInfo.objectDigest)}\n monospace\n />,\n <RowValue\n name={l10n.getString('type')}\n value={objectDigestInfo.digestedObjectType}\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 { h, FunctionalComponent } from '@stencil/core';\n\nimport type { X509AttributeCertificate } from '../../crypto';\nimport { l10n } from '../../utils';\nimport { RowTitle } from './row';\nimport { GeneralNamePart } from './extensions/general_name_part';\n\ninterface IIssuerProps {\n issuer: X509AttributeCertificate['issuer'];\n}\n\nexport const Issuer: FunctionalComponent<IIssuerProps> = (props) => {\n const { issuer } = props;\n\n if (!issuer) {\n return null;\n }\n\n return [\n <RowTitle\n value={l10n.getString('issuer')}\n />,\n issuer.map((item) => (\n <GeneralNamePart\n generalName={item}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n )),\n ];\n};\n","@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 Host,\n h,\n Prop,\n State,\n Watch,\n Build,\n} from '@stencil/core';\n\nimport { X509AttributeCertificate } from '../../crypto';\nimport { getDNSNameLink, getIPAddressLink, getLEILink } from '../../utils/third_party_links';\nimport {\n BasicInformation,\n Signature,\n Thumbprints,\n Extensions,\n Miscellaneous,\n Attributes,\n Holder,\n Issuer,\n} from '../certificate-details-parts';\nimport { Typography } from '../typography';\n\nexport type AttributeCertificateProp = string | X509AttributeCertificate;\n\n@Component({\n tag: 'peculiar-attribute-certificate-viewer',\n styleUrl: '../certificate-viewer/certificate-viewer.scss',\n shadow: true,\n})\nexport class AttributeCertificateViewer {\n private certificateDecoded: X509AttributeCertificate;\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() certificate: AttributeCertificateProp;\n\n /**\n * If `true` - component will show split-button to download certificate as PEM or DER.\n */\n @Prop() 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 * 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: AttributeCertificateProp) {\n this.isDecodeInProcess = true;\n\n try {\n if (certificate instanceof X509AttributeCertificate) {\n this.certificateDecoded = certificate;\n } else if (typeof certificate === 'string') {\n this.certificateDecoded = new X509AttributeCertificate(certificate);\n } else {\n return;\n }\n\n this.certificateDecoded.parseExtensions();\n this.certificateDecoded.parseAttributes();\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(\n newValue: AttributeCertificateProp,\n oldValue: AttributeCertificateProp,\n ) {\n if (typeof newValue === 'string' && typeof oldValue === 'string') {\n if (newValue !== oldValue) {\n this.decodeCertificate(newValue);\n }\n\n return;\n }\n\n if (\n newValue instanceof X509AttributeCertificate\n && oldValue instanceof X509AttributeCertificate\n ) {\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 // 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 attribute 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 attribute 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 <Issuer\n issuer={this.certificateDecoded.issuer}\n />\n\n <Holder\n holder={this.certificateDecoded.holder}\n />\n\n <Signature\n signature={this.certificateDecoded.signature}\n />\n\n <Thumbprints\n thumbprints={this.certificateDecoded.thumbprints}\n />\n\n <Attributes\n attributes={this.certificateDecoded.attributes}\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 <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"],"version":3}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { h, proxyCustomElement, HTMLElement, Host } from '@stencil/core/internal/client';
|
|
5
|
+
import { B as Button, T as Typography } from './button.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
const ActionsIcon = (props) => {
|
|
15
|
+
const { color = 'gray-10' } = props;
|
|
16
|
+
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "31", fill: "none" },
|
|
17
|
+
h("path", { fill: `var(--pv-color-${color})`, d: "M15 13.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-7 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm14 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z" })));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const buttonMenuCss = ".sc-peculiar-button-menu-h{display:-ms-inline-flexbox;display:inline-flex;position:relative}.is_shown.sc-peculiar-button-menu-h .button_popover.sc-peculiar-button-menu:before{position:fixed;width:100%;height:100%;top:0;left:0;content:\"\"}.is_shown.sc-peculiar-button-menu-h .popover.sc-peculiar-button-menu{display:block}.popover.sc-peculiar-button-menu{min-width:200px;position:absolute;top:100%;right:0;border-radius:4px;z-index:1;-webkit-box-shadow:var(--pv-shadow-light-medium);box-shadow:var(--pv-shadow-light-medium);background:var(--pv-color-white);padding:var(--pv-size-base-2) 0;margin:var(--pv-size-base) 0;display:none}.button_option.sc-peculiar-button-menu{width:100%;-ms-flex-pack:start;justify-content:flex-start;border-radius:0}.group.sc-peculiar-button-menu:not(:last-child){border-bottom:1px solid var(--pv-color-gray-5);padding-bottom:var(--pv-size-base-2);margin-bottom:var(--pv-size-base)}.group_title.sc-peculiar-button-menu{line-height:var(--pv-size-base-6);padding:0 var(--pv-size-base-2)}";
|
|
21
|
+
|
|
22
|
+
const ButtonMenu = /*@__PURE__*/ proxyCustomElement(class ButtonMenu extends HTMLElement {
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.__registerHost();
|
|
26
|
+
this.handleClick = () => {
|
|
27
|
+
this.open = !this.open;
|
|
28
|
+
};
|
|
29
|
+
this.groups = [];
|
|
30
|
+
this.open = false;
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
return (h(Host, { class: {
|
|
34
|
+
is_shown: this.open,
|
|
35
|
+
} }, h(Button, { class: "button_popover", onClick: this.handleClick, startIcon: h(ActionsIcon, null) }), h("div", { role: "dialog", tabIndex: -1, class: "popover", "aria-hidden": String(this.open) }, this.groups.map((group) => (h("div", { class: "group" }, h(Typography, { variant: "c2", color: "gray-9", class: "group_title" }, group.title), group.options.map((option) => (h(Button, { class: "button_option", startIcon: option.startIcon, href: option.href, onClick: (event) => {
|
|
36
|
+
event.stopPropagation();
|
|
37
|
+
this.handleClick();
|
|
38
|
+
if (option.onClick) {
|
|
39
|
+
option.onClick(event);
|
|
40
|
+
}
|
|
41
|
+
} }, option.text)))))))));
|
|
42
|
+
}
|
|
43
|
+
static get style() { return buttonMenuCss; }
|
|
44
|
+
}, [2, "peculiar-button-menu", {
|
|
45
|
+
"groups": [16],
|
|
46
|
+
"open": [32]
|
|
47
|
+
}]);
|
|
48
|
+
function defineCustomElement() {
|
|
49
|
+
if (typeof customElements === "undefined") {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const components = ["peculiar-button-menu"];
|
|
53
|
+
components.forEach(tagName => { switch (tagName) {
|
|
54
|
+
case "peculiar-button-menu":
|
|
55
|
+
if (!customElements.get(tagName)) {
|
|
56
|
+
customElements.define(tagName, ButtonMenu);
|
|
57
|
+
}
|
|
58
|
+
break;
|
|
59
|
+
} });
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { ButtonMenu as B, defineCustomElement as d };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=button-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"button-menu.js","mappings":";;;;;;AAAA;;;;;;;AAWO,MAAM,WAAW,GAA+C,CAAC,KAAK;EAC3E,MAAM,EAAE,KAAK,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;EAEpC,QACE,WACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,IAAI,EAAC,MAAM;IAEX,YACE,IAAI,EAAE,kBAAkB,KAAK,GAAG,EAChC,CAAC,EAAC,2GAA2G,GAC7G,CACE,EACN;AACJ,CAAC;;AC3BD,MAAM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-button-menu&encapsulation=scoped","src/components/button-menu/button-menu.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\nimport { FunctionalComponent, h } from '@stencil/core';\nimport type { ColorType } from '../../interface';\n\nexport const ActionsIcon: FunctionalComponent<{ color?: ColorType }> = (props) => {\n const { color = 'gray-10' } = props;\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"30\"\n height=\"31\"\n fill=\"none\"\n >\n <path\n fill={`var(--pv-color-${color})`}\n d=\"M15 13.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-7 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm14 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z\"\n />\n </svg>\n );\n};\n",":host {\n display: inline-flex;\n position: relative;\n\n &.is_shown {\n .button_popover {\n &:before {\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n content: '';\n }\n }\n\n .popover {\n display: block;\n }\n }\n}\n\n.popover {\n min-width: 200px;\n position: absolute;\n top: 100%;\n right: 0;\n border-radius: 4px;\n z-index: 1;\n box-shadow: var(--pv-shadow-light-medium);\n background: var(--pv-color-white);\n padding: var(--pv-size-base-2) 0;\n margin: var(--pv-size-base) 0;\n display: none;\n}\n\n.button_option {\n width: 100%;\n justify-content: flex-start;\n border-radius: 0;\n}\n\n.group {\n &:not(:last-child) {\n border-bottom: 1px solid var(--pv-color-gray-5);\n padding-bottom: var(--pv-size-base-2);\n margin-bottom: var(--pv-size-base);\n }\n}\n\n.group_title {\n line-height: var(--pv-size-base-6);\n padding: 0 var(--pv-size-base-2);\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 State,\n Prop,\n Host,\n} from '@stencil/core';\nimport { Button, ButtonProps } from '../button';\nimport { Typography } from '../typography';\nimport { ActionsIcon } from '../icons';\n\nexport interface ButtonMenuGroupOptions extends ButtonProps {\n text: string | string[];\n}\n\nexport interface ButtonMenuGroup {\n title: string | string[];\n options: ButtonMenuGroupOptions[];\n}\n\n@Component({\n tag: 'peculiar-button-menu',\n styleUrl: 'button-menu.scss',\n scoped: true,\n})\nexport class ButtonMenu {\n @Prop() groups: ButtonMenuGroup[] = [];\n\n @State() open: boolean = false;\n\n handleClick = () => {\n this.open = !this.open;\n };\n\n render() {\n return (\n <Host\n class={{\n is_shown: this.open,\n }}\n >\n <Button\n class=\"button_popover\"\n onClick={this.handleClick}\n startIcon={<ActionsIcon />}\n />\n <div\n role=\"dialog\"\n tabIndex={-1}\n class=\"popover\"\n aria-hidden={String(this.open)}\n >\n {this.groups.map((group) => (\n <div class=\"group\">\n <Typography\n variant=\"c2\"\n color=\"gray-9\"\n class=\"group_title\"\n >\n {group.title}\n </Typography>\n {group.options.map((option) => (\n <Button\n class=\"button_option\"\n startIcon={option.startIcon}\n href={option.href}\n onClick={(event) => {\n event.stopPropagation();\n\n this.handleClick();\n\n if (option.onClick) {\n option.onClick(event);\n }\n }}\n >\n {option.text}\n </Button>\n ))}\n </div>\n ))}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|