@peculiar/certificates-viewer 4.3.1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/actions.js +1 -0
- package/components/actions.js.map +1 -1
- package/components/arrow_top.js +1 -0
- package/components/arrow_top.js.map +1 -1
- package/components/attribute-certificate-viewer.js +23 -22
- package/components/attribute-certificate-viewer.js.map +1 -1
- package/components/attribute.js +4 -3
- package/components/attribute.js.map +1 -1
- package/components/button-menu.js +4 -4
- package/components/button-menu.js.map +1 -1
- package/components/button.js +1 -0
- package/components/button.js.map +1 -1
- package/components/certificate-chain-viewer.js +64 -0
- package/components/certificate-chain-viewer.js.map +1 -0
- package/components/certificate-viewer.js +21 -21
- package/components/certificate-viewer.js.map +1 -1
- package/components/circular-progress.js +12 -6
- package/components/circular-progress.js.map +1 -1
- package/components/crl-viewer.js +22 -20
- package/components/crl-viewer.js.map +1 -1
- package/components/cross.js +1 -0
- package/components/cross.js.map +1 -1
- package/components/csr-viewer.js +13 -10
- package/components/csr-viewer.js.map +1 -1
- package/components/download.js +1096 -1598
- package/components/download.js.map +1 -1
- package/components/highlight-words.js +3 -4
- package/components/highlight-words.js.map +1 -1
- package/components/index.js +1 -0
- package/components/index2.js +4 -3
- package/components/index2.js.map +1 -1
- package/components/issuer_name.js +2 -1
- package/components/issuer_name.js.map +1 -1
- package/components/miscellaneous.js +21 -20
- package/components/miscellaneous.js.map +1 -1
- package/components/peculiar-attribute-certificate-viewer.js +1 -0
- package/components/peculiar-button-menu.js +1 -0
- package/components/peculiar-certificate-chain-viewer.d.ts +11 -0
- package/components/peculiar-certificate-chain-viewer.js +12 -0
- package/components/peculiar-certificate-chain-viewer.js.map +1 -0
- package/components/peculiar-certificate-decoder.js +106 -23
- package/components/peculiar-certificate-decoder.js.map +1 -1
- package/components/peculiar-certificate-viewer.js +1 -0
- package/components/peculiar-certificates-viewer.js +35 -14
- package/components/peculiar-certificates-viewer.js.map +1 -1
- package/components/peculiar-circular-progress.js +1 -0
- package/components/peculiar-crl-viewer.js +1 -0
- package/components/peculiar-csr-viewer.js +1 -0
- package/components/peculiar-highlight-words.js +1 -0
- package/components/peculiar-text-hider.js +3 -3
- package/components/peculiar-text-hider.js.map +1 -1
- package/components/pkcs10_certificate_request.js +8 -7
- package/components/pkcs10_certificate_request.js.map +1 -1
- package/components/read_file.js +1 -0
- package/components/read_file.js.map +1 -1
- package/components/subject_name.js +4 -3
- package/components/subject_name.js.map +1 -1
- package/dist/cjs/{actions-789906f5.js → actions-Dl4HXXlI.js} +3 -2
- package/dist/cjs/actions-Dl4HXXlI.js.map +1 -0
- package/dist/cjs/{app-globals-c20ffa41.js → app-globals-BOZYdIuK.js} +2 -1
- package/dist/cjs/app-globals-BOZYdIuK.js.map +1 -0
- package/dist/cjs/{arrow_top-76e4261e.js → arrow_top-DBMPHVlB.js} +3 -2
- package/dist/cjs/arrow_top-DBMPHVlB.js.map +1 -0
- package/dist/cjs/{button-87086210.js → button-C5jDF-CZ.js} +3 -2
- package/dist/cjs/button-C5jDF-CZ.js.map +1 -0
- package/dist/cjs/{certification_request-ad267278.js → certification_request-Bipg1Az7.js} +1119 -1620
- package/dist/cjs/certification_request-Bipg1Az7.js.map +1 -0
- package/dist/cjs/{cross-bd099933.js → cross-pi7K0cHC.js} +3 -2
- package/dist/cjs/cross-pi7K0cHC.js.map +1 -0
- package/dist/cjs/{download-820d66ba.js → download-D9skkVoT.js} +3 -2
- package/dist/cjs/download-D9skkVoT.js.map +1 -0
- package/dist/cjs/index-BO3rFndV.js +2301 -0
- package/dist/cjs/index-BO3rFndV.js.map +1 -0
- package/dist/cjs/index.cjs.js +11 -12
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/{link-a3d3799d.js → link-CwLq-Nge.js} +4 -3
- package/dist/cjs/link-CwLq-Nge.js.map +1 -0
- package/dist/cjs/loader.cjs.js +4 -5
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/{miscellaneous-67439e59.js → miscellaneous-C0sOAo-1.js} +25 -24
- package/dist/cjs/miscellaneous-C0sOAo-1.js.map +1 -0
- package/dist/cjs/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.cjs.js.map +1 -0
- package/dist/cjs/{peculiar-attribute-certificate-viewer_3.cjs.entry.js → peculiar-attribute-certificate-viewer_4.cjs.entry.js} +75 -45
- package/dist/cjs/peculiar-attribute-certificate-viewer_4.cjs.entry.js.map +1 -0
- package/dist/cjs/peculiar-button-menu.peculiar-circular-progress.peculiar-highlight-words.entry.cjs.js.map +1 -0
- package/dist/cjs/peculiar-button-menu_3.cjs.entry.js +20 -19
- package/dist/cjs/peculiar-button-menu_3.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +104 -29
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-decoder.entry.cjs.js.map +1 -0
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +19 -21
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-viewer.entry.cjs.js.map +1 -0
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +43 -24
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificates-viewer.entry.cjs.js.map +1 -0
- package/dist/cjs/peculiar-text-hider.cjs.entry.js +6 -8
- package/dist/cjs/peculiar-text-hider.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-text-hider.entry.cjs.js.map +1 -0
- package/dist/cjs/peculiar.cjs.js +14 -13
- package/dist/cjs/peculiar.cjs.js.map +1 -1
- package/dist/cjs/{pkcs10_certificate_request-64898c88.js → pkcs10_certificate_request-BDz0P_px.js} +11 -10
- package/dist/cjs/pkcs10_certificate_request-BDz0P_px.js.map +1 -0
- package/dist/cjs/{read_file-2e22a97e.js → read_file-DWtcn3zU.js} +2 -1
- package/dist/cjs/read_file-DWtcn3zU.js.map +1 -0
- package/dist/cjs/{x509_certificate-4b0894c2.js → x509_certificate-DRvXOszL.js} +10 -9
- package/dist/cjs/x509_certificate-DRvXOszL.js.map +1 -0
- package/dist/cjs/{x509_crl-fc8d41a1.js → x509_crl-DVGVym_S.js} +17 -16
- package/dist/cjs/x509_crl-DVGVym_S.js.map +1 -0
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +24 -9
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js.map +1 -1
- package/dist/collection/components/button-menu/button-menu.js +4 -2
- package/dist/collection/components/button-menu/button-menu.js.map +1 -1
- package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.css +1019 -0
- package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js +99 -0
- package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js.map +1 -0
- package/dist/collection/components/certificate-decoder/certificate-decoder.css +1 -4
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +39 -20
- package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/miscellaneous.js.map +1 -1
- package/dist/collection/components/certificate-viewer/certificate-viewer.js +26 -10
- package/dist/collection/components/certificate-viewer/certificate-viewer.js.map +1 -1
- package/dist/collection/components/certificates-viewer/certificates-viewer.js +40 -11
- package/dist/collection/components/certificates-viewer/certificates-viewer.js.map +1 -1
- package/dist/collection/components/circular-progress/circular-progress.js +14 -4
- package/dist/collection/components/circular-progress/circular-progress.js.map +1 -1
- package/dist/collection/components/crl-viewer/crl-viewer.js +22 -8
- package/dist/collection/components/crl-viewer/crl-viewer.js.map +1 -1
- package/dist/collection/components/csr-viewer/csr-viewer.js +20 -7
- package/dist/collection/components/csr-viewer/csr-viewer.js.map +1 -1
- package/dist/collection/components/highlight-words/highlight-words.js +3 -2
- package/dist/collection/components/highlight-words/highlight-words.js.map +1 -1
- package/dist/collection/components/text-hider/text-hider.js +1 -1
- package/dist/collection/components/text-hider/text-hider.js.map +1 -1
- package/dist/collection/constants/oids.js +3 -0
- package/dist/collection/constants/oids.js.map +1 -1
- package/dist/collection/crypto/index.js +1 -0
- package/dist/collection/crypto/index.js.map +1 -1
- package/dist/collection/crypto/pem_converter.js +169 -0
- package/dist/collection/crypto/pem_converter.js.map +1 -0
- package/dist/collection/crypto/pkcs10_certificate_request.js +6 -5
- package/dist/collection/crypto/pkcs10_certificate_request.js.map +1 -1
- package/dist/collection/crypto/utils.js +18 -21
- package/dist/collection/crypto/utils.js.map +1 -1
- package/dist/collection/crypto/x509_attribute_certificate.js +6 -5
- package/dist/collection/crypto/x509_attribute_certificate.js.map +1 -1
- package/dist/collection/crypto/x509_certificate.js +6 -5
- package/dist/collection/crypto/x509_certificate.js.map +1 -1
- package/dist/collection/crypto/x509_certificates.js +69 -0
- package/dist/collection/crypto/x509_certificates.js.map +1 -0
- package/dist/collection/crypto/x509_crl.js +6 -5
- package/dist/collection/crypto/x509_crl.js.map +1 -1
- package/dist/collection/utils/index.js +0 -2
- package/dist/collection/utils/index.js.map +1 -1
- package/dist/collection/www-copy/index.js +123 -121
- package/dist/esm/{actions-aebcbc9d.js → actions-DzoPRObK.js} +3 -2
- package/dist/esm/actions-DzoPRObK.js.map +1 -0
- package/dist/esm/{app-globals-5e9b67e0.js → app-globals-zVR349KA.js} +2 -1
- package/dist/esm/app-globals-zVR349KA.js.map +1 -0
- package/dist/esm/{arrow_top-aee1ee02.js → arrow_top-CF9pv-tQ.js} +3 -2
- package/dist/esm/arrow_top-CF9pv-tQ.js.map +1 -0
- package/dist/esm/{button-a2fabf9a.js → button-Djn8UI82.js} +3 -2
- package/dist/esm/button-Djn8UI82.js.map +1 -0
- package/dist/esm/{certification_request-a4699dcf.js → certification_request-BTbyumBe.js} +1097 -1599
- package/dist/esm/certification_request-BTbyumBe.js.map +1 -0
- package/dist/esm/{cross-1377606f.js → cross-DdCuR1F2.js} +3 -2
- package/dist/esm/cross-DdCuR1F2.js.map +1 -0
- package/dist/esm/{download-14dc1047.js → download-Cqfc-Sxf.js} +3 -2
- package/dist/esm/download-Cqfc-Sxf.js.map +1 -0
- package/dist/esm/index-DDDrq3In.js +2292 -0
- package/dist/esm/index-DDDrq3In.js.map +1 -0
- package/dist/esm/index.js +11 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{link-7e4e9060.js → link-BfDk078v.js} +4 -3
- package/dist/esm/link-BfDk078v.js.map +1 -0
- package/dist/esm/loader.js +5 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/{miscellaneous-ba1fd2bd.js → miscellaneous-CGtCg3Q9.js} +27 -26
- package/dist/esm/miscellaneous-CGtCg3Q9.js.map +1 -0
- package/dist/esm/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.js.map +1 -0
- package/dist/esm/{peculiar-attribute-certificate-viewer_3.entry.js → peculiar-attribute-certificate-viewer_4.entry.js} +76 -45
- package/dist/esm/peculiar-attribute-certificate-viewer_4.entry.js.map +1 -0
- package/dist/esm/peculiar-button-menu.peculiar-circular-progress.peculiar-highlight-words.entry.js.map +1 -0
- package/dist/esm/peculiar-button-menu_3.entry.js +20 -17
- package/dist/esm/peculiar-button-menu_3.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-decoder.entry.js +105 -28
- package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-viewer.entry.js +19 -19
- package/dist/esm/peculiar-certificate-viewer.entry.js.map +1 -1
- package/dist/esm/peculiar-certificates-viewer.entry.js +43 -22
- package/dist/esm/peculiar-certificates-viewer.entry.js.map +1 -1
- package/dist/esm/peculiar-text-hider.entry.js +6 -6
- package/dist/esm/peculiar-text-hider.entry.js.map +1 -1
- package/dist/esm/peculiar.js +14 -12
- package/dist/esm/peculiar.js.map +1 -1
- package/dist/esm/{pkcs10_certificate_request-785a4794.js → pkcs10_certificate_request-CrA_WcgY.js} +11 -10
- package/dist/esm/pkcs10_certificate_request-CrA_WcgY.js.map +1 -0
- package/dist/esm/{read_file-bb0b1450.js → read_file-F2F0McJX.js} +2 -1
- package/dist/esm/read_file-F2F0McJX.js.map +1 -0
- package/dist/esm/{x509_certificate-05a23c0e.js → x509_certificate-DX7sKoAD.js} +10 -9
- package/dist/esm/x509_certificate-DX7sKoAD.js.map +1 -0
- package/dist/esm/{x509_crl-26081461.js → x509_crl-DRjoh8Yp.js} +17 -16
- package/dist/esm/x509_crl-DRjoh8Yp.js.map +1 -0
- package/dist/esm-es5/{actions-aebcbc9d.js → actions-DzoPRObK.js} +2 -2
- package/dist/esm-es5/actions-DzoPRObK.js.map +1 -0
- package/dist/esm-es5/{app-globals-5e9b67e0.js → app-globals-zVR349KA.js} +1 -1
- package/dist/esm-es5/app-globals-zVR349KA.js.map +1 -0
- package/dist/esm-es5/{arrow_top-aee1ee02.js → arrow_top-CF9pv-tQ.js} +2 -2
- package/dist/esm-es5/arrow_top-CF9pv-tQ.js.map +1 -0
- package/dist/esm-es5/{button-a2fabf9a.js → button-Djn8UI82.js} +2 -2
- package/dist/esm-es5/button-Djn8UI82.js.map +1 -0
- package/dist/esm-es5/certification_request-BTbyumBe.js +142 -0
- package/dist/esm-es5/certification_request-BTbyumBe.js.map +1 -0
- package/dist/esm-es5/{cross-1377606f.js → cross-DdCuR1F2.js} +2 -2
- package/dist/esm-es5/cross-DdCuR1F2.js.map +1 -0
- package/dist/esm-es5/{download-14dc1047.js → download-Cqfc-Sxf.js} +2 -2
- package/dist/esm-es5/download-Cqfc-Sxf.js.map +1 -0
- package/dist/esm-es5/index-DDDrq3In.js +6 -0
- package/dist/esm-es5/index-DDDrq3In.js.map +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/index.js.map +1 -1
- package/dist/esm-es5/link-BfDk078v.js +12 -0
- package/dist/esm-es5/link-BfDk078v.js.map +1 -0
- package/dist/esm-es5/loader.js +2 -2
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/{miscellaneous-ba1fd2bd.js → miscellaneous-CGtCg3Q9.js} +15 -15
- package/dist/esm-es5/miscellaneous-CGtCg3Q9.js.map +1 -0
- package/dist/esm-es5/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.js.map +1 -0
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_4.entry.js +110 -0
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_4.entry.js.map +1 -0
- package/dist/esm-es5/peculiar-button-menu.peculiar-circular-progress.peculiar-highlight-words.entry.js.map +1 -0
- 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 -2
- 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 +2 -2
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-text-hider.entry.js +1 -1
- package/dist/esm-es5/peculiar-text-hider.entry.js.map +1 -1
- package/dist/esm-es5/peculiar.js +1 -1
- package/dist/esm-es5/peculiar.js.map +1 -1
- package/dist/esm-es5/pkcs10_certificate_request-CrA_WcgY.js +19 -0
- package/dist/esm-es5/pkcs10_certificate_request-CrA_WcgY.js.map +1 -0
- package/dist/esm-es5/{read_file-bb0b1450.js → read_file-F2F0McJX.js} +1 -1
- package/dist/esm-es5/read_file-F2F0McJX.js.map +1 -0
- package/dist/esm-es5/x509_certificate-DX7sKoAD.js +12 -0
- package/dist/esm-es5/x509_certificate-DX7sKoAD.js.map +1 -0
- package/dist/esm-es5/x509_crl-DRjoh8Yp.js +19 -0
- package/dist/esm-es5/x509_crl-DRjoh8Yp.js.map +1 -0
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/index.esm.js.map +1 -1
- package/dist/peculiar/loader.esm.js.map +1 -0
- package/dist/peculiar/p-092074e8.system.entry.js +5 -0
- package/dist/peculiar/p-092074e8.system.entry.js.map +1 -0
- package/dist/peculiar/p-12d2e080.entry.js +5 -0
- package/dist/peculiar/p-12d2e080.entry.js.map +1 -0
- package/dist/peculiar/p-1af57833.system.entry.js +5 -0
- package/dist/peculiar/p-1af57833.system.entry.js.map +1 -0
- package/dist/peculiar/p-1b3855ec.system.entry.js +111 -0
- package/dist/peculiar/p-1b3855ec.system.entry.js.map +1 -0
- package/dist/peculiar/p-4IvcYmU7.js +19 -0
- package/dist/peculiar/p-4IvcYmU7.js.map +1 -0
- package/dist/peculiar/{p-9263e7ee.system.entry.js → p-73a75d1e.system.entry.js} +3 -3
- package/dist/peculiar/p-73a75d1e.system.entry.js.map +1 -0
- package/dist/peculiar/p-7Nmqck4T.system.js.map +1 -0
- package/dist/peculiar/p-80fc5538.entry.js +5 -0
- package/dist/peculiar/p-80fc5538.entry.js.map +1 -0
- package/dist/peculiar/{p-bafd67f3.entry.js → p-85667993.entry.js} +2 -2
- package/dist/peculiar/p-85667993.entry.js.map +1 -0
- package/dist/peculiar/p-B0CjUC4o.system.js +142 -0
- package/dist/peculiar/p-B0CjUC4o.system.js.map +1 -0
- package/dist/peculiar/{p-c241e4ba.system.js → p-B2YrZuK2.system.js} +2 -2
- package/dist/peculiar/p-B2YrZuK2.system.js.map +1 -0
- package/dist/peculiar/p-B7TxZGea.system.js +19 -0
- package/dist/peculiar/p-B7TxZGea.system.js.map +1 -0
- package/dist/peculiar/{p-243244af.system.js → p-B859JpGw.system.js} +3 -3
- package/dist/peculiar/p-B859JpGw.system.js.map +1 -0
- package/dist/peculiar/{p-eea904d7.system.js → p-BBgwMHRZ.system.js} +3 -3
- package/dist/peculiar/p-BBgwMHRZ.system.js.map +1 -0
- package/dist/peculiar/p-BCATfe_H.js +19 -0
- package/dist/peculiar/p-BCATfe_H.js.map +1 -0
- package/dist/peculiar/p-BFenL1ap.system.js +6 -0
- package/dist/peculiar/p-BFenL1ap.system.js.map +1 -0
- package/dist/peculiar/{p-ae91d778.js → p-BHBizfwo.js} +3 -3
- package/dist/peculiar/p-BHBizfwo.js.map +1 -0
- package/dist/peculiar/{p-5a662d6f.system.js → p-BOSH9vjy.system.js} +3 -3
- package/dist/{esm-es5/actions-aebcbc9d.js.map → peculiar/p-BOSH9vjy.system.js.map} +1 -1
- package/dist/peculiar/{p-8bbee8f4.system.js → p-BP2bmYR2.system.js} +3 -3
- package/dist/peculiar/p-BP2bmYR2.system.js.map +1 -0
- package/dist/peculiar/{p-9712b827.system.js → p-BRhx1gbw.system.js} +4 -4
- package/dist/peculiar/p-BRhx1gbw.system.js.map +1 -0
- package/dist/peculiar/p-BTbyumBe.js +142 -0
- package/dist/peculiar/p-BTbyumBe.js.map +1 -0
- package/dist/peculiar/p-BX9qW3ww.system.js.map +1 -0
- package/dist/peculiar/p-BbPo3hge.system.js.map +1 -0
- package/dist/peculiar/{p-e6a6e602.js → p-BisXzAqN.js} +2 -2
- package/dist/peculiar/p-BisXzAqN.js.map +1 -0
- package/dist/peculiar/p-Bw_icgVx.js +19 -0
- package/dist/peculiar/p-Bw_icgVx.js.map +1 -0
- package/dist/peculiar/p-C_7Koml8.system.js.map +1 -0
- package/dist/peculiar/{p-27ca6743.js → p-CeKqQ13Z.js} +4 -4
- package/dist/peculiar/p-CeKqQ13Z.js.map +1 -0
- package/dist/peculiar/p-CpTwQbPC.js +12 -0
- package/dist/peculiar/p-CpTwQbPC.js.map +1 -0
- package/dist/peculiar/p-Ct0zEUB_.js +369 -0
- package/dist/peculiar/p-Ct0zEUB_.js.map +1 -0
- package/dist/peculiar/{p-c2995a63.system.js → p-CwlxH4oM.system.js} +1 -1
- package/dist/peculiar/p-CwlxH4oM.system.js.map +1 -0
- package/dist/peculiar/p-D13P_msn.system.js.map +1 -0
- package/dist/peculiar/{p-55303453.system.js → p-D2QB-8Q6.system.js} +1 -1
- package/dist/peculiar/p-D2QB-8Q6.system.js.map +1 -0
- package/dist/peculiar/p-D5BWI7FK.system.js +5 -0
- package/dist/peculiar/p-D5BWI7FK.system.js.map +1 -0
- package/dist/peculiar/p-DDDrq3In.js +6 -0
- package/dist/peculiar/p-DDDrq3In.js.map +1 -0
- package/dist/peculiar/{p-a9487007.js → p-DhdG07f8.js} +2 -2
- package/dist/peculiar/p-DhdG07f8.js.map +1 -0
- package/dist/peculiar/{p-99efefea.js → p-DkAhB3Vy.js} +2 -2
- package/dist/peculiar/p-DkAhB3Vy.js.map +1 -0
- package/dist/peculiar/p-DxdVL_Kj.system.js +13 -0
- package/dist/peculiar/p-DxdVL_Kj.system.js.map +1 -0
- package/dist/peculiar/{p-25a532a3.js → p-F2F0McJX.js} +1 -1
- package/dist/peculiar/p-F2F0McJX.js.map +1 -0
- package/dist/peculiar/p-FVz6FuoZ.system.js.map +1 -0
- package/dist/peculiar/p-RW7UbzcZ.system.js.map +1 -0
- package/dist/peculiar/p-ab220e36.system.entry.js +5 -0
- package/dist/peculiar/p-ab220e36.system.entry.js.map +1 -0
- package/dist/peculiar/{p-67e82386.entry.js → p-c2a805b3.entry.js} +3 -3
- package/dist/peculiar/p-c2a805b3.entry.js.map +1 -0
- package/dist/peculiar/p-cae95996.system.entry.js +5 -0
- package/dist/peculiar/p-cae95996.system.entry.js.map +1 -0
- package/dist/peculiar/p-e7266b0a.entry.js +110 -0
- package/dist/peculiar/p-e7266b0a.entry.js.map +1 -0
- package/dist/peculiar/p-f4490197.entry.js +5 -0
- package/dist/peculiar/p-f4490197.entry.js.map +1 -0
- package/dist/peculiar/p-lnQq6VON.system.js +20 -0
- package/dist/peculiar/p-lnQq6VON.system.js.map +1 -0
- package/dist/peculiar/{p-2bc2abea.system.js → p-vMACJe_C.system.js} +54 -54
- package/dist/peculiar/{p-6e2ad7eb.js.map → p-vMACJe_C.system.js.map} +1 -1
- package/dist/peculiar/p-wgYkE8CV.system.js +5 -0
- package/dist/peculiar/p-wgYkE8CV.system.js.map +1 -0
- package/dist/peculiar/{p-dac867e8.js → p-zVR349KA.js} +1 -1
- package/dist/peculiar/p-zVR349KA.js.map +1 -0
- package/dist/peculiar/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.esm.js.map +1 -0
- package/dist/peculiar/peculiar-button-menu.peculiar-circular-progress.peculiar-highlight-words.entry.esm.js.map +1 -0
- package/dist/peculiar/peculiar-certificate-decoder.entry.esm.js.map +1 -0
- package/dist/peculiar/peculiar-certificate-viewer.entry.esm.js.map +1 -0
- package/dist/peculiar/peculiar-certificates-viewer.entry.esm.js.map +1 -0
- package/dist/peculiar/{p-b5389885.system.entry.js.map → peculiar-text-hider.entry.esm.js.map} +1 -1
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/peculiar/peculiar.esm.js.map +1 -1
- package/dist/peculiar/peculiar.js +1 -1
- package/dist/types/components/certificate-chain-viewer/certificate-chain-viewer.d.ts +21 -0
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +5 -4
- package/dist/types/components/certificate-details-parts/miscellaneous.d.ts +2 -2
- package/dist/types/components/typography/typography.d.ts +0 -1
- package/dist/types/components.d.ts +33 -4
- package/dist/types/constants/oids.d.ts +3 -0
- package/dist/types/crypto/index.d.ts +1 -0
- package/dist/types/crypto/pem_converter.d.ts +71 -0
- package/dist/types/crypto/pkcs10_certificate_request.d.ts +2 -2
- package/dist/types/crypto/utils.d.ts +7 -3
- package/dist/types/crypto/x509_attribute_certificate.d.ts +2 -2
- package/dist/types/crypto/x509_certificate.d.ts +2 -2
- package/dist/types/crypto/x509_certificates.d.ts +9 -0
- package/dist/types/crypto/x509_crl.d.ts +2 -2
- package/dist/types/stencil-public-runtime.d.ts +10 -10
- package/dist/types/utils/index.d.ts +0 -2
- package/hydrate/index.d.ts +53 -12
- package/hydrate/index.js +28615 -18748
- package/hydrate/index.mjs +34759 -0
- package/hydrate/package.json +7 -1
- package/loader/cdn.js +1 -1
- package/loader/index.cjs.js +1 -1
- package/loader/index.d.ts +3 -0
- package/loader/index.es2017.js +1 -1
- package/loader/index.js +1 -1
- package/package.json +32 -29
- package/dist/cjs/actions-789906f5.js.map +0 -1
- package/dist/cjs/app-globals-c20ffa41.js.map +0 -1
- package/dist/cjs/arrow_top-76e4261e.js.map +0 -1
- package/dist/cjs/button-87086210.js.map +0 -1
- package/dist/cjs/certification_request-ad267278.js.map +0 -1
- package/dist/cjs/cross-bd099933.js.map +0 -1
- package/dist/cjs/download-820d66ba.js.map +0 -1
- package/dist/cjs/index-e2ae280a.js +0 -2730
- package/dist/cjs/index-e2ae280a.js.map +0 -1
- package/dist/cjs/link-a3d3799d.js.map +0 -1
- package/dist/cjs/miscellaneous-67439e59.js.map +0 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js.map +0 -1
- package/dist/cjs/pkcs10_certificate_request-64898c88.js.map +0 -1
- package/dist/cjs/read_file-2e22a97e.js.map +0 -1
- package/dist/cjs/x509_certificate-4b0894c2.js.map +0 -1
- package/dist/cjs/x509_crl-fc8d41a1.js.map +0 -1
- package/dist/collection/utils/validator.js +0 -25
- package/dist/collection/utils/validator.js.map +0 -1
- package/dist/esm/actions-aebcbc9d.js.map +0 -1
- package/dist/esm/app-globals-5e9b67e0.js.map +0 -1
- package/dist/esm/arrow_top-aee1ee02.js.map +0 -1
- package/dist/esm/button-a2fabf9a.js.map +0 -1
- package/dist/esm/certification_request-a4699dcf.js.map +0 -1
- package/dist/esm/cross-1377606f.js.map +0 -1
- package/dist/esm/download-14dc1047.js.map +0 -1
- package/dist/esm/index-ae188432.js +0 -2701
- package/dist/esm/index-ae188432.js.map +0 -1
- package/dist/esm/link-7e4e9060.js.map +0 -1
- package/dist/esm/miscellaneous-ba1fd2bd.js.map +0 -1
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js.map +0 -1
- package/dist/esm/pkcs10_certificate_request-785a4794.js.map +0 -1
- package/dist/esm/read_file-bb0b1450.js.map +0 -1
- package/dist/esm/x509_certificate-05a23c0e.js.map +0 -1
- package/dist/esm/x509_crl-26081461.js.map +0 -1
- package/dist/esm-es5/app-globals-5e9b67e0.js.map +0 -1
- package/dist/esm-es5/arrow_top-aee1ee02.js.map +0 -1
- package/dist/esm-es5/button-a2fabf9a.js.map +0 -1
- package/dist/esm-es5/certification_request-a4699dcf.js +0 -135
- package/dist/esm-es5/certification_request-a4699dcf.js.map +0 -1
- package/dist/esm-es5/cross-1377606f.js.map +0 -1
- package/dist/esm-es5/download-14dc1047.js.map +0 -1
- package/dist/esm-es5/index-ae188432.js +0 -6
- package/dist/esm-es5/index-ae188432.js.map +0 -1
- package/dist/esm-es5/link-7e4e9060.js +0 -12
- package/dist/esm-es5/link-7e4e9060.js.map +0 -1
- package/dist/esm-es5/miscellaneous-ba1fd2bd.js.map +0 -1
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +0 -110
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js.map +0 -1
- package/dist/esm-es5/pkcs10_certificate_request-785a4794.js +0 -19
- package/dist/esm-es5/pkcs10_certificate_request-785a4794.js.map +0 -1
- package/dist/esm-es5/read_file-bb0b1450.js.map +0 -1
- package/dist/esm-es5/x509_certificate-05a23c0e.js +0 -12
- package/dist/esm-es5/x509_certificate-05a23c0e.js.map +0 -1
- package/dist/esm-es5/x509_crl-26081461.js +0 -19
- package/dist/esm-es5/x509_crl-26081461.js.map +0 -1
- package/dist/peculiar/p-1566ad92.system.entry.js +0 -5
- package/dist/peculiar/p-1566ad92.system.entry.js.map +0 -1
- package/dist/peculiar/p-243244af.system.js.map +0 -1
- package/dist/peculiar/p-25a532a3.js.map +0 -1
- package/dist/peculiar/p-27ca6743.js.map +0 -1
- package/dist/peculiar/p-2bc2abea.system.js.map +0 -1
- package/dist/peculiar/p-32807e5e.js +0 -135
- package/dist/peculiar/p-32807e5e.js.map +0 -1
- package/dist/peculiar/p-3cb79cd9.js +0 -6
- package/dist/peculiar/p-3cb79cd9.js.map +0 -1
- package/dist/peculiar/p-4bc5ddbe.js +0 -19
- package/dist/peculiar/p-4bc5ddbe.js.map +0 -1
- package/dist/peculiar/p-55303453.system.js.map +0 -1
- package/dist/peculiar/p-5a662d6f.system.js.map +0 -1
- package/dist/peculiar/p-5d1d4a96.entry.js +0 -110
- package/dist/peculiar/p-5d1d4a96.entry.js.map +0 -1
- package/dist/peculiar/p-67e82386.entry.js.map +0 -1
- package/dist/peculiar/p-6e2ad7eb.js +0 -369
- package/dist/peculiar/p-713563fb.entry.js +0 -5
- package/dist/peculiar/p-713563fb.entry.js.map +0 -1
- package/dist/peculiar/p-7ddd9a82.system.js +0 -19
- package/dist/peculiar/p-7ddd9a82.system.js.map +0 -1
- package/dist/peculiar/p-821bdcdc.system.js +0 -6
- package/dist/peculiar/p-821bdcdc.system.js.map +0 -1
- package/dist/peculiar/p-8393399a.system.js +0 -5
- package/dist/peculiar/p-8393399a.system.js.map +0 -1
- package/dist/peculiar/p-8bbee8f4.system.js.map +0 -1
- package/dist/peculiar/p-9263e7ee.system.entry.js.map +0 -1
- package/dist/peculiar/p-9712b827.system.js.map +0 -1
- package/dist/peculiar/p-98e3a016.system.js +0 -13
- package/dist/peculiar/p-98e3a016.system.js.map +0 -1
- package/dist/peculiar/p-99efefea.js.map +0 -1
- package/dist/peculiar/p-9ad547d2.system.entry.js +0 -5
- package/dist/peculiar/p-9ad547d2.system.entry.js.map +0 -1
- package/dist/peculiar/p-a1a48332.system.js +0 -5
- package/dist/peculiar/p-a1a48332.system.js.map +0 -1
- package/dist/peculiar/p-a9487007.js.map +0 -1
- package/dist/peculiar/p-ab5a4988.js +0 -12
- package/dist/peculiar/p-ab5a4988.js.map +0 -1
- package/dist/peculiar/p-ae44c2b0.system.js +0 -20
- package/dist/peculiar/p-ae44c2b0.system.js.map +0 -1
- package/dist/peculiar/p-ae91d778.js.map +0 -1
- package/dist/peculiar/p-afbd1c8e.entry.js +0 -5
- package/dist/peculiar/p-afbd1c8e.entry.js.map +0 -1
- package/dist/peculiar/p-b5389885.system.entry.js +0 -5
- package/dist/peculiar/p-bafd67f3.entry.js.map +0 -1
- package/dist/peculiar/p-c241e4ba.system.js.map +0 -1
- package/dist/peculiar/p-c2995a63.system.js.map +0 -1
- package/dist/peculiar/p-cd1b1876.entry.js +0 -5
- package/dist/peculiar/p-cd1b1876.entry.js.map +0 -1
- package/dist/peculiar/p-d5ba4fc2.js +0 -19
- package/dist/peculiar/p-d5ba4fc2.js.map +0 -1
- package/dist/peculiar/p-dac867e8.js.map +0 -1
- package/dist/peculiar/p-e37e4df2.system.js +0 -135
- package/dist/peculiar/p-e37e4df2.system.js.map +0 -1
- package/dist/peculiar/p-e4ad4f13.system.entry.js +0 -5
- package/dist/peculiar/p-e4ad4f13.system.entry.js.map +0 -1
- package/dist/peculiar/p-e6a6e602.js.map +0 -1
- package/dist/peculiar/p-eea904d7.system.js.map +0 -1
- package/dist/peculiar/p-f8c91ee4.js +0 -19
- package/dist/peculiar/p-f8c91ee4.js.map +0 -1
- package/dist/peculiar/p-f9c07207.system.entry.js +0 -111
- package/dist/peculiar/p-f9c07207.system.entry.js.map +0 -1
- package/dist/types/utils/validator.d.ts +0 -10
- package/loader/package.json +0 -11
package/components/download.js
CHANGED
|
@@ -52,12 +52,16 @@ function downloadFromBuffer(value, name, extension, mime = 'application/octet-st
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
function getDefaultExportFromCjs (x) {
|
|
56
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var build = {};
|
|
56
60
|
|
|
57
61
|
/*!
|
|
58
62
|
* MIT License
|
|
59
63
|
*
|
|
60
|
-
* Copyright (c) 2017-
|
|
64
|
+
* Copyright (c) 2017-2024 Peculiar Ventures, LLC
|
|
61
65
|
*
|
|
62
66
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
63
67
|
* of this software and associated documentation files (the "Software"), to deal
|
|
@@ -79,354 +83,388 @@ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof win
|
|
|
79
83
|
*
|
|
80
84
|
*/
|
|
81
85
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
86
|
+
var hasRequiredBuild;
|
|
87
|
+
|
|
88
|
+
function requireBuild () {
|
|
89
|
+
if (hasRequiredBuild) return build;
|
|
90
|
+
hasRequiredBuild = 1;
|
|
91
|
+
|
|
92
|
+
const ARRAY_BUFFER_NAME = "[object ArrayBuffer]";
|
|
93
|
+
class BufferSourceConverter {
|
|
94
|
+
static isArrayBuffer(data) {
|
|
95
|
+
return Object.prototype.toString.call(data) === ARRAY_BUFFER_NAME;
|
|
96
|
+
}
|
|
97
|
+
static toArrayBuffer(data) {
|
|
98
|
+
if (this.isArrayBuffer(data)) {
|
|
99
|
+
return data;
|
|
100
|
+
}
|
|
101
|
+
if (data.byteLength === data.buffer.byteLength) {
|
|
102
|
+
return data.buffer;
|
|
103
|
+
}
|
|
104
|
+
if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
|
|
105
|
+
return data.buffer;
|
|
106
|
+
}
|
|
107
|
+
return this.toUint8Array(data.buffer)
|
|
108
|
+
.slice(data.byteOffset, data.byteOffset + data.byteLength)
|
|
109
|
+
.buffer;
|
|
110
|
+
}
|
|
111
|
+
static toUint8Array(data) {
|
|
112
|
+
return this.toView(data, Uint8Array);
|
|
113
|
+
}
|
|
114
|
+
static toView(data, type) {
|
|
115
|
+
if (data.constructor === type) {
|
|
116
|
+
return data;
|
|
117
|
+
}
|
|
118
|
+
if (this.isArrayBuffer(data)) {
|
|
119
|
+
return new type(data);
|
|
120
|
+
}
|
|
121
|
+
if (this.isArrayBufferView(data)) {
|
|
122
|
+
return new type(data.buffer, data.byteOffset, data.byteLength);
|
|
123
|
+
}
|
|
124
|
+
throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");
|
|
125
|
+
}
|
|
126
|
+
static isBufferSource(data) {
|
|
127
|
+
return this.isArrayBufferView(data)
|
|
128
|
+
|| this.isArrayBuffer(data);
|
|
129
|
+
}
|
|
130
|
+
static isArrayBufferView(data) {
|
|
131
|
+
return ArrayBuffer.isView(data)
|
|
132
|
+
|| (data && this.isArrayBuffer(data.buffer));
|
|
133
|
+
}
|
|
134
|
+
static isEqual(a, b) {
|
|
135
|
+
const aView = BufferSourceConverter.toUint8Array(a);
|
|
136
|
+
const bView = BufferSourceConverter.toUint8Array(b);
|
|
137
|
+
if (aView.length !== bView.byteLength) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
for (let i = 0; i < aView.length; i++) {
|
|
141
|
+
if (aView[i] !== bView[i]) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return true;
|
|
146
|
+
}
|
|
147
|
+
static concat(...args) {
|
|
148
|
+
let buffers;
|
|
149
|
+
if (Array.isArray(args[0]) && !(args[1] instanceof Function)) {
|
|
150
|
+
buffers = args[0];
|
|
151
|
+
}
|
|
152
|
+
else if (Array.isArray(args[0]) && args[1] instanceof Function) {
|
|
153
|
+
buffers = args[0];
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
if (args[args.length - 1] instanceof Function) {
|
|
157
|
+
buffers = args.slice(0, args.length - 1);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
buffers = args;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
let size = 0;
|
|
164
|
+
for (const buffer of buffers) {
|
|
165
|
+
size += buffer.byteLength;
|
|
166
|
+
}
|
|
167
|
+
const res = new Uint8Array(size);
|
|
168
|
+
let offset = 0;
|
|
169
|
+
for (const buffer of buffers) {
|
|
170
|
+
const view = this.toUint8Array(buffer);
|
|
171
|
+
res.set(view, offset);
|
|
172
|
+
offset += view.length;
|
|
173
|
+
}
|
|
174
|
+
if (args[args.length - 1] instanceof Function) {
|
|
175
|
+
return this.toView(res, args[args.length - 1]);
|
|
176
|
+
}
|
|
177
|
+
return res.buffer;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const STRING_TYPE = "string";
|
|
182
|
+
const HEX_REGEX = /^[0-9a-f\s]+$/i;
|
|
183
|
+
const BASE64_REGEX = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
|
|
184
|
+
const BASE64URL_REGEX = /^[a-zA-Z0-9-_]+$/;
|
|
185
|
+
class Utf8Converter {
|
|
186
|
+
static fromString(text) {
|
|
187
|
+
const s = unescape(encodeURIComponent(text));
|
|
188
|
+
const uintArray = new Uint8Array(s.length);
|
|
189
|
+
for (let i = 0; i < s.length; i++) {
|
|
190
|
+
uintArray[i] = s.charCodeAt(i);
|
|
191
|
+
}
|
|
192
|
+
return uintArray.buffer;
|
|
193
|
+
}
|
|
194
|
+
static toString(buffer) {
|
|
195
|
+
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
196
|
+
let encodedString = "";
|
|
197
|
+
for (let i = 0; i < buf.length; i++) {
|
|
198
|
+
encodedString += String.fromCharCode(buf[i]);
|
|
199
|
+
}
|
|
200
|
+
const decodedString = decodeURIComponent(escape(encodedString));
|
|
201
|
+
return decodedString;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
class Utf16Converter {
|
|
205
|
+
static toString(buffer, littleEndian = false) {
|
|
206
|
+
const arrayBuffer = BufferSourceConverter.toArrayBuffer(buffer);
|
|
207
|
+
const dataView = new DataView(arrayBuffer);
|
|
208
|
+
let res = "";
|
|
209
|
+
for (let i = 0; i < arrayBuffer.byteLength; i += 2) {
|
|
210
|
+
const code = dataView.getUint16(i, littleEndian);
|
|
211
|
+
res += String.fromCharCode(code);
|
|
212
|
+
}
|
|
213
|
+
return res;
|
|
214
|
+
}
|
|
215
|
+
static fromString(text, littleEndian = false) {
|
|
216
|
+
const res = new ArrayBuffer(text.length * 2);
|
|
217
|
+
const dataView = new DataView(res);
|
|
218
|
+
for (let i = 0; i < text.length; i++) {
|
|
219
|
+
dataView.setUint16(i * 2, text.charCodeAt(i), littleEndian);
|
|
220
|
+
}
|
|
221
|
+
return res;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
class Convert {
|
|
225
|
+
static isHex(data) {
|
|
226
|
+
return typeof data === STRING_TYPE
|
|
227
|
+
&& HEX_REGEX.test(data);
|
|
228
|
+
}
|
|
229
|
+
static isBase64(data) {
|
|
230
|
+
return typeof data === STRING_TYPE
|
|
231
|
+
&& BASE64_REGEX.test(data);
|
|
232
|
+
}
|
|
233
|
+
static isBase64Url(data) {
|
|
234
|
+
return typeof data === STRING_TYPE
|
|
235
|
+
&& BASE64URL_REGEX.test(data);
|
|
236
|
+
}
|
|
237
|
+
static ToString(buffer, enc = "utf8") {
|
|
238
|
+
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
239
|
+
switch (enc.toLowerCase()) {
|
|
240
|
+
case "utf8":
|
|
241
|
+
return this.ToUtf8String(buf);
|
|
242
|
+
case "binary":
|
|
243
|
+
return this.ToBinary(buf);
|
|
244
|
+
case "hex":
|
|
245
|
+
return this.ToHex(buf);
|
|
246
|
+
case "base64":
|
|
247
|
+
return this.ToBase64(buf);
|
|
248
|
+
case "base64url":
|
|
249
|
+
return this.ToBase64Url(buf);
|
|
250
|
+
case "utf16le":
|
|
251
|
+
return Utf16Converter.toString(buf, true);
|
|
252
|
+
case "utf16":
|
|
253
|
+
case "utf16be":
|
|
254
|
+
return Utf16Converter.toString(buf);
|
|
255
|
+
default:
|
|
256
|
+
throw new Error(`Unknown type of encoding '${enc}'`);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
static FromString(str, enc = "utf8") {
|
|
260
|
+
if (!str) {
|
|
261
|
+
return new ArrayBuffer(0);
|
|
262
|
+
}
|
|
263
|
+
switch (enc.toLowerCase()) {
|
|
264
|
+
case "utf8":
|
|
265
|
+
return this.FromUtf8String(str);
|
|
266
|
+
case "binary":
|
|
267
|
+
return this.FromBinary(str);
|
|
268
|
+
case "hex":
|
|
269
|
+
return this.FromHex(str);
|
|
270
|
+
case "base64":
|
|
271
|
+
return this.FromBase64(str);
|
|
272
|
+
case "base64url":
|
|
273
|
+
return this.FromBase64Url(str);
|
|
274
|
+
case "utf16le":
|
|
275
|
+
return Utf16Converter.fromString(str, true);
|
|
276
|
+
case "utf16":
|
|
277
|
+
case "utf16be":
|
|
278
|
+
return Utf16Converter.fromString(str);
|
|
279
|
+
default:
|
|
280
|
+
throw new Error(`Unknown type of encoding '${enc}'`);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
static ToBase64(buffer) {
|
|
284
|
+
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
285
|
+
if (typeof btoa !== "undefined") {
|
|
286
|
+
const binary = this.ToString(buf, "binary");
|
|
287
|
+
return btoa(binary);
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
return Buffer.from(buf).toString("base64");
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
static FromBase64(base64) {
|
|
294
|
+
const formatted = this.formatString(base64);
|
|
295
|
+
if (!formatted) {
|
|
296
|
+
return new ArrayBuffer(0);
|
|
297
|
+
}
|
|
298
|
+
if (!Convert.isBase64(formatted)) {
|
|
299
|
+
throw new TypeError("Argument 'base64Text' is not Base64 encoded");
|
|
300
|
+
}
|
|
301
|
+
if (typeof atob !== "undefined") {
|
|
302
|
+
return this.FromBinary(atob(formatted));
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
return new Uint8Array(Buffer.from(formatted, "base64")).buffer;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
static FromBase64Url(base64url) {
|
|
309
|
+
const formatted = this.formatString(base64url);
|
|
310
|
+
if (!formatted) {
|
|
311
|
+
return new ArrayBuffer(0);
|
|
312
|
+
}
|
|
313
|
+
if (!Convert.isBase64Url(formatted)) {
|
|
314
|
+
throw new TypeError("Argument 'base64url' is not Base64Url encoded");
|
|
315
|
+
}
|
|
316
|
+
return this.FromBase64(this.Base64Padding(formatted.replace(/\-/g, "+").replace(/\_/g, "/")));
|
|
317
|
+
}
|
|
318
|
+
static ToBase64Url(data) {
|
|
319
|
+
return this.ToBase64(data).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, "");
|
|
320
|
+
}
|
|
321
|
+
static FromUtf8String(text, encoding = Convert.DEFAULT_UTF8_ENCODING) {
|
|
322
|
+
switch (encoding) {
|
|
323
|
+
case "ascii":
|
|
324
|
+
return this.FromBinary(text);
|
|
325
|
+
case "utf8":
|
|
326
|
+
return Utf8Converter.fromString(text);
|
|
327
|
+
case "utf16":
|
|
328
|
+
case "utf16be":
|
|
329
|
+
return Utf16Converter.fromString(text);
|
|
330
|
+
case "utf16le":
|
|
331
|
+
case "usc2":
|
|
332
|
+
return Utf16Converter.fromString(text, true);
|
|
333
|
+
default:
|
|
334
|
+
throw new Error(`Unknown type of encoding '${encoding}'`);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
static ToUtf8String(buffer, encoding = Convert.DEFAULT_UTF8_ENCODING) {
|
|
338
|
+
switch (encoding) {
|
|
339
|
+
case "ascii":
|
|
340
|
+
return this.ToBinary(buffer);
|
|
341
|
+
case "utf8":
|
|
342
|
+
return Utf8Converter.toString(buffer);
|
|
343
|
+
case "utf16":
|
|
344
|
+
case "utf16be":
|
|
345
|
+
return Utf16Converter.toString(buffer);
|
|
346
|
+
case "utf16le":
|
|
347
|
+
case "usc2":
|
|
348
|
+
return Utf16Converter.toString(buffer, true);
|
|
349
|
+
default:
|
|
350
|
+
throw new Error(`Unknown type of encoding '${encoding}'`);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
static FromBinary(text) {
|
|
354
|
+
const stringLength = text.length;
|
|
355
|
+
const resultView = new Uint8Array(stringLength);
|
|
356
|
+
for (let i = 0; i < stringLength; i++) {
|
|
357
|
+
resultView[i] = text.charCodeAt(i);
|
|
358
|
+
}
|
|
359
|
+
return resultView.buffer;
|
|
360
|
+
}
|
|
361
|
+
static ToBinary(buffer) {
|
|
362
|
+
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
363
|
+
let res = "";
|
|
364
|
+
for (let i = 0; i < buf.length; i++) {
|
|
365
|
+
res += String.fromCharCode(buf[i]);
|
|
366
|
+
}
|
|
367
|
+
return res;
|
|
368
|
+
}
|
|
369
|
+
static ToHex(buffer) {
|
|
370
|
+
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
371
|
+
let result = "";
|
|
372
|
+
const len = buf.length;
|
|
373
|
+
for (let i = 0; i < len; i++) {
|
|
374
|
+
const byte = buf[i];
|
|
375
|
+
if (byte < 16) {
|
|
376
|
+
result += "0";
|
|
377
|
+
}
|
|
378
|
+
result += byte.toString(16);
|
|
379
|
+
}
|
|
380
|
+
return result;
|
|
381
|
+
}
|
|
382
|
+
static FromHex(hexString) {
|
|
383
|
+
let formatted = this.formatString(hexString);
|
|
384
|
+
if (!formatted) {
|
|
385
|
+
return new ArrayBuffer(0);
|
|
386
|
+
}
|
|
387
|
+
if (!Convert.isHex(formatted)) {
|
|
388
|
+
throw new TypeError("Argument 'hexString' is not HEX encoded");
|
|
389
|
+
}
|
|
390
|
+
if (formatted.length % 2) {
|
|
391
|
+
formatted = `0${formatted}`;
|
|
392
|
+
}
|
|
393
|
+
const res = new Uint8Array(formatted.length / 2);
|
|
394
|
+
for (let i = 0; i < formatted.length; i = i + 2) {
|
|
395
|
+
const c = formatted.slice(i, i + 2);
|
|
396
|
+
res[i / 2] = parseInt(c, 16);
|
|
397
|
+
}
|
|
398
|
+
return res.buffer;
|
|
399
|
+
}
|
|
400
|
+
static ToUtf16String(buffer, littleEndian = false) {
|
|
401
|
+
return Utf16Converter.toString(buffer, littleEndian);
|
|
402
|
+
}
|
|
403
|
+
static FromUtf16String(text, littleEndian = false) {
|
|
404
|
+
return Utf16Converter.fromString(text, littleEndian);
|
|
405
|
+
}
|
|
406
|
+
static Base64Padding(base64) {
|
|
407
|
+
const padCount = 4 - (base64.length % 4);
|
|
408
|
+
if (padCount < 4) {
|
|
409
|
+
for (let i = 0; i < padCount; i++) {
|
|
410
|
+
base64 += "=";
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return base64;
|
|
414
|
+
}
|
|
415
|
+
static formatString(data) {
|
|
416
|
+
return (data === null || data === void 0 ? void 0 : data.replace(/[\n\r\t ]/g, "")) || "";
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
Convert.DEFAULT_UTF8_ENCODING = "utf8";
|
|
420
|
+
|
|
421
|
+
function assign(target, ...sources) {
|
|
422
|
+
const res = arguments[0];
|
|
423
|
+
for (let i = 1; i < arguments.length; i++) {
|
|
424
|
+
const obj = arguments[i];
|
|
425
|
+
for (const prop in obj) {
|
|
426
|
+
res[prop] = obj[prop];
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
return res;
|
|
430
|
+
}
|
|
431
|
+
function combine(...buf) {
|
|
432
|
+
const totalByteLength = buf.map((item) => item.byteLength).reduce((prev, cur) => prev + cur);
|
|
433
|
+
const res = new Uint8Array(totalByteLength);
|
|
434
|
+
let currentPos = 0;
|
|
435
|
+
buf.map((item) => new Uint8Array(item)).forEach((arr) => {
|
|
436
|
+
for (const item2 of arr) {
|
|
437
|
+
res[currentPos++] = item2;
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
return res.buffer;
|
|
441
|
+
}
|
|
442
|
+
function isEqual(bytes1, bytes2) {
|
|
443
|
+
if (!(bytes1 && bytes2)) {
|
|
444
|
+
return false;
|
|
445
|
+
}
|
|
446
|
+
if (bytes1.byteLength !== bytes2.byteLength) {
|
|
447
|
+
return false;
|
|
448
|
+
}
|
|
449
|
+
const b1 = new Uint8Array(bytes1);
|
|
450
|
+
const b2 = new Uint8Array(bytes2);
|
|
451
|
+
for (let i = 0; i < bytes1.byteLength; i++) {
|
|
452
|
+
if (b1[i] !== b2[i]) {
|
|
453
|
+
return false;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
return true;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
build.BufferSourceConverter = BufferSourceConverter;
|
|
460
|
+
build.Convert = Convert;
|
|
461
|
+
build.assign = assign;
|
|
462
|
+
build.combine = combine;
|
|
463
|
+
build.isEqual = isEqual;
|
|
464
|
+
return build;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
var buildExports = requireBuild();
|
|
430
468
|
|
|
431
469
|
/**
|
|
432
470
|
* @license
|
|
@@ -439,7 +477,7 @@ class Download {
|
|
|
439
477
|
}
|
|
440
478
|
Download.cert = {
|
|
441
479
|
asPEM: (pem, name) => {
|
|
442
|
-
downloadFromBuffer(
|
|
480
|
+
downloadFromBuffer(buildExports.Convert.FromString(pem), name, 'cer', 'application/pkix-cert');
|
|
443
481
|
},
|
|
444
482
|
asDER: (raw, name) => {
|
|
445
483
|
downloadFromBuffer(raw, name, 'cer', 'application/pkix-cert');
|
|
@@ -447,7 +485,7 @@ Download.cert = {
|
|
|
447
485
|
};
|
|
448
486
|
Download.attrCert = {
|
|
449
487
|
asPEM: (pem, name) => {
|
|
450
|
-
downloadFromBuffer(
|
|
488
|
+
downloadFromBuffer(buildExports.Convert.FromString(pem), name, 'cer', 'application/pkix-attr-cert');
|
|
451
489
|
},
|
|
452
490
|
asDER: (raw, name) => {
|
|
453
491
|
downloadFromBuffer(raw, name, 'cer', 'application/pkix-attr-cert');
|
|
@@ -455,7 +493,7 @@ Download.attrCert = {
|
|
|
455
493
|
};
|
|
456
494
|
Download.csr = {
|
|
457
495
|
asPEM: (pem, name) => {
|
|
458
|
-
downloadFromBuffer(
|
|
496
|
+
downloadFromBuffer(buildExports.Convert.FromString(pem), name, 'csr', 'application/pkcs10');
|
|
459
497
|
},
|
|
460
498
|
asDER: (raw, name) => {
|
|
461
499
|
downloadFromBuffer(raw, name, 'csr', 'application/pkcs10');
|
|
@@ -463,7 +501,7 @@ Download.csr = {
|
|
|
463
501
|
};
|
|
464
502
|
Download.crl = {
|
|
465
503
|
asPEM: (pem, name) => {
|
|
466
|
-
downloadFromBuffer(
|
|
504
|
+
downloadFromBuffer(buildExports.Convert.FromString(pem), name, 'crl', 'application/pkix-crl');
|
|
467
505
|
},
|
|
468
506
|
asDER: (raw, name) => {
|
|
469
507
|
downloadFromBuffer(raw, name, 'crl', 'application/pkix-crl');
|
|
@@ -473,6 +511,7 @@ Download.crl = {
|
|
|
473
511
|
/*!
|
|
474
512
|
Copyright (c) Peculiar Ventures, LLC
|
|
475
513
|
*/
|
|
514
|
+
|
|
476
515
|
function utilFromBase(inputBuffer, inputBase) {
|
|
477
516
|
let result = 0;
|
|
478
517
|
if (inputBuffer.length === 1) {
|
|
@@ -644,6 +683,7 @@ function padNumber(inputNumber, fullLength) {
|
|
|
644
683
|
*
|
|
645
684
|
*/
|
|
646
685
|
|
|
686
|
+
|
|
647
687
|
function assertBigInt() {
|
|
648
688
|
if (typeof BigInt === "undefined") {
|
|
649
689
|
throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.");
|
|
@@ -727,7 +767,7 @@ function HexBlock(BaseClass) {
|
|
|
727
767
|
super(...args);
|
|
728
768
|
const params = args[0] || {};
|
|
729
769
|
this.isHexOnly = (_a = params.isHexOnly) !== null && _a !== void 0 ? _a : false;
|
|
730
|
-
this.valueHexView = params.valueHex ?
|
|
770
|
+
this.valueHexView = params.valueHex ? buildExports.BufferSourceConverter.toUint8Array(params.valueHex) : EMPTY_VIEW;
|
|
731
771
|
}
|
|
732
772
|
get valueHex() {
|
|
733
773
|
return this.valueHexView.slice().buffer;
|
|
@@ -765,7 +805,7 @@ function HexBlock(BaseClass) {
|
|
|
765
805
|
return {
|
|
766
806
|
...super.toJSON(),
|
|
767
807
|
isHexOnly: this.isHexOnly,
|
|
768
|
-
valueHex:
|
|
808
|
+
valueHex: buildExports.Convert.ToHex(this.valueHexView),
|
|
769
809
|
};
|
|
770
810
|
}
|
|
771
811
|
},
|
|
@@ -778,7 +818,7 @@ class LocalBaseBlock {
|
|
|
778
818
|
this.blockLength = blockLength;
|
|
779
819
|
this.error = error;
|
|
780
820
|
this.warnings = warnings;
|
|
781
|
-
this.valueBeforeDecodeView =
|
|
821
|
+
this.valueBeforeDecodeView = buildExports.BufferSourceConverter.toUint8Array(valueBeforeDecode);
|
|
782
822
|
}
|
|
783
823
|
static blockName() {
|
|
784
824
|
return this.NAME;
|
|
@@ -795,7 +835,7 @@ class LocalBaseBlock {
|
|
|
795
835
|
blockLength: this.blockLength,
|
|
796
836
|
error: this.error,
|
|
797
837
|
warnings: this.warnings,
|
|
798
|
-
valueBeforeDecode:
|
|
838
|
+
valueBeforeDecode: buildExports.Convert.ToHex(this.valueBeforeDecodeView),
|
|
799
839
|
};
|
|
800
840
|
}
|
|
801
841
|
}
|
|
@@ -817,7 +857,7 @@ class LocalIdentificationBlock extends HexBlock(LocalBaseBlock) {
|
|
|
817
857
|
super();
|
|
818
858
|
if (idBlock) {
|
|
819
859
|
this.isHexOnly = (_a = idBlock.isHexOnly) !== null && _a !== void 0 ? _a : false;
|
|
820
|
-
this.valueHexView = idBlock.valueHex ?
|
|
860
|
+
this.valueHexView = idBlock.valueHex ? buildExports.BufferSourceConverter.toUint8Array(idBlock.valueHex) : EMPTY_VIEW;
|
|
821
861
|
this.tagClass = (_b = idBlock.tagClass) !== null && _b !== void 0 ? _b : -1;
|
|
822
862
|
this.tagNumber = (_c = idBlock.tagNumber) !== null && _c !== void 0 ? _c : -1;
|
|
823
863
|
this.isConstructed = (_d = idBlock.isConstructed) !== null && _d !== void 0 ? _d : false;
|
|
@@ -883,7 +923,7 @@ class LocalIdentificationBlock extends HexBlock(LocalBaseBlock) {
|
|
|
883
923
|
return retView.buffer;
|
|
884
924
|
}
|
|
885
925
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
886
|
-
const inputView =
|
|
926
|
+
const inputView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
887
927
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
888
928
|
return -1;
|
|
889
929
|
}
|
|
@@ -992,7 +1032,7 @@ class LocalLengthBlock extends LocalBaseBlock {
|
|
|
992
1032
|
this.length = (_c = lenBlock.length) !== null && _c !== void 0 ? _c : 0;
|
|
993
1033
|
}
|
|
994
1034
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
995
|
-
const view =
|
|
1035
|
+
const view = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
996
1036
|
if (!checkBufferParams(this, view, inputOffset, inputLength)) {
|
|
997
1037
|
return -1;
|
|
998
1038
|
}
|
|
@@ -1151,10 +1191,10 @@ class BaseBlock extends LocalBaseBlock {
|
|
|
1151
1191
|
if (encoding === "ascii") {
|
|
1152
1192
|
return this.onAsciiEncoding();
|
|
1153
1193
|
}
|
|
1154
|
-
return
|
|
1194
|
+
return buildExports.Convert.ToHex(this.toBER());
|
|
1155
1195
|
}
|
|
1156
1196
|
onAsciiEncoding() {
|
|
1157
|
-
return `${this.constructor.NAME} : ${
|
|
1197
|
+
return `${this.constructor.NAME} : ${buildExports.Convert.ToHex(this.valueBlock.valueBeforeDecodeView)}`;
|
|
1158
1198
|
}
|
|
1159
1199
|
isEqual(other) {
|
|
1160
1200
|
if (this === other) {
|
|
@@ -1452,7 +1492,7 @@ function fromBER(inputBuffer) {
|
|
|
1452
1492
|
result
|
|
1453
1493
|
};
|
|
1454
1494
|
}
|
|
1455
|
-
return localFromBER(
|
|
1495
|
+
return localFromBER(buildExports.BufferSourceConverter.toUint8Array(inputBuffer).slice(), 0, inputBuffer.byteLength);
|
|
1456
1496
|
}
|
|
1457
1497
|
|
|
1458
1498
|
function checkLen(indefiniteLength, length) {
|
|
@@ -1468,7 +1508,7 @@ class LocalConstructedValueBlock extends ValueBlock {
|
|
|
1468
1508
|
this.isIndefiniteForm = isIndefiniteForm;
|
|
1469
1509
|
}
|
|
1470
1510
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
1471
|
-
const view =
|
|
1511
|
+
const view = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1472
1512
|
if (!checkBufferParams(this, view, inputOffset, inputLength)) {
|
|
1473
1513
|
return -1;
|
|
1474
1514
|
}
|
|
@@ -1638,7 +1678,7 @@ class LocalBooleanValueBlock extends HexBlock(ValueBlock) {
|
|
|
1638
1678
|
constructor({ value, ...parameters } = {}) {
|
|
1639
1679
|
super(parameters);
|
|
1640
1680
|
if (parameters.valueHex) {
|
|
1641
|
-
this.valueHexView =
|
|
1681
|
+
this.valueHexView = buildExports.BufferSourceConverter.toUint8Array(parameters.valueHex);
|
|
1642
1682
|
}
|
|
1643
1683
|
else {
|
|
1644
1684
|
this.valueHexView = new Uint8Array(1);
|
|
@@ -1659,7 +1699,7 @@ class LocalBooleanValueBlock extends HexBlock(ValueBlock) {
|
|
|
1659
1699
|
this.valueHexView[0] = value ? 0xFF : 0x00;
|
|
1660
1700
|
}
|
|
1661
1701
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
1662
|
-
const inputView =
|
|
1702
|
+
const inputView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1663
1703
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
1664
1704
|
return -1;
|
|
1665
1705
|
}
|
|
@@ -1758,7 +1798,7 @@ class LocalOctetStringValueBlock extends HexBlock(LocalConstructedValueBlock) {
|
|
|
1758
1798
|
LocalOctetStringValueBlock.NAME = "OctetStringValueBlock";
|
|
1759
1799
|
|
|
1760
1800
|
var _a$r;
|
|
1761
|
-
|
|
1801
|
+
let OctetString$1 = class OctetString extends BaseBlock {
|
|
1762
1802
|
constructor({ idBlock = {}, lenBlock = {}, ...parameters } = {}) {
|
|
1763
1803
|
var _b, _c;
|
|
1764
1804
|
(_b = parameters.isConstructed) !== null && _b !== void 0 ? _b : (parameters.isConstructed = !!((_c = parameters.value) === null || _c === void 0 ? void 0 : _c.length));
|
|
@@ -1806,7 +1846,7 @@ class OctetString$1 extends BaseBlock {
|
|
|
1806
1846
|
if (this.valueBlock.isConstructed || (this.valueBlock.value && this.valueBlock.value.length)) {
|
|
1807
1847
|
return Constructed.prototype.onAsciiEncoding.call(this);
|
|
1808
1848
|
}
|
|
1809
|
-
return `${this.constructor.NAME} : ${
|
|
1849
|
+
return `${this.constructor.NAME} : ${buildExports.Convert.ToHex(this.valueBlock.valueHexView)}`;
|
|
1810
1850
|
}
|
|
1811
1851
|
getValue() {
|
|
1812
1852
|
if (!this.idBlock.isConstructed) {
|
|
@@ -1814,13 +1854,13 @@ class OctetString$1 extends BaseBlock {
|
|
|
1814
1854
|
}
|
|
1815
1855
|
const array = [];
|
|
1816
1856
|
for (const content of this.valueBlock.value) {
|
|
1817
|
-
if (content instanceof OctetString
|
|
1857
|
+
if (content instanceof OctetString) {
|
|
1818
1858
|
array.push(content.valueBlock.valueHexView);
|
|
1819
1859
|
}
|
|
1820
1860
|
}
|
|
1821
|
-
return
|
|
1861
|
+
return buildExports.BufferSourceConverter.concat(array);
|
|
1822
1862
|
}
|
|
1823
|
-
}
|
|
1863
|
+
};
|
|
1824
1864
|
_a$r = OctetString$1;
|
|
1825
1865
|
(() => {
|
|
1826
1866
|
typeStore.OctetString = _a$r;
|
|
@@ -1866,7 +1906,7 @@ class LocalBitStringValueBlock extends HexBlock(LocalConstructedValueBlock) {
|
|
|
1866
1906
|
}
|
|
1867
1907
|
return resultOffset;
|
|
1868
1908
|
}
|
|
1869
|
-
const inputView =
|
|
1909
|
+
const inputView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1870
1910
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
1871
1911
|
return -1;
|
|
1872
1912
|
}
|
|
@@ -1919,7 +1959,7 @@ class LocalBitStringValueBlock extends HexBlock(LocalConstructedValueBlock) {
|
|
|
1919
1959
|
LocalBitStringValueBlock.NAME = "BitStringValueBlock";
|
|
1920
1960
|
|
|
1921
1961
|
var _a$q;
|
|
1922
|
-
|
|
1962
|
+
let BitString$1 = class BitString extends BaseBlock {
|
|
1923
1963
|
constructor({ idBlock = {}, lenBlock = {}, ...parameters } = {}) {
|
|
1924
1964
|
var _b, _c;
|
|
1925
1965
|
(_b = parameters.isConstructed) !== null && _b !== void 0 ? _b : (parameters.isConstructed = !!((_c = parameters.value) === null || _c === void 0 ? void 0 : _c.length));
|
|
@@ -1956,7 +1996,7 @@ class BitString$1 extends BaseBlock {
|
|
|
1956
1996
|
return `${this.constructor.NAME} : ${bitsStr.substring(0, bitsStr.length - this.valueBlock.unusedBits)}`;
|
|
1957
1997
|
}
|
|
1958
1998
|
}
|
|
1959
|
-
}
|
|
1999
|
+
};
|
|
1960
2000
|
_a$q = BitString$1;
|
|
1961
2001
|
(() => {
|
|
1962
2002
|
typeStore.BitString = _a$q;
|
|
@@ -2206,13 +2246,13 @@ class Integer extends BaseBlock {
|
|
|
2206
2246
|
const bigIntValue = BigInt(value);
|
|
2207
2247
|
const writer = new ViewWriter();
|
|
2208
2248
|
const hex = bigIntValue.toString(16).replace(/^-/, "");
|
|
2209
|
-
const view = new Uint8Array(
|
|
2249
|
+
const view = new Uint8Array(buildExports.Convert.FromHex(hex));
|
|
2210
2250
|
if (bigIntValue < 0) {
|
|
2211
2251
|
const first = new Uint8Array(view.length + (view[0] & 0x80 ? 1 : 0));
|
|
2212
2252
|
first[0] |= 0x80;
|
|
2213
|
-
const firstInt = BigInt(`0x${
|
|
2253
|
+
const firstInt = BigInt(`0x${buildExports.Convert.ToHex(first)}`);
|
|
2214
2254
|
const secondInt = firstInt + bigIntValue;
|
|
2215
|
-
const second =
|
|
2255
|
+
const second = buildExports.BufferSourceConverter.toUint8Array(buildExports.Convert.FromHex(secondInt.toString(16)));
|
|
2216
2256
|
second[0] |= 0x80;
|
|
2217
2257
|
writer.write(second);
|
|
2218
2258
|
}
|
|
@@ -2273,7 +2313,7 @@ class LocalSidValueBlock extends HexBlock(ValueBlock) {
|
|
|
2273
2313
|
if (!inputLength) {
|
|
2274
2314
|
return inputOffset;
|
|
2275
2315
|
}
|
|
2276
|
-
const inputView =
|
|
2316
|
+
const inputView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2277
2317
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
2278
2318
|
return -1;
|
|
2279
2319
|
}
|
|
@@ -2345,7 +2385,7 @@ class LocalSidValueBlock extends HexBlock(ValueBlock) {
|
|
|
2345
2385
|
toString() {
|
|
2346
2386
|
let result = "";
|
|
2347
2387
|
if (this.isHexOnly)
|
|
2348
|
-
result =
|
|
2388
|
+
result = buildExports.Convert.ToHex(this.valueHexView);
|
|
2349
2389
|
else {
|
|
2350
2390
|
if (this.isFirstSid) {
|
|
2351
2391
|
let sidValue = this.valueDec;
|
|
@@ -2542,7 +2582,7 @@ class LocalRelativeSidValueBlock extends HexBlock(LocalBaseBlock) {
|
|
|
2542
2582
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
2543
2583
|
if (inputLength === 0)
|
|
2544
2584
|
return inputOffset;
|
|
2545
|
-
const inputView =
|
|
2585
|
+
const inputView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2546
2586
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength))
|
|
2547
2587
|
return -1;
|
|
2548
2588
|
const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);
|
|
@@ -2600,7 +2640,7 @@ class LocalRelativeSidValueBlock extends HexBlock(LocalBaseBlock) {
|
|
|
2600
2640
|
toString() {
|
|
2601
2641
|
let result = "";
|
|
2602
2642
|
if (this.isHexOnly)
|
|
2603
|
-
result =
|
|
2643
|
+
result = buildExports.Convert.ToHex(this.valueHexView);
|
|
2604
2644
|
else {
|
|
2605
2645
|
result = this.valueDec.toString();
|
|
2606
2646
|
}
|
|
@@ -2782,7 +2822,7 @@ class LocalSimpleStringBlock extends BaseStringBlock {
|
|
|
2782
2822
|
super(parameters, LocalSimpleStringValueBlock);
|
|
2783
2823
|
}
|
|
2784
2824
|
fromBuffer(inputBuffer) {
|
|
2785
|
-
this.valueBlock.value = String.fromCharCode.apply(null,
|
|
2825
|
+
this.valueBlock.value = String.fromCharCode.apply(null, buildExports.BufferSourceConverter.toUint8Array(inputBuffer));
|
|
2786
2826
|
}
|
|
2787
2827
|
fromString(inputString) {
|
|
2788
2828
|
const strLen = inputString.length;
|
|
@@ -2796,17 +2836,17 @@ LocalSimpleStringBlock.NAME = "SIMPLE STRING";
|
|
|
2796
2836
|
|
|
2797
2837
|
class LocalUtf8StringValueBlock extends LocalSimpleStringBlock {
|
|
2798
2838
|
fromBuffer(inputBuffer) {
|
|
2799
|
-
this.valueBlock.valueHexView =
|
|
2839
|
+
this.valueBlock.valueHexView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2800
2840
|
try {
|
|
2801
|
-
this.valueBlock.value =
|
|
2841
|
+
this.valueBlock.value = buildExports.Convert.ToUtf8String(inputBuffer);
|
|
2802
2842
|
}
|
|
2803
2843
|
catch (ex) {
|
|
2804
2844
|
this.warnings.push(`Error during "decodeURIComponent": ${ex}, using raw string`);
|
|
2805
|
-
this.valueBlock.value =
|
|
2845
|
+
this.valueBlock.value = buildExports.Convert.ToBinary(inputBuffer);
|
|
2806
2846
|
}
|
|
2807
2847
|
}
|
|
2808
2848
|
fromString(inputString) {
|
|
2809
|
-
this.valueBlock.valueHexView = new Uint8Array(
|
|
2849
|
+
this.valueBlock.valueHexView = new Uint8Array(buildExports.Convert.FromUtf8String(inputString));
|
|
2810
2850
|
this.valueBlock.value = inputString;
|
|
2811
2851
|
}
|
|
2812
2852
|
}
|
|
@@ -2828,12 +2868,12 @@ Utf8String.NAME = "UTF8String";
|
|
|
2828
2868
|
|
|
2829
2869
|
class LocalBmpStringValueBlock extends LocalSimpleStringBlock {
|
|
2830
2870
|
fromBuffer(inputBuffer) {
|
|
2831
|
-
this.valueBlock.value =
|
|
2832
|
-
this.valueBlock.valueHexView =
|
|
2871
|
+
this.valueBlock.value = buildExports.Convert.ToUtf16String(inputBuffer);
|
|
2872
|
+
this.valueBlock.valueHexView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2833
2873
|
}
|
|
2834
2874
|
fromString(inputString) {
|
|
2835
2875
|
this.valueBlock.value = inputString;
|
|
2836
|
-
this.valueBlock.valueHexView = new Uint8Array(
|
|
2876
|
+
this.valueBlock.valueHexView = new Uint8Array(buildExports.Convert.FromUtf16String(inputString));
|
|
2837
2877
|
}
|
|
2838
2878
|
}
|
|
2839
2879
|
LocalBmpStringValueBlock.NAME = "BmpStringValueBlock";
|
|
@@ -3045,7 +3085,7 @@ class UTCTime extends VisibleString {
|
|
|
3045
3085
|
this.idBlock.tagNumber = 23;
|
|
3046
3086
|
}
|
|
3047
3087
|
fromBuffer(inputBuffer) {
|
|
3048
|
-
this.fromString(String.fromCharCode.apply(null,
|
|
3088
|
+
this.fromString(String.fromCharCode.apply(null, buildExports.BufferSourceConverter.toUint8Array(inputBuffer)));
|
|
3049
3089
|
}
|
|
3050
3090
|
toBuffer() {
|
|
3051
3091
|
const str = this.toString();
|
|
@@ -3395,17 +3435,17 @@ class Repeated extends Any {
|
|
|
3395
3435
|
|
|
3396
3436
|
class RawData {
|
|
3397
3437
|
constructor({ data = EMPTY_VIEW } = {}) {
|
|
3398
|
-
this.dataView =
|
|
3438
|
+
this.dataView = buildExports.BufferSourceConverter.toUint8Array(data);
|
|
3399
3439
|
}
|
|
3400
3440
|
get data() {
|
|
3401
3441
|
return this.dataView.slice().buffer;
|
|
3402
3442
|
}
|
|
3403
3443
|
set data(value) {
|
|
3404
|
-
this.dataView =
|
|
3444
|
+
this.dataView = buildExports.BufferSourceConverter.toUint8Array(value);
|
|
3405
3445
|
}
|
|
3406
3446
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
3407
3447
|
const endLength = inputOffset + inputLength;
|
|
3408
|
-
this.dataView =
|
|
3448
|
+
this.dataView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer).subarray(inputOffset, endLength);
|
|
3409
3449
|
return endLength;
|
|
3410
3450
|
}
|
|
3411
3451
|
toBER(sizeOnly) {
|
|
@@ -3724,7 +3764,7 @@ function verifySchema(inputBuffer, inputSchema) {
|
|
|
3724
3764
|
result: { error: "Wrong ASN.1 schema type" }
|
|
3725
3765
|
};
|
|
3726
3766
|
}
|
|
3727
|
-
const asn1 = localFromBER(
|
|
3767
|
+
const asn1 = localFromBER(buildExports.BufferSourceConverter.toUint8Array(inputBuffer));
|
|
3728
3768
|
if (asn1.offset === -1) {
|
|
3729
3769
|
return {
|
|
3730
3770
|
verified: false,
|
|
@@ -3734,7 +3774,7 @@ function verifySchema(inputBuffer, inputSchema) {
|
|
|
3734
3774
|
return compareSchema(asn1.result, asn1.result, inputSchema);
|
|
3735
3775
|
}
|
|
3736
3776
|
|
|
3737
|
-
|
|
3777
|
+
var asn1js = /*#__PURE__*/Object.freeze({
|
|
3738
3778
|
__proto__: null,
|
|
3739
3779
|
Any: Any,
|
|
3740
3780
|
BaseBlock: BaseBlock,
|
|
@@ -3827,9 +3867,9 @@ class BitString {
|
|
|
3827
3867
|
if (typeof params === "number") {
|
|
3828
3868
|
this.fromNumber(params);
|
|
3829
3869
|
}
|
|
3830
|
-
else if (
|
|
3870
|
+
else if (buildExports.BufferSourceConverter.isBufferSource(params)) {
|
|
3831
3871
|
this.unusedBits = unusedBits;
|
|
3832
|
-
this.value =
|
|
3872
|
+
this.value = buildExports.BufferSourceConverter.toArrayBuffer(params);
|
|
3833
3873
|
}
|
|
3834
3874
|
else {
|
|
3835
3875
|
throw TypeError("Unsupported type of 'params' argument for BitString");
|
|
@@ -3867,7 +3907,11 @@ class BitString {
|
|
|
3867
3907
|
const octetSize = (bits.length + 7) >> 3;
|
|
3868
3908
|
this.unusedBits = (octetSize << 3) - bits.length;
|
|
3869
3909
|
const octets = new Uint8Array(octetSize);
|
|
3870
|
-
bits = bits
|
|
3910
|
+
bits = bits
|
|
3911
|
+
.padStart(octetSize << 3, "0")
|
|
3912
|
+
.split("")
|
|
3913
|
+
.reverse()
|
|
3914
|
+
.join("");
|
|
3871
3915
|
let index = 0;
|
|
3872
3916
|
while (index < octetSize) {
|
|
3873
3917
|
octets[index] = parseInt(bits.slice(index << 3, (index << 3) + 8), 2);
|
|
@@ -3889,8 +3933,8 @@ class OctetString {
|
|
|
3889
3933
|
this.buffer = new ArrayBuffer(param);
|
|
3890
3934
|
}
|
|
3891
3935
|
else {
|
|
3892
|
-
if (
|
|
3893
|
-
this.buffer =
|
|
3936
|
+
if (buildExports.BufferSourceConverter.isBufferSource(param)) {
|
|
3937
|
+
this.buffer = buildExports.BufferSourceConverter.toArrayBuffer(param);
|
|
3894
3938
|
}
|
|
3895
3939
|
else if (Array.isArray(param)) {
|
|
3896
3940
|
this.buffer = new Uint8Array(param);
|
|
@@ -4128,7 +4172,7 @@ class AsnSchemaStorage {
|
|
|
4128
4172
|
const item = schema.items[key];
|
|
4129
4173
|
const name = useNames ? key : "";
|
|
4130
4174
|
let asn1Item;
|
|
4131
|
-
if (typeof
|
|
4175
|
+
if (typeof item.type === "number") {
|
|
4132
4176
|
const Asn1TypeName = AsnPropTypes[item.type];
|
|
4133
4177
|
const Asn1Type = asn1js[Asn1TypeName];
|
|
4134
4178
|
if (!Asn1Type) {
|
|
@@ -4156,9 +4200,7 @@ class AsnSchemaStorage {
|
|
|
4156
4200
|
const optional = !!item.optional || item.defaultValue !== undefined;
|
|
4157
4201
|
if (item.repeated) {
|
|
4158
4202
|
asn1Item.name = "";
|
|
4159
|
-
const Container = item.repeated === "set"
|
|
4160
|
-
? Set
|
|
4161
|
-
: Sequence;
|
|
4203
|
+
const Container = item.repeated === "set" ? Set : Sequence;
|
|
4162
4204
|
asn1Item = new Container({
|
|
4163
4205
|
name: "",
|
|
4164
4206
|
value: [
|
|
@@ -4172,9 +4214,7 @@ class AsnSchemaStorage {
|
|
|
4172
4214
|
if (item.context !== null && item.context !== undefined) {
|
|
4173
4215
|
if (item.implicit) {
|
|
4174
4216
|
if (typeof item.type === "number" || isConvertible(item.type)) {
|
|
4175
|
-
const Container = item.repeated
|
|
4176
|
-
? Constructed
|
|
4177
|
-
: Primitive;
|
|
4217
|
+
const Container = item.repeated ? Constructed : Primitive;
|
|
4178
4218
|
asn1Value.push(new Container({
|
|
4179
4219
|
name,
|
|
4180
4220
|
optional,
|
|
@@ -4187,10 +4227,11 @@ class AsnSchemaStorage {
|
|
|
4187
4227
|
else {
|
|
4188
4228
|
this.cache(item.type);
|
|
4189
4229
|
const isRepeated = !!item.repeated;
|
|
4190
|
-
let value = !isRepeated
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4230
|
+
let value = !isRepeated ? this.get(item.type, true).schema : asn1Item;
|
|
4231
|
+
value =
|
|
4232
|
+
"valueBlock" in value
|
|
4233
|
+
? value.valueBlock.value
|
|
4234
|
+
: value.value;
|
|
4194
4235
|
asn1Value.push(new Constructed({
|
|
4195
4236
|
name: !isRepeated ? name : "",
|
|
4196
4237
|
optional,
|
|
@@ -4351,16 +4392,15 @@ class AsnParser {
|
|
|
4351
4392
|
}
|
|
4352
4393
|
if (schemaItem.repeated) {
|
|
4353
4394
|
if (schemaItem.implicit) {
|
|
4354
|
-
const Container = schemaItem.repeated === "sequence"
|
|
4355
|
-
? Sequence
|
|
4356
|
-
: Set;
|
|
4395
|
+
const Container = schemaItem.repeated === "sequence" ? Sequence : Set;
|
|
4357
4396
|
const newItem = new Container();
|
|
4358
4397
|
newItem.valueBlock = asn1SchemaValue.valueBlock;
|
|
4359
4398
|
const newItemAsn = fromBER(newItem.toBER(false));
|
|
4360
4399
|
if (newItemAsn.offset === -1) {
|
|
4361
4400
|
throw new Error(`Cannot parse the child item. ${newItemAsn.result.error}`);
|
|
4362
4401
|
}
|
|
4363
|
-
if (!("value" in newItemAsn.result.valueBlock &&
|
|
4402
|
+
if (!("value" in newItemAsn.result.valueBlock &&
|
|
4403
|
+
Array.isArray(newItemAsn.result.valueBlock.value))) {
|
|
4364
4404
|
throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");
|
|
4365
4405
|
}
|
|
4366
4406
|
const value = newItemAsn.result.valueBlock.value;
|
|
@@ -4451,19 +4491,23 @@ class AsnSerializer {
|
|
|
4451
4491
|
for (const key in schema.items) {
|
|
4452
4492
|
const schemaItem = schema.items[key];
|
|
4453
4493
|
const objProp = obj[key];
|
|
4454
|
-
if (objProp === undefined
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4494
|
+
if (objProp === undefined ||
|
|
4495
|
+
schemaItem.defaultValue === objProp ||
|
|
4496
|
+
(typeof schemaItem.defaultValue === "object" &&
|
|
4497
|
+
typeof objProp === "object" &&
|
|
4498
|
+
isArrayEqual(this.serialize(schemaItem.defaultValue), this.serialize(objProp)))) {
|
|
4458
4499
|
continue;
|
|
4459
4500
|
}
|
|
4460
4501
|
const asn1Item = AsnSerializer.toAsnItem(schemaItem, key, target, objProp);
|
|
4461
4502
|
if (typeof schemaItem.context === "number") {
|
|
4462
4503
|
if (schemaItem.implicit) {
|
|
4463
|
-
if (!schemaItem.repeated
|
|
4464
|
-
|
|
4504
|
+
if (!schemaItem.repeated &&
|
|
4505
|
+
(typeof schemaItem.type === "number" || isConvertible(schemaItem.type))) {
|
|
4465
4506
|
const value = {};
|
|
4466
|
-
value.valueHex =
|
|
4507
|
+
value.valueHex =
|
|
4508
|
+
asn1Item instanceof Null
|
|
4509
|
+
? asn1Item.valueBeforeDecodeView
|
|
4510
|
+
: asn1Item.valueBlock.toBER();
|
|
4467
4511
|
asn1Value.push(new Primitive({
|
|
4468
4512
|
optional: schemaItem.optional,
|
|
4469
4513
|
idBlock: {
|
|
@@ -4522,7 +4566,7 @@ class AsnSerializer {
|
|
|
4522
4566
|
}
|
|
4523
4567
|
static toAsnItem(schemaItem, key, target, objProp) {
|
|
4524
4568
|
let asn1Item;
|
|
4525
|
-
if (typeof
|
|
4569
|
+
if (typeof schemaItem.type === "number") {
|
|
4526
4570
|
const converter = schemaItem.converter;
|
|
4527
4571
|
if (!converter) {
|
|
4528
4572
|
throw new Error(`Property '${key}' doesn't have converter for type ${AsnPropTypes[schemaItem.type]} in schema '${target.name}'`);
|
|
@@ -4532,9 +4576,7 @@ class AsnSerializer {
|
|
|
4532
4576
|
throw new TypeError("Parameter 'objProp' should be type of Array.");
|
|
4533
4577
|
}
|
|
4534
4578
|
const items = Array.from(objProp, (element) => converter.toASN(element));
|
|
4535
|
-
const Container = schemaItem.repeated === "sequence"
|
|
4536
|
-
? Sequence
|
|
4537
|
-
: Set;
|
|
4579
|
+
const Container = schemaItem.repeated === "sequence" ? Sequence : Set;
|
|
4538
4580
|
asn1Item = new Container({
|
|
4539
4581
|
value: items,
|
|
4540
4582
|
});
|
|
@@ -4549,1086 +4591,186 @@ class AsnSerializer {
|
|
|
4549
4591
|
throw new TypeError("Parameter 'objProp' should be type of Array.");
|
|
4550
4592
|
}
|
|
4551
4593
|
const items = Array.from(objProp, (element) => this.toASN(element));
|
|
4552
|
-
const Container = schemaItem.repeated === "sequence"
|
|
4553
|
-
|
|
4554
|
-
:
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
else {
|
|
4560
|
-
asn1Item = this.toASN(objProp);
|
|
4561
|
-
}
|
|
4562
|
-
}
|
|
4563
|
-
return asn1Item;
|
|
4564
|
-
}
|
|
4565
|
-
}
|
|
4566
|
-
|
|
4567
|
-
class AsnArray extends Array {
|
|
4568
|
-
constructor(items = []) {
|
|
4569
|
-
if (typeof items === "number") {
|
|
4570
|
-
super(items);
|
|
4571
|
-
}
|
|
4572
|
-
else {
|
|
4573
|
-
super();
|
|
4574
|
-
for (const item of items) {
|
|
4575
|
-
this.push(item);
|
|
4576
|
-
}
|
|
4577
|
-
}
|
|
4578
|
-
}
|
|
4579
|
-
}
|
|
4580
|
-
|
|
4581
|
-
class AsnConvert {
|
|
4582
|
-
static serialize(obj) {
|
|
4583
|
-
return AsnSerializer.serialize(obj);
|
|
4584
|
-
}
|
|
4585
|
-
static parse(data, target) {
|
|
4586
|
-
return AsnParser.parse(data, target);
|
|
4587
|
-
}
|
|
4588
|
-
static toString(data) {
|
|
4589
|
-
const buf = BufferSourceConverter_1.isBufferSource(data)
|
|
4590
|
-
? BufferSourceConverter_1.toArrayBuffer(data)
|
|
4591
|
-
: AsnConvert.serialize(data);
|
|
4592
|
-
const asn = fromBER(buf);
|
|
4593
|
-
if (asn.offset === -1) {
|
|
4594
|
-
throw new Error(`Cannot decode ASN.1 data. ${asn.result.error}`);
|
|
4595
|
-
}
|
|
4596
|
-
return asn.result.toString();
|
|
4597
|
-
}
|
|
4598
|
-
}
|
|
4599
|
-
|
|
4600
|
-
/******************************************************************************
|
|
4601
|
-
Copyright (c) Microsoft Corporation.
|
|
4602
|
-
|
|
4603
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
4604
|
-
purpose with or without fee is hereby granted.
|
|
4605
|
-
|
|
4606
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
4607
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
4608
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
4609
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
4610
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
4611
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
4612
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
4613
|
-
***************************************************************************** */
|
|
4614
|
-
|
|
4615
|
-
function __decorate$1(decorators, target, key, desc) {
|
|
4616
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4617
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4618
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4619
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4620
|
-
}
|
|
4621
|
-
|
|
4622
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
4623
|
-
var e = new Error(message);
|
|
4624
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
4625
|
-
};
|
|
4626
|
-
|
|
4627
|
-
var ipaddr = {exports: {}};
|
|
4628
|
-
|
|
4629
|
-
(function (module) {
|
|
4630
|
-
(function (root) {
|
|
4631
|
-
// A list of regular expressions that match arbitrary IPv4 addresses,
|
|
4632
|
-
// for which a number of weird notations exist.
|
|
4633
|
-
// Note that an address like 0010.0xa5.1.1 is considered legal.
|
|
4634
|
-
const ipv4Part = '(0?\\d+|0x[a-f0-9]+)';
|
|
4635
|
-
const ipv4Regexes = {
|
|
4636
|
-
fourOctet: new RegExp(`^${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}$`, 'i'),
|
|
4637
|
-
threeOctet: new RegExp(`^${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}$`, 'i'),
|
|
4638
|
-
twoOctet: new RegExp(`^${ipv4Part}\\.${ipv4Part}$`, 'i'),
|
|
4639
|
-
longValue: new RegExp(`^${ipv4Part}$`, 'i')
|
|
4640
|
-
};
|
|
4641
|
-
|
|
4642
|
-
// Regular Expression for checking Octal numbers
|
|
4643
|
-
const octalRegex = new RegExp(`^0[0-7]+$`, 'i');
|
|
4644
|
-
const hexRegex = new RegExp(`^0x[a-f0-9]+$`, 'i');
|
|
4645
|
-
|
|
4646
|
-
const zoneIndex = '%[0-9a-z]{1,}';
|
|
4647
|
-
|
|
4648
|
-
// IPv6-matching regular expressions.
|
|
4649
|
-
// For IPv6, the task is simpler: it is enough to match the colon-delimited
|
|
4650
|
-
// hexadecimal IPv6 and a transitional variant with dotted-decimal IPv4 at
|
|
4651
|
-
// the end.
|
|
4652
|
-
const ipv6Part = '(?:[0-9a-f]+::?)+';
|
|
4653
|
-
const ipv6Regexes = {
|
|
4654
|
-
zoneIndex: new RegExp(zoneIndex, 'i'),
|
|
4655
|
-
'native': new RegExp(`^(::)?(${ipv6Part})?([0-9a-f]+)?(::)?(${zoneIndex})?$`, 'i'),
|
|
4656
|
-
deprecatedTransitional: new RegExp(`^(?:::)(${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}(${zoneIndex})?)$`, 'i'),
|
|
4657
|
-
transitional: new RegExp(`^((?:${ipv6Part})|(?:::)(?:${ipv6Part})?)${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}(${zoneIndex})?$`, 'i')
|
|
4658
|
-
};
|
|
4659
|
-
|
|
4660
|
-
// Expand :: in an IPv6 address or address part consisting of `parts` groups.
|
|
4661
|
-
function expandIPv6 (string, parts) {
|
|
4662
|
-
// More than one '::' means invalid adddress
|
|
4663
|
-
if (string.indexOf('::') !== string.lastIndexOf('::')) {
|
|
4664
|
-
return null;
|
|
4665
|
-
}
|
|
4666
|
-
|
|
4667
|
-
let colonCount = 0;
|
|
4668
|
-
let lastColon = -1;
|
|
4669
|
-
let zoneId = (string.match(ipv6Regexes.zoneIndex) || [])[0];
|
|
4670
|
-
let replacement, replacementCount;
|
|
4671
|
-
|
|
4672
|
-
// Remove zone index and save it for later
|
|
4673
|
-
if (zoneId) {
|
|
4674
|
-
zoneId = zoneId.substring(1);
|
|
4675
|
-
string = string.replace(/%.+$/, '');
|
|
4676
|
-
}
|
|
4677
|
-
|
|
4678
|
-
// How many parts do we already have?
|
|
4679
|
-
while ((lastColon = string.indexOf(':', lastColon + 1)) >= 0) {
|
|
4680
|
-
colonCount++;
|
|
4681
|
-
}
|
|
4682
|
-
|
|
4683
|
-
// 0::0 is two parts more than ::
|
|
4684
|
-
if (string.substr(0, 2) === '::') {
|
|
4685
|
-
colonCount--;
|
|
4686
|
-
}
|
|
4687
|
-
|
|
4688
|
-
if (string.substr(-2, 2) === '::') {
|
|
4689
|
-
colonCount--;
|
|
4690
|
-
}
|
|
4691
|
-
|
|
4692
|
-
// The following loop would hang if colonCount > parts
|
|
4693
|
-
if (colonCount > parts) {
|
|
4694
|
-
return null;
|
|
4695
|
-
}
|
|
4696
|
-
|
|
4697
|
-
// replacement = ':' + '0:' * (parts - colonCount)
|
|
4698
|
-
replacementCount = parts - colonCount;
|
|
4699
|
-
replacement = ':';
|
|
4700
|
-
while (replacementCount--) {
|
|
4701
|
-
replacement += '0:';
|
|
4702
|
-
}
|
|
4703
|
-
|
|
4704
|
-
// Insert the missing zeroes
|
|
4705
|
-
string = string.replace('::', replacement);
|
|
4706
|
-
|
|
4707
|
-
// Trim any garbage which may be hanging around if :: was at the edge in
|
|
4708
|
-
// the source strin
|
|
4709
|
-
if (string[0] === ':') {
|
|
4710
|
-
string = string.slice(1);
|
|
4711
|
-
}
|
|
4712
|
-
|
|
4713
|
-
if (string[string.length - 1] === ':') {
|
|
4714
|
-
string = string.slice(0, -1);
|
|
4715
|
-
}
|
|
4716
|
-
|
|
4717
|
-
parts = (function () {
|
|
4718
|
-
const ref = string.split(':');
|
|
4719
|
-
const results = [];
|
|
4720
|
-
|
|
4721
|
-
for (let i = 0; i < ref.length; i++) {
|
|
4722
|
-
results.push(parseInt(ref[i], 16));
|
|
4723
|
-
}
|
|
4724
|
-
|
|
4725
|
-
return results;
|
|
4726
|
-
})();
|
|
4727
|
-
|
|
4728
|
-
return {
|
|
4729
|
-
parts: parts,
|
|
4730
|
-
zoneId: zoneId
|
|
4731
|
-
};
|
|
4732
|
-
}
|
|
4733
|
-
|
|
4734
|
-
// A generic CIDR (Classless Inter-Domain Routing) RFC1518 range matcher.
|
|
4735
|
-
function matchCIDR (first, second, partSize, cidrBits) {
|
|
4736
|
-
if (first.length !== second.length) {
|
|
4737
|
-
throw new Error('ipaddr: cannot match CIDR for objects with different lengths');
|
|
4738
|
-
}
|
|
4739
|
-
|
|
4740
|
-
let part = 0;
|
|
4741
|
-
let shift;
|
|
4742
|
-
|
|
4743
|
-
while (cidrBits > 0) {
|
|
4744
|
-
shift = partSize - cidrBits;
|
|
4745
|
-
if (shift < 0) {
|
|
4746
|
-
shift = 0;
|
|
4747
|
-
}
|
|
4748
|
-
|
|
4749
|
-
if (first[part] >> shift !== second[part] >> shift) {
|
|
4750
|
-
return false;
|
|
4751
|
-
}
|
|
4752
|
-
|
|
4753
|
-
cidrBits -= partSize;
|
|
4754
|
-
part += 1;
|
|
4755
|
-
}
|
|
4756
|
-
|
|
4757
|
-
return true;
|
|
4758
|
-
}
|
|
4759
|
-
|
|
4760
|
-
function parseIntAuto (string) {
|
|
4761
|
-
// Hexadedimal base 16 (0x#)
|
|
4762
|
-
if (hexRegex.test(string)) {
|
|
4763
|
-
return parseInt(string, 16);
|
|
4764
|
-
}
|
|
4765
|
-
// While octal representation is discouraged by ECMAScript 3
|
|
4766
|
-
// and forbidden by ECMAScript 5, we silently allow it to
|
|
4767
|
-
// work only if the rest of the string has numbers less than 8.
|
|
4768
|
-
if (string[0] === '0' && !isNaN(parseInt(string[1], 10))) {
|
|
4769
|
-
if (octalRegex.test(string)) {
|
|
4770
|
-
return parseInt(string, 8);
|
|
4771
|
-
}
|
|
4772
|
-
throw new Error(`ipaddr: cannot parse ${string} as octal`);
|
|
4773
|
-
}
|
|
4774
|
-
// Always include the base 10 radix!
|
|
4775
|
-
return parseInt(string, 10);
|
|
4776
|
-
}
|
|
4777
|
-
|
|
4778
|
-
function padPart (part, length) {
|
|
4779
|
-
while (part.length < length) {
|
|
4780
|
-
part = `0${part}`;
|
|
4781
|
-
}
|
|
4782
|
-
|
|
4783
|
-
return part;
|
|
4784
|
-
}
|
|
4785
|
-
|
|
4786
|
-
const ipaddr = {};
|
|
4787
|
-
|
|
4788
|
-
// An IPv4 address (RFC791).
|
|
4789
|
-
ipaddr.IPv4 = (function () {
|
|
4790
|
-
// Constructs a new IPv4 address from an array of four octets
|
|
4791
|
-
// in network order (MSB first)
|
|
4792
|
-
// Verifies the input.
|
|
4793
|
-
function IPv4 (octets) {
|
|
4794
|
-
if (octets.length !== 4) {
|
|
4795
|
-
throw new Error('ipaddr: ipv4 octet count should be 4');
|
|
4796
|
-
}
|
|
4797
|
-
|
|
4798
|
-
let i, octet;
|
|
4799
|
-
|
|
4800
|
-
for (i = 0; i < octets.length; i++) {
|
|
4801
|
-
octet = octets[i];
|
|
4802
|
-
if (!((0 <= octet && octet <= 255))) {
|
|
4803
|
-
throw new Error('ipaddr: ipv4 octet should fit in 8 bits');
|
|
4804
|
-
}
|
|
4805
|
-
}
|
|
4806
|
-
|
|
4807
|
-
this.octets = octets;
|
|
4808
|
-
}
|
|
4809
|
-
|
|
4810
|
-
// Special IPv4 address ranges.
|
|
4811
|
-
// See also https://en.wikipedia.org/wiki/Reserved_IP_addresses
|
|
4812
|
-
IPv4.prototype.SpecialRanges = {
|
|
4813
|
-
unspecified: [[new IPv4([0, 0, 0, 0]), 8]],
|
|
4814
|
-
broadcast: [[new IPv4([255, 255, 255, 255]), 32]],
|
|
4815
|
-
// RFC3171
|
|
4816
|
-
multicast: [[new IPv4([224, 0, 0, 0]), 4]],
|
|
4817
|
-
// RFC3927
|
|
4818
|
-
linkLocal: [[new IPv4([169, 254, 0, 0]), 16]],
|
|
4819
|
-
// RFC5735
|
|
4820
|
-
loopback: [[new IPv4([127, 0, 0, 0]), 8]],
|
|
4821
|
-
// RFC6598
|
|
4822
|
-
carrierGradeNat: [[new IPv4([100, 64, 0, 0]), 10]],
|
|
4823
|
-
// RFC1918
|
|
4824
|
-
'private': [
|
|
4825
|
-
[new IPv4([10, 0, 0, 0]), 8],
|
|
4826
|
-
[new IPv4([172, 16, 0, 0]), 12],
|
|
4827
|
-
[new IPv4([192, 168, 0, 0]), 16]
|
|
4828
|
-
],
|
|
4829
|
-
// Reserved and testing-only ranges; RFCs 5735, 5737, 2544, 1700
|
|
4830
|
-
reserved: [
|
|
4831
|
-
[new IPv4([192, 0, 0, 0]), 24],
|
|
4832
|
-
[new IPv4([192, 0, 2, 0]), 24],
|
|
4833
|
-
[new IPv4([192, 88, 99, 0]), 24],
|
|
4834
|
-
[new IPv4([198, 18, 0, 0]), 15],
|
|
4835
|
-
[new IPv4([198, 51, 100, 0]), 24],
|
|
4836
|
-
[new IPv4([203, 0, 113, 0]), 24],
|
|
4837
|
-
[new IPv4([240, 0, 0, 0]), 4]
|
|
4838
|
-
]
|
|
4839
|
-
};
|
|
4840
|
-
|
|
4841
|
-
// The 'kind' method exists on both IPv4 and IPv6 classes.
|
|
4842
|
-
IPv4.prototype.kind = function () {
|
|
4843
|
-
return 'ipv4';
|
|
4844
|
-
};
|
|
4845
|
-
|
|
4846
|
-
// Checks if this address matches other one within given CIDR range.
|
|
4847
|
-
IPv4.prototype.match = function (other, cidrRange) {
|
|
4848
|
-
let ref;
|
|
4849
|
-
if (cidrRange === undefined) {
|
|
4850
|
-
ref = other;
|
|
4851
|
-
other = ref[0];
|
|
4852
|
-
cidrRange = ref[1];
|
|
4853
|
-
}
|
|
4854
|
-
|
|
4855
|
-
if (other.kind() !== 'ipv4') {
|
|
4856
|
-
throw new Error('ipaddr: cannot match ipv4 address with non-ipv4 one');
|
|
4857
|
-
}
|
|
4858
|
-
|
|
4859
|
-
return matchCIDR(this.octets, other.octets, 8, cidrRange);
|
|
4860
|
-
};
|
|
4861
|
-
|
|
4862
|
-
// returns a number of leading ones in IPv4 address, making sure that
|
|
4863
|
-
// the rest is a solid sequence of 0's (valid netmask)
|
|
4864
|
-
// returns either the CIDR length or null if mask is not valid
|
|
4865
|
-
IPv4.prototype.prefixLengthFromSubnetMask = function () {
|
|
4866
|
-
let cidr = 0;
|
|
4867
|
-
// non-zero encountered stop scanning for zeroes
|
|
4868
|
-
let stop = false;
|
|
4869
|
-
// number of zeroes in octet
|
|
4870
|
-
const zerotable = {
|
|
4871
|
-
0: 8,
|
|
4872
|
-
128: 7,
|
|
4873
|
-
192: 6,
|
|
4874
|
-
224: 5,
|
|
4875
|
-
240: 4,
|
|
4876
|
-
248: 3,
|
|
4877
|
-
252: 2,
|
|
4878
|
-
254: 1,
|
|
4879
|
-
255: 0
|
|
4880
|
-
};
|
|
4881
|
-
let i, octet, zeros;
|
|
4882
|
-
|
|
4883
|
-
for (i = 3; i >= 0; i -= 1) {
|
|
4884
|
-
octet = this.octets[i];
|
|
4885
|
-
if (octet in zerotable) {
|
|
4886
|
-
zeros = zerotable[octet];
|
|
4887
|
-
if (stop && zeros !== 0) {
|
|
4888
|
-
return null;
|
|
4889
|
-
}
|
|
4890
|
-
|
|
4891
|
-
if (zeros !== 8) {
|
|
4892
|
-
stop = true;
|
|
4893
|
-
}
|
|
4894
|
-
|
|
4895
|
-
cidr += zeros;
|
|
4896
|
-
} else {
|
|
4897
|
-
return null;
|
|
4898
|
-
}
|
|
4899
|
-
}
|
|
4900
|
-
|
|
4901
|
-
return 32 - cidr;
|
|
4902
|
-
};
|
|
4903
|
-
|
|
4904
|
-
// Checks if the address corresponds to one of the special ranges.
|
|
4905
|
-
IPv4.prototype.range = function () {
|
|
4906
|
-
return ipaddr.subnetMatch(this, this.SpecialRanges);
|
|
4907
|
-
};
|
|
4908
|
-
|
|
4909
|
-
// Returns an array of byte-sized values in network order (MSB first)
|
|
4910
|
-
IPv4.prototype.toByteArray = function () {
|
|
4911
|
-
return this.octets.slice(0);
|
|
4912
|
-
};
|
|
4913
|
-
|
|
4914
|
-
// Converts this IPv4 address to an IPv4-mapped IPv6 address.
|
|
4915
|
-
IPv4.prototype.toIPv4MappedAddress = function () {
|
|
4916
|
-
return ipaddr.IPv6.parse(`::ffff:${this.toString()}`);
|
|
4917
|
-
};
|
|
4918
|
-
|
|
4919
|
-
// Symmetrical method strictly for aligning with the IPv6 methods.
|
|
4920
|
-
IPv4.prototype.toNormalizedString = function () {
|
|
4921
|
-
return this.toString();
|
|
4922
|
-
};
|
|
4923
|
-
|
|
4924
|
-
// Returns the address in convenient, decimal-dotted format.
|
|
4925
|
-
IPv4.prototype.toString = function () {
|
|
4926
|
-
return this.octets.join('.');
|
|
4927
|
-
};
|
|
4928
|
-
|
|
4929
|
-
return IPv4;
|
|
4930
|
-
})();
|
|
4931
|
-
|
|
4932
|
-
// A utility function to return broadcast address given the IPv4 interface and prefix length in CIDR notation
|
|
4933
|
-
ipaddr.IPv4.broadcastAddressFromCIDR = function (string) {
|
|
4934
|
-
|
|
4935
|
-
try {
|
|
4936
|
-
const cidr = this.parseCIDR(string);
|
|
4937
|
-
const ipInterfaceOctets = cidr[0].toByteArray();
|
|
4938
|
-
const subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
|
|
4939
|
-
const octets = [];
|
|
4940
|
-
let i = 0;
|
|
4941
|
-
while (i < 4) {
|
|
4942
|
-
// Broadcast address is bitwise OR between ip interface and inverted mask
|
|
4943
|
-
octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255);
|
|
4944
|
-
i++;
|
|
4945
|
-
}
|
|
4946
|
-
|
|
4947
|
-
return new this(octets);
|
|
4948
|
-
} catch (e) {
|
|
4949
|
-
throw new Error('ipaddr: the address does not have IPv4 CIDR format');
|
|
4950
|
-
}
|
|
4951
|
-
};
|
|
4952
|
-
|
|
4953
|
-
// Checks if a given string is formatted like IPv4 address.
|
|
4954
|
-
ipaddr.IPv4.isIPv4 = function (string) {
|
|
4955
|
-
return this.parser(string) !== null;
|
|
4956
|
-
};
|
|
4957
|
-
|
|
4958
|
-
// Checks if a given string is a valid IPv4 address.
|
|
4959
|
-
ipaddr.IPv4.isValid = function (string) {
|
|
4960
|
-
try {
|
|
4961
|
-
new this(this.parser(string));
|
|
4962
|
-
return true;
|
|
4963
|
-
} catch (e) {
|
|
4964
|
-
return false;
|
|
4965
|
-
}
|
|
4966
|
-
};
|
|
4967
|
-
|
|
4968
|
-
// Checks if a given string is a full four-part IPv4 Address.
|
|
4969
|
-
ipaddr.IPv4.isValidFourPartDecimal = function (string) {
|
|
4970
|
-
if (ipaddr.IPv4.isValid(string) && string.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/)) {
|
|
4971
|
-
return true;
|
|
4972
|
-
} else {
|
|
4973
|
-
return false;
|
|
4974
|
-
}
|
|
4975
|
-
};
|
|
4976
|
-
|
|
4977
|
-
// A utility function to return network address given the IPv4 interface and prefix length in CIDR notation
|
|
4978
|
-
ipaddr.IPv4.networkAddressFromCIDR = function (string) {
|
|
4979
|
-
let cidr, i, ipInterfaceOctets, octets, subnetMaskOctets;
|
|
4980
|
-
|
|
4981
|
-
try {
|
|
4982
|
-
cidr = this.parseCIDR(string);
|
|
4983
|
-
ipInterfaceOctets = cidr[0].toByteArray();
|
|
4984
|
-
subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
|
|
4985
|
-
octets = [];
|
|
4986
|
-
i = 0;
|
|
4987
|
-
while (i < 4) {
|
|
4988
|
-
// Network address is bitwise AND between ip interface and mask
|
|
4989
|
-
octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10));
|
|
4990
|
-
i++;
|
|
4991
|
-
}
|
|
4992
|
-
|
|
4993
|
-
return new this(octets);
|
|
4994
|
-
} catch (e) {
|
|
4995
|
-
throw new Error('ipaddr: the address does not have IPv4 CIDR format');
|
|
4996
|
-
}
|
|
4997
|
-
};
|
|
4998
|
-
|
|
4999
|
-
// Tries to parse and validate a string with IPv4 address.
|
|
5000
|
-
// Throws an error if it fails.
|
|
5001
|
-
ipaddr.IPv4.parse = function (string) {
|
|
5002
|
-
const parts = this.parser(string);
|
|
5003
|
-
|
|
5004
|
-
if (parts === null) {
|
|
5005
|
-
throw new Error('ipaddr: string is not formatted like an IPv4 Address');
|
|
5006
|
-
}
|
|
5007
|
-
|
|
5008
|
-
return new this(parts);
|
|
5009
|
-
};
|
|
5010
|
-
|
|
5011
|
-
// Parses the string as an IPv4 Address with CIDR Notation.
|
|
5012
|
-
ipaddr.IPv4.parseCIDR = function (string) {
|
|
5013
|
-
let match;
|
|
5014
|
-
|
|
5015
|
-
if ((match = string.match(/^(.+)\/(\d+)$/))) {
|
|
5016
|
-
const maskLength = parseInt(match[2]);
|
|
5017
|
-
if (maskLength >= 0 && maskLength <= 32) {
|
|
5018
|
-
const parsed = [this.parse(match[1]), maskLength];
|
|
5019
|
-
Object.defineProperty(parsed, 'toString', {
|
|
5020
|
-
value: function () {
|
|
5021
|
-
return this.join('/');
|
|
5022
|
-
}
|
|
5023
|
-
});
|
|
5024
|
-
return parsed;
|
|
5025
|
-
}
|
|
5026
|
-
}
|
|
5027
|
-
|
|
5028
|
-
throw new Error('ipaddr: string is not formatted like an IPv4 CIDR range');
|
|
5029
|
-
};
|
|
5030
|
-
|
|
5031
|
-
// Classful variants (like a.b, where a is an octet, and b is a 24-bit
|
|
5032
|
-
// value representing last three octets; this corresponds to a class C
|
|
5033
|
-
// address) are omitted due to classless nature of modern Internet.
|
|
5034
|
-
ipaddr.IPv4.parser = function (string) {
|
|
5035
|
-
let match, part, value;
|
|
5036
|
-
|
|
5037
|
-
// parseInt recognizes all that octal & hexadecimal weirdness for us
|
|
5038
|
-
if ((match = string.match(ipv4Regexes.fourOctet))) {
|
|
5039
|
-
return (function () {
|
|
5040
|
-
const ref = match.slice(1, 6);
|
|
5041
|
-
const results = [];
|
|
5042
|
-
|
|
5043
|
-
for (let i = 0; i < ref.length; i++) {
|
|
5044
|
-
part = ref[i];
|
|
5045
|
-
results.push(parseIntAuto(part));
|
|
5046
|
-
}
|
|
5047
|
-
|
|
5048
|
-
return results;
|
|
5049
|
-
})();
|
|
5050
|
-
} else if ((match = string.match(ipv4Regexes.longValue))) {
|
|
5051
|
-
value = parseIntAuto(match[1]);
|
|
5052
|
-
if (value > 0xffffffff || value < 0) {
|
|
5053
|
-
throw new Error('ipaddr: address outside defined range');
|
|
5054
|
-
}
|
|
5055
|
-
|
|
5056
|
-
return ((function () {
|
|
5057
|
-
const results = [];
|
|
5058
|
-
let shift;
|
|
5059
|
-
|
|
5060
|
-
for (shift = 0; shift <= 24; shift += 8) {
|
|
5061
|
-
results.push((value >> shift) & 0xff);
|
|
5062
|
-
}
|
|
5063
|
-
|
|
5064
|
-
return results;
|
|
5065
|
-
})()).reverse();
|
|
5066
|
-
} else if ((match = string.match(ipv4Regexes.twoOctet))) {
|
|
5067
|
-
return (function () {
|
|
5068
|
-
const ref = match.slice(1, 4);
|
|
5069
|
-
const results = [];
|
|
5070
|
-
|
|
5071
|
-
value = parseIntAuto(ref[1]);
|
|
5072
|
-
if (value > 0xffffff || value < 0) {
|
|
5073
|
-
throw new Error('ipaddr: address outside defined range');
|
|
5074
|
-
}
|
|
5075
|
-
|
|
5076
|
-
results.push(parseIntAuto(ref[0]));
|
|
5077
|
-
results.push((value >> 16) & 0xff);
|
|
5078
|
-
results.push((value >> 8) & 0xff);
|
|
5079
|
-
results.push( value & 0xff);
|
|
5080
|
-
|
|
5081
|
-
return results;
|
|
5082
|
-
})();
|
|
5083
|
-
} else if ((match = string.match(ipv4Regexes.threeOctet))) {
|
|
5084
|
-
return (function () {
|
|
5085
|
-
const ref = match.slice(1, 5);
|
|
5086
|
-
const results = [];
|
|
5087
|
-
|
|
5088
|
-
value = parseIntAuto(ref[2]);
|
|
5089
|
-
if (value > 0xffff || value < 0) {
|
|
5090
|
-
throw new Error('ipaddr: address outside defined range');
|
|
5091
|
-
}
|
|
5092
|
-
|
|
5093
|
-
results.push(parseIntAuto(ref[0]));
|
|
5094
|
-
results.push(parseIntAuto(ref[1]));
|
|
5095
|
-
results.push((value >> 8) & 0xff);
|
|
5096
|
-
results.push( value & 0xff);
|
|
5097
|
-
|
|
5098
|
-
return results;
|
|
5099
|
-
})();
|
|
5100
|
-
} else {
|
|
5101
|
-
return null;
|
|
5102
|
-
}
|
|
5103
|
-
};
|
|
5104
|
-
|
|
5105
|
-
// A utility function to return subnet mask in IPv4 format given the prefix length
|
|
5106
|
-
ipaddr.IPv4.subnetMaskFromPrefixLength = function (prefix) {
|
|
5107
|
-
prefix = parseInt(prefix);
|
|
5108
|
-
if (prefix < 0 || prefix > 32) {
|
|
5109
|
-
throw new Error('ipaddr: invalid IPv4 prefix length');
|
|
5110
|
-
}
|
|
5111
|
-
|
|
5112
|
-
const octets = [0, 0, 0, 0];
|
|
5113
|
-
let j = 0;
|
|
5114
|
-
const filledOctetCount = Math.floor(prefix / 8);
|
|
5115
|
-
|
|
5116
|
-
while (j < filledOctetCount) {
|
|
5117
|
-
octets[j] = 255;
|
|
5118
|
-
j++;
|
|
5119
|
-
}
|
|
5120
|
-
|
|
5121
|
-
if (filledOctetCount < 4) {
|
|
5122
|
-
octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - (prefix % 8);
|
|
5123
|
-
}
|
|
5124
|
-
|
|
5125
|
-
return new this(octets);
|
|
5126
|
-
};
|
|
5127
|
-
|
|
5128
|
-
// An IPv6 address (RFC2460)
|
|
5129
|
-
ipaddr.IPv6 = (function () {
|
|
5130
|
-
// Constructs an IPv6 address from an array of eight 16 - bit parts
|
|
5131
|
-
// or sixteen 8 - bit parts in network order(MSB first).
|
|
5132
|
-
// Throws an error if the input is invalid.
|
|
5133
|
-
function IPv6 (parts, zoneId) {
|
|
5134
|
-
let i, part;
|
|
5135
|
-
|
|
5136
|
-
if (parts.length === 16) {
|
|
5137
|
-
this.parts = [];
|
|
5138
|
-
for (i = 0; i <= 14; i += 2) {
|
|
5139
|
-
this.parts.push((parts[i] << 8) | parts[i + 1]);
|
|
5140
|
-
}
|
|
5141
|
-
} else if (parts.length === 8) {
|
|
5142
|
-
this.parts = parts;
|
|
5143
|
-
} else {
|
|
5144
|
-
throw new Error('ipaddr: ipv6 part count should be 8 or 16');
|
|
5145
|
-
}
|
|
5146
|
-
|
|
5147
|
-
for (i = 0; i < this.parts.length; i++) {
|
|
5148
|
-
part = this.parts[i];
|
|
5149
|
-
if (!((0 <= part && part <= 0xffff))) {
|
|
5150
|
-
throw new Error('ipaddr: ipv6 part should fit in 16 bits');
|
|
5151
|
-
}
|
|
5152
|
-
}
|
|
5153
|
-
|
|
5154
|
-
if (zoneId) {
|
|
5155
|
-
this.zoneId = zoneId;
|
|
5156
|
-
}
|
|
5157
|
-
}
|
|
5158
|
-
|
|
5159
|
-
// Special IPv6 ranges
|
|
5160
|
-
IPv6.prototype.SpecialRanges = {
|
|
5161
|
-
// RFC4291, here and after
|
|
5162
|
-
unspecified: [new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128],
|
|
5163
|
-
linkLocal: [new IPv6([0xfe80, 0, 0, 0, 0, 0, 0, 0]), 10],
|
|
5164
|
-
multicast: [new IPv6([0xff00, 0, 0, 0, 0, 0, 0, 0]), 8],
|
|
5165
|
-
loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128],
|
|
5166
|
-
uniqueLocal: [new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7],
|
|
5167
|
-
ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96],
|
|
5168
|
-
// RFC6145
|
|
5169
|
-
rfc6145: [new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96],
|
|
5170
|
-
// RFC6052
|
|
5171
|
-
rfc6052: [new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96],
|
|
5172
|
-
// RFC3056
|
|
5173
|
-
'6to4': [new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16],
|
|
5174
|
-
// RFC6052, RFC6146
|
|
5175
|
-
teredo: [new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32],
|
|
5176
|
-
// RFC4291
|
|
5177
|
-
reserved: [[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32]],
|
|
5178
|
-
benchmarking: [new IPv6([0x2001, 0x2, 0, 0, 0, 0, 0, 0]), 48],
|
|
5179
|
-
amt: [new IPv6([0x2001, 0x3, 0, 0, 0, 0, 0, 0]), 32],
|
|
5180
|
-
as112v6: [new IPv6([0x2001, 0x4, 0x112, 0, 0, 0, 0, 0]), 48],
|
|
5181
|
-
deprecated: [new IPv6([0x2001, 0x10, 0, 0, 0, 0, 0, 0]), 28],
|
|
5182
|
-
orchid2: [new IPv6([0x2001, 0x20, 0, 0, 0, 0, 0, 0]), 28]
|
|
5183
|
-
};
|
|
5184
|
-
|
|
5185
|
-
// Checks if this address is an IPv4-mapped IPv6 address.
|
|
5186
|
-
IPv6.prototype.isIPv4MappedAddress = function () {
|
|
5187
|
-
return this.range() === 'ipv4Mapped';
|
|
5188
|
-
};
|
|
5189
|
-
|
|
5190
|
-
// The 'kind' method exists on both IPv4 and IPv6 classes.
|
|
5191
|
-
IPv6.prototype.kind = function () {
|
|
5192
|
-
return 'ipv6';
|
|
5193
|
-
};
|
|
5194
|
-
|
|
5195
|
-
// Checks if this address matches other one within given CIDR range.
|
|
5196
|
-
IPv6.prototype.match = function (other, cidrRange) {
|
|
5197
|
-
let ref;
|
|
5198
|
-
|
|
5199
|
-
if (cidrRange === undefined) {
|
|
5200
|
-
ref = other;
|
|
5201
|
-
other = ref[0];
|
|
5202
|
-
cidrRange = ref[1];
|
|
5203
|
-
}
|
|
5204
|
-
|
|
5205
|
-
if (other.kind() !== 'ipv6') {
|
|
5206
|
-
throw new Error('ipaddr: cannot match ipv6 address with non-ipv6 one');
|
|
5207
|
-
}
|
|
5208
|
-
|
|
5209
|
-
return matchCIDR(this.parts, other.parts, 16, cidrRange);
|
|
5210
|
-
};
|
|
5211
|
-
|
|
5212
|
-
// returns a number of leading ones in IPv6 address, making sure that
|
|
5213
|
-
// the rest is a solid sequence of 0's (valid netmask)
|
|
5214
|
-
// returns either the CIDR length or null if mask is not valid
|
|
5215
|
-
IPv6.prototype.prefixLengthFromSubnetMask = function () {
|
|
5216
|
-
let cidr = 0;
|
|
5217
|
-
// non-zero encountered stop scanning for zeroes
|
|
5218
|
-
let stop = false;
|
|
5219
|
-
// number of zeroes in octet
|
|
5220
|
-
const zerotable = {
|
|
5221
|
-
0: 16,
|
|
5222
|
-
32768: 15,
|
|
5223
|
-
49152: 14,
|
|
5224
|
-
57344: 13,
|
|
5225
|
-
61440: 12,
|
|
5226
|
-
63488: 11,
|
|
5227
|
-
64512: 10,
|
|
5228
|
-
65024: 9,
|
|
5229
|
-
65280: 8,
|
|
5230
|
-
65408: 7,
|
|
5231
|
-
65472: 6,
|
|
5232
|
-
65504: 5,
|
|
5233
|
-
65520: 4,
|
|
5234
|
-
65528: 3,
|
|
5235
|
-
65532: 2,
|
|
5236
|
-
65534: 1,
|
|
5237
|
-
65535: 0
|
|
5238
|
-
};
|
|
5239
|
-
let part, zeros;
|
|
5240
|
-
|
|
5241
|
-
for (let i = 7; i >= 0; i -= 1) {
|
|
5242
|
-
part = this.parts[i];
|
|
5243
|
-
if (part in zerotable) {
|
|
5244
|
-
zeros = zerotable[part];
|
|
5245
|
-
if (stop && zeros !== 0) {
|
|
5246
|
-
return null;
|
|
5247
|
-
}
|
|
5248
|
-
|
|
5249
|
-
if (zeros !== 16) {
|
|
5250
|
-
stop = true;
|
|
5251
|
-
}
|
|
5252
|
-
|
|
5253
|
-
cidr += zeros;
|
|
5254
|
-
} else {
|
|
5255
|
-
return null;
|
|
5256
|
-
}
|
|
5257
|
-
}
|
|
5258
|
-
|
|
5259
|
-
return 128 - cidr;
|
|
5260
|
-
};
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
// Checks if the address corresponds to one of the special ranges.
|
|
5264
|
-
IPv6.prototype.range = function () {
|
|
5265
|
-
return ipaddr.subnetMatch(this, this.SpecialRanges);
|
|
5266
|
-
};
|
|
5267
|
-
|
|
5268
|
-
// Returns an array of byte-sized values in network order (MSB first)
|
|
5269
|
-
IPv6.prototype.toByteArray = function () {
|
|
5270
|
-
let part;
|
|
5271
|
-
const bytes = [];
|
|
5272
|
-
const ref = this.parts;
|
|
5273
|
-
for (let i = 0; i < ref.length; i++) {
|
|
5274
|
-
part = ref[i];
|
|
5275
|
-
bytes.push(part >> 8);
|
|
5276
|
-
bytes.push(part & 0xff);
|
|
5277
|
-
}
|
|
5278
|
-
|
|
5279
|
-
return bytes;
|
|
5280
|
-
};
|
|
5281
|
-
|
|
5282
|
-
// Returns the address in expanded format with all zeroes included, like
|
|
5283
|
-
// 2001:0db8:0008:0066:0000:0000:0000:0001
|
|
5284
|
-
IPv6.prototype.toFixedLengthString = function () {
|
|
5285
|
-
const addr = ((function () {
|
|
5286
|
-
const results = [];
|
|
5287
|
-
for (let i = 0; i < this.parts.length; i++) {
|
|
5288
|
-
results.push(padPart(this.parts[i].toString(16), 4));
|
|
5289
|
-
}
|
|
5290
|
-
|
|
5291
|
-
return results;
|
|
5292
|
-
}).call(this)).join(':');
|
|
5293
|
-
|
|
5294
|
-
let suffix = '';
|
|
5295
|
-
|
|
5296
|
-
if (this.zoneId) {
|
|
5297
|
-
suffix = `%${this.zoneId}`;
|
|
5298
|
-
}
|
|
5299
|
-
|
|
5300
|
-
return addr + suffix;
|
|
5301
|
-
};
|
|
5302
|
-
|
|
5303
|
-
// Converts this address to IPv4 address if it is an IPv4-mapped IPv6 address.
|
|
5304
|
-
// Throws an error otherwise.
|
|
5305
|
-
IPv6.prototype.toIPv4Address = function () {
|
|
5306
|
-
if (!this.isIPv4MappedAddress()) {
|
|
5307
|
-
throw new Error('ipaddr: trying to convert a generic ipv6 address to ipv4');
|
|
5308
|
-
}
|
|
5309
|
-
|
|
5310
|
-
const ref = this.parts.slice(-2);
|
|
5311
|
-
const high = ref[0];
|
|
5312
|
-
const low = ref[1];
|
|
5313
|
-
|
|
5314
|
-
return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]);
|
|
5315
|
-
};
|
|
5316
|
-
|
|
5317
|
-
// Returns the address in expanded format with all zeroes included, like
|
|
5318
|
-
// 2001:db8:8:66:0:0:0:1
|
|
5319
|
-
//
|
|
5320
|
-
// Deprecated: use toFixedLengthString() instead.
|
|
5321
|
-
IPv6.prototype.toNormalizedString = function () {
|
|
5322
|
-
const addr = ((function () {
|
|
5323
|
-
const results = [];
|
|
5324
|
-
|
|
5325
|
-
for (let i = 0; i < this.parts.length; i++) {
|
|
5326
|
-
results.push(this.parts[i].toString(16));
|
|
5327
|
-
}
|
|
5328
|
-
|
|
5329
|
-
return results;
|
|
5330
|
-
}).call(this)).join(':');
|
|
5331
|
-
|
|
5332
|
-
let suffix = '';
|
|
5333
|
-
|
|
5334
|
-
if (this.zoneId) {
|
|
5335
|
-
suffix = `%${this.zoneId}`;
|
|
5336
|
-
}
|
|
5337
|
-
|
|
5338
|
-
return addr + suffix;
|
|
5339
|
-
};
|
|
5340
|
-
|
|
5341
|
-
// Returns the address in compact, human-readable format like
|
|
5342
|
-
// 2001:db8:8:66::1
|
|
5343
|
-
// in line with RFC 5952 (see https://tools.ietf.org/html/rfc5952#section-4)
|
|
5344
|
-
IPv6.prototype.toRFC5952String = function () {
|
|
5345
|
-
const regex = /((^|:)(0(:|$)){2,})/g;
|
|
5346
|
-
const string = this.toNormalizedString();
|
|
5347
|
-
let bestMatchIndex = 0;
|
|
5348
|
-
let bestMatchLength = -1;
|
|
5349
|
-
let match;
|
|
5350
|
-
|
|
5351
|
-
while ((match = regex.exec(string))) {
|
|
5352
|
-
if (match[0].length > bestMatchLength) {
|
|
5353
|
-
bestMatchIndex = match.index;
|
|
5354
|
-
bestMatchLength = match[0].length;
|
|
5355
|
-
}
|
|
5356
|
-
}
|
|
5357
|
-
|
|
5358
|
-
if (bestMatchLength < 0) {
|
|
5359
|
-
return string;
|
|
5360
|
-
}
|
|
5361
|
-
|
|
5362
|
-
return `${string.substring(0, bestMatchIndex)}::${string.substring(bestMatchIndex + bestMatchLength)}`;
|
|
5363
|
-
};
|
|
5364
|
-
|
|
5365
|
-
// Returns the address in compact, human-readable format like
|
|
5366
|
-
// 2001:db8:8:66::1
|
|
5367
|
-
// Calls toRFC5952String under the hood.
|
|
5368
|
-
IPv6.prototype.toString = function () {
|
|
5369
|
-
return this.toRFC5952String();
|
|
5370
|
-
};
|
|
5371
|
-
|
|
5372
|
-
return IPv6;
|
|
5373
|
-
|
|
5374
|
-
})();
|
|
5375
|
-
|
|
5376
|
-
// A utility function to return broadcast address given the IPv6 interface and prefix length in CIDR notation
|
|
5377
|
-
ipaddr.IPv6.broadcastAddressFromCIDR = function (string) {
|
|
5378
|
-
try {
|
|
5379
|
-
const cidr = this.parseCIDR(string);
|
|
5380
|
-
const ipInterfaceOctets = cidr[0].toByteArray();
|
|
5381
|
-
const subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
|
|
5382
|
-
const octets = [];
|
|
5383
|
-
let i = 0;
|
|
5384
|
-
while (i < 16) {
|
|
5385
|
-
// Broadcast address is bitwise OR between ip interface and inverted mask
|
|
5386
|
-
octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255);
|
|
5387
|
-
i++;
|
|
5388
|
-
}
|
|
5389
|
-
|
|
5390
|
-
return new this(octets);
|
|
5391
|
-
} catch (e) {
|
|
5392
|
-
throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`);
|
|
5393
|
-
}
|
|
5394
|
-
};
|
|
5395
|
-
|
|
5396
|
-
// Checks if a given string is formatted like IPv6 address.
|
|
5397
|
-
ipaddr.IPv6.isIPv6 = function (string) {
|
|
5398
|
-
return this.parser(string) !== null;
|
|
5399
|
-
};
|
|
5400
|
-
|
|
5401
|
-
// Checks to see if string is a valid IPv6 Address
|
|
5402
|
-
ipaddr.IPv6.isValid = function (string) {
|
|
5403
|
-
|
|
5404
|
-
// Since IPv6.isValid is always called first, this shortcut
|
|
5405
|
-
// provides a substantial performance gain.
|
|
5406
|
-
if (typeof string === 'string' && string.indexOf(':') === -1) {
|
|
5407
|
-
return false;
|
|
5408
|
-
}
|
|
5409
|
-
|
|
5410
|
-
try {
|
|
5411
|
-
const addr = this.parser(string);
|
|
5412
|
-
new this(addr.parts, addr.zoneId);
|
|
5413
|
-
return true;
|
|
5414
|
-
} catch (e) {
|
|
5415
|
-
return false;
|
|
5416
|
-
}
|
|
5417
|
-
};
|
|
5418
|
-
|
|
5419
|
-
// A utility function to return network address given the IPv6 interface and prefix length in CIDR notation
|
|
5420
|
-
ipaddr.IPv6.networkAddressFromCIDR = function (string) {
|
|
5421
|
-
let cidr, i, ipInterfaceOctets, octets, subnetMaskOctets;
|
|
5422
|
-
|
|
5423
|
-
try {
|
|
5424
|
-
cidr = this.parseCIDR(string);
|
|
5425
|
-
ipInterfaceOctets = cidr[0].toByteArray();
|
|
5426
|
-
subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
|
|
5427
|
-
octets = [];
|
|
5428
|
-
i = 0;
|
|
5429
|
-
while (i < 16) {
|
|
5430
|
-
// Network address is bitwise AND between ip interface and mask
|
|
5431
|
-
octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10));
|
|
5432
|
-
i++;
|
|
5433
|
-
}
|
|
5434
|
-
|
|
5435
|
-
return new this(octets);
|
|
5436
|
-
} catch (e) {
|
|
5437
|
-
throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`);
|
|
5438
|
-
}
|
|
5439
|
-
};
|
|
5440
|
-
|
|
5441
|
-
// Tries to parse and validate a string with IPv6 address.
|
|
5442
|
-
// Throws an error if it fails.
|
|
5443
|
-
ipaddr.IPv6.parse = function (string) {
|
|
5444
|
-
const addr = this.parser(string);
|
|
5445
|
-
|
|
5446
|
-
if (addr.parts === null) {
|
|
5447
|
-
throw new Error('ipaddr: string is not formatted like an IPv6 Address');
|
|
5448
|
-
}
|
|
5449
|
-
|
|
5450
|
-
return new this(addr.parts, addr.zoneId);
|
|
5451
|
-
};
|
|
5452
|
-
|
|
5453
|
-
ipaddr.IPv6.parseCIDR = function (string) {
|
|
5454
|
-
let maskLength, match, parsed;
|
|
5455
|
-
|
|
5456
|
-
if ((match = string.match(/^(.+)\/(\d+)$/))) {
|
|
5457
|
-
maskLength = parseInt(match[2]);
|
|
5458
|
-
if (maskLength >= 0 && maskLength <= 128) {
|
|
5459
|
-
parsed = [this.parse(match[1]), maskLength];
|
|
5460
|
-
Object.defineProperty(parsed, 'toString', {
|
|
5461
|
-
value: function () {
|
|
5462
|
-
return this.join('/');
|
|
5463
|
-
}
|
|
5464
|
-
});
|
|
5465
|
-
return parsed;
|
|
5466
|
-
}
|
|
5467
|
-
}
|
|
5468
|
-
|
|
5469
|
-
throw new Error('ipaddr: string is not formatted like an IPv6 CIDR range');
|
|
5470
|
-
};
|
|
5471
|
-
|
|
5472
|
-
// Parse an IPv6 address.
|
|
5473
|
-
ipaddr.IPv6.parser = function (string) {
|
|
5474
|
-
let addr, i, match, octet, octets, zoneId;
|
|
5475
|
-
|
|
5476
|
-
if ((match = string.match(ipv6Regexes.deprecatedTransitional))) {
|
|
5477
|
-
return this.parser(`::ffff:${match[1]}`);
|
|
5478
|
-
}
|
|
5479
|
-
if (ipv6Regexes.native.test(string)) {
|
|
5480
|
-
return expandIPv6(string, 8);
|
|
5481
|
-
}
|
|
5482
|
-
if ((match = string.match(ipv6Regexes.transitional))) {
|
|
5483
|
-
zoneId = match[6] || '';
|
|
5484
|
-
addr = expandIPv6(match[1].slice(0, -1) + zoneId, 6);
|
|
5485
|
-
if (addr.parts) {
|
|
5486
|
-
octets = [
|
|
5487
|
-
parseInt(match[2]),
|
|
5488
|
-
parseInt(match[3]),
|
|
5489
|
-
parseInt(match[4]),
|
|
5490
|
-
parseInt(match[5])
|
|
5491
|
-
];
|
|
5492
|
-
for (i = 0; i < octets.length; i++) {
|
|
5493
|
-
octet = octets[i];
|
|
5494
|
-
if (!((0 <= octet && octet <= 255))) {
|
|
5495
|
-
return null;
|
|
5496
|
-
}
|
|
5497
|
-
}
|
|
5498
|
-
|
|
5499
|
-
addr.parts.push(octets[0] << 8 | octets[1]);
|
|
5500
|
-
addr.parts.push(octets[2] << 8 | octets[3]);
|
|
5501
|
-
return {
|
|
5502
|
-
parts: addr.parts,
|
|
5503
|
-
zoneId: addr.zoneId
|
|
5504
|
-
};
|
|
4594
|
+
const Container = schemaItem.repeated === "sequence" ? Sequence : Set;
|
|
4595
|
+
asn1Item = new Container({
|
|
4596
|
+
value: items,
|
|
4597
|
+
});
|
|
4598
|
+
}
|
|
4599
|
+
else {
|
|
4600
|
+
asn1Item = this.toASN(objProp);
|
|
5505
4601
|
}
|
|
5506
4602
|
}
|
|
4603
|
+
return asn1Item;
|
|
4604
|
+
}
|
|
4605
|
+
}
|
|
5507
4606
|
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
ipaddr.IPv6.subnetMaskFromPrefixLength = function (prefix) {
|
|
5513
|
-
prefix = parseInt(prefix);
|
|
5514
|
-
if (prefix < 0 || prefix > 128) {
|
|
5515
|
-
throw new Error('ipaddr: invalid IPv6 prefix length');
|
|
4607
|
+
class AsnArray extends Array {
|
|
4608
|
+
constructor(items = []) {
|
|
4609
|
+
if (typeof items === "number") {
|
|
4610
|
+
super(items);
|
|
5516
4611
|
}
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
while (j < filledOctetCount) {
|
|
5523
|
-
octets[j] = 255;
|
|
5524
|
-
j++;
|
|
4612
|
+
else {
|
|
4613
|
+
super();
|
|
4614
|
+
for (const item of items) {
|
|
4615
|
+
this.push(item);
|
|
4616
|
+
}
|
|
5525
4617
|
}
|
|
4618
|
+
}
|
|
4619
|
+
}
|
|
5526
4620
|
|
|
5527
|
-
|
|
5528
|
-
|
|
4621
|
+
class AsnConvert {
|
|
4622
|
+
static serialize(obj) {
|
|
4623
|
+
return AsnSerializer.serialize(obj);
|
|
4624
|
+
}
|
|
4625
|
+
static parse(data, target) {
|
|
4626
|
+
return AsnParser.parse(data, target);
|
|
4627
|
+
}
|
|
4628
|
+
static toString(data) {
|
|
4629
|
+
const buf = buildExports.BufferSourceConverter.isBufferSource(data)
|
|
4630
|
+
? buildExports.BufferSourceConverter.toArrayBuffer(data)
|
|
4631
|
+
: AsnConvert.serialize(data);
|
|
4632
|
+
const asn = fromBER(buf);
|
|
4633
|
+
if (asn.offset === -1) {
|
|
4634
|
+
throw new Error(`Cannot decode ASN.1 data. ${asn.result.error}`);
|
|
5529
4635
|
}
|
|
4636
|
+
return asn.result.toString();
|
|
4637
|
+
}
|
|
4638
|
+
}
|
|
5530
4639
|
|
|
5531
|
-
|
|
5532
|
-
|
|
4640
|
+
/******************************************************************************
|
|
4641
|
+
Copyright (c) Microsoft Corporation.
|
|
5533
4642
|
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
const length = bytes.length;
|
|
4643
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
4644
|
+
purpose with or without fee is hereby granted.
|
|
5537
4645
|
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
4646
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
4647
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
4648
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
4649
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
4650
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
4651
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
4652
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
4653
|
+
***************************************************************************** */
|
|
4654
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
5546
4655
|
|
|
5547
|
-
// Checks if the address is valid IP address
|
|
5548
|
-
ipaddr.isValid = function (string) {
|
|
5549
|
-
return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string);
|
|
5550
|
-
};
|
|
5551
4656
|
|
|
4657
|
+
function __decorate$1(decorators, target, key, desc) {
|
|
4658
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4659
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4660
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4661
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4662
|
+
}
|
|
5552
4663
|
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
return ipaddr.IPv6.parse(string);
|
|
5558
|
-
} else if (ipaddr.IPv4.isValid(string)) {
|
|
5559
|
-
return ipaddr.IPv4.parse(string);
|
|
5560
|
-
} else {
|
|
5561
|
-
throw new Error('ipaddr: the address has neither IPv6 nor IPv4 format');
|
|
5562
|
-
}
|
|
5563
|
-
};
|
|
4664
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
4665
|
+
var e = new Error(message);
|
|
4666
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
4667
|
+
};
|
|
5564
4668
|
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
4669
|
+
class IpConverter {
|
|
4670
|
+
static isIPv4(ip) {
|
|
4671
|
+
return /^(\d{1,3}\.){3}\d{1,3}$/.test(ip);
|
|
4672
|
+
}
|
|
4673
|
+
static parseIPv4(ip) {
|
|
4674
|
+
const parts = ip.split(".");
|
|
4675
|
+
if (parts.length !== 4) {
|
|
4676
|
+
throw new Error("Invalid IPv4 address");
|
|
4677
|
+
}
|
|
4678
|
+
return parts.map((part) => {
|
|
4679
|
+
const num = parseInt(part, 10);
|
|
4680
|
+
if (isNaN(num) || num < 0 || num > 255) {
|
|
4681
|
+
throw new Error("Invalid IPv4 address part");
|
|
5575
4682
|
}
|
|
4683
|
+
return num;
|
|
4684
|
+
});
|
|
4685
|
+
}
|
|
4686
|
+
static parseIPv6(ip) {
|
|
4687
|
+
const expandedIP = this.expandIPv6(ip);
|
|
4688
|
+
const parts = expandedIP.split(":");
|
|
4689
|
+
if (parts.length !== 8) {
|
|
4690
|
+
throw new Error("Invalid IPv6 address");
|
|
5576
4691
|
}
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
return
|
|
5585
|
-
}
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
4692
|
+
return parts.reduce((bytes, part) => {
|
|
4693
|
+
const num = parseInt(part, 16);
|
|
4694
|
+
if (isNaN(num) || num < 0 || num > 0xffff) {
|
|
4695
|
+
throw new Error("Invalid IPv6 address part");
|
|
4696
|
+
}
|
|
4697
|
+
bytes.push((num >> 8) & 0xff);
|
|
4698
|
+
bytes.push(num & 0xff);
|
|
4699
|
+
return bytes;
|
|
4700
|
+
}, []);
|
|
4701
|
+
}
|
|
4702
|
+
static expandIPv6(ip) {
|
|
4703
|
+
if (!ip.includes("::")) {
|
|
4704
|
+
return ip;
|
|
4705
|
+
}
|
|
4706
|
+
const parts = ip.split("::");
|
|
4707
|
+
if (parts.length > 2) {
|
|
4708
|
+
throw new Error("Invalid IPv6 address");
|
|
4709
|
+
}
|
|
4710
|
+
const left = parts[0] ? parts[0].split(":") : [];
|
|
4711
|
+
const right = parts[1] ? parts[1].split(":") : [];
|
|
4712
|
+
const missing = 8 - (left.length + right.length);
|
|
4713
|
+
if (missing < 0) {
|
|
4714
|
+
throw new Error("Invalid IPv6 address");
|
|
4715
|
+
}
|
|
4716
|
+
return [...left, ...Array(missing).fill("0"), ...right].join(":");
|
|
4717
|
+
}
|
|
4718
|
+
static formatIPv6(bytes) {
|
|
4719
|
+
const parts = [];
|
|
4720
|
+
for (let i = 0; i < 16; i += 2) {
|
|
4721
|
+
parts.push(((bytes[i] << 8) | bytes[i + 1]).toString(16));
|
|
4722
|
+
}
|
|
4723
|
+
return this.compressIPv6(parts.join(":"));
|
|
4724
|
+
}
|
|
4725
|
+
static compressIPv6(ip) {
|
|
4726
|
+
const parts = ip.split(":");
|
|
4727
|
+
let longestZeroStart = -1;
|
|
4728
|
+
let longestZeroLength = 0;
|
|
4729
|
+
let currentZeroStart = -1;
|
|
4730
|
+
let currentZeroLength = 0;
|
|
4731
|
+
for (let i = 0; i < parts.length; i++) {
|
|
4732
|
+
if (parts[i] === "0") {
|
|
4733
|
+
if (currentZeroStart === -1) {
|
|
4734
|
+
currentZeroStart = i;
|
|
5606
4735
|
}
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
4736
|
+
currentZeroLength++;
|
|
4737
|
+
}
|
|
4738
|
+
else {
|
|
4739
|
+
if (currentZeroLength > longestZeroLength) {
|
|
4740
|
+
longestZeroStart = currentZeroStart;
|
|
4741
|
+
longestZeroLength = currentZeroLength;
|
|
5613
4742
|
}
|
|
4743
|
+
currentZeroStart = -1;
|
|
4744
|
+
currentZeroLength = 0;
|
|
5614
4745
|
}
|
|
5615
4746
|
}
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
4747
|
+
if (currentZeroLength > longestZeroLength) {
|
|
4748
|
+
longestZeroStart = currentZeroStart;
|
|
4749
|
+
longestZeroLength = currentZeroLength;
|
|
4750
|
+
}
|
|
4751
|
+
if (longestZeroLength > 1) {
|
|
4752
|
+
const before = parts.slice(0, longestZeroStart).join(":");
|
|
4753
|
+
const after = parts.slice(longestZeroStart + longestZeroLength).join(":");
|
|
4754
|
+
return `${before}::${after}`;
|
|
4755
|
+
}
|
|
4756
|
+
return ip;
|
|
4757
|
+
}
|
|
4758
|
+
static parseCIDR(text) {
|
|
4759
|
+
const [addr, prefixStr] = text.split("/");
|
|
4760
|
+
const prefix = parseInt(prefixStr, 10);
|
|
4761
|
+
if (this.isIPv4(addr)) {
|
|
4762
|
+
if (prefix < 0 || prefix > 32) {
|
|
4763
|
+
throw new Error("Invalid IPv4 prefix length");
|
|
4764
|
+
}
|
|
4765
|
+
return [this.parseIPv4(addr), prefix];
|
|
4766
|
+
}
|
|
4767
|
+
else {
|
|
4768
|
+
if (prefix < 0 || prefix > 128) {
|
|
4769
|
+
throw new Error("Invalid IPv6 prefix length");
|
|
4770
|
+
}
|
|
4771
|
+
return [this.parseIPv6(addr), prefix];
|
|
4772
|
+
}
|
|
5626
4773
|
}
|
|
5627
|
-
|
|
5628
|
-
}(commonjsGlobal));
|
|
5629
|
-
}(ipaddr));
|
|
5630
|
-
|
|
5631
|
-
class IpConverter {
|
|
5632
4774
|
static decodeIP(value) {
|
|
5633
4775
|
if (value.length === 64 && parseInt(value, 16) === 0) {
|
|
5634
4776
|
return "::/0";
|
|
@@ -5638,24 +4780,62 @@ class IpConverter {
|
|
|
5638
4780
|
}
|
|
5639
4781
|
const mask = parseInt(value.slice(8), 16)
|
|
5640
4782
|
.toString(2)
|
|
5641
|
-
.split(
|
|
5642
|
-
.reduce((a, k) => a +
|
|
5643
|
-
let ip = value.slice(0, 8)
|
|
5644
|
-
.replace(/(.{2})/g, match => `${parseInt(match, 16)}.`);
|
|
4783
|
+
.split("")
|
|
4784
|
+
.reduce((a, k) => a + +k, 0);
|
|
4785
|
+
let ip = value.slice(0, 8).replace(/(.{2})/g, (match) => `${parseInt(match, 16)}.`);
|
|
5645
4786
|
ip = ip.slice(0, -1);
|
|
5646
4787
|
return `${ip}/${mask}`;
|
|
5647
4788
|
}
|
|
5648
4789
|
static toString(buf) {
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
4790
|
+
const uint8 = new Uint8Array(buf);
|
|
4791
|
+
if (uint8.length === 4) {
|
|
4792
|
+
return Array.from(uint8).join(".");
|
|
4793
|
+
}
|
|
4794
|
+
if (uint8.length === 16) {
|
|
4795
|
+
return this.formatIPv6(uint8);
|
|
4796
|
+
}
|
|
4797
|
+
if (uint8.length === 8 || uint8.length === 32) {
|
|
4798
|
+
const half = uint8.length / 2;
|
|
4799
|
+
const addrBytes = uint8.slice(0, half);
|
|
4800
|
+
const maskBytes = uint8.slice(half);
|
|
4801
|
+
const isAllZeros = uint8.every((byte) => byte === 0);
|
|
4802
|
+
if (isAllZeros) {
|
|
4803
|
+
return uint8.length === 8 ? "0.0.0.0/0" : "::/0";
|
|
4804
|
+
}
|
|
4805
|
+
const prefixLen = maskBytes.reduce((a, b) => a + (b.toString(2).match(/1/g) || []).length, 0);
|
|
4806
|
+
if (uint8.length === 8) {
|
|
4807
|
+
const addrStr = Array.from(addrBytes).join(".");
|
|
4808
|
+
return `${addrStr}/${prefixLen}`;
|
|
4809
|
+
}
|
|
4810
|
+
else {
|
|
4811
|
+
const addrStr = this.formatIPv6(addrBytes);
|
|
4812
|
+
return `${addrStr}/${prefixLen}`;
|
|
4813
|
+
}
|
|
5653
4814
|
}
|
|
5654
|
-
return this.decodeIP(
|
|
4815
|
+
return this.decodeIP(buildExports.Convert.ToHex(buf));
|
|
5655
4816
|
}
|
|
5656
4817
|
static fromString(text) {
|
|
5657
|
-
|
|
5658
|
-
|
|
4818
|
+
if (text.includes("/")) {
|
|
4819
|
+
const [addr, prefix] = this.parseCIDR(text);
|
|
4820
|
+
const maskBytes = new Uint8Array(addr.length);
|
|
4821
|
+
let bitsLeft = prefix;
|
|
4822
|
+
for (let i = 0; i < maskBytes.length; i++) {
|
|
4823
|
+
if (bitsLeft >= 8) {
|
|
4824
|
+
maskBytes[i] = 0xff;
|
|
4825
|
+
bitsLeft -= 8;
|
|
4826
|
+
}
|
|
4827
|
+
else if (bitsLeft > 0) {
|
|
4828
|
+
maskBytes[i] = 0xff << (8 - bitsLeft);
|
|
4829
|
+
bitsLeft = 0;
|
|
4830
|
+
}
|
|
4831
|
+
}
|
|
4832
|
+
const out = new Uint8Array(addr.length * 2);
|
|
4833
|
+
out.set(addr, 0);
|
|
4834
|
+
out.set(maskBytes, addr.length);
|
|
4835
|
+
return out.buffer;
|
|
4836
|
+
}
|
|
4837
|
+
const bytes = this.isIPv4(text) ? this.parseIPv4(text) : this.parseIPv6(text);
|
|
4838
|
+
return new Uint8Array(bytes).buffer;
|
|
5659
4839
|
}
|
|
5660
4840
|
}
|
|
5661
4841
|
|
|
@@ -5665,8 +4845,12 @@ let DirectoryString = class DirectoryString {
|
|
|
5665
4845
|
Object.assign(this, params);
|
|
5666
4846
|
}
|
|
5667
4847
|
toString() {
|
|
5668
|
-
return this.bmpString ||
|
|
5669
|
-
|
|
4848
|
+
return (this.bmpString ||
|
|
4849
|
+
this.printableString ||
|
|
4850
|
+
this.teletexString ||
|
|
4851
|
+
this.universalString ||
|
|
4852
|
+
this.utf8String ||
|
|
4853
|
+
"");
|
|
5670
4854
|
}
|
|
5671
4855
|
};
|
|
5672
4856
|
__decorate$1([
|
|
@@ -5693,7 +4877,7 @@ let AttributeValue = class AttributeValue extends DirectoryString {
|
|
|
5693
4877
|
Object.assign(this, params);
|
|
5694
4878
|
}
|
|
5695
4879
|
toString() {
|
|
5696
|
-
return this.ia5String || (this.anyValue ?
|
|
4880
|
+
return this.ia5String || (this.anyValue ? buildExports.Convert.ToHex(this.anyValue) : super.toString());
|
|
5697
4881
|
}
|
|
5698
4882
|
};
|
|
5699
4883
|
__decorate$1([
|
|
@@ -5802,7 +4986,12 @@ __decorate$1([
|
|
|
5802
4986
|
AsnProp({ type: AsnPropTypes.IA5String, context: 6, implicit: true })
|
|
5803
4987
|
], GeneralName.prototype, "uniformResourceIdentifier", void 0);
|
|
5804
4988
|
__decorate$1([
|
|
5805
|
-
AsnProp({
|
|
4989
|
+
AsnProp({
|
|
4990
|
+
type: AsnPropTypes.OctetString,
|
|
4991
|
+
context: 7,
|
|
4992
|
+
implicit: true,
|
|
4993
|
+
converter: AsnIpConverter,
|
|
4994
|
+
})
|
|
5806
4995
|
], GeneralName.prototype, "iPAddress", void 0);
|
|
5807
4996
|
__decorate$1([
|
|
5808
4997
|
AsnProp({ type: AsnPropTypes.ObjectIdentifier, context: 8, implicit: true })
|
|
@@ -6136,19 +5325,39 @@ __decorate$1([
|
|
|
6136
5325
|
AsnProp({ type: DistributionPointName, context: 0, optional: true })
|
|
6137
5326
|
], IssuingDistributionPoint.prototype, "distributionPoint", void 0);
|
|
6138
5327
|
__decorate$1([
|
|
6139
|
-
AsnProp({
|
|
5328
|
+
AsnProp({
|
|
5329
|
+
type: AsnPropTypes.Boolean,
|
|
5330
|
+
context: 1,
|
|
5331
|
+
defaultValue: IssuingDistributionPoint.ONLY,
|
|
5332
|
+
implicit: true,
|
|
5333
|
+
})
|
|
6140
5334
|
], IssuingDistributionPoint.prototype, "onlyContainsUserCerts", void 0);
|
|
6141
5335
|
__decorate$1([
|
|
6142
|
-
AsnProp({
|
|
5336
|
+
AsnProp({
|
|
5337
|
+
type: AsnPropTypes.Boolean,
|
|
5338
|
+
context: 2,
|
|
5339
|
+
defaultValue: IssuingDistributionPoint.ONLY,
|
|
5340
|
+
implicit: true,
|
|
5341
|
+
})
|
|
6143
5342
|
], IssuingDistributionPoint.prototype, "onlyContainsCACerts", void 0);
|
|
6144
5343
|
__decorate$1([
|
|
6145
5344
|
AsnProp({ type: Reason, context: 3, optional: true, implicit: true })
|
|
6146
5345
|
], IssuingDistributionPoint.prototype, "onlySomeReasons", void 0);
|
|
6147
5346
|
__decorate$1([
|
|
6148
|
-
AsnProp({
|
|
5347
|
+
AsnProp({
|
|
5348
|
+
type: AsnPropTypes.Boolean,
|
|
5349
|
+
context: 4,
|
|
5350
|
+
defaultValue: IssuingDistributionPoint.ONLY,
|
|
5351
|
+
implicit: true,
|
|
5352
|
+
})
|
|
6149
5353
|
], IssuingDistributionPoint.prototype, "indirectCRL", void 0);
|
|
6150
5354
|
__decorate$1([
|
|
6151
|
-
AsnProp({
|
|
5355
|
+
AsnProp({
|
|
5356
|
+
type: AsnPropTypes.Boolean,
|
|
5357
|
+
context: 5,
|
|
5358
|
+
defaultValue: IssuingDistributionPoint.ONLY,
|
|
5359
|
+
implicit: true,
|
|
5360
|
+
})
|
|
6152
5361
|
], IssuingDistributionPoint.prototype, "onlyContainsAttributeCerts", void 0);
|
|
6153
5362
|
|
|
6154
5363
|
const id_ce_cRLReasons = `${id_ce}.21`;
|
|
@@ -6335,13 +5544,19 @@ class PolicyConstraints {
|
|
|
6335
5544
|
}
|
|
6336
5545
|
__decorate$1([
|
|
6337
5546
|
AsnProp({
|
|
6338
|
-
type: AsnPropTypes.Integer,
|
|
5547
|
+
type: AsnPropTypes.Integer,
|
|
5548
|
+
context: 0,
|
|
5549
|
+
implicit: true,
|
|
5550
|
+
optional: true,
|
|
6339
5551
|
converter: AsnIntegerArrayBufferConverter,
|
|
6340
5552
|
})
|
|
6341
5553
|
], PolicyConstraints.prototype, "requireExplicitPolicy", void 0);
|
|
6342
5554
|
__decorate$1([
|
|
6343
5555
|
AsnProp({
|
|
6344
|
-
type: AsnPropTypes.Integer,
|
|
5556
|
+
type: AsnPropTypes.Integer,
|
|
5557
|
+
context: 1,
|
|
5558
|
+
implicit: true,
|
|
5559
|
+
optional: true,
|
|
6345
5560
|
converter: AsnIntegerArrayBufferConverter,
|
|
6346
5561
|
})
|
|
6347
5562
|
], PolicyConstraints.prototype, "inhibitPolicyMapping", void 0);
|
|
@@ -6383,13 +5598,13 @@ SubjectAlternativeName = SubjectAlternativeName_1 = __decorate$1([
|
|
|
6383
5598
|
AsnType({ type: AsnTypeTypes.Sequence })
|
|
6384
5599
|
], SubjectAlternativeName);
|
|
6385
5600
|
|
|
6386
|
-
|
|
5601
|
+
let Attribute$1 = class Attribute {
|
|
6387
5602
|
constructor(params = {}) {
|
|
6388
5603
|
this.type = "";
|
|
6389
5604
|
this.values = [];
|
|
6390
5605
|
Object.assign(this, params);
|
|
6391
5606
|
}
|
|
6392
|
-
}
|
|
5607
|
+
};
|
|
6393
5608
|
__decorate$1([
|
|
6394
5609
|
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
|
|
6395
5610
|
], Attribute$1.prototype, "type", void 0);
|
|
@@ -6423,7 +5638,7 @@ __decorate$1([
|
|
|
6423
5638
|
AsnProp({ type: AsnPropTypes.GeneralizedTime, context: 0, implicit: true, optional: true })
|
|
6424
5639
|
], PrivateKeyUsagePeriod.prototype, "notBefore", void 0);
|
|
6425
5640
|
__decorate$1([
|
|
6426
|
-
AsnProp({ type: AsnPropTypes.GeneralizedTime, context: 1, implicit: true, optional: true
|
|
5641
|
+
AsnProp({ type: AsnPropTypes.GeneralizedTime, context: 1, implicit: true, optional: true })
|
|
6427
5642
|
], PrivateKeyUsagePeriod.prototype, "notAfter", void 0);
|
|
6428
5643
|
|
|
6429
5644
|
const id_entrust_entrustVersInfo = "1.2.840.113533.7.65.0";
|
|
@@ -6454,7 +5669,7 @@ class EntrustInfo extends BitString {
|
|
|
6454
5669
|
}
|
|
6455
5670
|
class EntrustVersionInfo {
|
|
6456
5671
|
constructor(params = {}) {
|
|
6457
|
-
this.entrustVers =
|
|
5672
|
+
this.entrustVers = "";
|
|
6458
5673
|
this.entrustInfoFlags = new EntrustInfo();
|
|
6459
5674
|
Object.assign(this, params);
|
|
6460
5675
|
}
|
|
@@ -6484,12 +5699,12 @@ class AlgorithmIdentifier {
|
|
|
6484
5699
|
Object.assign(this, params);
|
|
6485
5700
|
}
|
|
6486
5701
|
isEqual(data) {
|
|
6487
|
-
return data instanceof AlgorithmIdentifier
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
||
|
|
6492
|
-
|
|
5702
|
+
return (data instanceof AlgorithmIdentifier &&
|
|
5703
|
+
data.algorithm == this.algorithm &&
|
|
5704
|
+
((data.parameters &&
|
|
5705
|
+
this.parameters &&
|
|
5706
|
+
buildExports.isEqual(data.parameters, this.parameters)) ||
|
|
5707
|
+
data.parameters === this.parameters));
|
|
6493
5708
|
}
|
|
6494
5709
|
}
|
|
6495
5710
|
__decorate$1([
|
|
@@ -6575,14 +5790,14 @@ __decorate$1([
|
|
|
6575
5790
|
], Validity.prototype, "notAfter", void 0);
|
|
6576
5791
|
|
|
6577
5792
|
var Extensions_1;
|
|
6578
|
-
|
|
5793
|
+
let Extension$1 = class Extension {
|
|
6579
5794
|
constructor(params = {}) {
|
|
6580
5795
|
this.extnID = "";
|
|
6581
|
-
this.critical = Extension
|
|
5796
|
+
this.critical = Extension.CRITICAL;
|
|
6582
5797
|
this.extnValue = new OctetString();
|
|
6583
5798
|
Object.assign(this, params);
|
|
6584
5799
|
}
|
|
6585
|
-
}
|
|
5800
|
+
};
|
|
6586
5801
|
Extension$1.CRITICAL = false;
|
|
6587
5802
|
__decorate$1([
|
|
6588
5803
|
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
|
|
@@ -6924,7 +6139,10 @@ const mgf1SHA1 = new AlgorithmIdentifier({
|
|
|
6924
6139
|
});
|
|
6925
6140
|
const pSpecifiedEmpty = new AlgorithmIdentifier({
|
|
6926
6141
|
algorithm: id_pSpecified,
|
|
6927
|
-
parameters: AsnConvert.serialize(AsnOctetStringConverter.toASN(new Uint8Array([
|
|
6142
|
+
parameters: AsnConvert.serialize(AsnOctetStringConverter.toASN(new Uint8Array([
|
|
6143
|
+
0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d, 0x32, 0x55, 0xbf, 0xef, 0x95, 0x60, 0x18,
|
|
6144
|
+
0x90, 0xaf, 0xd8, 0x07, 0x09,
|
|
6145
|
+
]).buffer)),
|
|
6928
6146
|
});
|
|
6929
6147
|
create(id_rsaEncryption);
|
|
6930
6148
|
create(id_md2WithRSAEncryption);
|
|
@@ -7115,13 +6333,13 @@ CompositeSignatureValue = CompositeSignatureValue_1 = __decorate$1([
|
|
|
7115
6333
|
|
|
7116
6334
|
class EncryptedData extends OctetString {
|
|
7117
6335
|
}
|
|
7118
|
-
|
|
6336
|
+
let EncryptedPrivateKeyInfo$1 = class EncryptedPrivateKeyInfo {
|
|
7119
6337
|
constructor(params = {}) {
|
|
7120
6338
|
this.encryptionAlgorithm = new AlgorithmIdentifier();
|
|
7121
6339
|
this.encryptedData = new EncryptedData();
|
|
7122
6340
|
Object.assign(this, params);
|
|
7123
6341
|
}
|
|
7124
|
-
}
|
|
6342
|
+
};
|
|
7125
6343
|
__decorate$1([
|
|
7126
6344
|
AsnProp({ type: AlgorithmIdentifier })
|
|
7127
6345
|
], EncryptedPrivateKeyInfo$1.prototype, "encryptionAlgorithm", void 0);
|
|
@@ -7145,14 +6363,14 @@ let Attributes$1 = Attributes_1$1 = class Attributes extends AsnArray {
|
|
|
7145
6363
|
Attributes$1 = Attributes_1$1 = __decorate$1([
|
|
7146
6364
|
AsnType({ type: AsnTypeTypes.Sequence, itemType: Attribute$1 })
|
|
7147
6365
|
], Attributes$1);
|
|
7148
|
-
|
|
6366
|
+
let PrivateKeyInfo$1 = class PrivateKeyInfo {
|
|
7149
6367
|
constructor(params = {}) {
|
|
7150
6368
|
this.version = Version$3.v1;
|
|
7151
6369
|
this.privateKeyAlgorithm = new AlgorithmIdentifier();
|
|
7152
6370
|
this.privateKey = new PrivateKey();
|
|
7153
6371
|
Object.assign(this, params);
|
|
7154
6372
|
}
|
|
7155
|
-
}
|
|
6373
|
+
};
|
|
7156
6374
|
__decorate$1([
|
|
7157
6375
|
AsnProp({ type: AsnPropTypes.Integer })
|
|
7158
6376
|
], PrivateKeyInfo$1.prototype, "version", void 0);
|
|
@@ -7243,43 +6461,41 @@ CompositePrivateKey = CompositePrivateKey_1 = __decorate$1([
|
|
|
7243
6461
|
AsnType({ type: AsnTypeTypes.Sequence, itemType: OneAsymmetricKey })
|
|
7244
6462
|
], CompositePrivateKey);
|
|
7245
6463
|
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
window.atob(value);
|
|
7261
|
-
return true;
|
|
7262
|
-
}
|
|
7263
|
-
catch (error) {
|
|
7264
|
-
return false;
|
|
7265
|
-
}
|
|
7266
|
-
};
|
|
6464
|
+
var dayjs_min$1 = {exports: {}};
|
|
6465
|
+
|
|
6466
|
+
var dayjs_min = dayjs_min$1.exports;
|
|
6467
|
+
|
|
6468
|
+
var hasRequiredDayjs_min;
|
|
6469
|
+
|
|
6470
|
+
function requireDayjs_min () {
|
|
6471
|
+
if (hasRequiredDayjs_min) return dayjs_min$1.exports;
|
|
6472
|
+
hasRequiredDayjs_min = 1;
|
|
6473
|
+
(function (module, exports) {
|
|
6474
|
+
!function(t,e){module.exports=e();}(dayjs_min,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,true),this.parse(t),this.$x=this.$x||t.x||{},this[p]=true;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,false)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case "YY":return String(e.$y).slice(-2);case "YYYY":return b.s(e.$y,4,"0");case "M":return a+1;case "MM":return b.s(a+1,2,"0");case "MMM":return h(n.monthsShort,a,c,3);case "MMMM":return h(c,a);case "D":return e.$D;case "DD":return b.s(e.$D,2,"0");case "d":return String(e.$W);case "dd":return h(n.weekdaysMin,e.$W,o,2);case "ddd":return h(n.weekdaysShort,e.$W,o,3);case "dddd":return o[e.$W];case "H":return String(s);case "HH":return b.s(s,2,"0");case "h":return d(1);case "hh":return d(2);case "a":return $(s,u,true);case "A":return $(s,u,false);case "m":return String(u);case "mm":return b.s(u,2,"0");case "s":return String(e.$s);case "ss":return b.s(e.$s,2,"0");case "SSS":return b.s(e.$ms,3,"0");case "Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,true);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=true),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
|
|
6475
|
+
} (dayjs_min$1));
|
|
6476
|
+
return dayjs_min$1.exports;
|
|
6477
|
+
}
|
|
7267
6478
|
|
|
7268
|
-
var
|
|
6479
|
+
var dayjs_minExports = requireDayjs_min();
|
|
6480
|
+
var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
|
|
7269
6481
|
|
|
7270
|
-
|
|
7271
|
-
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
|
|
7272
|
-
}(dayjs_min));
|
|
6482
|
+
var relativeTime$2 = {exports: {}};
|
|
7273
6483
|
|
|
7274
|
-
|
|
6484
|
+
var relativeTime$1 = relativeTime$2.exports;
|
|
7275
6485
|
|
|
7276
|
-
var
|
|
6486
|
+
var hasRequiredRelativeTime;
|
|
7277
6487
|
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
6488
|
+
function requireRelativeTime () {
|
|
6489
|
+
if (hasRequiredRelativeTime) return relativeTime$2.exports;
|
|
6490
|
+
hasRequiredRelativeTime = 1;
|
|
6491
|
+
(function (module, exports) {
|
|
6492
|
+
!function(r,e){module.exports=e();}(relativeTime$1,(function(){return function(r,e,t){r=r||{};var n=e.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(r,e,t,o){return n.fromToBase(r,e,t,o)}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(f=d?t(e).diff(i,y.d,true):i.diff(e,y.d,true));var p=(r.rounding||Math.round)(Math.abs(f));if(s=f>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(""+p)),a="string"==typeof v?v.replace("%d",p):v(p,n,y.l,s);break}}if(n)return a;var M=s?l.future:l.past;return "function"==typeof M?M(a):M.replace("%s",a)},n.to=function(r,e){return i(r,e,this,true)},n.from=function(r,e){return i(r,e,this)};var d=function(r){return r.$u?t.utc():t()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)};}}));
|
|
6493
|
+
} (relativeTime$2));
|
|
6494
|
+
return relativeTime$2.exports;
|
|
6495
|
+
}
|
|
7281
6496
|
|
|
7282
|
-
|
|
6497
|
+
var relativeTimeExports = requireRelativeTime();
|
|
6498
|
+
var relativeTime = /*@__PURE__*/getDefaultExportFromCjs(relativeTimeExports);
|
|
7283
6499
|
|
|
7284
6500
|
/**
|
|
7285
6501
|
* @license
|
|
@@ -7344,7 +6560,7 @@ const crlEntryExtensions = "CRL Entry Extensions";
|
|
|
7344
6560
|
const previewCertificate = "Preview certificate";
|
|
7345
6561
|
const viewDetails = "View details";
|
|
7346
6562
|
const downloadOptions = "Download options";
|
|
7347
|
-
|
|
6563
|
+
var en = {
|
|
7348
6564
|
basicInformation: basicInformation,
|
|
7349
6565
|
subjectName: subjectName,
|
|
7350
6566
|
issuerName: issuerName,
|
|
@@ -9498,6 +8714,9 @@ const OIDs = {
|
|
|
9498
8714
|
'2.16.840.1.101.3.4.2.4': 'SHA-224',
|
|
9499
8715
|
'2.16.840.1.101.3.4.3.1': 'DSA with Sha224',
|
|
9500
8716
|
'2.16.840.1.101.3.4.3.2': 'DSA with Sha256',
|
|
8717
|
+
'2.16.840.1.101.3.4.3.17': 'ML-DSA-44',
|
|
8718
|
+
'2.16.840.1.101.3.4.3.18': 'ML-DSA-65',
|
|
8719
|
+
'2.16.840.1.101.3.4.3.19': 'ML-DSA-87',
|
|
9501
8720
|
'2.16.840.1.113719.1.2.8': 'Novell Algorithm',
|
|
9502
8721
|
'2.16.840.1.113719.1.2.8.22': 'DES Cbc IV8',
|
|
9503
8722
|
'2.16.840.1.113719.1.2.8.23': 'DES Cbc Pad IV8',
|
|
@@ -9805,7 +9024,7 @@ var _Name_asn;
|
|
|
9805
9024
|
class Name {
|
|
9806
9025
|
constructor(data) {
|
|
9807
9026
|
_Name_asn.set(this, new Name$1());
|
|
9808
|
-
if (
|
|
9027
|
+
if (buildExports.BufferSourceConverter.isBufferSource(data)) {
|
|
9809
9028
|
__classPrivateFieldSet$1(this, _Name_asn, AsnParser.parse(data, Name$1), "f");
|
|
9810
9029
|
}
|
|
9811
9030
|
else {
|
|
@@ -10013,8 +9232,8 @@ let CaVersion = class CaVersion {
|
|
|
10013
9232
|
data.set(new Uint8Array(this.value), 4 - this.value.byteLength);
|
|
10014
9233
|
}
|
|
10015
9234
|
return {
|
|
10016
|
-
keyIndex: parseInt(
|
|
10017
|
-
certificateIndex: parseInt(
|
|
9235
|
+
keyIndex: parseInt(buildExports.Convert.ToHex(data.slice(0, 2)), 16),
|
|
9236
|
+
certificateIndex: parseInt(buildExports.Convert.ToHex(data.slice(2)), 16),
|
|
10018
9237
|
};
|
|
10019
9238
|
}
|
|
10020
9239
|
};
|
|
@@ -10435,7 +9654,7 @@ class ByteStream {
|
|
|
10435
9654
|
}
|
|
10436
9655
|
constructor(bytes) {
|
|
10437
9656
|
this.offset = 0;
|
|
10438
|
-
this.view =
|
|
9657
|
+
this.view = buildExports.BufferSourceConverter.toUint8Array(bytes);
|
|
10439
9658
|
}
|
|
10440
9659
|
read(size = 1) {
|
|
10441
9660
|
const res = this.view.slice(this.offset, this.offset + size);
|
|
@@ -10451,7 +9670,7 @@ class ByteStream {
|
|
|
10451
9670
|
}
|
|
10452
9671
|
readNumber(size) {
|
|
10453
9672
|
const bytes = this.read(size);
|
|
10454
|
-
const hex =
|
|
9673
|
+
const hex = buildExports.Convert.ToHex(bytes);
|
|
10455
9674
|
return parseInt(hex, 16);
|
|
10456
9675
|
}
|
|
10457
9676
|
readEnd() {
|
|
@@ -10464,7 +9683,7 @@ class ByteStream {
|
|
|
10464
9683
|
|
|
10465
9684
|
class Structure {
|
|
10466
9685
|
static createStream(bytes) {
|
|
10467
|
-
const view =
|
|
9686
|
+
const view = buildExports.BufferSourceConverter.toUint8Array(bytes);
|
|
10468
9687
|
return new ByteStream(view);
|
|
10469
9688
|
}
|
|
10470
9689
|
}
|
|
@@ -10508,7 +9727,7 @@ class SignedCertificateTimestamp extends Structure {
|
|
|
10508
9727
|
parse(stream) {
|
|
10509
9728
|
this.version = stream.readByte();
|
|
10510
9729
|
stream.read(2);
|
|
10511
|
-
this.logId =
|
|
9730
|
+
this.logId = buildExports.BufferSourceConverter.toArrayBuffer(stream.read(32));
|
|
10512
9731
|
this.timestamp = new Date(stream.readNumber(8));
|
|
10513
9732
|
const extLen = stream.readNumber(2);
|
|
10514
9733
|
this.extensions = stream.read(extLen).buffer;
|
|
@@ -10519,12 +9738,12 @@ class SignedCertificateTimestamp extends Structure {
|
|
|
10519
9738
|
toJSON() {
|
|
10520
9739
|
return {
|
|
10521
9740
|
version: this.version,
|
|
10522
|
-
logId:
|
|
9741
|
+
logId: buildExports.Convert.ToHex(this.logId),
|
|
10523
9742
|
timestamp: this.timestamp,
|
|
10524
|
-
extensions:
|
|
9743
|
+
extensions: buildExports.Convert.ToBase64(this.extensions),
|
|
10525
9744
|
hashAlgorithm: HashAlgorithm[this.hashAlgorithm] || "undefined",
|
|
10526
9745
|
signatureAlgorithm: SignatureAlgorithm[this.signatureAlgorithm] || "undefined",
|
|
10527
|
-
signature:
|
|
9746
|
+
signature: buildExports.Convert.ToBase64(this.signature),
|
|
10528
9747
|
};
|
|
10529
9748
|
}
|
|
10530
9749
|
}
|
|
@@ -10546,7 +9765,7 @@ class CertificateTransparency extends OctetString {
|
|
|
10546
9765
|
return this;
|
|
10547
9766
|
}
|
|
10548
9767
|
toJSON() {
|
|
10549
|
-
return this.items.map(o => o.toJSON());
|
|
9768
|
+
return this.items.map((o) => o.toJSON());
|
|
10550
9769
|
}
|
|
10551
9770
|
}
|
|
10552
9771
|
|
|
@@ -10690,7 +9909,12 @@ class LogotypeImageInfo {
|
|
|
10690
9909
|
}
|
|
10691
9910
|
}
|
|
10692
9911
|
__decorate$1([
|
|
10693
|
-
AsnProp({
|
|
9912
|
+
AsnProp({
|
|
9913
|
+
type: AsnPropTypes.Integer,
|
|
9914
|
+
context: 0,
|
|
9915
|
+
implicit: true,
|
|
9916
|
+
defaultValue: LogotypeImageType.color,
|
|
9917
|
+
})
|
|
10694
9918
|
], LogotypeImageInfo.prototype, "type", void 0);
|
|
10695
9919
|
__decorate$1([
|
|
10696
9920
|
AsnProp({ type: AsnPropTypes.Integer })
|
|
@@ -10808,7 +10032,7 @@ let JWTClaimNames = JWTClaimNames_1 = class JWTClaimNames extends AsnArray {
|
|
|
10808
10032
|
JWTClaimNames = JWTClaimNames_1 = __decorate$1([
|
|
10809
10033
|
AsnType({
|
|
10810
10034
|
type: AsnTypeTypes.Sequence,
|
|
10811
|
-
itemType: AsnPropTypes.IA5String
|
|
10035
|
+
itemType: AsnPropTypes.IA5String,
|
|
10812
10036
|
})
|
|
10813
10037
|
], JWTClaimNames);
|
|
10814
10038
|
class JWTClaimPermittedValues {
|
|
@@ -10838,7 +10062,7 @@ let JWTClaimPermittedValuesList = JWTClaimPermittedValuesList_1 = class JWTClaim
|
|
|
10838
10062
|
JWTClaimPermittedValuesList = JWTClaimPermittedValuesList_1 = __decorate$1([
|
|
10839
10063
|
AsnType({
|
|
10840
10064
|
type: AsnTypeTypes.Sequence,
|
|
10841
|
-
itemType: JWTClaimPermittedValues
|
|
10065
|
+
itemType: JWTClaimPermittedValues,
|
|
10842
10066
|
})
|
|
10843
10067
|
], JWTClaimPermittedValuesList);
|
|
10844
10068
|
class JWTClaimConstraints {
|
|
@@ -11080,6 +10304,12 @@ __decorate$1([
|
|
|
11080
10304
|
__decorate$1([
|
|
11081
10305
|
AsnProp({ context: 720, type: AsnPropTypes.Null, optional: true })
|
|
11082
10306
|
], AuthorizationList.prototype, "deviceUniqueAttestation", void 0);
|
|
10307
|
+
__decorate$1([
|
|
10308
|
+
AsnProp({ context: 723, type: OctetString, optional: true })
|
|
10309
|
+
], AuthorizationList.prototype, "attestationIdSecondImei", void 0);
|
|
10310
|
+
__decorate$1([
|
|
10311
|
+
AsnProp({ context: 724, type: OctetString, optional: true })
|
|
10312
|
+
], AuthorizationList.prototype, "moduleHash", void 0);
|
|
11083
10313
|
var SecurityLevel;
|
|
11084
10314
|
(function (SecurityLevel) {
|
|
11085
10315
|
SecurityLevel[SecurityLevel["software"] = 0] = "software";
|
|
@@ -11094,6 +10324,8 @@ var Version;
|
|
|
11094
10324
|
Version[Version["KM4_1"] = 4] = "KM4_1";
|
|
11095
10325
|
Version[Version["keyMint1"] = 100] = "keyMint1";
|
|
11096
10326
|
Version[Version["keyMint2"] = 200] = "keyMint2";
|
|
10327
|
+
Version[Version["keyMint3"] = 300] = "keyMint3";
|
|
10328
|
+
Version[Version["keyMint4"] = 400] = "keyMint4";
|
|
11097
10329
|
})(Version || (Version = {}));
|
|
11098
10330
|
class KeyDescription {
|
|
11099
10331
|
constructor(params = {}) {
|
|
@@ -11132,6 +10364,67 @@ __decorate$1([
|
|
|
11132
10364
|
__decorate$1([
|
|
11133
10365
|
AsnProp({ type: AuthorizationList })
|
|
11134
10366
|
], KeyDescription.prototype, "teeEnforced", void 0);
|
|
10367
|
+
class KeyMintKeyDescription {
|
|
10368
|
+
constructor(params = {}) {
|
|
10369
|
+
this.attestationVersion = Version.keyMint4;
|
|
10370
|
+
this.attestationSecurityLevel = SecurityLevel.software;
|
|
10371
|
+
this.keyMintVersion = 0;
|
|
10372
|
+
this.keyMintSecurityLevel = SecurityLevel.software;
|
|
10373
|
+
this.attestationChallenge = new OctetString();
|
|
10374
|
+
this.uniqueId = new OctetString();
|
|
10375
|
+
this.softwareEnforced = new AuthorizationList();
|
|
10376
|
+
this.hardwareEnforced = new AuthorizationList();
|
|
10377
|
+
Object.assign(this, params);
|
|
10378
|
+
}
|
|
10379
|
+
toLegacyKeyDescription() {
|
|
10380
|
+
return new KeyDescription({
|
|
10381
|
+
attestationVersion: this.attestationVersion,
|
|
10382
|
+
attestationSecurityLevel: this.attestationSecurityLevel,
|
|
10383
|
+
keymasterVersion: this.keyMintVersion,
|
|
10384
|
+
keymasterSecurityLevel: this.keyMintSecurityLevel,
|
|
10385
|
+
attestationChallenge: this.attestationChallenge,
|
|
10386
|
+
uniqueId: this.uniqueId,
|
|
10387
|
+
softwareEnforced: this.softwareEnforced,
|
|
10388
|
+
teeEnforced: this.hardwareEnforced,
|
|
10389
|
+
});
|
|
10390
|
+
}
|
|
10391
|
+
static fromLegacyKeyDescription(keyDesc) {
|
|
10392
|
+
return new KeyMintKeyDescription({
|
|
10393
|
+
attestationVersion: keyDesc.attestationVersion,
|
|
10394
|
+
attestationSecurityLevel: keyDesc.attestationSecurityLevel,
|
|
10395
|
+
keyMintVersion: keyDesc.keymasterVersion,
|
|
10396
|
+
keyMintSecurityLevel: keyDesc.keymasterSecurityLevel,
|
|
10397
|
+
attestationChallenge: keyDesc.attestationChallenge,
|
|
10398
|
+
uniqueId: keyDesc.uniqueId,
|
|
10399
|
+
softwareEnforced: keyDesc.softwareEnforced,
|
|
10400
|
+
hardwareEnforced: keyDesc.teeEnforced,
|
|
10401
|
+
});
|
|
10402
|
+
}
|
|
10403
|
+
}
|
|
10404
|
+
__decorate$1([
|
|
10405
|
+
AsnProp({ type: AsnPropTypes.Integer })
|
|
10406
|
+
], KeyMintKeyDescription.prototype, "attestationVersion", void 0);
|
|
10407
|
+
__decorate$1([
|
|
10408
|
+
AsnProp({ type: AsnPropTypes.Enumerated })
|
|
10409
|
+
], KeyMintKeyDescription.prototype, "attestationSecurityLevel", void 0);
|
|
10410
|
+
__decorate$1([
|
|
10411
|
+
AsnProp({ type: AsnPropTypes.Integer })
|
|
10412
|
+
], KeyMintKeyDescription.prototype, "keyMintVersion", void 0);
|
|
10413
|
+
__decorate$1([
|
|
10414
|
+
AsnProp({ type: AsnPropTypes.Enumerated })
|
|
10415
|
+
], KeyMintKeyDescription.prototype, "keyMintSecurityLevel", void 0);
|
|
10416
|
+
__decorate$1([
|
|
10417
|
+
AsnProp({ type: OctetString })
|
|
10418
|
+
], KeyMintKeyDescription.prototype, "attestationChallenge", void 0);
|
|
10419
|
+
__decorate$1([
|
|
10420
|
+
AsnProp({ type: OctetString })
|
|
10421
|
+
], KeyMintKeyDescription.prototype, "uniqueId", void 0);
|
|
10422
|
+
__decorate$1([
|
|
10423
|
+
AsnProp({ type: AuthorizationList })
|
|
10424
|
+
], KeyMintKeyDescription.prototype, "softwareEnforced", void 0);
|
|
10425
|
+
__decorate$1([
|
|
10426
|
+
AsnProp({ type: AuthorizationList })
|
|
10427
|
+
], KeyMintKeyDescription.prototype, "hardwareEnforced", void 0);
|
|
11135
10428
|
|
|
11136
10429
|
var NonStandardAuthorizationList_1;
|
|
11137
10430
|
let NonStandardAuthorization = class NonStandardAuthorization extends AuthorizationList {
|
|
@@ -11145,7 +10438,7 @@ let NonStandardAuthorizationList = NonStandardAuthorizationList_1 = class NonSta
|
|
|
11145
10438
|
Object.setPrototypeOf(this, NonStandardAuthorizationList_1.prototype);
|
|
11146
10439
|
}
|
|
11147
10440
|
findProperty(key) {
|
|
11148
|
-
const prop = this.find((o => key in o)
|
|
10441
|
+
const prop = this.find((o) => key in o);
|
|
11149
10442
|
if (prop) {
|
|
11150
10443
|
return prop[key];
|
|
11151
10444
|
}
|
|
@@ -11156,6 +10449,24 @@ NonStandardAuthorizationList = NonStandardAuthorizationList_1 = __decorate$1([
|
|
|
11156
10449
|
AsnType({ type: AsnTypeTypes.Sequence, itemType: NonStandardAuthorization })
|
|
11157
10450
|
], NonStandardAuthorizationList);
|
|
11158
10451
|
class NonStandardKeyDescription {
|
|
10452
|
+
get keyMintVersion() {
|
|
10453
|
+
return this.keymasterVersion;
|
|
10454
|
+
}
|
|
10455
|
+
set keyMintVersion(value) {
|
|
10456
|
+
this.keymasterVersion = value;
|
|
10457
|
+
}
|
|
10458
|
+
get keyMintSecurityLevel() {
|
|
10459
|
+
return this.keymasterSecurityLevel;
|
|
10460
|
+
}
|
|
10461
|
+
set keyMintSecurityLevel(value) {
|
|
10462
|
+
this.keymasterSecurityLevel = value;
|
|
10463
|
+
}
|
|
10464
|
+
get hardwareEnforced() {
|
|
10465
|
+
return this.teeEnforced;
|
|
10466
|
+
}
|
|
10467
|
+
set hardwareEnforced(value) {
|
|
10468
|
+
this.teeEnforced = value;
|
|
10469
|
+
}
|
|
11159
10470
|
constructor(params = {}) {
|
|
11160
10471
|
this.attestationVersion = Version.KM4;
|
|
11161
10472
|
this.attestationSecurityLevel = SecurityLevel.software;
|
|
@@ -11192,6 +10503,23 @@ __decorate$1([
|
|
|
11192
10503
|
__decorate$1([
|
|
11193
10504
|
AsnProp({ type: NonStandardAuthorizationList })
|
|
11194
10505
|
], NonStandardKeyDescription.prototype, "teeEnforced", void 0);
|
|
10506
|
+
let NonStandardKeyMintKeyDescription = class NonStandardKeyMintKeyDescription extends NonStandardKeyDescription {
|
|
10507
|
+
constructor(params = {}) {
|
|
10508
|
+
if ("keymasterVersion" in params && !("keyMintVersion" in params)) {
|
|
10509
|
+
params.keyMintVersion = params.keymasterVersion;
|
|
10510
|
+
}
|
|
10511
|
+
if ("keymasterSecurityLevel" in params && !("keyMintSecurityLevel" in params)) {
|
|
10512
|
+
params.keyMintSecurityLevel = params.keymasterSecurityLevel;
|
|
10513
|
+
}
|
|
10514
|
+
if ("teeEnforced" in params && !("hardwareEnforced" in params)) {
|
|
10515
|
+
params.hardwareEnforced = params.teeEnforced;
|
|
10516
|
+
}
|
|
10517
|
+
super(params);
|
|
10518
|
+
}
|
|
10519
|
+
};
|
|
10520
|
+
NonStandardKeyMintKeyDescription = __decorate$1([
|
|
10521
|
+
AsnType({ type: AsnTypeTypes.Sequence })
|
|
10522
|
+
], NonStandardKeyMintKeyDescription);
|
|
11195
10523
|
|
|
11196
10524
|
class AttestationPackageInfo {
|
|
11197
10525
|
constructor(params = {}) {
|
|
@@ -11294,7 +10622,7 @@ class AsnData {
|
|
|
11294
10622
|
else {
|
|
11295
10623
|
// raw, type
|
|
11296
10624
|
__classPrivateFieldSet(this, _AsnData_asn, AsnConvert.parse(args[0], args[1]), "f");
|
|
11297
|
-
__classPrivateFieldSet(this, _AsnData_raw,
|
|
10625
|
+
__classPrivateFieldSet(this, _AsnData_raw, buildExports.BufferSourceConverter.toArrayBuffer(args[0]), "f");
|
|
11298
10626
|
}
|
|
11299
10627
|
}
|
|
11300
10628
|
get asn() {
|
|
@@ -11371,15 +10699,180 @@ class Extension extends AsnData {
|
|
|
11371
10699
|
}
|
|
11372
10700
|
else {
|
|
11373
10701
|
console.warn(`Didn't detect parser for "${this.asn.extnID}" extension.`);
|
|
11374
|
-
this.value =
|
|
10702
|
+
this.value = buildExports.Convert.ToHex(asnExtnValue);
|
|
11375
10703
|
}
|
|
11376
10704
|
}
|
|
11377
10705
|
catch (error) {
|
|
11378
10706
|
console.error(`Error parse "${this.asn.extnID}" extension:`, error.message);
|
|
11379
|
-
this.value =
|
|
10707
|
+
this.value = buildExports.Convert.ToHex(asnExtnValue);
|
|
10708
|
+
}
|
|
10709
|
+
}
|
|
10710
|
+
}
|
|
10711
|
+
|
|
10712
|
+
/**
|
|
10713
|
+
* @license
|
|
10714
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
10715
|
+
*
|
|
10716
|
+
* This source code is licensed under the MIT license found in the
|
|
10717
|
+
* LICENSE file in the root directory of this source tree.
|
|
10718
|
+
*/
|
|
10719
|
+
const rPaddingTag = '-{5}';
|
|
10720
|
+
const rEolChars = '\\n';
|
|
10721
|
+
const rNameTag = `[^${rEolChars}]+`;
|
|
10722
|
+
const rBeginTag = `${rPaddingTag}BEGIN (${rNameTag}(?=${rPaddingTag}))${rPaddingTag}`;
|
|
10723
|
+
const rEndTag = `${rPaddingTag}END \\1${rPaddingTag}`;
|
|
10724
|
+
const rEolGroup = '\\n';
|
|
10725
|
+
const rHeaderKey = `[^:${rEolChars}]+`;
|
|
10726
|
+
const rHeaderValue = `(?:[^${rEolChars}]+${rEolGroup}(?: +[^${rEolChars}]+${rEolGroup})*)`;
|
|
10727
|
+
const rBase64Chars = '[a-zA-Z0-9=+/]+';
|
|
10728
|
+
const rBase64 = `(?:${rBase64Chars}${rEolGroup})+`;
|
|
10729
|
+
const rPem = `${rBeginTag}${rEolGroup}(?:((?:${rHeaderKey}: ${rHeaderValue})+))?${rEolGroup}?(${rBase64})${rEndTag}`;
|
|
10730
|
+
/**
|
|
10731
|
+
* Represents PEM Converter.
|
|
10732
|
+
*/
|
|
10733
|
+
class PemConverter {
|
|
10734
|
+
static isPem(data) {
|
|
10735
|
+
return typeof data === 'string'
|
|
10736
|
+
&& new RegExp(rPem, 'g').test(data);
|
|
10737
|
+
}
|
|
10738
|
+
static decodeWithHeaders(pem) {
|
|
10739
|
+
// eslint-disable-next-line no-param-reassign
|
|
10740
|
+
pem = pem.replace(/\r/g, ''); // CRLF -> LF
|
|
10741
|
+
const pattern = new RegExp(rPem, 'g');
|
|
10742
|
+
const res = [];
|
|
10743
|
+
let matches = null;
|
|
10744
|
+
// eslint-disable-next-line no-cond-assign
|
|
10745
|
+
while (matches = pattern.exec(pem)) {
|
|
10746
|
+
// prepare pem encoded message
|
|
10747
|
+
const base64 = matches[3]
|
|
10748
|
+
.replace(new RegExp(`[${rEolChars}]+`, 'g'), '');
|
|
10749
|
+
const pemStruct = {
|
|
10750
|
+
type: matches[1],
|
|
10751
|
+
headers: [],
|
|
10752
|
+
rawData: buildExports.Convert.FromBase64(base64),
|
|
10753
|
+
};
|
|
10754
|
+
// read headers
|
|
10755
|
+
const headersString = matches[2];
|
|
10756
|
+
if (headersString) {
|
|
10757
|
+
const headers = headersString.split(new RegExp(rEolGroup, 'g'));
|
|
10758
|
+
let lastHeader = null;
|
|
10759
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
10760
|
+
for (const header of headers) {
|
|
10761
|
+
const [key, value] = header.split(/:(.*)/);
|
|
10762
|
+
if (value === undefined) {
|
|
10763
|
+
// value
|
|
10764
|
+
if (!lastHeader) {
|
|
10765
|
+
throw new Error('Cannot parse PEM string. Incorrect header value');
|
|
10766
|
+
}
|
|
10767
|
+
lastHeader.value += key.trim();
|
|
10768
|
+
}
|
|
10769
|
+
else {
|
|
10770
|
+
// key and value
|
|
10771
|
+
if (lastHeader) {
|
|
10772
|
+
pemStruct.headers.push(lastHeader);
|
|
10773
|
+
}
|
|
10774
|
+
lastHeader = { key, value: value.trim() };
|
|
10775
|
+
}
|
|
10776
|
+
}
|
|
10777
|
+
// add last header
|
|
10778
|
+
if (lastHeader) {
|
|
10779
|
+
pemStruct.headers.push(lastHeader);
|
|
10780
|
+
}
|
|
10781
|
+
}
|
|
10782
|
+
res.push(pemStruct);
|
|
10783
|
+
}
|
|
10784
|
+
return res;
|
|
10785
|
+
}
|
|
10786
|
+
/**
|
|
10787
|
+
* Decodes PEM to a list of raws
|
|
10788
|
+
* @param pem message in PEM format
|
|
10789
|
+
*/
|
|
10790
|
+
static decode(pem) {
|
|
10791
|
+
const blocks = this.decodeWithHeaders(pem);
|
|
10792
|
+
return blocks.map((o) => o.rawData);
|
|
10793
|
+
}
|
|
10794
|
+
static encode(rawData, tag) {
|
|
10795
|
+
if (Array.isArray(rawData)) {
|
|
10796
|
+
const raws = new Array();
|
|
10797
|
+
if (tag) {
|
|
10798
|
+
// encode BufferSource[]
|
|
10799
|
+
rawData.forEach((element) => {
|
|
10800
|
+
if (!buildExports.BufferSourceConverter.isBufferSource(element)) {
|
|
10801
|
+
throw new TypeError('Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource');
|
|
10802
|
+
}
|
|
10803
|
+
raws.push(this.encodeStruct({
|
|
10804
|
+
type: tag,
|
|
10805
|
+
rawData: buildExports.BufferSourceConverter.toArrayBuffer(element),
|
|
10806
|
+
}));
|
|
10807
|
+
});
|
|
10808
|
+
}
|
|
10809
|
+
else {
|
|
10810
|
+
// encode PemStruct[]
|
|
10811
|
+
rawData.forEach((element) => {
|
|
10812
|
+
if (!('type' in element)) {
|
|
10813
|
+
throw new TypeError('Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut');
|
|
10814
|
+
}
|
|
10815
|
+
raws.push(this.encodeStruct(element));
|
|
10816
|
+
});
|
|
10817
|
+
}
|
|
10818
|
+
return raws.join('\n');
|
|
10819
|
+
}
|
|
10820
|
+
if (!tag) {
|
|
10821
|
+
throw new Error("Required argument 'tag' is missed");
|
|
11380
10822
|
}
|
|
10823
|
+
return this.encodeStruct({
|
|
10824
|
+
type: tag,
|
|
10825
|
+
rawData: buildExports.BufferSourceConverter.toArrayBuffer(rawData),
|
|
10826
|
+
});
|
|
10827
|
+
}
|
|
10828
|
+
/**
|
|
10829
|
+
* Encodes PEMStruct in PEM block
|
|
10830
|
+
* @param pem PEM structure for encoding
|
|
10831
|
+
* @returns Returns PEM encoded block
|
|
10832
|
+
*/
|
|
10833
|
+
static encodeStruct(pem) {
|
|
10834
|
+
var _a;
|
|
10835
|
+
const upperCaseType = pem.type.toLocaleUpperCase();
|
|
10836
|
+
const res = [];
|
|
10837
|
+
res.push(`-----BEGIN ${upperCaseType}-----`);
|
|
10838
|
+
if ((_a = pem.headers) === null || _a === void 0 ? void 0 : _a.length) {
|
|
10839
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
10840
|
+
for (const header of pem.headers) {
|
|
10841
|
+
res.push(`${header.key}: ${header.value}`);
|
|
10842
|
+
}
|
|
10843
|
+
res.push(''); // blank line
|
|
10844
|
+
}
|
|
10845
|
+
const base64 = buildExports.Convert.ToBase64(pem.rawData);
|
|
10846
|
+
let sliced;
|
|
10847
|
+
let offset = 0;
|
|
10848
|
+
const rows = Array();
|
|
10849
|
+
while (offset < base64.length) {
|
|
10850
|
+
if (base64.length - offset < 64) {
|
|
10851
|
+
sliced = base64.substring(offset);
|
|
10852
|
+
}
|
|
10853
|
+
else {
|
|
10854
|
+
sliced = base64.substring(offset, offset + 64);
|
|
10855
|
+
offset += 64;
|
|
10856
|
+
}
|
|
10857
|
+
if (sliced.length !== 0) {
|
|
10858
|
+
rows.push(sliced);
|
|
10859
|
+
if (sliced.length < 64) {
|
|
10860
|
+
break;
|
|
10861
|
+
}
|
|
10862
|
+
}
|
|
10863
|
+
else {
|
|
10864
|
+
break;
|
|
10865
|
+
}
|
|
10866
|
+
}
|
|
10867
|
+
res.push(...rows);
|
|
10868
|
+
res.push(`-----END ${upperCaseType}-----`);
|
|
10869
|
+
return res.join('\n');
|
|
11381
10870
|
}
|
|
11382
10871
|
}
|
|
10872
|
+
PemConverter.CertificateTag = 'CERTIFICATE';
|
|
10873
|
+
PemConverter.CrlTag = 'CRL';
|
|
10874
|
+
PemConverter.CertificateRequestTag = 'CERTIFICATE REQUEST';
|
|
10875
|
+
PemConverter.AttributeCertificateTag = 'ATTRIBUTE CERTIFICATE';
|
|
11383
10876
|
|
|
11384
10877
|
/**
|
|
11385
10878
|
* @license
|
|
@@ -11423,30 +10916,27 @@ class CryptoProvider {
|
|
|
11423
10916
|
CryptoProvider.DEFAULT = 'default';
|
|
11424
10917
|
const cryptoProvider = new CryptoProvider();
|
|
11425
10918
|
|
|
11426
|
-
|
|
11427
|
-
|
|
11428
|
-
|
|
11429
|
-
|
|
11430
|
-
|
|
11431
|
-
|
|
11432
|
-
|
|
11433
|
-
.replace(/(.{4})/g, '$1 ')
|
|
11434
|
-
.trim());
|
|
11435
|
-
const base64Format = (base64) => (base64
|
|
11436
|
-
.replace(/(.{64})/g, '$1\n'));
|
|
10919
|
+
/**
|
|
10920
|
+
* @license
|
|
10921
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
10922
|
+
*
|
|
10923
|
+
* This source code is licensed under the MIT license found in the
|
|
10924
|
+
* LICENSE file in the root directory of this source tree.
|
|
10925
|
+
*/
|
|
11437
10926
|
const certificateRawToBuffer = (raw) => {
|
|
11438
|
-
|
|
11439
|
-
|
|
11440
|
-
if (isHex(rawClarified)) {
|
|
11441
|
-
buffer = Convert_1.FromHex(rawClarified);
|
|
10927
|
+
if (PemConverter.isPem(raw)) {
|
|
10928
|
+
return PemConverter.decode(raw)[0];
|
|
11442
10929
|
}
|
|
11443
|
-
|
|
11444
|
-
|
|
10930
|
+
if (buildExports.Convert.isHex(raw)) {
|
|
10931
|
+
return buildExports.Convert.FromHex(raw);
|
|
11445
10932
|
}
|
|
11446
|
-
|
|
11447
|
-
|
|
10933
|
+
if (buildExports.Convert.isBase64(raw)) {
|
|
10934
|
+
return buildExports.Convert.FromBase64(raw);
|
|
11448
10935
|
}
|
|
11449
|
-
|
|
10936
|
+
if (buildExports.Convert.isBase64Url(raw)) {
|
|
10937
|
+
return buildExports.Convert.FromBase64Url(raw);
|
|
10938
|
+
}
|
|
10939
|
+
throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url");
|
|
11450
10940
|
};
|
|
11451
10941
|
const getCertificateThumbprint = async (algorithm, data) => {
|
|
11452
10942
|
const crypto = cryptoProvider.get();
|
|
@@ -12014,7 +11504,7 @@ WebGDPR = __decorate$1([
|
|
|
12014
11504
|
|
|
12015
11505
|
class IssuerAndSerialNumber {
|
|
12016
11506
|
constructor(params = {}) {
|
|
12017
|
-
this.issuer = new Name$1;
|
|
11507
|
+
this.issuer = new Name$1();
|
|
12018
11508
|
this.serialNumber = new ArrayBuffer(0);
|
|
12019
11509
|
Object.assign(this, params);
|
|
12020
11510
|
}
|
|
@@ -12239,7 +11729,14 @@ __decorate$1([
|
|
|
12239
11729
|
AsnProp({ type: OctetString, context: 0, implicit: true, optional: true })
|
|
12240
11730
|
], EncryptedContent.prototype, "value", void 0);
|
|
12241
11731
|
__decorate$1([
|
|
12242
|
-
AsnProp({
|
|
11732
|
+
AsnProp({
|
|
11733
|
+
type: OctetString,
|
|
11734
|
+
converter: AsnConstructedOctetStringConverter,
|
|
11735
|
+
context: 0,
|
|
11736
|
+
implicit: true,
|
|
11737
|
+
optional: true,
|
|
11738
|
+
repeated: "sequence",
|
|
11739
|
+
})
|
|
12243
11740
|
], EncryptedContent.prototype, "constructedValue", void 0);
|
|
12244
11741
|
EncryptedContent = __decorate$1([
|
|
12245
11742
|
AsnType({ type: AsnTypeTypes.Choice })
|
|
@@ -13075,6 +12572,7 @@ const DownloadIcon = (props) => {
|
|
|
13075
12572
|
h("path", { fill: `var(--pv-color-${color})`, d: "M21 12h-2c-.6 0-1 .4-1 1s.4 1 1 1h2c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1H9c-.6 0-1-.4-1-1v-7c0-.6.4-1 1-1h2c.6 0 1-.4 1-1s-.4-1-1-1H9c-1.7 0-3 1.3-3 3v7c0 1.7 1.3 3 3 3h12c1.7 0 3-1.3 3-3v-7c0-1.7-1.3-3-3-3Zm-9.7 5.7 3 3c.2.2.4.3.7.3.3 0 .5-.1.7-.3l3-3c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0L16 17.6V6c0-.6-.4-1-1-1s-1 .4-1 1v11.6l-1.3-1.3c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4Z" })));
|
|
13076
12573
|
};
|
|
13077
12574
|
|
|
13078
|
-
export {
|
|
12575
|
+
export { CertificateList as $, AsnData as A, id_TypeRelationship as B, CertificationRequest as C, Download as D, ECParameters as E, id_DomainNameTechnicalOperator as F, id_DomainNameOwner as G, id_DomainNameLegalRepresentative as H, InsuranceValue as I, id_DomainNameBeneficiary as J, Certificate as K, Link as L, dateDiff as M, Name as N, id_composite_key as O, PemConverter as P, CompositePublicKey as Q, RSAPublicKey as R, id_alg_composite as S, TypeRelationship as T, UnstructuredName as U, ValuationRanking as V, WebGDPR as W, CompositeSignatureValue as X, CompositeParams as Y, dateShort as Z, OIDs as _, DownloadIcon as a, CRLReason as a0, InvalidityDate as a1, CertificateIssuer as a2, SignedData as a3, EncapsulatedContent as a4, OctetString as a5, CertificateSet as a6, CertificateChoices as a7, ContentInfo as a8, AttributeCertificate as a9, CertificatePolicies as aA, CertificateTransparency as aB, NameConstraints as aC, CertificateTemplate as aD, EnrollCertTypeChoice as aE, CaVersion as aF, QCStatements as aG, NetscapeComment as aH, NetscapeCertType as aI, LeiRole as aJ, LeiChoice as aK, Timestamp as aL, ArchiveRevInfo as aM, SubjectDirectoryAttributes as aN, PrivateKeyUsagePeriod as aO, EntrustVersionInfo as aP, BiometricSyntax as aQ, LogotypeExtn as aR, TNAuthorizationList as aS, PolicyConstraints as aT, PolicyMappings as aU, CRLNumber as aV, IssuingDistributionPoint as aW, NonStandardKeyDescription as aX, CabforganizationIdentifier as aY, Name$1 as aa, OtherName as ab, DisplayText as ac, UserNotice as ad, EDIPartyName as ae, __decorate$1 as af, AsnProp as ag, AsnPropTypes as ah, AsnType as ai, AsnTypeTypes as aj, AsnArray as ak, id_qcs_pkixQCSyntax_v2 as al, SemanticsInformation as am, AsnIntegerArrayBufferConverter as an, AttestationApplicationId as ao, RootOfTrust as ap, IntegerSet as aq, KeyUsage as ar, BasicConstraints as as, ExtendedKeyUsage as at, SubjectKeyIdentifier as au, AuthorityKeyIdentifier as av, CRLDistributionPoints as aw, AuthorityInfoAccessSyntax as ax, SubjectInfoAccessSyntax as ay, SubjectAlternativeName as az, AsnConvert as b, certificateRawToBuffer as c, downloadFromBuffer as d, id_rsaEncryption as e, buildExports as f, getCertificateThumbprint as g, id_pkcs9_at_extensionRequest as h, id_ecPublicKey as i, Extension as j, Attribute$1 as k, l10n as l, AsnParser as m, ExtensionRequest as n, ChallengePassword as o, ActivityDescription as p, DomainNameTechnicalOperator as q, DomainNameOwner as r, DomainNameLegalRepresentative as s, DomainNameBeneficiary as t, id_pkcs9_at_unstructuredName as u, id_pkcs9_at_challengePassword as v, id_ValuationRanking as w, id_InsuranceValue as x, id_WebGDPR as y, id_ActivityDescription as z };
|
|
12576
|
+
//# sourceMappingURL=download.js.map
|
|
13079
12577
|
|
|
13080
12578
|
//# sourceMappingURL=download.js.map
|