@peculiar/certificates-viewer 4.2.0 → 4.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/actions.js +3 -3
- package/components/actions.js.map +1 -1
- package/components/arrow_top.js +6 -6
- package/components/arrow_top.js.map +1 -1
- package/components/attribute-certificate-viewer.js +227 -222
- package/components/attribute-certificate-viewer.js.map +1 -1
- package/components/attribute.js +53 -0
- package/components/attribute.js.map +1 -0
- package/components/button-menu.js +36 -35
- package/components/button-menu.js.map +1 -1
- package/components/button.js +42 -42
- package/components/button.js.map +1 -1
- package/components/certificate-viewer.js +254 -251
- package/components/certificate-viewer.js.map +1 -1
- package/components/circular-progress.js +34 -33
- package/components/circular-progress.js.map +1 -1
- package/components/crl-viewer.js +219 -216
- package/components/crl-viewer.js.map +1 -1
- package/components/cross.js +9 -9
- package/components/cross.js.map +1 -1
- package/components/csr-viewer.js +117 -209
- package/components/csr-viewer.js.map +1 -1
- package/components/download.js +12578 -64
- package/components/download.js.map +1 -1
- package/components/highlight-words.js +45 -44
- package/components/highlight-words.js.map +1 -1
- package/components/index.js +2 -0
- package/components/index.js.map +1 -1
- package/components/index2.js +114 -169
- package/components/index2.js.map +1 -1
- package/components/issuer_name.js +8 -8
- package/components/issuer_name.js.map +1 -1
- package/components/miscellaneous.js +729 -13311
- package/components/miscellaneous.js.map +1 -1
- package/components/peculiar-attribute-certificate-viewer.d.ts +2 -2
- package/components/peculiar-button-menu.d.ts +2 -2
- package/components/peculiar-certificate-decoder.d.ts +2 -2
- package/components/peculiar-certificate-decoder.js +177 -207
- package/components/peculiar-certificate-decoder.js.map +1 -1
- package/components/peculiar-certificate-viewer.d.ts +2 -2
- package/components/peculiar-certificates-viewer.d.ts +2 -2
- package/components/peculiar-certificates-viewer.js +297 -297
- package/components/peculiar-certificates-viewer.js.map +1 -1
- package/components/peculiar-circular-progress.d.ts +2 -2
- package/components/peculiar-crl-viewer.d.ts +2 -2
- package/components/peculiar-crl-viewer.js +1 -1
- package/components/peculiar-csr-viewer.d.ts +2 -2
- package/components/peculiar-csr-viewer.js +1 -1
- package/components/peculiar-highlight-words.d.ts +2 -2
- package/components/peculiar-text-hider.d.ts +2 -2
- package/components/peculiar-text-hider.js +23 -22
- package/components/peculiar-text-hider.js.map +1 -1
- package/components/pkcs10_certificate_request.js +102 -0
- package/components/pkcs10_certificate_request.js.map +1 -0
- package/components/read_file.js +110 -0
- package/components/read_file.js.map +1 -0
- package/components/subject_name.js +36 -36
- package/components/subject_name.js.map +1 -1
- package/dist/cjs/actions-789906f5.js +23 -0
- package/dist/cjs/{actions-19013d4a.js.map → actions-789906f5.js.map} +1 -1
- package/dist/cjs/app-globals-c20ffa41.js +10 -0
- package/dist/cjs/app-globals-c20ffa41.js.map +1 -0
- package/dist/cjs/arrow_top-76e4261e.js +37 -0
- package/dist/cjs/{arrow_top-834fb7ec.js.map → arrow_top-76e4261e.js.map} +1 -1
- package/dist/cjs/button-87086210.js +77 -0
- package/dist/cjs/{button-14e2b73f.js.map → button-87086210.js.map} +1 -1
- package/dist/cjs/{certification_request-5672c667.js → certification_request-815ec558.js} +3284 -2888
- package/dist/cjs/certification_request-815ec558.js.map +1 -0
- package/dist/cjs/cross-bd099933.js +51 -0
- package/dist/cjs/{cross-9872c473.js.map → cross-bd099933.js.map} +1 -1
- package/dist/cjs/download-820d66ba.js +23 -0
- package/dist/cjs/{download-254ddc57.js.map → download-820d66ba.js.map} +1 -1
- package/dist/cjs/{index-efd561e9.js → index-e2ae280a.js} +398 -145
- package/dist/cjs/index-e2ae280a.js.map +1 -0
- package/dist/cjs/index.cjs.js +18 -11
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/link-a3d3799d.js +25 -0
- package/dist/cjs/{link-6aea0be4.js.map → link-a3d3799d.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +4 -2
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/miscellaneous-9a573276.js +1418 -0
- package/dist/cjs/miscellaneous-9a573276.js.map +1 -0
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +481 -480
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-button-menu_3.cjs.entry.js +72 -69
- package/dist/cjs/peculiar-button-menu_3.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +142 -172
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +106 -106
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +257 -257
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-text-hider.cjs.entry.js +12 -11
- package/dist/cjs/peculiar-text-hider.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar.cjs.js +5 -3
- package/dist/cjs/peculiar.cjs.js.map +1 -1
- package/dist/cjs/pkcs10_certificate_request-0ebc0023.js +149 -0
- package/dist/cjs/pkcs10_certificate_request-0ebc0023.js.map +1 -0
- package/dist/cjs/read_file-2e22a97e.js +115 -0
- package/dist/cjs/read_file-2e22a97e.js.map +1 -0
- package/dist/cjs/x509_certificate-9914b149.js +161 -0
- package/dist/cjs/x509_certificate-9914b149.js.map +1 -0
- package/dist/cjs/x509_crl-86b6e71d.js +179 -0
- package/dist/cjs/x509_crl-86b6e71d.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +259 -259
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js.map +1 -1
- package/dist/collection/components/button/button.js +9 -9
- package/dist/collection/components/button/button.js.map +1 -1
- package/dist/collection/components/button-menu/button-menu.js +60 -60
- package/dist/collection/components/button-menu/button-menu.js.map +1 -1
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +212 -212
- package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/activity_description_attribute.js +4 -3
- package/dist/collection/components/certificate-details-parts/attributes/activity_description_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/as_string_attribute.js +2 -2
- package/dist/collection/components/certificate-details-parts/attributes/as_string_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/basic_attribute.js +6 -6
- package/dist/collection/components/certificate-details-parts/attributes/basic_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/challenge_password_attribute.js +2 -2
- package/dist/collection/components/certificate-details-parts/attributes/challenge_password_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/index.js +42 -42
- package/dist/collection/components/certificate-details-parts/attributes/index.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/insurance_value_attribute.js +3 -3
- package/dist/collection/components/certificate-details-parts/attributes/insurance_value_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/name_attribute.js +2 -2
- package/dist/collection/components/certificate-details-parts/attributes/name_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/name_part.js +5 -5
- package/dist/collection/components/certificate-details-parts/attributes/name_part.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/type_relationship_attribute.js +2 -2
- package/dist/collection/components/certificate-details-parts/attributes/type_relationship_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/unstructured_name_attribute.js +2 -2
- package/dist/collection/components/certificate-details-parts/attributes/unstructured_name_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/valuation_ranking_attribute.js +14 -14
- package/dist/collection/components/certificate-details-parts/attributes/valuation_ranking_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/attributes/web_gdpr_attribute.js +4 -3
- package/dist/collection/components/certificate-details-parts/attributes/web_gdpr_attribute.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/basic_information.js +12 -12
- package/dist/collection/components/certificate-details-parts/basic_information.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/archive_rev_info_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/archive_rev_info_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/as_string_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/as_string_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/attribute_value.js +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/attribute_value.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/authority_key_identifier_extension.js +8 -8
- package/dist/collection/components/certificate-details-parts/extensions/authority_key_identifier_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/basic_constraints_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/basic_constraints_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/basic_extension.js +7 -7
- package/dist/collection/components/certificate-details-parts/extensions/basic_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/biometric_syntax_extension.js +5 -5
- package/dist/collection/components/certificate-details-parts/extensions/biometric_syntax_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/ca_version_extension.js +3 -3
- package/dist/collection/components/certificate-details-parts/extensions/ca_version_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/cabforganization_identifier_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/cabforganization_identifier_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/certificate_policies_extension.js +23 -23
- package/dist/collection/components/certificate-details-parts/extensions/certificate_policies_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/certificate_template_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/certificate_template_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js +5 -5
- package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/crl_distribution_points_extension.js +8 -8
- package/dist/collection/components/certificate-details-parts/extensions/crl_distribution_points_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/crl_number_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/crl_number_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/crl_reason_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/crl_reason_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/enroll_cert_type_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/enroll_cert_type_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/entrust_version_info_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/entrust_version_info_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/extended_key_usage_extension.js +5 -5
- package/dist/collection/components/certificate-details-parts/extensions/extended_key_usage_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/general_name_part.js +52 -52
- package/dist/collection/components/certificate-details-parts/extensions/general_name_part.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/index.js +121 -121
- package/dist/collection/components/certificate-details-parts/extensions/index.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/info_access_syntax_extension.js +5 -5
- package/dist/collection/components/certificate-details-parts/extensions/info_access_syntax_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/issuing_distribution_point_extension.js +4 -4
- package/dist/collection/components/certificate-details-parts/extensions/issuing_distribution_point_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/key_description_extension.js +58 -58
- package/dist/collection/components/certificate-details-parts/extensions/key_description_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/key_usage_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/key_usage_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/lei_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/lei_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/lei_role_extennsion.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/lei_role_extennsion.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/logotype_extension.js +42 -42
- package/dist/collection/components/certificate-details-parts/extensions/logotype_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/name_constraints_extension.js +5 -5
- package/dist/collection/components/certificate-details-parts/extensions/name_constraints_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/netscape_cert_type_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/netscape_cert_type_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/netscape_comment_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/netscape_comment_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/policy_constraints_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/policy_constraints_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/policy_mappings_extension.js +6 -7
- package/dist/collection/components/certificate-details-parts/extensions/policy_mappings_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/private_key_usage_period_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/private_key_usage_period_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js +29 -29
- package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/subject_alternative_name_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/subject_alternative_name_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/subject_directory_attributes_extension.js +5 -5
- package/dist/collection/components/certificate-details-parts/extensions/subject_directory_attributes_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/subject_key_identifier_extension.js +8 -8
- package/dist/collection/components/certificate-details-parts/extensions/subject_key_identifier_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/timestamp_extension.js +2 -2
- package/dist/collection/components/certificate-details-parts/extensions/timestamp_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/tn_auth_list_extension.js +6 -8
- package/dist/collection/components/certificate-details-parts/extensions/tn_auth_list_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/holder.js +19 -21
- package/dist/collection/components/certificate-details-parts/holder.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/issuer.js +8 -8
- package/dist/collection/components/certificate-details-parts/issuer.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/issuer_name.js +6 -6
- package/dist/collection/components/certificate-details-parts/issuer_name.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/miscellaneous.js +6 -6
- package/dist/collection/components/certificate-details-parts/miscellaneous.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/public_key.js +29 -29
- package/dist/collection/components/certificate-details-parts/public_key.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/revoked_certificates.js +30 -30
- package/dist/collection/components/certificate-details-parts/revoked_certificates.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/row.js +26 -26
- package/dist/collection/components/certificate-details-parts/row.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/signature.js +13 -13
- package/dist/collection/components/certificate-details-parts/signature.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/subject_name.js +5 -5
- package/dist/collection/components/certificate-details-parts/subject_name.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/thumbprints.js +12 -12
- package/dist/collection/components/certificate-details-parts/thumbprints.js.map +1 -1
- package/dist/collection/components/certificate-summary/certificate-summary.js +3 -3
- package/dist/collection/components/certificate-summary/certificate-summary.js.map +1 -1
- package/dist/collection/components/certificate-viewer/certificate-viewer.js +278 -278
- package/dist/collection/components/certificate-viewer/certificate-viewer.js.map +1 -1
- package/dist/collection/components/certificates-viewer/certificates-viewer.js +374 -374
- package/dist/collection/components/certificates-viewer/certificates-viewer.js.map +1 -1
- package/dist/collection/components/circular-progress/circular-progress.js +67 -67
- package/dist/collection/components/circular-progress/circular-progress.js.map +1 -1
- package/dist/collection/components/crl-viewer/crl-viewer.js +230 -230
- package/dist/collection/components/crl-viewer/crl-viewer.js.map +1 -1
- package/dist/collection/components/csr-viewer/csr-viewer.js +212 -220
- package/dist/collection/components/csr-viewer/csr-viewer.js.map +1 -1
- package/dist/collection/components/highlight-words/highlight-words.js +60 -60
- package/dist/collection/components/highlight-words/highlight-words.js.map +1 -1
- package/dist/collection/components/icons/actions.js +2 -2
- package/dist/collection/components/icons/actions.js.map +1 -1
- package/dist/collection/components/icons/arrow_bottom.js +2 -2
- package/dist/collection/components/icons/arrow_bottom.js.map +1 -1
- package/dist/collection/components/icons/arrow_top.js +2 -2
- package/dist/collection/components/icons/arrow_top.js.map +1 -1
- package/dist/collection/components/icons/cross.js +2 -2
- package/dist/collection/components/icons/cross.js.map +1 -1
- package/dist/collection/components/icons/details.js +2 -2
- package/dist/collection/components/icons/details.js.map +1 -1
- package/dist/collection/components/icons/download.js +2 -2
- package/dist/collection/components/icons/download.js.map +1 -1
- package/dist/collection/components/icons/link.js +2 -2
- package/dist/collection/components/icons/link.js.map +1 -1
- package/dist/collection/components/link/link.js +4 -4
- package/dist/collection/components/link/link.js.map +1 -1
- package/dist/collection/components/text-hider/text-hider.js +23 -23
- package/dist/collection/components/text-hider/text-hider.js.map +1 -1
- package/dist/collection/components/typography/typography.js +32 -32
- package/dist/collection/components/typography/typography.js.map +1 -1
- package/dist/collection/constants/logs.js +77 -77
- package/dist/collection/constants/logs.js.map +1 -1
- package/dist/collection/constants/oids.js +2334 -2334
- package/dist/collection/constants/oids.js.map +1 -1
- package/dist/collection/crypto/asn_data.js +31 -31
- package/dist/collection/crypto/asn_data.js.map +1 -1
- package/dist/collection/crypto/attribute.js +35 -51
- package/dist/collection/crypto/attribute.js.map +1 -1
- package/dist/collection/crypto/extension.js +63 -138
- package/dist/collection/crypto/extension.js.map +1 -1
- package/dist/collection/crypto/extensions/cabforganization_identifier.js +20 -15
- package/dist/collection/crypto/extensions/cabforganization_identifier.js.map +1 -1
- package/dist/collection/crypto/index.js +2 -2
- package/dist/collection/crypto/index.js.map +1 -1
- package/dist/collection/crypto/name.js +31 -31
- package/dist/collection/crypto/name.js.map +1 -1
- package/dist/collection/crypto/pkcs10_certificate_request.js +108 -0
- package/dist/collection/crypto/pkcs10_certificate_request.js.map +1 -0
- package/dist/collection/crypto/provider.js +26 -26
- package/dist/collection/crypto/provider.js.map +1 -1
- package/dist/collection/crypto/utils.js +23 -23
- package/dist/collection/crypto/utils.js.map +1 -1
- package/dist/collection/crypto/x509_attribute_certificate.js +68 -66
- package/dist/collection/crypto/x509_attribute_certificate.js.map +1 -1
- package/dist/collection/crypto/x509_certificate.js +127 -125
- package/dist/collection/crypto/x509_certificate.js.map +1 -1
- package/dist/collection/crypto/x509_crl.js +94 -0
- package/dist/collection/crypto/x509_crl.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/utils/camel_case_to_words.js +2 -2
- package/dist/collection/utils/camel_case_to_words.js.map +1 -1
- package/dist/collection/utils/date_formatter.js +6 -6
- package/dist/collection/utils/date_formatter.js.map +1 -1
- package/dist/collection/utils/download.js +24 -24
- package/dist/collection/utils/download.js.map +1 -1
- package/dist/collection/utils/download_from_buffer.js +25 -25
- package/dist/collection/utils/download_from_buffer.js.map +1 -1
- package/dist/collection/utils/get_string_by_oid.js +5 -5
- package/dist/collection/utils/get_string_by_oid.js.map +1 -1
- package/dist/collection/utils/is_link.js +1 -1
- package/dist/collection/utils/is_link.js.map +1 -1
- package/dist/collection/utils/l10n.js +25 -25
- package/dist/collection/utils/l10n.js.map +1 -1
- package/dist/collection/utils/read_file.js +40 -40
- package/dist/collection/utils/read_file.js.map +1 -1
- package/dist/collection/utils/validator.js +13 -13
- package/dist/collection/utils/validator.js.map +1 -1
- package/dist/esm/actions-aebcbc9d.js +21 -0
- package/dist/esm/{actions-8d745b2a.js.map → actions-aebcbc9d.js.map} +1 -1
- package/dist/esm/app-globals-5e9b67e0.js +8 -0
- package/dist/esm/app-globals-5e9b67e0.js.map +1 -0
- package/dist/esm/arrow_top-aee1ee02.js +34 -0
- package/dist/esm/{arrow_top-fc298828.js.map → arrow_top-aee1ee02.js.map} +1 -1
- package/dist/esm/button-a2fabf9a.js +74 -0
- package/dist/esm/{button-35146bdd.js.map → button-a2fabf9a.js.map} +1 -1
- package/dist/esm/{certification_request-d5ea5973.js → certification_request-08b4deb8.js} +3227 -2835
- package/dist/esm/certification_request-08b4deb8.js.map +1 -0
- package/dist/esm/cross-1377606f.js +47 -0
- package/dist/esm/{cross-9ec9a759.js.map → cross-1377606f.js.map} +1 -1
- package/dist/esm/download-14dc1047.js +21 -0
- package/dist/esm/{download-0cc3077a.js.map → download-14dc1047.js.map} +1 -1
- package/dist/esm/{index-4079bbb5.js → index-ae188432.js} +398 -145
- package/dist/esm/index-ae188432.js.map +1 -0
- package/dist/esm/index.js +10 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/link-7e4e9060.js +23 -0
- package/dist/esm/{link-ad24c3be.js.map → link-7e4e9060.js.map} +1 -1
- package/dist/esm/loader.js +5 -3
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/miscellaneous-d4bbc6f2.js +1400 -0
- package/dist/esm/miscellaneous-d4bbc6f2.js.map +1 -0
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +481 -480
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -1
- package/dist/esm/peculiar-button-menu_3.entry.js +72 -69
- package/dist/esm/peculiar-button-menu_3.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-decoder.entry.js +142 -172
- package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-viewer.entry.js +106 -106
- package/dist/esm/peculiar-certificate-viewer.entry.js.map +1 -1
- package/dist/esm/peculiar-certificates-viewer.entry.js +257 -257
- package/dist/esm/peculiar-certificates-viewer.entry.js.map +1 -1
- package/dist/esm/peculiar-text-hider.entry.js +12 -11
- package/dist/esm/peculiar-text-hider.entry.js.map +1 -1
- package/dist/esm/peculiar.js +6 -4
- package/dist/esm/peculiar.js.map +1 -1
- package/dist/esm/pkcs10_certificate_request-3763c2af.js +146 -0
- package/dist/esm/pkcs10_certificate_request-3763c2af.js.map +1 -0
- package/dist/esm/read_file-bb0b1450.js +110 -0
- package/dist/esm/read_file-bb0b1450.js.map +1 -0
- package/dist/esm/x509_certificate-47b4c5ee.js +159 -0
- package/dist/esm/x509_certificate-47b4c5ee.js.map +1 -0
- package/dist/esm/x509_crl-ba76d3ed.js +176 -0
- package/dist/esm/x509_crl-ba76d3ed.js.map +1 -0
- package/dist/esm-es5/{actions-8d745b2a.js → actions-aebcbc9d.js} +2 -2
- package/dist/esm-es5/app-globals-5e9b67e0.js +5 -0
- package/dist/esm-es5/app-globals-5e9b67e0.js.map +1 -0
- package/dist/esm-es5/{arrow_top-fc298828.js → arrow_top-aee1ee02.js} +2 -2
- package/dist/esm-es5/button-a2fabf9a.js +19 -0
- package/dist/esm-es5/{certification_request-d5ea5973.js → certification_request-08b4deb8.js} +60 -22
- package/dist/esm-es5/certification_request-08b4deb8.js.map +1 -0
- package/dist/esm-es5/{cross-9ec9a759.js → cross-1377606f.js} +2 -2
- package/dist/esm-es5/{download-0cc3077a.js → download-14dc1047.js} +2 -2
- package/dist/esm-es5/index-ae188432.js +6 -0
- package/dist/esm-es5/index-ae188432.js.map +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{link-ad24c3be.js → link-7e4e9060.js} +3 -3
- package/dist/esm-es5/loader.js +2 -2
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/{miscellaneous-cdfd8905.js → miscellaneous-d4bbc6f2.js} +51 -51
- package/dist/esm-es5/miscellaneous-d4bbc6f2.js.map +1 -0
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +17 -17
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-button-menu_3.entry.js +1 -1
- package/dist/esm-es5/peculiar-button-menu_3.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js +2 -9
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificate-viewer.entry.js +2 -2
- package/dist/esm-es5/peculiar-certificate-viewer.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js +3 -3
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-text-hider.entry.js +1 -1
- package/dist/esm-es5/peculiar-text-hider.entry.js.map +1 -1
- package/dist/esm-es5/peculiar.js +2 -2
- package/dist/esm-es5/peculiar.js.map +1 -1
- package/dist/esm-es5/pkcs10_certificate_request-3763c2af.js +19 -0
- package/dist/esm-es5/pkcs10_certificate_request-3763c2af.js.map +1 -0
- package/dist/esm-es5/read_file-bb0b1450.js +12 -0
- package/dist/esm-es5/read_file-bb0b1450.js.map +1 -0
- package/dist/esm-es5/x509_certificate-47b4c5ee.js +12 -0
- package/dist/esm-es5/x509_certificate-47b4c5ee.js.map +1 -0
- package/dist/esm-es5/x509_crl-ba76d3ed.js +19 -0
- package/dist/esm-es5/x509_crl-ba76d3ed.js.map +1 -0
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/{p-a67b8793.system.entry.js → p-0f3787cf.system.entry.js} +10 -10
- package/dist/peculiar/p-0f3787cf.system.entry.js.map +1 -0
- package/dist/peculiar/p-1818204e.system.js +13 -0
- package/dist/peculiar/p-1818204e.system.js.map +1 -0
- package/dist/peculiar/p-243244af.system.js +13 -0
- package/dist/peculiar/p-25a532a3.js +12 -0
- package/dist/peculiar/p-25a532a3.js.map +1 -0
- package/dist/peculiar/{p-0fc2e2b4.js → p-27ca6743.js} +2 -2
- package/dist/peculiar/p-28b4d316.system.js +5 -0
- package/dist/peculiar/p-30e18f2d.system.js +20 -0
- package/dist/peculiar/p-30e18f2d.system.js.map +1 -0
- package/dist/peculiar/p-31d5da39.js +12 -0
- package/dist/peculiar/p-31d5da39.js.map +1 -0
- package/dist/peculiar/p-364df80d.system.entry.js +111 -0
- package/dist/peculiar/p-364df80d.system.entry.js.map +1 -0
- package/dist/peculiar/p-3cb79cd9.js +6 -0
- package/dist/peculiar/p-3cb79cd9.js.map +1 -0
- package/dist/peculiar/p-4bc5ddbe.js +19 -0
- package/dist/peculiar/p-4ee5140c.system.js +19 -0
- package/dist/peculiar/p-4ee5140c.system.js.map +1 -0
- package/dist/peculiar/p-55303453.system.js +12 -0
- package/dist/peculiar/p-55303453.system.js.map +1 -0
- package/dist/peculiar/p-5a662d6f.system.js +13 -0
- package/dist/peculiar/p-6acca6ea.js +135 -0
- package/dist/peculiar/p-6acca6ea.js.map +1 -0
- package/dist/peculiar/p-713563fb.entry.js +5 -0
- package/dist/peculiar/p-713563fb.entry.js.map +1 -0
- package/dist/peculiar/p-78a6b479.js +19 -0
- package/dist/peculiar/p-78a6b479.js.map +1 -0
- package/dist/peculiar/p-82005297.system.entry.js +5 -0
- package/dist/peculiar/p-82005297.system.entry.js.map +1 -0
- package/dist/peculiar/p-821bdcdc.system.js +6 -0
- package/dist/peculiar/p-821bdcdc.system.js.map +1 -0
- package/dist/peculiar/p-82e4faf0.js +19 -0
- package/dist/peculiar/p-82e4faf0.js.map +1 -0
- package/dist/peculiar/p-8393399a.system.js +5 -0
- package/dist/peculiar/p-8393399a.system.js.map +1 -0
- package/dist/peculiar/p-84e3e94a.entry.js +110 -0
- package/dist/peculiar/p-84e3e94a.entry.js.map +1 -0
- package/dist/peculiar/p-8bbee8f4.system.js +13 -0
- package/dist/peculiar/p-8db3e1fd.system.entry.js +5 -0
- package/dist/peculiar/p-8db3e1fd.system.entry.js.map +1 -0
- package/dist/peculiar/p-9712b827.system.js +20 -0
- package/dist/peculiar/{p-2fcad8cb.system.js.map → p-9712b827.system.js.map} +1 -1
- package/dist/peculiar/{p-370cee20.js → p-99efefea.js} +2 -2
- package/dist/peculiar/p-9c8dc738.entry.js +5 -0
- package/dist/peculiar/p-9c8dc738.entry.js.map +1 -0
- package/dist/peculiar/{p-1ceb0fe3.js → p-a9487007.js} +2 -2
- package/dist/peculiar/{p-17e3c47b.js → p-ae91d778.js} +2 -2
- package/dist/peculiar/p-afbd1c8e.entry.js +5 -0
- package/dist/peculiar/p-afbd1c8e.entry.js.map +1 -0
- package/dist/peculiar/{p-67156853.js → p-b0c963b1.js} +26 -26
- package/dist/peculiar/p-b0c963b1.js.map +1 -0
- package/dist/peculiar/p-b5389885.system.entry.js +5 -0
- package/dist/peculiar/p-b5389885.system.entry.js.map +1 -0
- package/dist/peculiar/p-c10bfa6a.system.js +369 -0
- package/dist/peculiar/p-c10bfa6a.system.js.map +1 -0
- package/dist/peculiar/p-c241e4ba.system.js +20 -0
- package/dist/peculiar/{p-c99507d4.system.js.map → p-c241e4ba.system.js.map} +1 -1
- package/dist/peculiar/p-c2995a63.system.js +5 -0
- package/dist/peculiar/p-c2995a63.system.js.map +1 -0
- package/dist/peculiar/p-c3fce3f5.entry.js +5 -0
- package/dist/peculiar/p-c3fce3f5.entry.js.map +1 -0
- package/dist/peculiar/p-dac867e8.js +5 -0
- package/dist/peculiar/p-dac867e8.js.map +1 -0
- package/dist/peculiar/p-df2c8826.system.js +135 -0
- package/dist/peculiar/p-df2c8826.system.js.map +1 -0
- package/dist/peculiar/p-e4ad4f13.system.entry.js +5 -0
- package/dist/peculiar/p-e4ad4f13.system.entry.js.map +1 -0
- package/dist/peculiar/p-e6a6e602.js +12 -0
- package/dist/peculiar/p-eea904d7.system.js +27 -0
- package/dist/peculiar/{p-ddae2f8e.system.js.map → p-eea904d7.system.js.map} +1 -1
- package/dist/peculiar/{p-c35b180c.entry.js → p-f8efbe93.entry.js} +3 -3
- package/dist/peculiar/p-f8efbe93.entry.js.map +1 -0
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/peculiar/peculiar.esm.js.map +1 -1
- package/dist/peculiar/peculiar.js +15 -15
- package/dist/types/components/attribute-certificate-viewer/attribute-certificate-viewer.d.ts +68 -68
- package/dist/types/components/button/button.d.ts +4 -4
- package/dist/types/components/button-menu/button-menu.d.ts +7 -7
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +32 -32
- package/dist/types/components/certificate-details-parts/attributes/activity_description_attribute.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/attributes/as_string_attribute.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/attributes/basic_attribute.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/attributes/challenge_password_attribute.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/attributes/index.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/attributes/insurance_value_attribute.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/attributes/name_attribute.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/attributes/name_part.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/attributes/type_relationship_attribute.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/attributes/unstructured_name_attribute.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/attributes/valuation_ranking_attribute.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/attributes/web_gdpr_attribute.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/basic_information.d.ts +8 -8
- package/dist/types/components/certificate-details-parts/extensions/archive_rev_info_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/as_string_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/authority_key_identifier_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/basic_constraints_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/basic_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/biometric_syntax_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/ca_version_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/cabforganization_identifier_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/certificate_policies_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/certificate_template_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/certificate_transparency_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/crl_distribution_points_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/crl_number_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/crl_reason_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/enroll_cert_type_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/entrust_version_info_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/extended_key_usage_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/general_name_part.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/index.d.ts +2 -2
- package/dist/types/components/certificate-details-parts/extensions/info_access_syntax_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/issuing_distribution_point_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/key_description_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/key_usage_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/lei_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/lei_role_extennsion.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/logotype_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/name_constraints_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/netscape_cert_type_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/netscape_comment_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/policy_constraints_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/policy_mappings_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/private_key_usage_period_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/qc_statements_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/subject_alternative_name_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/subject_directory_attributes_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/subject_key_identifier_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/timestamp_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/extensions/tn_auth_list_extension.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/holder.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/issuer.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/issuer_name.d.ts +2 -2
- package/dist/types/components/certificate-details-parts/miscellaneous.d.ts +3 -3
- package/dist/types/components/certificate-details-parts/public_key.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/revoked_certificates.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/row.d.ts +7 -7
- package/dist/types/components/certificate-details-parts/signature.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/subject_name.d.ts +1 -1
- package/dist/types/components/certificate-details-parts/thumbprints.d.ts +1 -1
- package/dist/types/components/certificate-summary/certificate-summary.d.ts +2 -2
- package/dist/types/components/certificate-viewer/certificate-viewer.d.ts +74 -74
- package/dist/types/components/certificates-viewer/certificates-viewer.d.ts +75 -75
- package/dist/types/components/circular-progress/circular-progress.d.ts +10 -10
- package/dist/types/components/crl-viewer/crl-viewer.d.ts +58 -58
- package/dist/types/components/csr-viewer/csr-viewer.d.ts +54 -55
- package/dist/types/components/highlight-words/highlight-words.d.ts +8 -8
- package/dist/types/components/icons/actions.d.ts +1 -1
- package/dist/types/components/icons/arrow_bottom.d.ts +1 -1
- package/dist/types/components/icons/arrow_top.d.ts +1 -1
- package/dist/types/components/icons/cross.d.ts +1 -1
- package/dist/types/components/icons/details.d.ts +1 -1
- package/dist/types/components/icons/download.d.ts +1 -1
- package/dist/types/components/icons/link.d.ts +1 -1
- package/dist/types/components/link/link.d.ts +2 -2
- package/dist/types/components/text-hider/text-hider.d.ts +2 -2
- package/dist/types/components/typography/typography.d.ts +4 -4
- package/dist/types/components.d.ts +24 -0
- package/dist/types/constants/logs.d.ts +77 -77
- package/dist/types/constants/oids.d.ts +2326 -2326
- package/dist/types/crypto/asn_data.d.ts +6 -6
- package/dist/types/crypto/attribute.d.ts +21 -6
- package/dist/types/crypto/extension.d.ts +51 -5
- package/dist/types/crypto/extensions/cabforganization_identifier.d.ts +5 -5
- package/dist/types/crypto/index.d.ts +2 -2
- package/dist/types/crypto/name.d.ts +7 -7
- package/dist/types/crypto/pkcs10_certificate_request.d.ts +42 -0
- package/dist/types/crypto/provider.d.ts +15 -15
- package/dist/types/crypto/x509_attribute_certificate.d.ts +23 -24
- package/dist/types/crypto/x509_certificate.d.ts +32 -33
- package/dist/types/crypto/x509_crl.d.ts +33 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +29 -0
- package/dist/types/utils/download.d.ts +16 -16
- package/dist/types/utils/l10n.d.ts +56 -56
- package/dist/types/utils/read_file.d.ts +7 -7
- package/hydrate/index.d.ts +2 -2
- package/hydrate/index.js +11369 -9539
- package/package.json +21 -13
- package/dist/cjs/actions-19013d4a.js +0 -23
- package/dist/cjs/arrow_top-834fb7ec.js +0 -37
- package/dist/cjs/button-14e2b73f.js +0 -77
- package/dist/cjs/certification_request-5672c667.js.map +0 -1
- package/dist/cjs/crl-3f681d44.js +0 -322
- package/dist/cjs/crl-3f681d44.js.map +0 -1
- package/dist/cjs/cross-9872c473.js +0 -51
- package/dist/cjs/download-0fa5b33c.js +0 -476
- package/dist/cjs/download-0fa5b33c.js.map +0 -1
- package/dist/cjs/download-254ddc57.js +0 -23
- package/dist/cjs/index-efd561e9.js.map +0 -1
- package/dist/cjs/link-6aea0be4.js +0 -25
- package/dist/cjs/miscellaneous-905ec852.js +0 -1416
- package/dist/cjs/miscellaneous-905ec852.js.map +0 -1
- package/dist/cjs/x509_certificate-69764c52.js +0 -160
- package/dist/cjs/x509_certificate-69764c52.js.map +0 -1
- package/dist/collection/crypto/crl.js +0 -92
- package/dist/collection/crypto/crl.js.map +0 -1
- package/dist/collection/crypto/csr.js +0 -99
- package/dist/collection/crypto/csr.js.map +0 -1
- package/dist/esm/actions-8d745b2a.js +0 -21
- package/dist/esm/arrow_top-fc298828.js +0 -34
- package/dist/esm/button-35146bdd.js +0 -74
- package/dist/esm/certification_request-d5ea5973.js.map +0 -1
- package/dist/esm/crl-d13d9ec5.js +0 -318
- package/dist/esm/crl-d13d9ec5.js.map +0 -1
- package/dist/esm/cross-9ec9a759.js +0 -47
- package/dist/esm/download-0cc3077a.js +0 -21
- package/dist/esm/download-aacb6eff.js +0 -470
- package/dist/esm/download-aacb6eff.js.map +0 -1
- package/dist/esm/index-4079bbb5.js.map +0 -1
- package/dist/esm/link-ad24c3be.js +0 -23
- package/dist/esm/miscellaneous-cdfd8905.js +0 -1399
- package/dist/esm/miscellaneous-cdfd8905.js.map +0 -1
- package/dist/esm/x509_certificate-a9fcab55.js +0 -158
- package/dist/esm/x509_certificate-a9fcab55.js.map +0 -1
- package/dist/esm-es5/button-35146bdd.js +0 -19
- package/dist/esm-es5/certification_request-d5ea5973.js.map +0 -1
- package/dist/esm-es5/crl-d13d9ec5.js +0 -33
- package/dist/esm-es5/crl-d13d9ec5.js.map +0 -1
- package/dist/esm-es5/download-aacb6eff.js +0 -43
- package/dist/esm-es5/download-aacb6eff.js.map +0 -1
- package/dist/esm-es5/index-4079bbb5.js +0 -6
- package/dist/esm-es5/index-4079bbb5.js.map +0 -1
- package/dist/esm-es5/miscellaneous-cdfd8905.js.map +0 -1
- package/dist/esm-es5/x509_certificate-a9fcab55.js +0 -12
- package/dist/esm-es5/x509_certificate-a9fcab55.js.map +0 -1
- package/dist/peculiar/p-0b356bb5.js +0 -6
- package/dist/peculiar/p-0b356bb5.js.map +0 -1
- package/dist/peculiar/p-14f281b0.system.js +0 -43
- package/dist/peculiar/p-14f281b0.system.js.map +0 -1
- package/dist/peculiar/p-2fcad8cb.system.js +0 -20
- package/dist/peculiar/p-33196289.entry.js +0 -5
- package/dist/peculiar/p-33196289.entry.js.map +0 -1
- package/dist/peculiar/p-3b395604.system.entry.js +0 -5
- package/dist/peculiar/p-3b395604.system.entry.js.map +0 -1
- package/dist/peculiar/p-48474b8d.js +0 -12
- package/dist/peculiar/p-48474b8d.js.map +0 -1
- package/dist/peculiar/p-4a6ceeda.js +0 -97
- package/dist/peculiar/p-4a6ceeda.js.map +0 -1
- package/dist/peculiar/p-5151cb6f.system.entry.js +0 -5
- package/dist/peculiar/p-5151cb6f.system.entry.js.map +0 -1
- package/dist/peculiar/p-53784f15.system.entry.js +0 -5
- package/dist/peculiar/p-53784f15.system.entry.js.map +0 -1
- package/dist/peculiar/p-59e5ac12.js +0 -43
- package/dist/peculiar/p-59e5ac12.js.map +0 -1
- package/dist/peculiar/p-5aabeba7.system.js +0 -6
- package/dist/peculiar/p-5aabeba7.system.js.map +0 -1
- package/dist/peculiar/p-5ab007e9.entry.js +0 -5
- package/dist/peculiar/p-5ab007e9.entry.js.map +0 -1
- package/dist/peculiar/p-609ee9f0.entry.js +0 -5
- package/dist/peculiar/p-609ee9f0.entry.js.map +0 -1
- package/dist/peculiar/p-67156853.js.map +0 -1
- package/dist/peculiar/p-6cb88fd6.system.js +0 -13
- package/dist/peculiar/p-6daee4d7.system.js +0 -369
- package/dist/peculiar/p-6daee4d7.system.js.map +0 -1
- package/dist/peculiar/p-6e48afc4.system.js +0 -34
- package/dist/peculiar/p-6e48afc4.system.js.map +0 -1
- package/dist/peculiar/p-718982f4.system.entry.js +0 -111
- package/dist/peculiar/p-718982f4.system.entry.js.map +0 -1
- package/dist/peculiar/p-7f9beaa8.js +0 -19
- package/dist/peculiar/p-80832207.system.js +0 -5
- package/dist/peculiar/p-80832207.system.js.map +0 -1
- package/dist/peculiar/p-8fac1d56.js +0 -33
- package/dist/peculiar/p-8fac1d56.js.map +0 -1
- package/dist/peculiar/p-94a453d7.js +0 -12
- package/dist/peculiar/p-a3eeb94b.system.js +0 -5
- package/dist/peculiar/p-a67b8793.system.entry.js.map +0 -1
- package/dist/peculiar/p-a720c0a5.system.entry.js +0 -13
- package/dist/peculiar/p-a720c0a5.system.entry.js.map +0 -1
- package/dist/peculiar/p-a7386b78.entry.js +0 -12
- package/dist/peculiar/p-a7386b78.entry.js.map +0 -1
- package/dist/peculiar/p-ab7dc738.system.js +0 -13
- package/dist/peculiar/p-ab7dc738.system.js.map +0 -1
- package/dist/peculiar/p-b313be9e.system.js +0 -13
- package/dist/peculiar/p-c35b180c.entry.js.map +0 -1
- package/dist/peculiar/p-c99507d4.system.js +0 -20
- package/dist/peculiar/p-ddae2f8e.system.js +0 -27
- package/dist/peculiar/p-e0f4bda5.system.js +0 -97
- package/dist/peculiar/p-e0f4bda5.system.js.map +0 -1
- package/dist/peculiar/p-e6a3b4d4.system.js +0 -13
- package/dist/peculiar/p-f86279f6.entry.js +0 -110
- package/dist/peculiar/p-f86279f6.entry.js.map +0 -1
- package/dist/types/crypto/crl.d.ts +0 -34
- package/dist/types/crypto/csr.d.ts +0 -41
- /package/dist/esm-es5/{actions-8d745b2a.js.map → actions-aebcbc9d.js.map} +0 -0
- /package/dist/esm-es5/{arrow_top-fc298828.js.map → arrow_top-aee1ee02.js.map} +0 -0
- /package/dist/esm-es5/{button-35146bdd.js.map → button-a2fabf9a.js.map} +0 -0
- /package/dist/esm-es5/{cross-9ec9a759.js.map → cross-1377606f.js.map} +0 -0
- /package/dist/esm-es5/{download-0cc3077a.js.map → download-14dc1047.js.map} +0 -0
- /package/dist/esm-es5/{link-ad24c3be.js.map → link-7e4e9060.js.map} +0 -0
- /package/dist/peculiar/{p-6cb88fd6.system.js.map → p-243244af.system.js.map} +0 -0
- /package/dist/peculiar/{p-0fc2e2b4.js.map → p-27ca6743.js.map} +0 -0
- /package/dist/peculiar/{p-a3eeb94b.system.js.map → p-28b4d316.system.js.map} +0 -0
- /package/dist/peculiar/{p-7f9beaa8.js.map → p-4bc5ddbe.js.map} +0 -0
- /package/dist/peculiar/{p-b313be9e.system.js.map → p-5a662d6f.system.js.map} +0 -0
- /package/dist/peculiar/{p-e6a3b4d4.system.js.map → p-8bbee8f4.system.js.map} +0 -0
- /package/dist/peculiar/{p-370cee20.js.map → p-99efefea.js.map} +0 -0
- /package/dist/peculiar/{p-1ceb0fe3.js.map → p-a9487007.js.map} +0 -0
- /package/dist/peculiar/{p-17e3c47b.js.map → p-ae91d778.js.map} +0 -0
- /package/dist/peculiar/{p-94a453d7.js.map → p-e6a6e602.js.map} +0 -0
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
10
|
*/
|
|
11
11
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
if (kind === "m")
|
|
13
|
+
throw new TypeError("Private method is not writable");
|
|
14
|
+
if (kind === "a" && !f)
|
|
15
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
16
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
17
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
18
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
19
19
|
};
|
|
20
20
|
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
if (kind === "a" && !f)
|
|
22
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
23
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
24
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
25
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
26
26
|
};
|
|
27
27
|
var _Name_asn;
|
|
28
28
|
import { Name as AsnName } from "@peculiar/asn1-x509";
|
|
@@ -30,27 +30,27 @@ import { AsnParser } from "@peculiar/asn1-schema";
|
|
|
30
30
|
import { BufferSourceConverter } from "pvtsutils";
|
|
31
31
|
import { OIDs, OIDsShort } from "../constants/oids";
|
|
32
32
|
export class Name {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
constructor(data) {
|
|
34
|
+
_Name_asn.set(this, new AsnName());
|
|
35
|
+
if (BufferSourceConverter.isBufferSource(data)) {
|
|
36
|
+
__classPrivateFieldSet(this, _Name_asn, AsnParser.parse(data, AsnName), "f");
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
__classPrivateFieldSet(this, _Name_asn, data, "f");
|
|
40
|
+
}
|
|
37
41
|
}
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
toJSON() {
|
|
43
|
+
const res = [];
|
|
44
|
+
__classPrivateFieldGet(this, _Name_asn, "f").forEach((o) => (o.forEach((a) => {
|
|
45
|
+
res.push({
|
|
46
|
+
type: a.type,
|
|
47
|
+
name: OIDs[a.type],
|
|
48
|
+
shortName: OIDsShort[a.type],
|
|
49
|
+
value: a.value.toString(),
|
|
50
|
+
});
|
|
51
|
+
})));
|
|
52
|
+
return res;
|
|
40
53
|
}
|
|
41
|
-
}
|
|
42
|
-
toJSON() {
|
|
43
|
-
const res = [];
|
|
44
|
-
__classPrivateFieldGet(this, _Name_asn, "f").forEach((o) => (o.forEach((a) => {
|
|
45
|
-
res.push({
|
|
46
|
-
type: a.type,
|
|
47
|
-
name: OIDs[a.type],
|
|
48
|
-
shortName: OIDsShort[a.type],
|
|
49
|
-
value: a.value.toString(),
|
|
50
|
-
});
|
|
51
|
-
})));
|
|
52
|
-
return res;
|
|
53
|
-
}
|
|
54
54
|
}
|
|
55
55
|
_Name_asn = new WeakMap();
|
|
56
56
|
//# sourceMappingURL=name.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"name.js","sourceRoot":"","sources":["../../src/crypto/name.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;;;;;;;;AAEH,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AASpD,MAAM,OAAO,IAAI;
|
|
1
|
+
{"version":3,"file":"name.js","sourceRoot":"","sources":["../../src/crypto/name.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;;;;;;;;AAEH,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AASpD,MAAM,OAAO,IAAI;IAGf,YAAmB,IAA4B;QAF/C,oBAAO,IAAI,OAAO,EAAE,EAAC;QAGnB,IAAI,qBAAqB,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/C,uBAAA,IAAI,aAAQ,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,MAAA,CAAC;QAC7C,CAAC;aAAM,CAAC;YACN,uBAAA,IAAI,aAAQ,IAAI,MAAA,CAAC;QACnB,CAAC;IACH,CAAC;IAEM,MAAM;QACX,MAAM,GAAG,GAAG,EAAE,CAAC;QAEf,uBAAA,IAAI,iBAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACvB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACd,GAAG,CAAC,IAAI,CAAC;gBACP,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;gBAClB,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;gBAC5B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE;aAC1B,CAAC,CAAC;QACL,CAAC,CAAC,CACH,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;IACb,CAAC;CACF","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 { Name as AsnName } from '@peculiar/asn1-x509';\nimport { AsnParser } from '@peculiar/asn1-schema';\nimport { BufferSourceConverter } from 'pvtsutils';\nimport { OIDs, OIDsShort } from '../constants/oids';\n\nexport interface INameJSON {\n type: string;\n name: string;\n shortName: string;\n value: string;\n}\n\nexport class Name {\n #asn = new AsnName();\n\n public constructor(data: BufferSource | AsnName) {\n if (BufferSourceConverter.isBufferSource(data)) {\n this.#asn = AsnParser.parse(data, AsnName);\n } else {\n this.#asn = data;\n }\n }\n\n public toJSON(): INameJSON[] {\n const res = [];\n\n this.#asn.forEach((o) => (\n o.forEach((a) => {\n res.push({\n type: a.type,\n name: OIDs[a.type],\n shortName: OIDsShort[a.type],\n value: a.value.toString(),\n });\n })\n ));\n\n return res;\n }\n}\n"]}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/
|
|
11
|
+
import { AsnConvert } from "@peculiar/asn1-schema";
|
|
12
|
+
import { ECParameters, id_ecPublicKey } from "@peculiar/asn1-ecc";
|
|
13
|
+
import { id_rsaEncryption, RSAPublicKey } from "@peculiar/asn1-rsa";
|
|
14
|
+
import { CertificationRequest } from "@peculiar/asn1-csr";
|
|
15
|
+
import { id_pkcs9_at_extensionRequest, } from "@peculiar/asn1-pkcs9";
|
|
16
|
+
import { Convert } from "pvtsutils";
|
|
17
|
+
import { Download } from "../utils";
|
|
18
|
+
import { AsnData } from "./asn_data";
|
|
19
|
+
import { Name } from "./name";
|
|
20
|
+
import { Attribute } from "./attribute";
|
|
21
|
+
import { Extension } from "./extension";
|
|
22
|
+
import { certificateRawToBuffer, hexFormat, base64Format, getCertificateThumbprint, } from "./utils";
|
|
23
|
+
export class Pkcs10CertificateRequest extends AsnData {
|
|
24
|
+
constructor(raw) {
|
|
25
|
+
super(certificateRawToBuffer(raw), CertificationRequest);
|
|
26
|
+
this.thumbprints = {};
|
|
27
|
+
this.type = 'PKCS#10 Certificate Request';
|
|
28
|
+
this.tag = 'CERTIFICATE REQUEST';
|
|
29
|
+
const { certificationRequestInfo } = this.asn;
|
|
30
|
+
this.subject = new Name(certificationRequestInfo.subject).toJSON();
|
|
31
|
+
this.version = certificationRequestInfo.version;
|
|
32
|
+
}
|
|
33
|
+
get publicKey() {
|
|
34
|
+
const { subjectPublicKey, algorithm } = this.asn.certificationRequestInfo.subjectPKInfo;
|
|
35
|
+
let params;
|
|
36
|
+
if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {
|
|
37
|
+
params = AsnConvert.parse(algorithm.parameters, ECParameters);
|
|
38
|
+
}
|
|
39
|
+
if (algorithm.algorithm === id_rsaEncryption) {
|
|
40
|
+
params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);
|
|
41
|
+
}
|
|
42
|
+
const spki = AsnConvert.serialize(this.asn.certificationRequestInfo.subjectPKInfo);
|
|
43
|
+
return {
|
|
44
|
+
params,
|
|
45
|
+
value: spki,
|
|
46
|
+
algorithm: algorithm.algorithm,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
get signature() {
|
|
50
|
+
const { signature, signatureAlgorithm } = this.asn;
|
|
51
|
+
return {
|
|
52
|
+
value: signature,
|
|
53
|
+
algorithm: signatureAlgorithm.algorithm,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
get commonName() {
|
|
57
|
+
if (!this.subject) {
|
|
58
|
+
return '';
|
|
59
|
+
}
|
|
60
|
+
for (let i = 0; i < this.subject.length; i += 1) {
|
|
61
|
+
const name = this.subject[i];
|
|
62
|
+
if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {
|
|
63
|
+
return name.value;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return '';
|
|
67
|
+
}
|
|
68
|
+
async getThumbprint(algorithm = 'SHA-1') {
|
|
69
|
+
try {
|
|
70
|
+
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
71
|
+
if (thumbprint) {
|
|
72
|
+
this.thumbprints[algorithm] = Convert.ToHex(thumbprint);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
console.error('Error thumbprint get:', error);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
parseAttributes() {
|
|
80
|
+
const { certificationRequestInfo } = this.asn;
|
|
81
|
+
if (certificationRequestInfo.attributes) {
|
|
82
|
+
this.attributes = certificationRequestInfo.attributes
|
|
83
|
+
.map((e) => new Attribute(AsnConvert.serialize(e)));
|
|
84
|
+
const extensionRequestAttribute = this.attributes.find((attribute) => attribute.asn.type === id_pkcs9_at_extensionRequest);
|
|
85
|
+
if (extensionRequestAttribute) {
|
|
86
|
+
this.extensions = extensionRequestAttribute.value
|
|
87
|
+
.map((e) => new Extension(AsnConvert.serialize(e)));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
toString(format = 'pem') {
|
|
92
|
+
switch (format) {
|
|
93
|
+
case 'hex':
|
|
94
|
+
return hexFormat(Convert.ToHex(this.raw));
|
|
95
|
+
case 'pem':
|
|
96
|
+
return `-----BEGIN ${this.tag}-----\n${base64Format(this.toString('base64'))}\n-----END ${this.tag}-----`;
|
|
97
|
+
default:
|
|
98
|
+
return Convert.ToBase64(this.raw);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
downloadAsPEM(name) {
|
|
102
|
+
Download.csr.asPEM(this.toString('pem'), name || this.commonName);
|
|
103
|
+
}
|
|
104
|
+
downloadAsDER(name) {
|
|
105
|
+
Download.csr.asDER(this.toString('hex'), name || this.commonName);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=pkcs10_certificate_request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pkcs10_certificate_request.js","sourceRoot":"","sources":["../../src/crypto/pkcs10_certificate_request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EACL,4BAA4B,GAE7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,IAAI,EAAa,MAAM,QAA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CAAC;IAEM,aAAa,CAAC,IAAa;QAChC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAChB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpB,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;IACJ,CAAC;CACF","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 { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport { CertificationRequest } from '@peculiar/asn1-csr';\nimport {\n id_pkcs9_at_extensionRequest,\n ExtensionRequest,\n} from '@peculiar/asn1-pkcs9';\nimport { Convert } from 'pvtsutils';\n\nimport { Download } from '../utils';\n\nimport { AsnData } from './asn_data';\nimport { Name, INameJSON } from './name';\nimport { Attribute, TAttributeValue } from './attribute';\nimport { Extension, TExtensionValue } from './extension';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\ninterface IPublicKey {\n algorithm: string;\n value: BufferSource;\n params?: ECParameters | RSAPublicKey;\n}\n\nexport class Pkcs10CertificateRequest extends AsnData<CertificationRequest> {\n public readonly subject: INameJSON[];\n\n public readonly version: number;\n\n public attributes: Attribute<TAttributeValue>[];\n\n public extensions: Extension<TExtensionValue>[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'PKCS#10 Certificate Request';\n\n public readonly tag = 'CERTIFICATE REQUEST';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), CertificationRequest);\n\n const { certificationRequestInfo } = this.asn;\n\n this.subject = new Name(certificationRequestInfo.subject).toJSON();\n this.version = certificationRequestInfo.version;\n }\n\n public get publicKey(): IPublicKey {\n const { subjectPublicKey, algorithm } = this.asn.certificationRequestInfo.subjectPKInfo;\n let params;\n\n if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {\n params = AsnConvert.parse(algorithm.parameters, ECParameters);\n }\n\n if (algorithm.algorithm === id_rsaEncryption) {\n params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);\n }\n\n const spki = AsnConvert.serialize(this.asn.certificationRequestInfo.subjectPKInfo);\n\n return {\n params,\n value: spki,\n algorithm: algorithm.algorithm,\n };\n }\n\n public get signature(): ISignature {\n const { signature, signatureAlgorithm } = this.asn;\n\n return {\n value: signature,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public get commonName(): string {\n if (!this.subject) {\n return '';\n }\n\n for (let i = 0; i < this.subject.length; i += 1) {\n const name = this.subject[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\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 parseAttributes() {\n const { certificationRequestInfo } = this.asn;\n\n if (certificationRequestInfo.attributes) {\n this.attributes = certificationRequestInfo.attributes\n .map((e) => new Attribute(AsnConvert.serialize(e)));\n\n const extensionRequestAttribute = this.attributes.find(\n (attribute) => attribute.asn.type === id_pkcs9_at_extensionRequest,\n ) as Attribute<ExtensionRequest>;\n\n if (extensionRequestAttribute) {\n this.extensions = extensionRequestAttribute.value\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.csr.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.csr.asDER(\n this.toString('hex'),\n name || this.commonName,\n );\n }\n}\n"]}
|
|
@@ -9,36 +9,36 @@
|
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
10
|
*/
|
|
11
11
|
export class CryptoProvider {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
constructor() {
|
|
16
|
-
this.providers = new Map();
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
const crypto = window.crypto || window.msCrypto;
|
|
19
|
-
if (typeof crypto !== 'undefined') {
|
|
20
|
-
this.set(CryptoProvider.DEFAULT, crypto);
|
|
12
|
+
static isCryptoKeyPair(data) {
|
|
13
|
+
return data && data.privateKey && data.publicKey;
|
|
21
14
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
constructor() {
|
|
16
|
+
this.providers = new Map();
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
const crypto = window.crypto || window.msCrypto;
|
|
19
|
+
if (typeof crypto !== 'undefined') {
|
|
20
|
+
this.set(CryptoProvider.DEFAULT, crypto);
|
|
21
|
+
}
|
|
27
22
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
this.providers.set(key.toLowerCase(), value);
|
|
23
|
+
get(key = CryptoProvider.DEFAULT) {
|
|
24
|
+
const crypto = this.providers.get(key.toLowerCase());
|
|
25
|
+
if (!crypto) {
|
|
26
|
+
throw new Error(`Cannot get Crypto by name '${key}'`);
|
|
27
|
+
}
|
|
28
|
+
return crypto;
|
|
36
29
|
}
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
set(key, value) {
|
|
31
|
+
if (typeof key === 'string') {
|
|
32
|
+
if (!value) {
|
|
33
|
+
throw new TypeError("Argument 'value' is required");
|
|
34
|
+
}
|
|
35
|
+
this.providers.set(key.toLowerCase(), value);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.providers.set(CryptoProvider.DEFAULT, key);
|
|
39
|
+
}
|
|
40
|
+
return this;
|
|
39
41
|
}
|
|
40
|
-
return this;
|
|
41
|
-
}
|
|
42
42
|
}
|
|
43
43
|
CryptoProvider.DEFAULT = 'default';
|
|
44
44
|
export const cryptoProvider = new CryptoProvider();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/crypto/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,OAAO,cAAc;
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/crypto/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,OAAO,cAAc;IAKlB,MAAM,CAAC,eAAe,CAAC,IAAS;QACrC,OAAO,IAAI,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,SAAS,CAAC;IACnD,CAAC;IAED;QARQ,cAAS,GAAwB,IAAI,GAAG,EAAE,CAAC;QASjD,aAAa;QACb,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC;QAEhD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IAaM,GAAG,CAAC,GAAG,GAAG,cAAc,CAAC,OAAO;QACrC,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;QAErD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,8BAA8B,GAAG,GAAG,CAAC,CAAC;QACxD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAMM,GAAG,CAAC,GAAoB,EAAE,KAAc;QAC7C,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC5B,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAC;YACtD,CAAC;YAED,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAAC;QAC/C,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAClD,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;;AApDa,sBAAO,GAAG,SAAS,AAAZ,CAAa;AAuDpC,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC","sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport class CryptoProvider {\n private providers: Map<string, Crypto> = new Map();\n\n public static DEFAULT = 'default';\n\n public static isCryptoKeyPair(data: any): data is CryptoKeyPair {\n return data && data.privateKey && data.publicKey;\n }\n\n constructor() {\n // @ts-ignore\n const crypto = window.crypto || window.msCrypto;\n\n if (typeof crypto !== 'undefined') {\n this.set(CryptoProvider.DEFAULT, crypto);\n }\n }\n\n /**\n * Returns default crypto\n */\n public get(): Crypto;\n\n /**\n * Returns crypto by name\n * @param key Crypto name\n */\n public get(key: string): Crypto;\n\n public get(key = CryptoProvider.DEFAULT) {\n const crypto = this.providers.get(key.toLowerCase());\n\n if (!crypto) {\n throw new Error(`Cannot get Crypto by name '${key}'`);\n }\n\n return crypto;\n }\n\n public set(value: Crypto): this;\n\n public set(key: string, value: Crypto): this;\n\n public set(key: string | Crypto, value?: Crypto) {\n if (typeof key === 'string') {\n if (!value) {\n throw new TypeError(\"Argument 'value' is required\");\n }\n\n this.providers.set(key.toLowerCase(), value);\n } else {\n this.providers.set(CryptoProvider.DEFAULT, key);\n }\n\n return this;\n }\n}\n\nexport const cryptoProvider = new CryptoProvider();\n"]}
|
|
@@ -6,34 +6,34 @@ import { validator } from "../utils";
|
|
|
6
6
|
import { cryptoProvider } from "./provider";
|
|
7
7
|
const base64Re = /-----BEGIN [^-]+-----([A-Za-z0-9+/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+/=\s]+)====/;
|
|
8
8
|
export const base64Clarify = (base64) => {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const execArray = base64Re.exec(base64);
|
|
10
|
+
return execArray ? (execArray[1] || execArray[2]) : base64;
|
|
11
11
|
};
|
|
12
12
|
export const hexFormat = (hex) => (hex
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
.replace(/(.{32})/g, '$1\n')
|
|
14
|
+
.replace(/(.{4})/g, '$1 ')
|
|
15
|
+
.trim());
|
|
16
16
|
export const base64Format = (base64) => (base64
|
|
17
|
-
|
|
17
|
+
.replace(/(.{64})/g, '$1\n'));
|
|
18
18
|
export const certificateRawToBuffer = (raw) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
const rawClarified = base64Clarify(raw);
|
|
20
|
+
let buffer;
|
|
21
|
+
if (validator.isHex(rawClarified)) {
|
|
22
|
+
buffer = Convert.FromHex(rawClarified);
|
|
23
|
+
}
|
|
24
|
+
else if (validator.isBase64(rawClarified) || validator.isPem(rawClarified)) {
|
|
25
|
+
buffer = Convert.FromBase64(rawClarified);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
buffer = Convert.FromBinary(raw);
|
|
29
|
+
}
|
|
30
|
+
return buffer;
|
|
31
31
|
};
|
|
32
32
|
export const getCertificateThumbprint = async (algorithm, data) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
const crypto = cryptoProvider.get();
|
|
34
|
+
if (crypto.subtle) {
|
|
35
|
+
return crypto.subtle.digest(algorithm, data);
|
|
36
|
+
}
|
|
37
|
+
return undefined;
|
|
38
38
|
};
|
|
39
39
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/crypto/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,QAAQ,GAAG,yGAAyG,CAAC;AAE3H,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAc,EAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/crypto/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,QAAQ,GAAG,yGAAyG,CAAC;AAE3H,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAc,EAAU,EAAE;IACtD,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAExC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,CAChD,GAAG;KACA,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC;KAC3B,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC;KACzB,IAAI,EAAE,CACV,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,CACtD,MAAM;KACH,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAW,EAAe,EAAE;IACjE,MAAM,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,MAAmB,CAAC;IAExB,IAAI,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;QAClC,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACzC,CAAC;SAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;QAC7E,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC5C,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,EAC3C,SAAyC,EACzC,IAAiB,EACiB,EAAE;IACpC,MAAM,MAAM,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC;IAEpC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["import { Convert } from 'pvtsutils';\nimport { validator } from '../utils';\n\nimport { cryptoProvider } from './provider';\n\nconst base64Re = /-----BEGIN [^-]+-----([A-Za-z0-9+/=\\s]+)-----END [^-]+-----|begin-base64[^\\n]+\\n([A-Za-z0-9+/=\\s]+)====/;\n\nexport const base64Clarify = (base64: string): string => {\n const execArray = base64Re.exec(base64);\n\n return execArray ? (execArray[1] || execArray[2]) : base64;\n};\n\nexport const hexFormat = (hex: string): string => (\n hex\n .replace(/(.{32})/g, '$1\\n')\n .replace(/(.{4})/g, '$1 ')\n .trim()\n);\n\nexport const base64Format = (base64: string): string => (\n base64\n .replace(/(.{64})/g, '$1\\n')\n);\n\nexport const certificateRawToBuffer = (raw: string): ArrayBuffer => {\n const rawClarified = base64Clarify(raw);\n let buffer: ArrayBuffer;\n\n if (validator.isHex(rawClarified)) {\n buffer = Convert.FromHex(rawClarified);\n } else if (validator.isBase64(rawClarified) || validator.isPem(rawClarified)) {\n buffer = Convert.FromBase64(rawClarified);\n } else {\n buffer = Convert.FromBinary(raw);\n }\n\n return buffer;\n};\n\nexport const getCertificateThumbprint = async (\n algorithm: globalThis.AlgorithmIdentifier,\n data: ArrayBuffer,\n): Promise<ArrayBuffer | undefined> => {\n const crypto = cryptoProvider.get();\n\n if (crypto.subtle) {\n return crypto.subtle.digest(algorithm, data);\n }\n\n return undefined;\n};\n"]}
|
|
@@ -17,77 +17,79 @@ import { Extension } from "./extension";
|
|
|
17
17
|
import { Attribute } from "./attribute";
|
|
18
18
|
import { certificateRawToBuffer, hexFormat, base64Format, getCertificateThumbprint, } from "./utils";
|
|
19
19
|
export class X509AttributeCertificate extends AsnData {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
constructor(raw) {
|
|
21
|
+
var _a;
|
|
22
|
+
super(certificateRawToBuffer(raw), AttributeCertificate);
|
|
23
|
+
this.thumbprints = {};
|
|
24
|
+
this.type = 'X.509 Attribute Certificate';
|
|
25
|
+
this.tag = 'ATTRIBUTE CERTIFICATE';
|
|
26
|
+
const { acinfo } = this.asn;
|
|
27
|
+
this.serialNumber = Convert.ToHex(acinfo.serialNumber);
|
|
28
|
+
this.version = acinfo.version;
|
|
29
|
+
const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;
|
|
30
|
+
if (!notBefore) {
|
|
31
|
+
throw new Error("Cannot get 'notBefore' value");
|
|
32
|
+
}
|
|
33
|
+
this.notBefore = notBefore;
|
|
34
|
+
const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;
|
|
35
|
+
if (!notAfter) {
|
|
36
|
+
throw new Error("Cannot get 'notAfter' value");
|
|
37
|
+
}
|
|
38
|
+
this.notAfter = notAfter;
|
|
39
|
+
this.validity = dateDiff(this.notBefore, this.notAfter);
|
|
40
|
+
this.issuer = acinfo.issuer.v1Form || ((_a = acinfo.issuer.v2Form) === null || _a === void 0 ? void 0 : _a.issuerName);
|
|
41
|
+
this.holder = acinfo.holder;
|
|
31
42
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
get signature() {
|
|
44
|
+
const { signatureValue, signatureAlgorithm } = this.asn;
|
|
45
|
+
return {
|
|
46
|
+
value: signatureValue,
|
|
47
|
+
algorithm: signatureAlgorithm.algorithm,
|
|
48
|
+
};
|
|
36
49
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const { signatureValue, signatureAlgorithm } = this.asn;
|
|
44
|
-
return {
|
|
45
|
-
value: signatureValue,
|
|
46
|
-
algorithm: signatureAlgorithm.algorithm,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
parseExtensions() {
|
|
50
|
-
const { acinfo } = this.asn;
|
|
51
|
-
if (acinfo.extensions) {
|
|
52
|
-
this.extensions = acinfo.extensions
|
|
53
|
-
.map((e) => new Extension(AsnConvert.serialize(e)));
|
|
50
|
+
parseExtensions() {
|
|
51
|
+
const { acinfo } = this.asn;
|
|
52
|
+
if (acinfo.extensions) {
|
|
53
|
+
this.extensions = acinfo.extensions
|
|
54
|
+
.map((e) => new Extension(AsnConvert.serialize(e)));
|
|
55
|
+
}
|
|
54
56
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
parseAttributes() {
|
|
58
|
+
const { acinfo } = this.asn;
|
|
59
|
+
if (acinfo.attributes) {
|
|
60
|
+
this.attributes = acinfo.attributes
|
|
61
|
+
.map((e) => new Attribute(AsnConvert.serialize(e)));
|
|
62
|
+
}
|
|
61
63
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
async getThumbprint(algorithm = 'SHA-1') {
|
|
65
|
+
try {
|
|
66
|
+
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
67
|
+
if (thumbprint) {
|
|
68
|
+
this.thumbprints[algorithm] = Convert.ToHex(thumbprint);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
console.error('Error thumbprint get:', error);
|
|
73
|
+
}
|
|
69
74
|
}
|
|
70
|
-
|
|
71
|
-
|
|
75
|
+
get commonName() {
|
|
76
|
+
return `attribute-certificate-${this.thumbprints['SHA-1']}`;
|
|
77
|
+
}
|
|
78
|
+
toString(format = 'pem') {
|
|
79
|
+
switch (format) {
|
|
80
|
+
case 'hex':
|
|
81
|
+
return hexFormat(Convert.ToHex(this.raw));
|
|
82
|
+
case 'pem':
|
|
83
|
+
return `-----BEGIN ${this.tag}-----\n${base64Format(this.toString('base64'))}\n-----END ${this.tag}-----`;
|
|
84
|
+
default:
|
|
85
|
+
return Convert.ToBase64(this.raw);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
downloadAsPEM(name) {
|
|
89
|
+
Download.attrCert.asPEM(this.toString('pem'), name || this.commonName);
|
|
90
|
+
}
|
|
91
|
+
downloadAsDER(name) {
|
|
92
|
+
Download.attrCert.asDER(this.toString('hex'), name || this.commonName);
|
|
72
93
|
}
|
|
73
|
-
}
|
|
74
|
-
exportAsBase64() {
|
|
75
|
-
return Convert.ToBase64(this.raw);
|
|
76
|
-
}
|
|
77
|
-
exportAsHexFormatted() {
|
|
78
|
-
return hexFormat(Convert.ToHex(this.raw));
|
|
79
|
-
}
|
|
80
|
-
exportAsPemFormatted() {
|
|
81
|
-
return `-----BEGIN ATTRIBUTE CERTIFICATE-----\n${base64Format(this.exportAsBase64())}\n-----END ATTRIBUTE CERTIFICATE-----`;
|
|
82
|
-
}
|
|
83
|
-
get commonName() {
|
|
84
|
-
return `attribute-certificate-${this.thumbprints['SHA-1']}`;
|
|
85
|
-
}
|
|
86
|
-
downloadAsPEM(name) {
|
|
87
|
-
Download.attrCert.asPEM(this.exportAsPemFormatted(), name || this.commonName);
|
|
88
|
-
}
|
|
89
|
-
downloadAsDER(name) {
|
|
90
|
-
Download.attrCert.asDER(this.exportAsHexFormatted(), name || this.commonName);
|
|
91
|
-
}
|
|
92
94
|
}
|
|
93
95
|
//# sourceMappingURL=x509_attribute_certificate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x509_attribute_certificate.js","sourceRoot":"","sources":["../../src/crypto/x509_attribute_certificate.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAU,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,SA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AC,EACpB,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;IACJ,CAAC;IAEM,aAAa,CAAC,IAAa;QAChC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CACrB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpB,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;IACJ,CAAC;CACF","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 readonly type = 'X.509 Attribute Certificate';\n\n public readonly tag = '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 get commonName(): string {\n return `attribute-certificate-${this.thumbprints['SHA-1']}`;\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.attrCert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.attrCert.asDER(\n this.toString('hex'),\n name || this.commonName,\n );\n }\n}\n"]}
|