@peculiar/certificates-viewer 4.3.2 → 4.5.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 +20 -19
- 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 +2 -4
- package/components/certificate-chain-viewer.js.map +1 -1
- package/components/certificate-viewer.js +18 -18
- package/components/certificate-viewer.js.map +1 -1
- package/components/circular-progress.js +9 -3
- package/components/circular-progress.js.map +1 -1
- package/components/crl-viewer.js +19 -17
- 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 +956 -1585
- package/components/download.js.map +1 -1
- package/components/highlight-words.js +2 -3
- 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.js +1 -0
- package/components/peculiar-certificate-decoder.js +4 -7
- package/components/peculiar-certificate-decoder.js.map +1 -1
- package/components/peculiar-certificate-viewer.js +1 -0
- package/components/peculiar-certificates-viewer.js +34 -13
- 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 +2 -2
- package/components/peculiar-text-hider.js.map +1 -1
- package/components/pkcs10_certificate_request.js +5 -4
- 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-64ce3326.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-b9b9f280.js → arrow_top-DBMPHVlB.js} +3 -2
- package/dist/cjs/arrow_top-DBMPHVlB.js.map +1 -0
- package/dist/cjs/{button-61bb8305.js → button-C5jDF-CZ.js} +3 -2
- package/dist/cjs/button-C5jDF-CZ.js.map +1 -0
- package/dist/cjs/{certification_request-393a843d.js → certification_request-DS5FED4F.js} +957 -1587
- package/dist/cjs/certification_request-DS5FED4F.js.map +1 -0
- package/dist/cjs/{cross-3aeffd04.js → cross-pi7K0cHC.js} +3 -2
- package/dist/cjs/cross-pi7K0cHC.js.map +1 -0
- package/dist/cjs/{download-c2836546.js → download-D9skkVoT.js} +3 -2
- package/dist/cjs/download-D9skkVoT.js.map +1 -0
- package/dist/cjs/{index-484a84a0.js → index-BO3rFndV.js} +1356 -1168
- 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-dad7195a.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-ca06fb81.js → miscellaneous-UxtK1SWb.js} +25 -24
- package/dist/cjs/miscellaneous-UxtK1SWb.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_4.cjs.entry.js +47 -48
- package/dist/cjs/peculiar-attribute-certificate-viewer_4.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-button-menu.peculiar-circular-progress.peculiar-highlight-words.entry.cjs.js.map +1 -0
- package/dist/cjs/peculiar-button-menu_3.cjs.entry.js +16 -15
- package/dist/cjs/peculiar-button-menu_3.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +12 -17
- 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 +42 -23
- 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 +5 -7
- 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 +8 -7
- package/dist/cjs/peculiar.cjs.js.map +1 -1
- package/dist/cjs/{pkcs10_certificate_request-56990e4f.js → pkcs10_certificate_request-DaWYvR0i.js} +8 -7
- package/dist/cjs/pkcs10_certificate_request-DaWYvR0i.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-d162984c.js → x509_certificate-DBpSGIUT.js} +7 -6
- package/dist/cjs/x509_certificate-DBpSGIUT.js.map +1 -0
- package/dist/cjs/{x509_crl-13322e13.js → x509_crl-BBnJqOIF.js} +11 -10
- package/dist/cjs/x509_crl-BBnJqOIF.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +10 -9
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js.map +1 -1
- package/dist/collection/components/button-menu/button-menu.js +2 -2
- package/dist/collection/components/button-menu/button-menu.js.map +1 -1
- package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js +0 -2
- package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js.map +1 -1
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +0 -3
- package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
- package/dist/collection/components/certificate-viewer/certificate-viewer.js +10 -10
- package/dist/collection/components/certificate-viewer/certificate-viewer.js.map +1 -1
- package/dist/collection/components/certificates-viewer/certificates-viewer.js +31 -10
- package/dist/collection/components/certificates-viewer/certificates-viewer.js.map +1 -1
- package/dist/collection/components/circular-progress/circular-progress.js +7 -1
- package/dist/collection/components/circular-progress/circular-progress.js.map +1 -1
- package/dist/collection/components/crl-viewer/crl-viewer.js +10 -8
- package/dist/collection/components/crl-viewer/crl-viewer.js.map +1 -1
- package/dist/collection/components/csr-viewer/csr-viewer.js +10 -7
- package/dist/collection/components/csr-viewer/csr-viewer.js.map +1 -1
- package/dist/collection/components/highlight-words/highlight-words.js +0 -1
- package/dist/collection/components/highlight-words/highlight-words.js.map +1 -1
- package/dist/collection/components/text-hider/text-hider.js.map +1 -1
- package/dist/collection/constants/oids.js +16 -0
- package/dist/collection/constants/oids.js.map +1 -1
- package/dist/collection/crypto/utils.js +1 -1
- package/dist/collection/crypto/utils.js.map +1 -1
- package/dist/esm/{actions-2e39a3b9.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-72c7543a.js → arrow_top-CF9pv-tQ.js} +3 -2
- package/dist/esm/arrow_top-CF9pv-tQ.js.map +1 -0
- package/dist/esm/{button-e0909687.js → button-Djn8UI82.js} +3 -2
- package/dist/esm/button-Djn8UI82.js.map +1 -0
- package/dist/esm/{certification_request-714bd438.js → certification_request-Wtz6WM17.js} +957 -1586
- package/dist/esm/certification_request-Wtz6WM17.js.map +1 -0
- package/dist/esm/{cross-0c62835f.js → cross-DdCuR1F2.js} +3 -2
- package/dist/esm/cross-DdCuR1F2.js.map +1 -0
- package/dist/esm/{download-5686d86f.js → download-Cqfc-Sxf.js} +3 -2
- package/dist/esm/download-Cqfc-Sxf.js.map +1 -0
- package/dist/esm/{index-38365508.js → index-DDDrq3In.js} +1354 -1146
- 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-09718951.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-0657d00e.js → miscellaneous-CsGuJ6zr.js} +27 -26
- package/dist/esm/miscellaneous-CsGuJ6zr.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_4.entry.js +48 -47
- package/dist/esm/peculiar-attribute-certificate-viewer_4.entry.js.map +1 -1
- package/dist/esm/peculiar-button-menu.peculiar-circular-progress.peculiar-highlight-words.entry.js.map +1 -0
- package/dist/esm/peculiar-button-menu_3.entry.js +16 -13
- package/dist/esm/peculiar-button-menu_3.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-decoder.entry.js +12 -15
- 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 +42 -21
- package/dist/esm/peculiar-certificates-viewer.entry.js.map +1 -1
- package/dist/esm/peculiar-text-hider.entry.js +5 -5
- package/dist/esm/peculiar-text-hider.entry.js.map +1 -1
- package/dist/esm/peculiar.js +7 -5
- package/dist/esm/peculiar.js.map +1 -1
- package/dist/esm/{pkcs10_certificate_request-d3871050.js → pkcs10_certificate_request-Cn7_Z7a1.js} +8 -7
- package/dist/esm/pkcs10_certificate_request-Cn7_Z7a1.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-d0d0c5c1.js → x509_certificate-ObET7_Te.js} +7 -6
- package/dist/esm/x509_certificate-ObET7_Te.js.map +1 -0
- package/dist/esm/{x509_crl-e837f4c3.js → x509_crl-CeW7yzP9.js} +11 -10
- package/dist/esm/x509_crl-CeW7yzP9.js.map +1 -0
- package/dist/esm-es5/{actions-2e39a3b9.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-72c7543a.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-e0909687.js → button-Djn8UI82.js} +2 -2
- package/dist/esm-es5/button-Djn8UI82.js.map +1 -0
- package/dist/esm-es5/certification_request-Wtz6WM17.js +142 -0
- package/dist/esm-es5/certification_request-Wtz6WM17.js.map +1 -0
- package/dist/esm-es5/{cross-0c62835f.js → cross-DdCuR1F2.js} +2 -2
- package/dist/esm-es5/cross-DdCuR1F2.js.map +1 -0
- package/dist/esm-es5/{download-5686d86f.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 +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/{miscellaneous-0657d00e.js → miscellaneous-CsGuJ6zr.js} +15 -15
- package/dist/esm-es5/miscellaneous-CsGuJ6zr.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 +5 -5
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_4.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-button-menu.peculiar-circular-progress.peculiar-highlight-words.entry.js.map +1 -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 +1 -1
- 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 +2 -2
- package/dist/esm-es5/peculiar.js.map +1 -1
- package/dist/esm-es5/pkcs10_certificate_request-Cn7_Z7a1.js +19 -0
- package/dist/esm-es5/pkcs10_certificate_request-Cn7_Z7a1.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-ObET7_Te.js +12 -0
- package/dist/esm-es5/x509_certificate-ObET7_Te.js.map +1 -0
- package/dist/esm-es5/x509_crl-CeW7yzP9.js +19 -0
- package/dist/esm-es5/x509_crl-CeW7yzP9.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-0e8ab957.entry.js +5 -0
- package/dist/peculiar/p-0e8ab957.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-3e4062f6.entry.js +110 -0
- package/dist/peculiar/p-3e4062f6.entry.js.map +1 -0
- package/dist/peculiar/p-5608ba3e.system.entry.js +5 -0
- package/dist/peculiar/p-5608ba3e.system.entry.js.map +1 -0
- package/dist/peculiar/p-5b829829.system.entry.js +5 -0
- package/dist/peculiar/p-5b829829.system.entry.js.map +1 -0
- package/dist/peculiar/{p-04228f9c.system.entry.js → p-63aa01ad.system.entry.js} +3 -3
- package/dist/peculiar/p-63aa01ad.system.entry.js.map +1 -0
- package/dist/peculiar/{p-b01c70cf.entry.js → p-69b461b4.entry.js} +3 -3
- package/dist/peculiar/p-69b461b4.entry.js.map +1 -0
- package/dist/peculiar/p-7Nmqck4T.system.js.map +1 -0
- package/dist/peculiar/{p-6eb92f5a.entry.js → p-7a3bf94e.entry.js} +2 -2
- package/dist/peculiar/p-7a3bf94e.entry.js.map +1 -0
- package/dist/peculiar/{p-d46670fa.system.js → p-B2YrZuK2.system.js} +2 -2
- package/dist/peculiar/p-B2YrZuK2.system.js.map +1 -0
- package/dist/peculiar/p-B3myni_G.js +19 -0
- package/dist/peculiar/p-B3myni_G.js.map +1 -0
- package/dist/peculiar/{p-9ca02302.system.js → p-B859JpGw.system.js} +3 -3
- package/dist/peculiar/p-B859JpGw.system.js.map +1 -0
- package/dist/peculiar/{p-a3054d6e.system.js → p-BBgwMHRZ.system.js} +3 -3
- package/dist/peculiar/p-BBgwMHRZ.system.js.map +1 -0
- package/dist/peculiar/{p-9987b899.js → p-BCATfe_H.js} +2 -2
- 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-562652dd.js → p-BHBizfwo.js} +3 -3
- package/dist/peculiar/p-BHBizfwo.js.map +1 -0
- package/dist/peculiar/{p-02529999.system.js → p-BOSH9vjy.system.js} +3 -3
- package/dist/{esm-es5/actions-2e39a3b9.js.map → peculiar/p-BOSH9vjy.system.js.map} +1 -1
- package/dist/peculiar/{p-4ee5beee.system.js → p-BP2bmYR2.system.js} +3 -3
- package/dist/peculiar/p-BP2bmYR2.system.js.map +1 -0
- package/dist/peculiar/{p-d9145ee8.system.js → p-BRhx1gbw.system.js} +4 -4
- package/dist/peculiar/p-BRhx1gbw.system.js.map +1 -0
- package/dist/peculiar/p-BX9qW3ww.system.js.map +1 -0
- package/dist/peculiar/p-BisXzAqN.js +12 -0
- package/dist/peculiar/p-BisXzAqN.js.map +1 -0
- package/dist/peculiar/p-CFhlbr47.system.js.map +1 -0
- package/dist/peculiar/{p-a9ea6c79.system.js → p-CKoxwzVA.system.js} +4 -4
- package/dist/peculiar/p-CKoxwzVA.system.js.map +1 -0
- package/dist/peculiar/p-C_vT-OYk.system.js.map +1 -0
- package/dist/peculiar/p-CcANm2qm.system.js +5 -0
- package/dist/peculiar/p-CcANm2qm.system.js.map +1 -0
- package/dist/peculiar/{p-ba3dfc03.js → p-CeKqQ13Z.js} +4 -4
- package/dist/peculiar/p-CeKqQ13Z.js.map +1 -0
- package/dist/peculiar/p-CttQwkXH.js +369 -0
- package/dist/peculiar/p-CttQwkXH.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-c5d3333c.system.js → p-DPre0WhP.system.js} +4 -4
- package/dist/{esm/pkcs10_certificate_request-d3871050.js.map → peculiar/p-DPre0WhP.system.js.map} +1 -1
- package/dist/peculiar/p-DX5B2Msh.system.js.map +1 -0
- package/dist/peculiar/p-DgcB4Nqx.system.js +142 -0
- package/dist/peculiar/p-DgcB4Nqx.system.js.map +1 -0
- package/dist/peculiar/{p-90c3a063.js → p-DhdG07f8.js} +2 -2
- package/dist/peculiar/p-DhdG07f8.js.map +1 -0
- package/dist/peculiar/p-Dk86_qlM.system.js.map +1 -0
- package/dist/peculiar/{p-92f9641a.js → p-DkAhB3Vy.js} +2 -2
- package/dist/peculiar/p-DkAhB3Vy.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-L1KL0R34.system.js +13 -0
- package/dist/peculiar/p-L1KL0R34.system.js.map +1 -0
- package/dist/peculiar/p-Wtz6WM17.js +142 -0
- package/dist/peculiar/p-Wtz6WM17.js.map +1 -0
- package/dist/peculiar/p-bafc3336.system.entry.js +111 -0
- package/dist/peculiar/p-bafc3336.system.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-f4490197.entry.js +5 -0
- package/dist/peculiar/p-f4490197.entry.js.map +1 -0
- package/dist/peculiar/p-lNFxlG5A.js +19 -0
- package/dist/peculiar/p-lNFxlG5A.js.map +1 -0
- package/dist/peculiar/p-t-yLLnfF.js +12 -0
- package/dist/peculiar/p-t-yLLnfF.js.map +1 -0
- package/dist/peculiar/{p-35cd359e.system.js → p-uFLk5hDd.system.js} +54 -54
- package/dist/peculiar/{p-90f461c0.js.map → p-uFLk5hDd.system.js.map} +1 -1
- 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-39bbe0b9.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/constants/oids.d.ts +15 -0
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/hydrate/index.d.ts +22 -5
- package/hydrate/index.js +2862 -3023
- package/hydrate/index.mjs +2862 -3021
- package/package.json +23 -23
- package/dist/cjs/actions-64ce3326.js.map +0 -1
- package/dist/cjs/app-globals-c20ffa41.js.map +0 -1
- package/dist/cjs/arrow_top-b9b9f280.js.map +0 -1
- package/dist/cjs/button-61bb8305.js.map +0 -1
- package/dist/cjs/certification_request-393a843d.js.map +0 -1
- package/dist/cjs/cross-3aeffd04.js.map +0 -1
- package/dist/cjs/download-c2836546.js.map +0 -1
- package/dist/cjs/index-484a84a0.js.map +0 -1
- package/dist/cjs/link-dad7195a.js.map +0 -1
- package/dist/cjs/miscellaneous-ca06fb81.js.map +0 -1
- package/dist/cjs/pkcs10_certificate_request-56990e4f.js.map +0 -1
- package/dist/cjs/read_file-2e22a97e.js.map +0 -1
- package/dist/cjs/x509_certificate-d162984c.js.map +0 -1
- package/dist/cjs/x509_crl-13322e13.js.map +0 -1
- package/dist/esm/actions-2e39a3b9.js.map +0 -1
- package/dist/esm/app-globals-5e9b67e0.js.map +0 -1
- package/dist/esm/arrow_top-72c7543a.js.map +0 -1
- package/dist/esm/button-e0909687.js.map +0 -1
- package/dist/esm/certification_request-714bd438.js.map +0 -1
- package/dist/esm/cross-0c62835f.js.map +0 -1
- package/dist/esm/download-5686d86f.js.map +0 -1
- package/dist/esm/index-38365508.js.map +0 -1
- package/dist/esm/link-09718951.js.map +0 -1
- package/dist/esm/miscellaneous-0657d00e.js.map +0 -1
- package/dist/esm/read_file-bb0b1450.js.map +0 -1
- package/dist/esm/x509_certificate-d0d0c5c1.js.map +0 -1
- package/dist/esm/x509_crl-e837f4c3.js.map +0 -1
- package/dist/esm-es5/app-globals-5e9b67e0.js.map +0 -1
- package/dist/esm-es5/arrow_top-72c7543a.js.map +0 -1
- package/dist/esm-es5/button-e0909687.js.map +0 -1
- package/dist/esm-es5/certification_request-714bd438.js +0 -142
- package/dist/esm-es5/certification_request-714bd438.js.map +0 -1
- package/dist/esm-es5/cross-0c62835f.js.map +0 -1
- package/dist/esm-es5/download-5686d86f.js.map +0 -1
- package/dist/esm-es5/index-38365508.js +0 -6
- package/dist/esm-es5/index-38365508.js.map +0 -1
- package/dist/esm-es5/link-09718951.js +0 -12
- package/dist/esm-es5/link-09718951.js.map +0 -1
- package/dist/esm-es5/miscellaneous-0657d00e.js.map +0 -1
- package/dist/esm-es5/pkcs10_certificate_request-d3871050.js +0 -19
- package/dist/esm-es5/pkcs10_certificate_request-d3871050.js.map +0 -1
- package/dist/esm-es5/read_file-bb0b1450.js.map +0 -1
- package/dist/esm-es5/x509_certificate-d0d0c5c1.js +0 -12
- package/dist/esm-es5/x509_certificate-d0d0c5c1.js.map +0 -1
- package/dist/esm-es5/x509_crl-e837f4c3.js +0 -19
- package/dist/esm-es5/x509_crl-e837f4c3.js.map +0 -1
- package/dist/peculiar/p-02529999.system.js.map +0 -1
- package/dist/peculiar/p-04228f9c.system.entry.js.map +0 -1
- package/dist/peculiar/p-12bc3ebc.system.entry.js +0 -5
- package/dist/peculiar/p-12bc3ebc.system.entry.js.map +0 -1
- package/dist/peculiar/p-161f7f97.entry.js +0 -5
- package/dist/peculiar/p-161f7f97.entry.js.map +0 -1
- package/dist/peculiar/p-25a532a3.js.map +0 -1
- package/dist/peculiar/p-32cf293c.system.js +0 -5
- package/dist/peculiar/p-32cf293c.system.js.map +0 -1
- package/dist/peculiar/p-35cd359e.system.js.map +0 -1
- package/dist/peculiar/p-39bbe0b9.system.entry.js +0 -5
- package/dist/peculiar/p-41eacbcd.system.entry.js +0 -111
- package/dist/peculiar/p-41eacbcd.system.entry.js.map +0 -1
- package/dist/peculiar/p-47b7dd9e.entry.js +0 -110
- package/dist/peculiar/p-47b7dd9e.entry.js.map +0 -1
- package/dist/peculiar/p-4ee5beee.system.js.map +0 -1
- package/dist/peculiar/p-55303453.system.js.map +0 -1
- package/dist/peculiar/p-562652dd.js.map +0 -1
- package/dist/peculiar/p-5b4db88b.system.js +0 -5
- package/dist/peculiar/p-5b4db88b.system.js.map +0 -1
- package/dist/peculiar/p-67452b74.system.entry.js +0 -5
- package/dist/peculiar/p-67452b74.system.entry.js.map +0 -1
- package/dist/peculiar/p-684b7f0f.system.js +0 -142
- package/dist/peculiar/p-684b7f0f.system.js.map +0 -1
- package/dist/peculiar/p-6eb92f5a.entry.js.map +0 -1
- package/dist/peculiar/p-8dd6d1ee.entry.js +0 -5
- package/dist/peculiar/p-8dd6d1ee.entry.js.map +0 -1
- package/dist/peculiar/p-90c3a063.js.map +0 -1
- package/dist/peculiar/p-90f461c0.js +0 -369
- package/dist/peculiar/p-92f9641a.js.map +0 -1
- package/dist/peculiar/p-93e299aa.system.entry.js +0 -5
- package/dist/peculiar/p-93e299aa.system.entry.js.map +0 -1
- package/dist/peculiar/p-9987b899.js.map +0 -1
- package/dist/peculiar/p-9b64adaa.system.js +0 -13
- package/dist/peculiar/p-9b64adaa.system.js.map +0 -1
- package/dist/peculiar/p-9ca02302.system.js.map +0 -1
- package/dist/peculiar/p-a1adb881.js +0 -6
- package/dist/peculiar/p-a1adb881.js.map +0 -1
- package/dist/peculiar/p-a3054d6e.system.js.map +0 -1
- package/dist/peculiar/p-a55fd6f1.js +0 -142
- package/dist/peculiar/p-a55fd6f1.js.map +0 -1
- package/dist/peculiar/p-a87e1a0e.js +0 -12
- package/dist/peculiar/p-a87e1a0e.js.map +0 -1
- package/dist/peculiar/p-a9ea6c79.system.js.map +0 -1
- package/dist/peculiar/p-b01c70cf.entry.js.map +0 -1
- package/dist/peculiar/p-b5674f82.js +0 -19
- package/dist/peculiar/p-b5674f82.js.map +0 -1
- package/dist/peculiar/p-ba3dfc03.js.map +0 -1
- package/dist/peculiar/p-bc91996c.system.js +0 -6
- package/dist/peculiar/p-bc91996c.system.js.map +0 -1
- package/dist/peculiar/p-c2995a63.system.js.map +0 -1
- package/dist/peculiar/p-c5d3333c.system.js.map +0 -1
- package/dist/peculiar/p-cb8a0b79.js +0 -19
- package/dist/peculiar/p-cb8a0b79.js.map +0 -1
- package/dist/peculiar/p-d46670fa.system.js.map +0 -1
- package/dist/peculiar/p-d9145ee8.system.js.map +0 -1
- package/dist/peculiar/p-dac867e8.js.map +0 -1
- package/dist/peculiar/p-f456fe47.js +0 -12
- package/dist/peculiar/p-f456fe47.js.map +0 -1
- package/dist/peculiar/p-f6ec61db.entry.js +0 -5
- package/dist/peculiar/p-f6ec61db.entry.js.map +0 -1
- package/loader/package.json +0 -11
|
@@ -49,7 +49,11 @@ function downloadFromBuffer(value, name, extension, mime = 'application/octet-st
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
function getDefaultExportFromCjs (x) {
|
|
53
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
var build = {};
|
|
53
57
|
|
|
54
58
|
/*!
|
|
55
59
|
* MIT License
|
|
@@ -76,354 +80,388 @@ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof win
|
|
|
76
80
|
*
|
|
77
81
|
*/
|
|
78
82
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
83
|
+
var hasRequiredBuild;
|
|
84
|
+
|
|
85
|
+
function requireBuild () {
|
|
86
|
+
if (hasRequiredBuild) return build;
|
|
87
|
+
hasRequiredBuild = 1;
|
|
88
|
+
|
|
89
|
+
const ARRAY_BUFFER_NAME = "[object ArrayBuffer]";
|
|
90
|
+
class BufferSourceConverter {
|
|
91
|
+
static isArrayBuffer(data) {
|
|
92
|
+
return Object.prototype.toString.call(data) === ARRAY_BUFFER_NAME;
|
|
93
|
+
}
|
|
94
|
+
static toArrayBuffer(data) {
|
|
95
|
+
if (this.isArrayBuffer(data)) {
|
|
96
|
+
return data;
|
|
97
|
+
}
|
|
98
|
+
if (data.byteLength === data.buffer.byteLength) {
|
|
99
|
+
return data.buffer;
|
|
100
|
+
}
|
|
101
|
+
if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
|
|
102
|
+
return data.buffer;
|
|
103
|
+
}
|
|
104
|
+
return this.toUint8Array(data.buffer)
|
|
105
|
+
.slice(data.byteOffset, data.byteOffset + data.byteLength)
|
|
106
|
+
.buffer;
|
|
107
|
+
}
|
|
108
|
+
static toUint8Array(data) {
|
|
109
|
+
return this.toView(data, Uint8Array);
|
|
110
|
+
}
|
|
111
|
+
static toView(data, type) {
|
|
112
|
+
if (data.constructor === type) {
|
|
113
|
+
return data;
|
|
114
|
+
}
|
|
115
|
+
if (this.isArrayBuffer(data)) {
|
|
116
|
+
return new type(data);
|
|
117
|
+
}
|
|
118
|
+
if (this.isArrayBufferView(data)) {
|
|
119
|
+
return new type(data.buffer, data.byteOffset, data.byteLength);
|
|
120
|
+
}
|
|
121
|
+
throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");
|
|
122
|
+
}
|
|
123
|
+
static isBufferSource(data) {
|
|
124
|
+
return this.isArrayBufferView(data)
|
|
125
|
+
|| this.isArrayBuffer(data);
|
|
126
|
+
}
|
|
127
|
+
static isArrayBufferView(data) {
|
|
128
|
+
return ArrayBuffer.isView(data)
|
|
129
|
+
|| (data && this.isArrayBuffer(data.buffer));
|
|
130
|
+
}
|
|
131
|
+
static isEqual(a, b) {
|
|
132
|
+
const aView = BufferSourceConverter.toUint8Array(a);
|
|
133
|
+
const bView = BufferSourceConverter.toUint8Array(b);
|
|
134
|
+
if (aView.length !== bView.byteLength) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
for (let i = 0; i < aView.length; i++) {
|
|
138
|
+
if (aView[i] !== bView[i]) {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
static concat(...args) {
|
|
145
|
+
let buffers;
|
|
146
|
+
if (Array.isArray(args[0]) && !(args[1] instanceof Function)) {
|
|
147
|
+
buffers = args[0];
|
|
148
|
+
}
|
|
149
|
+
else if (Array.isArray(args[0]) && args[1] instanceof Function) {
|
|
150
|
+
buffers = args[0];
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
if (args[args.length - 1] instanceof Function) {
|
|
154
|
+
buffers = args.slice(0, args.length - 1);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
buffers = args;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
let size = 0;
|
|
161
|
+
for (const buffer of buffers) {
|
|
162
|
+
size += buffer.byteLength;
|
|
163
|
+
}
|
|
164
|
+
const res = new Uint8Array(size);
|
|
165
|
+
let offset = 0;
|
|
166
|
+
for (const buffer of buffers) {
|
|
167
|
+
const view = this.toUint8Array(buffer);
|
|
168
|
+
res.set(view, offset);
|
|
169
|
+
offset += view.length;
|
|
170
|
+
}
|
|
171
|
+
if (args[args.length - 1] instanceof Function) {
|
|
172
|
+
return this.toView(res, args[args.length - 1]);
|
|
173
|
+
}
|
|
174
|
+
return res.buffer;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const STRING_TYPE = "string";
|
|
179
|
+
const HEX_REGEX = /^[0-9a-f\s]+$/i;
|
|
180
|
+
const BASE64_REGEX = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
|
|
181
|
+
const BASE64URL_REGEX = /^[a-zA-Z0-9-_]+$/;
|
|
182
|
+
class Utf8Converter {
|
|
183
|
+
static fromString(text) {
|
|
184
|
+
const s = unescape(encodeURIComponent(text));
|
|
185
|
+
const uintArray = new Uint8Array(s.length);
|
|
186
|
+
for (let i = 0; i < s.length; i++) {
|
|
187
|
+
uintArray[i] = s.charCodeAt(i);
|
|
188
|
+
}
|
|
189
|
+
return uintArray.buffer;
|
|
190
|
+
}
|
|
191
|
+
static toString(buffer) {
|
|
192
|
+
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
193
|
+
let encodedString = "";
|
|
194
|
+
for (let i = 0; i < buf.length; i++) {
|
|
195
|
+
encodedString += String.fromCharCode(buf[i]);
|
|
196
|
+
}
|
|
197
|
+
const decodedString = decodeURIComponent(escape(encodedString));
|
|
198
|
+
return decodedString;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
class Utf16Converter {
|
|
202
|
+
static toString(buffer, littleEndian = false) {
|
|
203
|
+
const arrayBuffer = BufferSourceConverter.toArrayBuffer(buffer);
|
|
204
|
+
const dataView = new DataView(arrayBuffer);
|
|
205
|
+
let res = "";
|
|
206
|
+
for (let i = 0; i < arrayBuffer.byteLength; i += 2) {
|
|
207
|
+
const code = dataView.getUint16(i, littleEndian);
|
|
208
|
+
res += String.fromCharCode(code);
|
|
209
|
+
}
|
|
210
|
+
return res;
|
|
211
|
+
}
|
|
212
|
+
static fromString(text, littleEndian = false) {
|
|
213
|
+
const res = new ArrayBuffer(text.length * 2);
|
|
214
|
+
const dataView = new DataView(res);
|
|
215
|
+
for (let i = 0; i < text.length; i++) {
|
|
216
|
+
dataView.setUint16(i * 2, text.charCodeAt(i), littleEndian);
|
|
217
|
+
}
|
|
218
|
+
return res;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
class Convert {
|
|
222
|
+
static isHex(data) {
|
|
223
|
+
return typeof data === STRING_TYPE
|
|
224
|
+
&& HEX_REGEX.test(data);
|
|
225
|
+
}
|
|
226
|
+
static isBase64(data) {
|
|
227
|
+
return typeof data === STRING_TYPE
|
|
228
|
+
&& BASE64_REGEX.test(data);
|
|
229
|
+
}
|
|
230
|
+
static isBase64Url(data) {
|
|
231
|
+
return typeof data === STRING_TYPE
|
|
232
|
+
&& BASE64URL_REGEX.test(data);
|
|
233
|
+
}
|
|
234
|
+
static ToString(buffer, enc = "utf8") {
|
|
235
|
+
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
236
|
+
switch (enc.toLowerCase()) {
|
|
237
|
+
case "utf8":
|
|
238
|
+
return this.ToUtf8String(buf);
|
|
239
|
+
case "binary":
|
|
240
|
+
return this.ToBinary(buf);
|
|
241
|
+
case "hex":
|
|
242
|
+
return this.ToHex(buf);
|
|
243
|
+
case "base64":
|
|
244
|
+
return this.ToBase64(buf);
|
|
245
|
+
case "base64url":
|
|
246
|
+
return this.ToBase64Url(buf);
|
|
247
|
+
case "utf16le":
|
|
248
|
+
return Utf16Converter.toString(buf, true);
|
|
249
|
+
case "utf16":
|
|
250
|
+
case "utf16be":
|
|
251
|
+
return Utf16Converter.toString(buf);
|
|
252
|
+
default:
|
|
253
|
+
throw new Error(`Unknown type of encoding '${enc}'`);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
static FromString(str, enc = "utf8") {
|
|
257
|
+
if (!str) {
|
|
258
|
+
return new ArrayBuffer(0);
|
|
259
|
+
}
|
|
260
|
+
switch (enc.toLowerCase()) {
|
|
261
|
+
case "utf8":
|
|
262
|
+
return this.FromUtf8String(str);
|
|
263
|
+
case "binary":
|
|
264
|
+
return this.FromBinary(str);
|
|
265
|
+
case "hex":
|
|
266
|
+
return this.FromHex(str);
|
|
267
|
+
case "base64":
|
|
268
|
+
return this.FromBase64(str);
|
|
269
|
+
case "base64url":
|
|
270
|
+
return this.FromBase64Url(str);
|
|
271
|
+
case "utf16le":
|
|
272
|
+
return Utf16Converter.fromString(str, true);
|
|
273
|
+
case "utf16":
|
|
274
|
+
case "utf16be":
|
|
275
|
+
return Utf16Converter.fromString(str);
|
|
276
|
+
default:
|
|
277
|
+
throw new Error(`Unknown type of encoding '${enc}'`);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
static ToBase64(buffer) {
|
|
281
|
+
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
282
|
+
if (typeof btoa !== "undefined") {
|
|
283
|
+
const binary = this.ToString(buf, "binary");
|
|
284
|
+
return btoa(binary);
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
return Buffer.from(buf).toString("base64");
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
static FromBase64(base64) {
|
|
291
|
+
const formatted = this.formatString(base64);
|
|
292
|
+
if (!formatted) {
|
|
293
|
+
return new ArrayBuffer(0);
|
|
294
|
+
}
|
|
295
|
+
if (!Convert.isBase64(formatted)) {
|
|
296
|
+
throw new TypeError("Argument 'base64Text' is not Base64 encoded");
|
|
297
|
+
}
|
|
298
|
+
if (typeof atob !== "undefined") {
|
|
299
|
+
return this.FromBinary(atob(formatted));
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
return new Uint8Array(Buffer.from(formatted, "base64")).buffer;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
static FromBase64Url(base64url) {
|
|
306
|
+
const formatted = this.formatString(base64url);
|
|
307
|
+
if (!formatted) {
|
|
308
|
+
return new ArrayBuffer(0);
|
|
309
|
+
}
|
|
310
|
+
if (!Convert.isBase64Url(formatted)) {
|
|
311
|
+
throw new TypeError("Argument 'base64url' is not Base64Url encoded");
|
|
312
|
+
}
|
|
313
|
+
return this.FromBase64(this.Base64Padding(formatted.replace(/\-/g, "+").replace(/\_/g, "/")));
|
|
314
|
+
}
|
|
315
|
+
static ToBase64Url(data) {
|
|
316
|
+
return this.ToBase64(data).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, "");
|
|
317
|
+
}
|
|
318
|
+
static FromUtf8String(text, encoding = Convert.DEFAULT_UTF8_ENCODING) {
|
|
319
|
+
switch (encoding) {
|
|
320
|
+
case "ascii":
|
|
321
|
+
return this.FromBinary(text);
|
|
322
|
+
case "utf8":
|
|
323
|
+
return Utf8Converter.fromString(text);
|
|
324
|
+
case "utf16":
|
|
325
|
+
case "utf16be":
|
|
326
|
+
return Utf16Converter.fromString(text);
|
|
327
|
+
case "utf16le":
|
|
328
|
+
case "usc2":
|
|
329
|
+
return Utf16Converter.fromString(text, true);
|
|
330
|
+
default:
|
|
331
|
+
throw new Error(`Unknown type of encoding '${encoding}'`);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
static ToUtf8String(buffer, encoding = Convert.DEFAULT_UTF8_ENCODING) {
|
|
335
|
+
switch (encoding) {
|
|
336
|
+
case "ascii":
|
|
337
|
+
return this.ToBinary(buffer);
|
|
338
|
+
case "utf8":
|
|
339
|
+
return Utf8Converter.toString(buffer);
|
|
340
|
+
case "utf16":
|
|
341
|
+
case "utf16be":
|
|
342
|
+
return Utf16Converter.toString(buffer);
|
|
343
|
+
case "utf16le":
|
|
344
|
+
case "usc2":
|
|
345
|
+
return Utf16Converter.toString(buffer, true);
|
|
346
|
+
default:
|
|
347
|
+
throw new Error(`Unknown type of encoding '${encoding}'`);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
static FromBinary(text) {
|
|
351
|
+
const stringLength = text.length;
|
|
352
|
+
const resultView = new Uint8Array(stringLength);
|
|
353
|
+
for (let i = 0; i < stringLength; i++) {
|
|
354
|
+
resultView[i] = text.charCodeAt(i);
|
|
355
|
+
}
|
|
356
|
+
return resultView.buffer;
|
|
357
|
+
}
|
|
358
|
+
static ToBinary(buffer) {
|
|
359
|
+
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
360
|
+
let res = "";
|
|
361
|
+
for (let i = 0; i < buf.length; i++) {
|
|
362
|
+
res += String.fromCharCode(buf[i]);
|
|
363
|
+
}
|
|
364
|
+
return res;
|
|
365
|
+
}
|
|
366
|
+
static ToHex(buffer) {
|
|
367
|
+
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
368
|
+
let result = "";
|
|
369
|
+
const len = buf.length;
|
|
370
|
+
for (let i = 0; i < len; i++) {
|
|
371
|
+
const byte = buf[i];
|
|
372
|
+
if (byte < 16) {
|
|
373
|
+
result += "0";
|
|
374
|
+
}
|
|
375
|
+
result += byte.toString(16);
|
|
376
|
+
}
|
|
377
|
+
return result;
|
|
378
|
+
}
|
|
379
|
+
static FromHex(hexString) {
|
|
380
|
+
let formatted = this.formatString(hexString);
|
|
381
|
+
if (!formatted) {
|
|
382
|
+
return new ArrayBuffer(0);
|
|
383
|
+
}
|
|
384
|
+
if (!Convert.isHex(formatted)) {
|
|
385
|
+
throw new TypeError("Argument 'hexString' is not HEX encoded");
|
|
386
|
+
}
|
|
387
|
+
if (formatted.length % 2) {
|
|
388
|
+
formatted = `0${formatted}`;
|
|
389
|
+
}
|
|
390
|
+
const res = new Uint8Array(formatted.length / 2);
|
|
391
|
+
for (let i = 0; i < formatted.length; i = i + 2) {
|
|
392
|
+
const c = formatted.slice(i, i + 2);
|
|
393
|
+
res[i / 2] = parseInt(c, 16);
|
|
394
|
+
}
|
|
395
|
+
return res.buffer;
|
|
396
|
+
}
|
|
397
|
+
static ToUtf16String(buffer, littleEndian = false) {
|
|
398
|
+
return Utf16Converter.toString(buffer, littleEndian);
|
|
399
|
+
}
|
|
400
|
+
static FromUtf16String(text, littleEndian = false) {
|
|
401
|
+
return Utf16Converter.fromString(text, littleEndian);
|
|
402
|
+
}
|
|
403
|
+
static Base64Padding(base64) {
|
|
404
|
+
const padCount = 4 - (base64.length % 4);
|
|
405
|
+
if (padCount < 4) {
|
|
406
|
+
for (let i = 0; i < padCount; i++) {
|
|
407
|
+
base64 += "=";
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
return base64;
|
|
411
|
+
}
|
|
412
|
+
static formatString(data) {
|
|
413
|
+
return (data === null || data === void 0 ? void 0 : data.replace(/[\n\r\t ]/g, "")) || "";
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
Convert.DEFAULT_UTF8_ENCODING = "utf8";
|
|
417
|
+
|
|
418
|
+
function assign(target, ...sources) {
|
|
419
|
+
const res = arguments[0];
|
|
420
|
+
for (let i = 1; i < arguments.length; i++) {
|
|
421
|
+
const obj = arguments[i];
|
|
422
|
+
for (const prop in obj) {
|
|
423
|
+
res[prop] = obj[prop];
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
return res;
|
|
427
|
+
}
|
|
428
|
+
function combine(...buf) {
|
|
429
|
+
const totalByteLength = buf.map((item) => item.byteLength).reduce((prev, cur) => prev + cur);
|
|
430
|
+
const res = new Uint8Array(totalByteLength);
|
|
431
|
+
let currentPos = 0;
|
|
432
|
+
buf.map((item) => new Uint8Array(item)).forEach((arr) => {
|
|
433
|
+
for (const item2 of arr) {
|
|
434
|
+
res[currentPos++] = item2;
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
return res.buffer;
|
|
438
|
+
}
|
|
439
|
+
function isEqual(bytes1, bytes2) {
|
|
440
|
+
if (!(bytes1 && bytes2)) {
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
443
|
+
if (bytes1.byteLength !== bytes2.byteLength) {
|
|
444
|
+
return false;
|
|
445
|
+
}
|
|
446
|
+
const b1 = new Uint8Array(bytes1);
|
|
447
|
+
const b2 = new Uint8Array(bytes2);
|
|
448
|
+
for (let i = 0; i < bytes1.byteLength; i++) {
|
|
449
|
+
if (b1[i] !== b2[i]) {
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
return true;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
build.BufferSourceConverter = BufferSourceConverter;
|
|
457
|
+
build.Convert = Convert;
|
|
458
|
+
build.assign = assign;
|
|
459
|
+
build.combine = combine;
|
|
460
|
+
build.isEqual = isEqual;
|
|
461
|
+
return build;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
var buildExports = requireBuild();
|
|
427
465
|
|
|
428
466
|
/**
|
|
429
467
|
* @license
|
|
@@ -436,7 +474,7 @@ class Download {
|
|
|
436
474
|
}
|
|
437
475
|
Download.cert = {
|
|
438
476
|
asPEM: (pem, name) => {
|
|
439
|
-
downloadFromBuffer(
|
|
477
|
+
downloadFromBuffer(buildExports.Convert.FromString(pem), name, 'cer', 'application/pkix-cert');
|
|
440
478
|
},
|
|
441
479
|
asDER: (raw, name) => {
|
|
442
480
|
downloadFromBuffer(raw, name, 'cer', 'application/pkix-cert');
|
|
@@ -444,7 +482,7 @@ Download.cert = {
|
|
|
444
482
|
};
|
|
445
483
|
Download.attrCert = {
|
|
446
484
|
asPEM: (pem, name) => {
|
|
447
|
-
downloadFromBuffer(
|
|
485
|
+
downloadFromBuffer(buildExports.Convert.FromString(pem), name, 'cer', 'application/pkix-attr-cert');
|
|
448
486
|
},
|
|
449
487
|
asDER: (raw, name) => {
|
|
450
488
|
downloadFromBuffer(raw, name, 'cer', 'application/pkix-attr-cert');
|
|
@@ -452,7 +490,7 @@ Download.attrCert = {
|
|
|
452
490
|
};
|
|
453
491
|
Download.csr = {
|
|
454
492
|
asPEM: (pem, name) => {
|
|
455
|
-
downloadFromBuffer(
|
|
493
|
+
downloadFromBuffer(buildExports.Convert.FromString(pem), name, 'csr', 'application/pkcs10');
|
|
456
494
|
},
|
|
457
495
|
asDER: (raw, name) => {
|
|
458
496
|
downloadFromBuffer(raw, name, 'csr', 'application/pkcs10');
|
|
@@ -460,7 +498,7 @@ Download.csr = {
|
|
|
460
498
|
};
|
|
461
499
|
Download.crl = {
|
|
462
500
|
asPEM: (pem, name) => {
|
|
463
|
-
downloadFromBuffer(
|
|
501
|
+
downloadFromBuffer(buildExports.Convert.FromString(pem), name, 'crl', 'application/pkix-crl');
|
|
464
502
|
},
|
|
465
503
|
asDER: (raw, name) => {
|
|
466
504
|
downloadFromBuffer(raw, name, 'crl', 'application/pkix-crl');
|
|
@@ -470,6 +508,7 @@ Download.crl = {
|
|
|
470
508
|
/*!
|
|
471
509
|
Copyright (c) Peculiar Ventures, LLC
|
|
472
510
|
*/
|
|
511
|
+
|
|
473
512
|
function utilFromBase(inputBuffer, inputBase) {
|
|
474
513
|
let result = 0;
|
|
475
514
|
if (inputBuffer.length === 1) {
|
|
@@ -641,6 +680,7 @@ function padNumber(inputNumber, fullLength) {
|
|
|
641
680
|
*
|
|
642
681
|
*/
|
|
643
682
|
|
|
683
|
+
|
|
644
684
|
function assertBigInt() {
|
|
645
685
|
if (typeof BigInt === "undefined") {
|
|
646
686
|
throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.");
|
|
@@ -724,7 +764,7 @@ function HexBlock(BaseClass) {
|
|
|
724
764
|
super(...args);
|
|
725
765
|
const params = args[0] || {};
|
|
726
766
|
this.isHexOnly = (_a = params.isHexOnly) !== null && _a !== void 0 ? _a : false;
|
|
727
|
-
this.valueHexView = params.valueHex ?
|
|
767
|
+
this.valueHexView = params.valueHex ? buildExports.BufferSourceConverter.toUint8Array(params.valueHex) : EMPTY_VIEW;
|
|
728
768
|
}
|
|
729
769
|
get valueHex() {
|
|
730
770
|
return this.valueHexView.slice().buffer;
|
|
@@ -762,7 +802,7 @@ function HexBlock(BaseClass) {
|
|
|
762
802
|
return {
|
|
763
803
|
...super.toJSON(),
|
|
764
804
|
isHexOnly: this.isHexOnly,
|
|
765
|
-
valueHex:
|
|
805
|
+
valueHex: buildExports.Convert.ToHex(this.valueHexView),
|
|
766
806
|
};
|
|
767
807
|
}
|
|
768
808
|
},
|
|
@@ -775,7 +815,7 @@ class LocalBaseBlock {
|
|
|
775
815
|
this.blockLength = blockLength;
|
|
776
816
|
this.error = error;
|
|
777
817
|
this.warnings = warnings;
|
|
778
|
-
this.valueBeforeDecodeView =
|
|
818
|
+
this.valueBeforeDecodeView = buildExports.BufferSourceConverter.toUint8Array(valueBeforeDecode);
|
|
779
819
|
}
|
|
780
820
|
static blockName() {
|
|
781
821
|
return this.NAME;
|
|
@@ -792,7 +832,7 @@ class LocalBaseBlock {
|
|
|
792
832
|
blockLength: this.blockLength,
|
|
793
833
|
error: this.error,
|
|
794
834
|
warnings: this.warnings,
|
|
795
|
-
valueBeforeDecode:
|
|
835
|
+
valueBeforeDecode: buildExports.Convert.ToHex(this.valueBeforeDecodeView),
|
|
796
836
|
};
|
|
797
837
|
}
|
|
798
838
|
}
|
|
@@ -814,7 +854,7 @@ class LocalIdentificationBlock extends HexBlock(LocalBaseBlock) {
|
|
|
814
854
|
super();
|
|
815
855
|
if (idBlock) {
|
|
816
856
|
this.isHexOnly = (_a = idBlock.isHexOnly) !== null && _a !== void 0 ? _a : false;
|
|
817
|
-
this.valueHexView = idBlock.valueHex ?
|
|
857
|
+
this.valueHexView = idBlock.valueHex ? buildExports.BufferSourceConverter.toUint8Array(idBlock.valueHex) : EMPTY_VIEW;
|
|
818
858
|
this.tagClass = (_b = idBlock.tagClass) !== null && _b !== void 0 ? _b : -1;
|
|
819
859
|
this.tagNumber = (_c = idBlock.tagNumber) !== null && _c !== void 0 ? _c : -1;
|
|
820
860
|
this.isConstructed = (_d = idBlock.isConstructed) !== null && _d !== void 0 ? _d : false;
|
|
@@ -880,7 +920,7 @@ class LocalIdentificationBlock extends HexBlock(LocalBaseBlock) {
|
|
|
880
920
|
return retView.buffer;
|
|
881
921
|
}
|
|
882
922
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
883
|
-
const inputView =
|
|
923
|
+
const inputView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
884
924
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
885
925
|
return -1;
|
|
886
926
|
}
|
|
@@ -989,7 +1029,7 @@ class LocalLengthBlock extends LocalBaseBlock {
|
|
|
989
1029
|
this.length = (_c = lenBlock.length) !== null && _c !== void 0 ? _c : 0;
|
|
990
1030
|
}
|
|
991
1031
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
992
|
-
const view =
|
|
1032
|
+
const view = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
993
1033
|
if (!checkBufferParams(this, view, inputOffset, inputLength)) {
|
|
994
1034
|
return -1;
|
|
995
1035
|
}
|
|
@@ -1148,10 +1188,10 @@ class BaseBlock extends LocalBaseBlock {
|
|
|
1148
1188
|
if (encoding === "ascii") {
|
|
1149
1189
|
return this.onAsciiEncoding();
|
|
1150
1190
|
}
|
|
1151
|
-
return
|
|
1191
|
+
return buildExports.Convert.ToHex(this.toBER());
|
|
1152
1192
|
}
|
|
1153
1193
|
onAsciiEncoding() {
|
|
1154
|
-
return `${this.constructor.NAME} : ${
|
|
1194
|
+
return `${this.constructor.NAME} : ${buildExports.Convert.ToHex(this.valueBlock.valueBeforeDecodeView)}`;
|
|
1155
1195
|
}
|
|
1156
1196
|
isEqual(other) {
|
|
1157
1197
|
if (this === other) {
|
|
@@ -1449,7 +1489,7 @@ function fromBER(inputBuffer) {
|
|
|
1449
1489
|
result
|
|
1450
1490
|
};
|
|
1451
1491
|
}
|
|
1452
|
-
return localFromBER(
|
|
1492
|
+
return localFromBER(buildExports.BufferSourceConverter.toUint8Array(inputBuffer).slice(), 0, inputBuffer.byteLength);
|
|
1453
1493
|
}
|
|
1454
1494
|
|
|
1455
1495
|
function checkLen(indefiniteLength, length) {
|
|
@@ -1465,7 +1505,7 @@ class LocalConstructedValueBlock extends ValueBlock {
|
|
|
1465
1505
|
this.isIndefiniteForm = isIndefiniteForm;
|
|
1466
1506
|
}
|
|
1467
1507
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
1468
|
-
const view =
|
|
1508
|
+
const view = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1469
1509
|
if (!checkBufferParams(this, view, inputOffset, inputLength)) {
|
|
1470
1510
|
return -1;
|
|
1471
1511
|
}
|
|
@@ -1635,7 +1675,7 @@ class LocalBooleanValueBlock extends HexBlock(ValueBlock) {
|
|
|
1635
1675
|
constructor({ value, ...parameters } = {}) {
|
|
1636
1676
|
super(parameters);
|
|
1637
1677
|
if (parameters.valueHex) {
|
|
1638
|
-
this.valueHexView =
|
|
1678
|
+
this.valueHexView = buildExports.BufferSourceConverter.toUint8Array(parameters.valueHex);
|
|
1639
1679
|
}
|
|
1640
1680
|
else {
|
|
1641
1681
|
this.valueHexView = new Uint8Array(1);
|
|
@@ -1656,7 +1696,7 @@ class LocalBooleanValueBlock extends HexBlock(ValueBlock) {
|
|
|
1656
1696
|
this.valueHexView[0] = value ? 0xFF : 0x00;
|
|
1657
1697
|
}
|
|
1658
1698
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
1659
|
-
const inputView =
|
|
1699
|
+
const inputView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1660
1700
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
1661
1701
|
return -1;
|
|
1662
1702
|
}
|
|
@@ -1755,7 +1795,7 @@ class LocalOctetStringValueBlock extends HexBlock(LocalConstructedValueBlock) {
|
|
|
1755
1795
|
LocalOctetStringValueBlock.NAME = "OctetStringValueBlock";
|
|
1756
1796
|
|
|
1757
1797
|
var _a$r;
|
|
1758
|
-
|
|
1798
|
+
let OctetString$1 = class OctetString extends BaseBlock {
|
|
1759
1799
|
constructor({ idBlock = {}, lenBlock = {}, ...parameters } = {}) {
|
|
1760
1800
|
var _b, _c;
|
|
1761
1801
|
(_b = parameters.isConstructed) !== null && _b !== void 0 ? _b : (parameters.isConstructed = !!((_c = parameters.value) === null || _c === void 0 ? void 0 : _c.length));
|
|
@@ -1803,7 +1843,7 @@ class OctetString$1 extends BaseBlock {
|
|
|
1803
1843
|
if (this.valueBlock.isConstructed || (this.valueBlock.value && this.valueBlock.value.length)) {
|
|
1804
1844
|
return Constructed.prototype.onAsciiEncoding.call(this);
|
|
1805
1845
|
}
|
|
1806
|
-
return `${this.constructor.NAME} : ${
|
|
1846
|
+
return `${this.constructor.NAME} : ${buildExports.Convert.ToHex(this.valueBlock.valueHexView)}`;
|
|
1807
1847
|
}
|
|
1808
1848
|
getValue() {
|
|
1809
1849
|
if (!this.idBlock.isConstructed) {
|
|
@@ -1811,13 +1851,13 @@ class OctetString$1 extends BaseBlock {
|
|
|
1811
1851
|
}
|
|
1812
1852
|
const array = [];
|
|
1813
1853
|
for (const content of this.valueBlock.value) {
|
|
1814
|
-
if (content instanceof OctetString
|
|
1854
|
+
if (content instanceof OctetString) {
|
|
1815
1855
|
array.push(content.valueBlock.valueHexView);
|
|
1816
1856
|
}
|
|
1817
1857
|
}
|
|
1818
|
-
return
|
|
1858
|
+
return buildExports.BufferSourceConverter.concat(array);
|
|
1819
1859
|
}
|
|
1820
|
-
}
|
|
1860
|
+
};
|
|
1821
1861
|
_a$r = OctetString$1;
|
|
1822
1862
|
(() => {
|
|
1823
1863
|
typeStore.OctetString = _a$r;
|
|
@@ -1863,7 +1903,7 @@ class LocalBitStringValueBlock extends HexBlock(LocalConstructedValueBlock) {
|
|
|
1863
1903
|
}
|
|
1864
1904
|
return resultOffset;
|
|
1865
1905
|
}
|
|
1866
|
-
const inputView =
|
|
1906
|
+
const inputView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1867
1907
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
1868
1908
|
return -1;
|
|
1869
1909
|
}
|
|
@@ -1916,7 +1956,7 @@ class LocalBitStringValueBlock extends HexBlock(LocalConstructedValueBlock) {
|
|
|
1916
1956
|
LocalBitStringValueBlock.NAME = "BitStringValueBlock";
|
|
1917
1957
|
|
|
1918
1958
|
var _a$q;
|
|
1919
|
-
|
|
1959
|
+
let BitString$1 = class BitString extends BaseBlock {
|
|
1920
1960
|
constructor({ idBlock = {}, lenBlock = {}, ...parameters } = {}) {
|
|
1921
1961
|
var _b, _c;
|
|
1922
1962
|
(_b = parameters.isConstructed) !== null && _b !== void 0 ? _b : (parameters.isConstructed = !!((_c = parameters.value) === null || _c === void 0 ? void 0 : _c.length));
|
|
@@ -1953,7 +1993,7 @@ class BitString$1 extends BaseBlock {
|
|
|
1953
1993
|
return `${this.constructor.NAME} : ${bitsStr.substring(0, bitsStr.length - this.valueBlock.unusedBits)}`;
|
|
1954
1994
|
}
|
|
1955
1995
|
}
|
|
1956
|
-
}
|
|
1996
|
+
};
|
|
1957
1997
|
_a$q = BitString$1;
|
|
1958
1998
|
(() => {
|
|
1959
1999
|
typeStore.BitString = _a$q;
|
|
@@ -2203,13 +2243,13 @@ class Integer extends BaseBlock {
|
|
|
2203
2243
|
const bigIntValue = BigInt(value);
|
|
2204
2244
|
const writer = new ViewWriter();
|
|
2205
2245
|
const hex = bigIntValue.toString(16).replace(/^-/, "");
|
|
2206
|
-
const view = new Uint8Array(
|
|
2246
|
+
const view = new Uint8Array(buildExports.Convert.FromHex(hex));
|
|
2207
2247
|
if (bigIntValue < 0) {
|
|
2208
2248
|
const first = new Uint8Array(view.length + (view[0] & 0x80 ? 1 : 0));
|
|
2209
2249
|
first[0] |= 0x80;
|
|
2210
|
-
const firstInt = BigInt(`0x${
|
|
2250
|
+
const firstInt = BigInt(`0x${buildExports.Convert.ToHex(first)}`);
|
|
2211
2251
|
const secondInt = firstInt + bigIntValue;
|
|
2212
|
-
const second =
|
|
2252
|
+
const second = buildExports.BufferSourceConverter.toUint8Array(buildExports.Convert.FromHex(secondInt.toString(16)));
|
|
2213
2253
|
second[0] |= 0x80;
|
|
2214
2254
|
writer.write(second);
|
|
2215
2255
|
}
|
|
@@ -2270,7 +2310,7 @@ class LocalSidValueBlock extends HexBlock(ValueBlock) {
|
|
|
2270
2310
|
if (!inputLength) {
|
|
2271
2311
|
return inputOffset;
|
|
2272
2312
|
}
|
|
2273
|
-
const inputView =
|
|
2313
|
+
const inputView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2274
2314
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
2275
2315
|
return -1;
|
|
2276
2316
|
}
|
|
@@ -2342,7 +2382,7 @@ class LocalSidValueBlock extends HexBlock(ValueBlock) {
|
|
|
2342
2382
|
toString() {
|
|
2343
2383
|
let result = "";
|
|
2344
2384
|
if (this.isHexOnly)
|
|
2345
|
-
result =
|
|
2385
|
+
result = buildExports.Convert.ToHex(this.valueHexView);
|
|
2346
2386
|
else {
|
|
2347
2387
|
if (this.isFirstSid) {
|
|
2348
2388
|
let sidValue = this.valueDec;
|
|
@@ -2539,7 +2579,7 @@ class LocalRelativeSidValueBlock extends HexBlock(LocalBaseBlock) {
|
|
|
2539
2579
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
2540
2580
|
if (inputLength === 0)
|
|
2541
2581
|
return inputOffset;
|
|
2542
|
-
const inputView =
|
|
2582
|
+
const inputView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2543
2583
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength))
|
|
2544
2584
|
return -1;
|
|
2545
2585
|
const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);
|
|
@@ -2597,7 +2637,7 @@ class LocalRelativeSidValueBlock extends HexBlock(LocalBaseBlock) {
|
|
|
2597
2637
|
toString() {
|
|
2598
2638
|
let result = "";
|
|
2599
2639
|
if (this.isHexOnly)
|
|
2600
|
-
result =
|
|
2640
|
+
result = buildExports.Convert.ToHex(this.valueHexView);
|
|
2601
2641
|
else {
|
|
2602
2642
|
result = this.valueDec.toString();
|
|
2603
2643
|
}
|
|
@@ -2779,7 +2819,7 @@ class LocalSimpleStringBlock extends BaseStringBlock {
|
|
|
2779
2819
|
super(parameters, LocalSimpleStringValueBlock);
|
|
2780
2820
|
}
|
|
2781
2821
|
fromBuffer(inputBuffer) {
|
|
2782
|
-
this.valueBlock.value = String.fromCharCode.apply(null,
|
|
2822
|
+
this.valueBlock.value = String.fromCharCode.apply(null, buildExports.BufferSourceConverter.toUint8Array(inputBuffer));
|
|
2783
2823
|
}
|
|
2784
2824
|
fromString(inputString) {
|
|
2785
2825
|
const strLen = inputString.length;
|
|
@@ -2793,17 +2833,17 @@ LocalSimpleStringBlock.NAME = "SIMPLE STRING";
|
|
|
2793
2833
|
|
|
2794
2834
|
class LocalUtf8StringValueBlock extends LocalSimpleStringBlock {
|
|
2795
2835
|
fromBuffer(inputBuffer) {
|
|
2796
|
-
this.valueBlock.valueHexView =
|
|
2836
|
+
this.valueBlock.valueHexView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2797
2837
|
try {
|
|
2798
|
-
this.valueBlock.value =
|
|
2838
|
+
this.valueBlock.value = buildExports.Convert.ToUtf8String(inputBuffer);
|
|
2799
2839
|
}
|
|
2800
2840
|
catch (ex) {
|
|
2801
2841
|
this.warnings.push(`Error during "decodeURIComponent": ${ex}, using raw string`);
|
|
2802
|
-
this.valueBlock.value =
|
|
2842
|
+
this.valueBlock.value = buildExports.Convert.ToBinary(inputBuffer);
|
|
2803
2843
|
}
|
|
2804
2844
|
}
|
|
2805
2845
|
fromString(inputString) {
|
|
2806
|
-
this.valueBlock.valueHexView = new Uint8Array(
|
|
2846
|
+
this.valueBlock.valueHexView = new Uint8Array(buildExports.Convert.FromUtf8String(inputString));
|
|
2807
2847
|
this.valueBlock.value = inputString;
|
|
2808
2848
|
}
|
|
2809
2849
|
}
|
|
@@ -2825,12 +2865,12 @@ Utf8String.NAME = "UTF8String";
|
|
|
2825
2865
|
|
|
2826
2866
|
class LocalBmpStringValueBlock extends LocalSimpleStringBlock {
|
|
2827
2867
|
fromBuffer(inputBuffer) {
|
|
2828
|
-
this.valueBlock.value =
|
|
2829
|
-
this.valueBlock.valueHexView =
|
|
2868
|
+
this.valueBlock.value = buildExports.Convert.ToUtf16String(inputBuffer);
|
|
2869
|
+
this.valueBlock.valueHexView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2830
2870
|
}
|
|
2831
2871
|
fromString(inputString) {
|
|
2832
2872
|
this.valueBlock.value = inputString;
|
|
2833
|
-
this.valueBlock.valueHexView = new Uint8Array(
|
|
2873
|
+
this.valueBlock.valueHexView = new Uint8Array(buildExports.Convert.FromUtf16String(inputString));
|
|
2834
2874
|
}
|
|
2835
2875
|
}
|
|
2836
2876
|
LocalBmpStringValueBlock.NAME = "BmpStringValueBlock";
|
|
@@ -3042,7 +3082,7 @@ class UTCTime extends VisibleString {
|
|
|
3042
3082
|
this.idBlock.tagNumber = 23;
|
|
3043
3083
|
}
|
|
3044
3084
|
fromBuffer(inputBuffer) {
|
|
3045
|
-
this.fromString(String.fromCharCode.apply(null,
|
|
3085
|
+
this.fromString(String.fromCharCode.apply(null, buildExports.BufferSourceConverter.toUint8Array(inputBuffer)));
|
|
3046
3086
|
}
|
|
3047
3087
|
toBuffer() {
|
|
3048
3088
|
const str = this.toString();
|
|
@@ -3392,17 +3432,17 @@ class Repeated extends Any {
|
|
|
3392
3432
|
|
|
3393
3433
|
class RawData {
|
|
3394
3434
|
constructor({ data = EMPTY_VIEW } = {}) {
|
|
3395
|
-
this.dataView =
|
|
3435
|
+
this.dataView = buildExports.BufferSourceConverter.toUint8Array(data);
|
|
3396
3436
|
}
|
|
3397
3437
|
get data() {
|
|
3398
3438
|
return this.dataView.slice().buffer;
|
|
3399
3439
|
}
|
|
3400
3440
|
set data(value) {
|
|
3401
|
-
this.dataView =
|
|
3441
|
+
this.dataView = buildExports.BufferSourceConverter.toUint8Array(value);
|
|
3402
3442
|
}
|
|
3403
3443
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
3404
3444
|
const endLength = inputOffset + inputLength;
|
|
3405
|
-
this.dataView =
|
|
3445
|
+
this.dataView = buildExports.BufferSourceConverter.toUint8Array(inputBuffer).subarray(inputOffset, endLength);
|
|
3406
3446
|
return endLength;
|
|
3407
3447
|
}
|
|
3408
3448
|
toBER(sizeOnly) {
|
|
@@ -3721,7 +3761,7 @@ function verifySchema(inputBuffer, inputSchema) {
|
|
|
3721
3761
|
result: { error: "Wrong ASN.1 schema type" }
|
|
3722
3762
|
};
|
|
3723
3763
|
}
|
|
3724
|
-
const asn1 = localFromBER(
|
|
3764
|
+
const asn1 = localFromBER(buildExports.BufferSourceConverter.toUint8Array(inputBuffer));
|
|
3725
3765
|
if (asn1.offset === -1) {
|
|
3726
3766
|
return {
|
|
3727
3767
|
verified: false,
|
|
@@ -3731,7 +3771,7 @@ function verifySchema(inputBuffer, inputSchema) {
|
|
|
3731
3771
|
return compareSchema(asn1.result, asn1.result, inputSchema);
|
|
3732
3772
|
}
|
|
3733
3773
|
|
|
3734
|
-
|
|
3774
|
+
var asn1js = /*#__PURE__*/Object.freeze({
|
|
3735
3775
|
__proto__: null,
|
|
3736
3776
|
Any: Any,
|
|
3737
3777
|
BaseBlock: BaseBlock,
|
|
@@ -3824,9 +3864,9 @@ class BitString {
|
|
|
3824
3864
|
if (typeof params === "number") {
|
|
3825
3865
|
this.fromNumber(params);
|
|
3826
3866
|
}
|
|
3827
|
-
else if (
|
|
3867
|
+
else if (buildExports.BufferSourceConverter.isBufferSource(params)) {
|
|
3828
3868
|
this.unusedBits = unusedBits;
|
|
3829
|
-
this.value =
|
|
3869
|
+
this.value = buildExports.BufferSourceConverter.toArrayBuffer(params);
|
|
3830
3870
|
}
|
|
3831
3871
|
else {
|
|
3832
3872
|
throw TypeError("Unsupported type of 'params' argument for BitString");
|
|
@@ -3864,7 +3904,11 @@ class BitString {
|
|
|
3864
3904
|
const octetSize = (bits.length + 7) >> 3;
|
|
3865
3905
|
this.unusedBits = (octetSize << 3) - bits.length;
|
|
3866
3906
|
const octets = new Uint8Array(octetSize);
|
|
3867
|
-
bits = bits
|
|
3907
|
+
bits = bits
|
|
3908
|
+
.padStart(octetSize << 3, "0")
|
|
3909
|
+
.split("")
|
|
3910
|
+
.reverse()
|
|
3911
|
+
.join("");
|
|
3868
3912
|
let index = 0;
|
|
3869
3913
|
while (index < octetSize) {
|
|
3870
3914
|
octets[index] = parseInt(bits.slice(index << 3, (index << 3) + 8), 2);
|
|
@@ -3886,8 +3930,8 @@ class OctetString {
|
|
|
3886
3930
|
this.buffer = new ArrayBuffer(param);
|
|
3887
3931
|
}
|
|
3888
3932
|
else {
|
|
3889
|
-
if (
|
|
3890
|
-
this.buffer =
|
|
3933
|
+
if (buildExports.BufferSourceConverter.isBufferSource(param)) {
|
|
3934
|
+
this.buffer = buildExports.BufferSourceConverter.toArrayBuffer(param);
|
|
3891
3935
|
}
|
|
3892
3936
|
else if (Array.isArray(param)) {
|
|
3893
3937
|
this.buffer = new Uint8Array(param);
|
|
@@ -4125,7 +4169,7 @@ class AsnSchemaStorage {
|
|
|
4125
4169
|
const item = schema.items[key];
|
|
4126
4170
|
const name = useNames ? key : "";
|
|
4127
4171
|
let asn1Item;
|
|
4128
|
-
if (typeof
|
|
4172
|
+
if (typeof item.type === "number") {
|
|
4129
4173
|
const Asn1TypeName = AsnPropTypes[item.type];
|
|
4130
4174
|
const Asn1Type = asn1js[Asn1TypeName];
|
|
4131
4175
|
if (!Asn1Type) {
|
|
@@ -4153,9 +4197,7 @@ class AsnSchemaStorage {
|
|
|
4153
4197
|
const optional = !!item.optional || item.defaultValue !== undefined;
|
|
4154
4198
|
if (item.repeated) {
|
|
4155
4199
|
asn1Item.name = "";
|
|
4156
|
-
const Container = item.repeated === "set"
|
|
4157
|
-
? Set
|
|
4158
|
-
: Sequence;
|
|
4200
|
+
const Container = item.repeated === "set" ? Set : Sequence;
|
|
4159
4201
|
asn1Item = new Container({
|
|
4160
4202
|
name: "",
|
|
4161
4203
|
value: [
|
|
@@ -4169,9 +4211,7 @@ class AsnSchemaStorage {
|
|
|
4169
4211
|
if (item.context !== null && item.context !== undefined) {
|
|
4170
4212
|
if (item.implicit) {
|
|
4171
4213
|
if (typeof item.type === "number" || isConvertible(item.type)) {
|
|
4172
|
-
const Container = item.repeated
|
|
4173
|
-
? Constructed
|
|
4174
|
-
: Primitive;
|
|
4214
|
+
const Container = item.repeated ? Constructed : Primitive;
|
|
4175
4215
|
asn1Value.push(new Container({
|
|
4176
4216
|
name,
|
|
4177
4217
|
optional,
|
|
@@ -4184,10 +4224,11 @@ class AsnSchemaStorage {
|
|
|
4184
4224
|
else {
|
|
4185
4225
|
this.cache(item.type);
|
|
4186
4226
|
const isRepeated = !!item.repeated;
|
|
4187
|
-
let value = !isRepeated
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4227
|
+
let value = !isRepeated ? this.get(item.type, true).schema : asn1Item;
|
|
4228
|
+
value =
|
|
4229
|
+
"valueBlock" in value
|
|
4230
|
+
? value.valueBlock.value
|
|
4231
|
+
: value.value;
|
|
4191
4232
|
asn1Value.push(new Constructed({
|
|
4192
4233
|
name: !isRepeated ? name : "",
|
|
4193
4234
|
optional,
|
|
@@ -4348,16 +4389,15 @@ class AsnParser {
|
|
|
4348
4389
|
}
|
|
4349
4390
|
if (schemaItem.repeated) {
|
|
4350
4391
|
if (schemaItem.implicit) {
|
|
4351
|
-
const Container = schemaItem.repeated === "sequence"
|
|
4352
|
-
? Sequence
|
|
4353
|
-
: Set;
|
|
4392
|
+
const Container = schemaItem.repeated === "sequence" ? Sequence : Set;
|
|
4354
4393
|
const newItem = new Container();
|
|
4355
4394
|
newItem.valueBlock = asn1SchemaValue.valueBlock;
|
|
4356
4395
|
const newItemAsn = fromBER(newItem.toBER(false));
|
|
4357
4396
|
if (newItemAsn.offset === -1) {
|
|
4358
4397
|
throw new Error(`Cannot parse the child item. ${newItemAsn.result.error}`);
|
|
4359
4398
|
}
|
|
4360
|
-
if (!("value" in newItemAsn.result.valueBlock &&
|
|
4399
|
+
if (!("value" in newItemAsn.result.valueBlock &&
|
|
4400
|
+
Array.isArray(newItemAsn.result.valueBlock.value))) {
|
|
4361
4401
|
throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");
|
|
4362
4402
|
}
|
|
4363
4403
|
const value = newItemAsn.result.valueBlock.value;
|
|
@@ -4448,19 +4488,23 @@ class AsnSerializer {
|
|
|
4448
4488
|
for (const key in schema.items) {
|
|
4449
4489
|
const schemaItem = schema.items[key];
|
|
4450
4490
|
const objProp = obj[key];
|
|
4451
|
-
if (objProp === undefined
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4491
|
+
if (objProp === undefined ||
|
|
4492
|
+
schemaItem.defaultValue === objProp ||
|
|
4493
|
+
(typeof schemaItem.defaultValue === "object" &&
|
|
4494
|
+
typeof objProp === "object" &&
|
|
4495
|
+
isArrayEqual(this.serialize(schemaItem.defaultValue), this.serialize(objProp)))) {
|
|
4455
4496
|
continue;
|
|
4456
4497
|
}
|
|
4457
4498
|
const asn1Item = AsnSerializer.toAsnItem(schemaItem, key, target, objProp);
|
|
4458
4499
|
if (typeof schemaItem.context === "number") {
|
|
4459
4500
|
if (schemaItem.implicit) {
|
|
4460
|
-
if (!schemaItem.repeated
|
|
4461
|
-
|
|
4501
|
+
if (!schemaItem.repeated &&
|
|
4502
|
+
(typeof schemaItem.type === "number" || isConvertible(schemaItem.type))) {
|
|
4462
4503
|
const value = {};
|
|
4463
|
-
value.valueHex =
|
|
4504
|
+
value.valueHex =
|
|
4505
|
+
asn1Item instanceof Null
|
|
4506
|
+
? asn1Item.valueBeforeDecodeView
|
|
4507
|
+
: asn1Item.valueBlock.toBER();
|
|
4464
4508
|
asn1Value.push(new Primitive({
|
|
4465
4509
|
optional: schemaItem.optional,
|
|
4466
4510
|
idBlock: {
|
|
@@ -4517,1115 +4561,213 @@ class AsnSerializer {
|
|
|
4517
4561
|
}
|
|
4518
4562
|
return asnSchema;
|
|
4519
4563
|
}
|
|
4520
|
-
static toAsnItem(schemaItem, key, target, objProp) {
|
|
4521
|
-
let asn1Item;
|
|
4522
|
-
if (typeof
|
|
4523
|
-
const converter = schemaItem.converter;
|
|
4524
|
-
if (!converter) {
|
|
4525
|
-
throw new Error(`Property '${key}' doesn't have converter for type ${AsnPropTypes[schemaItem.type]} in schema '${target.name}'`);
|
|
4526
|
-
}
|
|
4527
|
-
if (schemaItem.repeated) {
|
|
4528
|
-
if (!Array.isArray(objProp)) {
|
|
4529
|
-
throw new TypeError("Parameter 'objProp' should be type of Array.");
|
|
4530
|
-
}
|
|
4531
|
-
const items = Array.from(objProp, (element) => converter.toASN(element));
|
|
4532
|
-
const Container = schemaItem.repeated === "sequence"
|
|
4533
|
-
? Sequence
|
|
4534
|
-
: Set;
|
|
4535
|
-
asn1Item = new Container({
|
|
4536
|
-
value: items,
|
|
4537
|
-
});
|
|
4538
|
-
}
|
|
4539
|
-
else {
|
|
4540
|
-
asn1Item = converter.toASN(objProp);
|
|
4541
|
-
}
|
|
4542
|
-
}
|
|
4543
|
-
else {
|
|
4544
|
-
if (schemaItem.repeated) {
|
|
4545
|
-
if (!Array.isArray(objProp)) {
|
|
4546
|
-
throw new TypeError("Parameter 'objProp' should be type of Array.");
|
|
4547
|
-
}
|
|
4548
|
-
const items = Array.from(objProp, (element) => this.toASN(element));
|
|
4549
|
-
const Container = schemaItem.repeated === "sequence"
|
|
4550
|
-
? Sequence
|
|
4551
|
-
: Set;
|
|
4552
|
-
asn1Item = new Container({
|
|
4553
|
-
value: items,
|
|
4554
|
-
});
|
|
4555
|
-
}
|
|
4556
|
-
else {
|
|
4557
|
-
asn1Item = this.toASN(objProp);
|
|
4558
|
-
}
|
|
4559
|
-
}
|
|
4560
|
-
return asn1Item;
|
|
4561
|
-
}
|
|
4562
|
-
}
|
|
4563
|
-
|
|
4564
|
-
class AsnArray extends Array {
|
|
4565
|
-
constructor(items = []) {
|
|
4566
|
-
if (typeof items === "number") {
|
|
4567
|
-
super(items);
|
|
4568
|
-
}
|
|
4569
|
-
else {
|
|
4570
|
-
super();
|
|
4571
|
-
for (const item of items) {
|
|
4572
|
-
this.push(item);
|
|
4573
|
-
}
|
|
4574
|
-
}
|
|
4575
|
-
}
|
|
4576
|
-
}
|
|
4577
|
-
|
|
4578
|
-
class AsnConvert {
|
|
4579
|
-
static serialize(obj) {
|
|
4580
|
-
return AsnSerializer.serialize(obj);
|
|
4581
|
-
}
|
|
4582
|
-
static parse(data, target) {
|
|
4583
|
-
return AsnParser.parse(data, target);
|
|
4584
|
-
}
|
|
4585
|
-
static toString(data) {
|
|
4586
|
-
const buf = BufferSourceConverter_1.isBufferSource(data)
|
|
4587
|
-
? BufferSourceConverter_1.toArrayBuffer(data)
|
|
4588
|
-
: AsnConvert.serialize(data);
|
|
4589
|
-
const asn = fromBER(buf);
|
|
4590
|
-
if (asn.offset === -1) {
|
|
4591
|
-
throw new Error(`Cannot decode ASN.1 data. ${asn.result.error}`);
|
|
4592
|
-
}
|
|
4593
|
-
return asn.result.toString();
|
|
4594
|
-
}
|
|
4595
|
-
}
|
|
4596
|
-
|
|
4597
|
-
/******************************************************************************
|
|
4598
|
-
Copyright (c) Microsoft Corporation.
|
|
4599
|
-
|
|
4600
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
4601
|
-
purpose with or without fee is hereby granted.
|
|
4602
|
-
|
|
4603
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
4604
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
4605
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
4606
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
4607
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
4608
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
4609
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
4610
|
-
***************************************************************************** */
|
|
4611
|
-
|
|
4612
|
-
function __decorate$1(decorators, target, key, desc) {
|
|
4613
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4614
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4615
|
-
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;
|
|
4616
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4617
|
-
}
|
|
4618
|
-
|
|
4619
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
4620
|
-
var e = new Error(message);
|
|
4621
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
4622
|
-
};
|
|
4623
|
-
|
|
4624
|
-
var ipaddr = {exports: {}};
|
|
4625
|
-
|
|
4626
|
-
(function (module) {
|
|
4627
|
-
(function (root) {
|
|
4628
|
-
// A list of regular expressions that match arbitrary IPv4 addresses,
|
|
4629
|
-
// for which a number of weird notations exist.
|
|
4630
|
-
// Note that an address like 0010.0xa5.1.1 is considered legal.
|
|
4631
|
-
const ipv4Part = '(0?\\d+|0x[a-f0-9]+)';
|
|
4632
|
-
const ipv4Regexes = {
|
|
4633
|
-
fourOctet: new RegExp(`^${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}$`, 'i'),
|
|
4634
|
-
threeOctet: new RegExp(`^${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}$`, 'i'),
|
|
4635
|
-
twoOctet: new RegExp(`^${ipv4Part}\\.${ipv4Part}$`, 'i'),
|
|
4636
|
-
longValue: new RegExp(`^${ipv4Part}$`, 'i')
|
|
4637
|
-
};
|
|
4638
|
-
|
|
4639
|
-
// Regular Expression for checking Octal numbers
|
|
4640
|
-
const octalRegex = new RegExp(`^0[0-7]+$`, 'i');
|
|
4641
|
-
const hexRegex = new RegExp(`^0x[a-f0-9]+$`, 'i');
|
|
4642
|
-
|
|
4643
|
-
const zoneIndex = '%[0-9a-z]{1,}';
|
|
4644
|
-
|
|
4645
|
-
// IPv6-matching regular expressions.
|
|
4646
|
-
// For IPv6, the task is simpler: it is enough to match the colon-delimited
|
|
4647
|
-
// hexadecimal IPv6 and a transitional variant with dotted-decimal IPv4 at
|
|
4648
|
-
// the end.
|
|
4649
|
-
const ipv6Part = '(?:[0-9a-f]+::?)+';
|
|
4650
|
-
const ipv6Regexes = {
|
|
4651
|
-
zoneIndex: new RegExp(zoneIndex, 'i'),
|
|
4652
|
-
'native': new RegExp(`^(::)?(${ipv6Part})?([0-9a-f]+)?(::)?(${zoneIndex})?$`, 'i'),
|
|
4653
|
-
deprecatedTransitional: new RegExp(`^(?:::)(${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}(${zoneIndex})?)$`, 'i'),
|
|
4654
|
-
transitional: new RegExp(`^((?:${ipv6Part})|(?:::)(?:${ipv6Part})?)${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}(${zoneIndex})?$`, 'i')
|
|
4655
|
-
};
|
|
4656
|
-
|
|
4657
|
-
// Expand :: in an IPv6 address or address part consisting of `parts` groups.
|
|
4658
|
-
function expandIPv6 (string, parts) {
|
|
4659
|
-
// More than one '::' means invalid adddress
|
|
4660
|
-
if (string.indexOf('::') !== string.lastIndexOf('::')) {
|
|
4661
|
-
return null;
|
|
4662
|
-
}
|
|
4663
|
-
|
|
4664
|
-
let colonCount = 0;
|
|
4665
|
-
let lastColon = -1;
|
|
4666
|
-
let zoneId = (string.match(ipv6Regexes.zoneIndex) || [])[0];
|
|
4667
|
-
let replacement, replacementCount;
|
|
4668
|
-
|
|
4669
|
-
// Remove zone index and save it for later
|
|
4670
|
-
if (zoneId) {
|
|
4671
|
-
zoneId = zoneId.substring(1);
|
|
4672
|
-
string = string.replace(/%.+$/, '');
|
|
4673
|
-
}
|
|
4674
|
-
|
|
4675
|
-
// How many parts do we already have?
|
|
4676
|
-
while ((lastColon = string.indexOf(':', lastColon + 1)) >= 0) {
|
|
4677
|
-
colonCount++;
|
|
4678
|
-
}
|
|
4679
|
-
|
|
4680
|
-
// 0::0 is two parts more than ::
|
|
4681
|
-
if (string.substr(0, 2) === '::') {
|
|
4682
|
-
colonCount--;
|
|
4683
|
-
}
|
|
4684
|
-
|
|
4685
|
-
if (string.substr(-2, 2) === '::') {
|
|
4686
|
-
colonCount--;
|
|
4687
|
-
}
|
|
4688
|
-
|
|
4689
|
-
// The following loop would hang if colonCount > parts
|
|
4690
|
-
if (colonCount > parts) {
|
|
4691
|
-
return null;
|
|
4692
|
-
}
|
|
4693
|
-
|
|
4694
|
-
// replacement = ':' + '0:' * (parts - colonCount)
|
|
4695
|
-
replacementCount = parts - colonCount;
|
|
4696
|
-
replacement = ':';
|
|
4697
|
-
while (replacementCount--) {
|
|
4698
|
-
replacement += '0:';
|
|
4699
|
-
}
|
|
4700
|
-
|
|
4701
|
-
// Insert the missing zeroes
|
|
4702
|
-
string = string.replace('::', replacement);
|
|
4703
|
-
|
|
4704
|
-
// Trim any garbage which may be hanging around if :: was at the edge in
|
|
4705
|
-
// the source strin
|
|
4706
|
-
if (string[0] === ':') {
|
|
4707
|
-
string = string.slice(1);
|
|
4708
|
-
}
|
|
4709
|
-
|
|
4710
|
-
if (string[string.length - 1] === ':') {
|
|
4711
|
-
string = string.slice(0, -1);
|
|
4712
|
-
}
|
|
4713
|
-
|
|
4714
|
-
parts = (function () {
|
|
4715
|
-
const ref = string.split(':');
|
|
4716
|
-
const results = [];
|
|
4717
|
-
|
|
4718
|
-
for (let i = 0; i < ref.length; i++) {
|
|
4719
|
-
results.push(parseInt(ref[i], 16));
|
|
4720
|
-
}
|
|
4721
|
-
|
|
4722
|
-
return results;
|
|
4723
|
-
})();
|
|
4724
|
-
|
|
4725
|
-
return {
|
|
4726
|
-
parts: parts,
|
|
4727
|
-
zoneId: zoneId
|
|
4728
|
-
};
|
|
4729
|
-
}
|
|
4730
|
-
|
|
4731
|
-
// A generic CIDR (Classless Inter-Domain Routing) RFC1518 range matcher.
|
|
4732
|
-
function matchCIDR (first, second, partSize, cidrBits) {
|
|
4733
|
-
if (first.length !== second.length) {
|
|
4734
|
-
throw new Error('ipaddr: cannot match CIDR for objects with different lengths');
|
|
4735
|
-
}
|
|
4736
|
-
|
|
4737
|
-
let part = 0;
|
|
4738
|
-
let shift;
|
|
4739
|
-
|
|
4740
|
-
while (cidrBits > 0) {
|
|
4741
|
-
shift = partSize - cidrBits;
|
|
4742
|
-
if (shift < 0) {
|
|
4743
|
-
shift = 0;
|
|
4744
|
-
}
|
|
4745
|
-
|
|
4746
|
-
if (first[part] >> shift !== second[part] >> shift) {
|
|
4747
|
-
return false;
|
|
4748
|
-
}
|
|
4749
|
-
|
|
4750
|
-
cidrBits -= partSize;
|
|
4751
|
-
part += 1;
|
|
4752
|
-
}
|
|
4753
|
-
|
|
4754
|
-
return true;
|
|
4755
|
-
}
|
|
4756
|
-
|
|
4757
|
-
function parseIntAuto (string) {
|
|
4758
|
-
// Hexadedimal base 16 (0x#)
|
|
4759
|
-
if (hexRegex.test(string)) {
|
|
4760
|
-
return parseInt(string, 16);
|
|
4761
|
-
}
|
|
4762
|
-
// While octal representation is discouraged by ECMAScript 3
|
|
4763
|
-
// and forbidden by ECMAScript 5, we silently allow it to
|
|
4764
|
-
// work only if the rest of the string has numbers less than 8.
|
|
4765
|
-
if (string[0] === '0' && !isNaN(parseInt(string[1], 10))) {
|
|
4766
|
-
if (octalRegex.test(string)) {
|
|
4767
|
-
return parseInt(string, 8);
|
|
4768
|
-
}
|
|
4769
|
-
throw new Error(`ipaddr: cannot parse ${string} as octal`);
|
|
4770
|
-
}
|
|
4771
|
-
// Always include the base 10 radix!
|
|
4772
|
-
return parseInt(string, 10);
|
|
4773
|
-
}
|
|
4774
|
-
|
|
4775
|
-
function padPart (part, length) {
|
|
4776
|
-
while (part.length < length) {
|
|
4777
|
-
part = `0${part}`;
|
|
4778
|
-
}
|
|
4779
|
-
|
|
4780
|
-
return part;
|
|
4781
|
-
}
|
|
4782
|
-
|
|
4783
|
-
const ipaddr = {};
|
|
4784
|
-
|
|
4785
|
-
// An IPv4 address (RFC791).
|
|
4786
|
-
ipaddr.IPv4 = (function () {
|
|
4787
|
-
// Constructs a new IPv4 address from an array of four octets
|
|
4788
|
-
// in network order (MSB first)
|
|
4789
|
-
// Verifies the input.
|
|
4790
|
-
function IPv4 (octets) {
|
|
4791
|
-
if (octets.length !== 4) {
|
|
4792
|
-
throw new Error('ipaddr: ipv4 octet count should be 4');
|
|
4793
|
-
}
|
|
4794
|
-
|
|
4795
|
-
let i, octet;
|
|
4796
|
-
|
|
4797
|
-
for (i = 0; i < octets.length; i++) {
|
|
4798
|
-
octet = octets[i];
|
|
4799
|
-
if (!((0 <= octet && octet <= 255))) {
|
|
4800
|
-
throw new Error('ipaddr: ipv4 octet should fit in 8 bits');
|
|
4801
|
-
}
|
|
4802
|
-
}
|
|
4803
|
-
|
|
4804
|
-
this.octets = octets;
|
|
4805
|
-
}
|
|
4806
|
-
|
|
4807
|
-
// Special IPv4 address ranges.
|
|
4808
|
-
// See also https://en.wikipedia.org/wiki/Reserved_IP_addresses
|
|
4809
|
-
IPv4.prototype.SpecialRanges = {
|
|
4810
|
-
unspecified: [[new IPv4([0, 0, 0, 0]), 8]],
|
|
4811
|
-
broadcast: [[new IPv4([255, 255, 255, 255]), 32]],
|
|
4812
|
-
// RFC3171
|
|
4813
|
-
multicast: [[new IPv4([224, 0, 0, 0]), 4]],
|
|
4814
|
-
// RFC3927
|
|
4815
|
-
linkLocal: [[new IPv4([169, 254, 0, 0]), 16]],
|
|
4816
|
-
// RFC5735
|
|
4817
|
-
loopback: [[new IPv4([127, 0, 0, 0]), 8]],
|
|
4818
|
-
// RFC6598
|
|
4819
|
-
carrierGradeNat: [[new IPv4([100, 64, 0, 0]), 10]],
|
|
4820
|
-
// RFC1918
|
|
4821
|
-
'private': [
|
|
4822
|
-
[new IPv4([10, 0, 0, 0]), 8],
|
|
4823
|
-
[new IPv4([172, 16, 0, 0]), 12],
|
|
4824
|
-
[new IPv4([192, 168, 0, 0]), 16]
|
|
4825
|
-
],
|
|
4826
|
-
// Reserved and testing-only ranges; RFCs 5735, 5737, 2544, 1700
|
|
4827
|
-
reserved: [
|
|
4828
|
-
[new IPv4([192, 0, 0, 0]), 24],
|
|
4829
|
-
[new IPv4([192, 0, 2, 0]), 24],
|
|
4830
|
-
[new IPv4([192, 88, 99, 0]), 24],
|
|
4831
|
-
[new IPv4([198, 18, 0, 0]), 15],
|
|
4832
|
-
[new IPv4([198, 51, 100, 0]), 24],
|
|
4833
|
-
[new IPv4([203, 0, 113, 0]), 24],
|
|
4834
|
-
[new IPv4([240, 0, 0, 0]), 4]
|
|
4835
|
-
]
|
|
4836
|
-
};
|
|
4837
|
-
|
|
4838
|
-
// The 'kind' method exists on both IPv4 and IPv6 classes.
|
|
4839
|
-
IPv4.prototype.kind = function () {
|
|
4840
|
-
return 'ipv4';
|
|
4841
|
-
};
|
|
4842
|
-
|
|
4843
|
-
// Checks if this address matches other one within given CIDR range.
|
|
4844
|
-
IPv4.prototype.match = function (other, cidrRange) {
|
|
4845
|
-
let ref;
|
|
4846
|
-
if (cidrRange === undefined) {
|
|
4847
|
-
ref = other;
|
|
4848
|
-
other = ref[0];
|
|
4849
|
-
cidrRange = ref[1];
|
|
4850
|
-
}
|
|
4851
|
-
|
|
4852
|
-
if (other.kind() !== 'ipv4') {
|
|
4853
|
-
throw new Error('ipaddr: cannot match ipv4 address with non-ipv4 one');
|
|
4854
|
-
}
|
|
4855
|
-
|
|
4856
|
-
return matchCIDR(this.octets, other.octets, 8, cidrRange);
|
|
4857
|
-
};
|
|
4858
|
-
|
|
4859
|
-
// returns a number of leading ones in IPv4 address, making sure that
|
|
4860
|
-
// the rest is a solid sequence of 0's (valid netmask)
|
|
4861
|
-
// returns either the CIDR length or null if mask is not valid
|
|
4862
|
-
IPv4.prototype.prefixLengthFromSubnetMask = function () {
|
|
4863
|
-
let cidr = 0;
|
|
4864
|
-
// non-zero encountered stop scanning for zeroes
|
|
4865
|
-
let stop = false;
|
|
4866
|
-
// number of zeroes in octet
|
|
4867
|
-
const zerotable = {
|
|
4868
|
-
0: 8,
|
|
4869
|
-
128: 7,
|
|
4870
|
-
192: 6,
|
|
4871
|
-
224: 5,
|
|
4872
|
-
240: 4,
|
|
4873
|
-
248: 3,
|
|
4874
|
-
252: 2,
|
|
4875
|
-
254: 1,
|
|
4876
|
-
255: 0
|
|
4877
|
-
};
|
|
4878
|
-
let i, octet, zeros;
|
|
4879
|
-
|
|
4880
|
-
for (i = 3; i >= 0; i -= 1) {
|
|
4881
|
-
octet = this.octets[i];
|
|
4882
|
-
if (octet in zerotable) {
|
|
4883
|
-
zeros = zerotable[octet];
|
|
4884
|
-
if (stop && zeros !== 0) {
|
|
4885
|
-
return null;
|
|
4886
|
-
}
|
|
4887
|
-
|
|
4888
|
-
if (zeros !== 8) {
|
|
4889
|
-
stop = true;
|
|
4890
|
-
}
|
|
4891
|
-
|
|
4892
|
-
cidr += zeros;
|
|
4893
|
-
} else {
|
|
4894
|
-
return null;
|
|
4895
|
-
}
|
|
4896
|
-
}
|
|
4897
|
-
|
|
4898
|
-
return 32 - cidr;
|
|
4899
|
-
};
|
|
4900
|
-
|
|
4901
|
-
// Checks if the address corresponds to one of the special ranges.
|
|
4902
|
-
IPv4.prototype.range = function () {
|
|
4903
|
-
return ipaddr.subnetMatch(this, this.SpecialRanges);
|
|
4904
|
-
};
|
|
4905
|
-
|
|
4906
|
-
// Returns an array of byte-sized values in network order (MSB first)
|
|
4907
|
-
IPv4.prototype.toByteArray = function () {
|
|
4908
|
-
return this.octets.slice(0);
|
|
4909
|
-
};
|
|
4910
|
-
|
|
4911
|
-
// Converts this IPv4 address to an IPv4-mapped IPv6 address.
|
|
4912
|
-
IPv4.prototype.toIPv4MappedAddress = function () {
|
|
4913
|
-
return ipaddr.IPv6.parse(`::ffff:${this.toString()}`);
|
|
4914
|
-
};
|
|
4915
|
-
|
|
4916
|
-
// Symmetrical method strictly for aligning with the IPv6 methods.
|
|
4917
|
-
IPv4.prototype.toNormalizedString = function () {
|
|
4918
|
-
return this.toString();
|
|
4919
|
-
};
|
|
4920
|
-
|
|
4921
|
-
// Returns the address in convenient, decimal-dotted format.
|
|
4922
|
-
IPv4.prototype.toString = function () {
|
|
4923
|
-
return this.octets.join('.');
|
|
4924
|
-
};
|
|
4925
|
-
|
|
4926
|
-
return IPv4;
|
|
4927
|
-
})();
|
|
4928
|
-
|
|
4929
|
-
// A utility function to return broadcast address given the IPv4 interface and prefix length in CIDR notation
|
|
4930
|
-
ipaddr.IPv4.broadcastAddressFromCIDR = function (string) {
|
|
4931
|
-
|
|
4932
|
-
try {
|
|
4933
|
-
const cidr = this.parseCIDR(string);
|
|
4934
|
-
const ipInterfaceOctets = cidr[0].toByteArray();
|
|
4935
|
-
const subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
|
|
4936
|
-
const octets = [];
|
|
4937
|
-
let i = 0;
|
|
4938
|
-
while (i < 4) {
|
|
4939
|
-
// Broadcast address is bitwise OR between ip interface and inverted mask
|
|
4940
|
-
octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255);
|
|
4941
|
-
i++;
|
|
4942
|
-
}
|
|
4943
|
-
|
|
4944
|
-
return new this(octets);
|
|
4945
|
-
} catch (e) {
|
|
4946
|
-
throw new Error('ipaddr: the address does not have IPv4 CIDR format');
|
|
4947
|
-
}
|
|
4948
|
-
};
|
|
4949
|
-
|
|
4950
|
-
// Checks if a given string is formatted like IPv4 address.
|
|
4951
|
-
ipaddr.IPv4.isIPv4 = function (string) {
|
|
4952
|
-
return this.parser(string) !== null;
|
|
4953
|
-
};
|
|
4954
|
-
|
|
4955
|
-
// Checks if a given string is a valid IPv4 address.
|
|
4956
|
-
ipaddr.IPv4.isValid = function (string) {
|
|
4957
|
-
try {
|
|
4958
|
-
new this(this.parser(string));
|
|
4959
|
-
return true;
|
|
4960
|
-
} catch (e) {
|
|
4961
|
-
return false;
|
|
4962
|
-
}
|
|
4963
|
-
};
|
|
4964
|
-
|
|
4965
|
-
// Checks if a given string is a full four-part IPv4 Address.
|
|
4966
|
-
ipaddr.IPv4.isValidFourPartDecimal = function (string) {
|
|
4967
|
-
if (ipaddr.IPv4.isValid(string) && string.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/)) {
|
|
4968
|
-
return true;
|
|
4969
|
-
} else {
|
|
4970
|
-
return false;
|
|
4971
|
-
}
|
|
4972
|
-
};
|
|
4973
|
-
|
|
4974
|
-
// A utility function to return network address given the IPv4 interface and prefix length in CIDR notation
|
|
4975
|
-
ipaddr.IPv4.networkAddressFromCIDR = function (string) {
|
|
4976
|
-
let cidr, i, ipInterfaceOctets, octets, subnetMaskOctets;
|
|
4977
|
-
|
|
4978
|
-
try {
|
|
4979
|
-
cidr = this.parseCIDR(string);
|
|
4980
|
-
ipInterfaceOctets = cidr[0].toByteArray();
|
|
4981
|
-
subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
|
|
4982
|
-
octets = [];
|
|
4983
|
-
i = 0;
|
|
4984
|
-
while (i < 4) {
|
|
4985
|
-
// Network address is bitwise AND between ip interface and mask
|
|
4986
|
-
octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10));
|
|
4987
|
-
i++;
|
|
4988
|
-
}
|
|
4989
|
-
|
|
4990
|
-
return new this(octets);
|
|
4991
|
-
} catch (e) {
|
|
4992
|
-
throw new Error('ipaddr: the address does not have IPv4 CIDR format');
|
|
4993
|
-
}
|
|
4994
|
-
};
|
|
4995
|
-
|
|
4996
|
-
// Tries to parse and validate a string with IPv4 address.
|
|
4997
|
-
// Throws an error if it fails.
|
|
4998
|
-
ipaddr.IPv4.parse = function (string) {
|
|
4999
|
-
const parts = this.parser(string);
|
|
5000
|
-
|
|
5001
|
-
if (parts === null) {
|
|
5002
|
-
throw new Error('ipaddr: string is not formatted like an IPv4 Address');
|
|
5003
|
-
}
|
|
5004
|
-
|
|
5005
|
-
return new this(parts);
|
|
5006
|
-
};
|
|
5007
|
-
|
|
5008
|
-
// Parses the string as an IPv4 Address with CIDR Notation.
|
|
5009
|
-
ipaddr.IPv4.parseCIDR = function (string) {
|
|
5010
|
-
let match;
|
|
5011
|
-
|
|
5012
|
-
if ((match = string.match(/^(.+)\/(\d+)$/))) {
|
|
5013
|
-
const maskLength = parseInt(match[2]);
|
|
5014
|
-
if (maskLength >= 0 && maskLength <= 32) {
|
|
5015
|
-
const parsed = [this.parse(match[1]), maskLength];
|
|
5016
|
-
Object.defineProperty(parsed, 'toString', {
|
|
5017
|
-
value: function () {
|
|
5018
|
-
return this.join('/');
|
|
5019
|
-
}
|
|
5020
|
-
});
|
|
5021
|
-
return parsed;
|
|
5022
|
-
}
|
|
5023
|
-
}
|
|
5024
|
-
|
|
5025
|
-
throw new Error('ipaddr: string is not formatted like an IPv4 CIDR range');
|
|
5026
|
-
};
|
|
5027
|
-
|
|
5028
|
-
// Classful variants (like a.b, where a is an octet, and b is a 24-bit
|
|
5029
|
-
// value representing last three octets; this corresponds to a class C
|
|
5030
|
-
// address) are omitted due to classless nature of modern Internet.
|
|
5031
|
-
ipaddr.IPv4.parser = function (string) {
|
|
5032
|
-
let match, part, value;
|
|
5033
|
-
|
|
5034
|
-
// parseInt recognizes all that octal & hexadecimal weirdness for us
|
|
5035
|
-
if ((match = string.match(ipv4Regexes.fourOctet))) {
|
|
5036
|
-
return (function () {
|
|
5037
|
-
const ref = match.slice(1, 6);
|
|
5038
|
-
const results = [];
|
|
5039
|
-
|
|
5040
|
-
for (let i = 0; i < ref.length; i++) {
|
|
5041
|
-
part = ref[i];
|
|
5042
|
-
results.push(parseIntAuto(part));
|
|
5043
|
-
}
|
|
5044
|
-
|
|
5045
|
-
return results;
|
|
5046
|
-
})();
|
|
5047
|
-
} else if ((match = string.match(ipv4Regexes.longValue))) {
|
|
5048
|
-
value = parseIntAuto(match[1]);
|
|
5049
|
-
if (value > 0xffffffff || value < 0) {
|
|
5050
|
-
throw new Error('ipaddr: address outside defined range');
|
|
5051
|
-
}
|
|
5052
|
-
|
|
5053
|
-
return ((function () {
|
|
5054
|
-
const results = [];
|
|
5055
|
-
let shift;
|
|
5056
|
-
|
|
5057
|
-
for (shift = 0; shift <= 24; shift += 8) {
|
|
5058
|
-
results.push((value >> shift) & 0xff);
|
|
5059
|
-
}
|
|
5060
|
-
|
|
5061
|
-
return results;
|
|
5062
|
-
})()).reverse();
|
|
5063
|
-
} else if ((match = string.match(ipv4Regexes.twoOctet))) {
|
|
5064
|
-
return (function () {
|
|
5065
|
-
const ref = match.slice(1, 4);
|
|
5066
|
-
const results = [];
|
|
5067
|
-
|
|
5068
|
-
value = parseIntAuto(ref[1]);
|
|
5069
|
-
if (value > 0xffffff || value < 0) {
|
|
5070
|
-
throw new Error('ipaddr: address outside defined range');
|
|
5071
|
-
}
|
|
5072
|
-
|
|
5073
|
-
results.push(parseIntAuto(ref[0]));
|
|
5074
|
-
results.push((value >> 16) & 0xff);
|
|
5075
|
-
results.push((value >> 8) & 0xff);
|
|
5076
|
-
results.push( value & 0xff);
|
|
5077
|
-
|
|
5078
|
-
return results;
|
|
5079
|
-
})();
|
|
5080
|
-
} else if ((match = string.match(ipv4Regexes.threeOctet))) {
|
|
5081
|
-
return (function () {
|
|
5082
|
-
const ref = match.slice(1, 5);
|
|
5083
|
-
const results = [];
|
|
5084
|
-
|
|
5085
|
-
value = parseIntAuto(ref[2]);
|
|
5086
|
-
if (value > 0xffff || value < 0) {
|
|
5087
|
-
throw new Error('ipaddr: address outside defined range');
|
|
5088
|
-
}
|
|
5089
|
-
|
|
5090
|
-
results.push(parseIntAuto(ref[0]));
|
|
5091
|
-
results.push(parseIntAuto(ref[1]));
|
|
5092
|
-
results.push((value >> 8) & 0xff);
|
|
5093
|
-
results.push( value & 0xff);
|
|
5094
|
-
|
|
5095
|
-
return results;
|
|
5096
|
-
})();
|
|
5097
|
-
} else {
|
|
5098
|
-
return null;
|
|
5099
|
-
}
|
|
5100
|
-
};
|
|
5101
|
-
|
|
5102
|
-
// A utility function to return subnet mask in IPv4 format given the prefix length
|
|
5103
|
-
ipaddr.IPv4.subnetMaskFromPrefixLength = function (prefix) {
|
|
5104
|
-
prefix = parseInt(prefix);
|
|
5105
|
-
if (prefix < 0 || prefix > 32) {
|
|
5106
|
-
throw new Error('ipaddr: invalid IPv4 prefix length');
|
|
5107
|
-
}
|
|
5108
|
-
|
|
5109
|
-
const octets = [0, 0, 0, 0];
|
|
5110
|
-
let j = 0;
|
|
5111
|
-
const filledOctetCount = Math.floor(prefix / 8);
|
|
5112
|
-
|
|
5113
|
-
while (j < filledOctetCount) {
|
|
5114
|
-
octets[j] = 255;
|
|
5115
|
-
j++;
|
|
5116
|
-
}
|
|
5117
|
-
|
|
5118
|
-
if (filledOctetCount < 4) {
|
|
5119
|
-
octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - (prefix % 8);
|
|
5120
|
-
}
|
|
5121
|
-
|
|
5122
|
-
return new this(octets);
|
|
5123
|
-
};
|
|
5124
|
-
|
|
5125
|
-
// An IPv6 address (RFC2460)
|
|
5126
|
-
ipaddr.IPv6 = (function () {
|
|
5127
|
-
// Constructs an IPv6 address from an array of eight 16 - bit parts
|
|
5128
|
-
// or sixteen 8 - bit parts in network order(MSB first).
|
|
5129
|
-
// Throws an error if the input is invalid.
|
|
5130
|
-
function IPv6 (parts, zoneId) {
|
|
5131
|
-
let i, part;
|
|
5132
|
-
|
|
5133
|
-
if (parts.length === 16) {
|
|
5134
|
-
this.parts = [];
|
|
5135
|
-
for (i = 0; i <= 14; i += 2) {
|
|
5136
|
-
this.parts.push((parts[i] << 8) | parts[i + 1]);
|
|
5137
|
-
}
|
|
5138
|
-
} else if (parts.length === 8) {
|
|
5139
|
-
this.parts = parts;
|
|
5140
|
-
} else {
|
|
5141
|
-
throw new Error('ipaddr: ipv6 part count should be 8 or 16');
|
|
5142
|
-
}
|
|
5143
|
-
|
|
5144
|
-
for (i = 0; i < this.parts.length; i++) {
|
|
5145
|
-
part = this.parts[i];
|
|
5146
|
-
if (!((0 <= part && part <= 0xffff))) {
|
|
5147
|
-
throw new Error('ipaddr: ipv6 part should fit in 16 bits');
|
|
5148
|
-
}
|
|
5149
|
-
}
|
|
5150
|
-
|
|
5151
|
-
if (zoneId) {
|
|
5152
|
-
this.zoneId = zoneId;
|
|
5153
|
-
}
|
|
5154
|
-
}
|
|
5155
|
-
|
|
5156
|
-
// Special IPv6 ranges
|
|
5157
|
-
IPv6.prototype.SpecialRanges = {
|
|
5158
|
-
// RFC4291, here and after
|
|
5159
|
-
unspecified: [new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128],
|
|
5160
|
-
linkLocal: [new IPv6([0xfe80, 0, 0, 0, 0, 0, 0, 0]), 10],
|
|
5161
|
-
multicast: [new IPv6([0xff00, 0, 0, 0, 0, 0, 0, 0]), 8],
|
|
5162
|
-
loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128],
|
|
5163
|
-
uniqueLocal: [new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7],
|
|
5164
|
-
ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96],
|
|
5165
|
-
// RFC6145
|
|
5166
|
-
rfc6145: [new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96],
|
|
5167
|
-
// RFC6052
|
|
5168
|
-
rfc6052: [new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96],
|
|
5169
|
-
// RFC3056
|
|
5170
|
-
'6to4': [new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16],
|
|
5171
|
-
// RFC6052, RFC6146
|
|
5172
|
-
teredo: [new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32],
|
|
5173
|
-
// RFC4291
|
|
5174
|
-
reserved: [[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32]],
|
|
5175
|
-
benchmarking: [new IPv6([0x2001, 0x2, 0, 0, 0, 0, 0, 0]), 48],
|
|
5176
|
-
amt: [new IPv6([0x2001, 0x3, 0, 0, 0, 0, 0, 0]), 32],
|
|
5177
|
-
as112v6: [new IPv6([0x2001, 0x4, 0x112, 0, 0, 0, 0, 0]), 48],
|
|
5178
|
-
deprecated: [new IPv6([0x2001, 0x10, 0, 0, 0, 0, 0, 0]), 28],
|
|
5179
|
-
orchid2: [new IPv6([0x2001, 0x20, 0, 0, 0, 0, 0, 0]), 28]
|
|
5180
|
-
};
|
|
5181
|
-
|
|
5182
|
-
// Checks if this address is an IPv4-mapped IPv6 address.
|
|
5183
|
-
IPv6.prototype.isIPv4MappedAddress = function () {
|
|
5184
|
-
return this.range() === 'ipv4Mapped';
|
|
5185
|
-
};
|
|
5186
|
-
|
|
5187
|
-
// The 'kind' method exists on both IPv4 and IPv6 classes.
|
|
5188
|
-
IPv6.prototype.kind = function () {
|
|
5189
|
-
return 'ipv6';
|
|
5190
|
-
};
|
|
5191
|
-
|
|
5192
|
-
// Checks if this address matches other one within given CIDR range.
|
|
5193
|
-
IPv6.prototype.match = function (other, cidrRange) {
|
|
5194
|
-
let ref;
|
|
5195
|
-
|
|
5196
|
-
if (cidrRange === undefined) {
|
|
5197
|
-
ref = other;
|
|
5198
|
-
other = ref[0];
|
|
5199
|
-
cidrRange = ref[1];
|
|
5200
|
-
}
|
|
5201
|
-
|
|
5202
|
-
if (other.kind() !== 'ipv6') {
|
|
5203
|
-
throw new Error('ipaddr: cannot match ipv6 address with non-ipv6 one');
|
|
5204
|
-
}
|
|
5205
|
-
|
|
5206
|
-
return matchCIDR(this.parts, other.parts, 16, cidrRange);
|
|
5207
|
-
};
|
|
5208
|
-
|
|
5209
|
-
// returns a number of leading ones in IPv6 address, making sure that
|
|
5210
|
-
// the rest is a solid sequence of 0's (valid netmask)
|
|
5211
|
-
// returns either the CIDR length or null if mask is not valid
|
|
5212
|
-
IPv6.prototype.prefixLengthFromSubnetMask = function () {
|
|
5213
|
-
let cidr = 0;
|
|
5214
|
-
// non-zero encountered stop scanning for zeroes
|
|
5215
|
-
let stop = false;
|
|
5216
|
-
// number of zeroes in octet
|
|
5217
|
-
const zerotable = {
|
|
5218
|
-
0: 16,
|
|
5219
|
-
32768: 15,
|
|
5220
|
-
49152: 14,
|
|
5221
|
-
57344: 13,
|
|
5222
|
-
61440: 12,
|
|
5223
|
-
63488: 11,
|
|
5224
|
-
64512: 10,
|
|
5225
|
-
65024: 9,
|
|
5226
|
-
65280: 8,
|
|
5227
|
-
65408: 7,
|
|
5228
|
-
65472: 6,
|
|
5229
|
-
65504: 5,
|
|
5230
|
-
65520: 4,
|
|
5231
|
-
65528: 3,
|
|
5232
|
-
65532: 2,
|
|
5233
|
-
65534: 1,
|
|
5234
|
-
65535: 0
|
|
5235
|
-
};
|
|
5236
|
-
let part, zeros;
|
|
5237
|
-
|
|
5238
|
-
for (let i = 7; i >= 0; i -= 1) {
|
|
5239
|
-
part = this.parts[i];
|
|
5240
|
-
if (part in zerotable) {
|
|
5241
|
-
zeros = zerotable[part];
|
|
5242
|
-
if (stop && zeros !== 0) {
|
|
5243
|
-
return null;
|
|
5244
|
-
}
|
|
5245
|
-
|
|
5246
|
-
if (zeros !== 16) {
|
|
5247
|
-
stop = true;
|
|
5248
|
-
}
|
|
5249
|
-
|
|
5250
|
-
cidr += zeros;
|
|
5251
|
-
} else {
|
|
5252
|
-
return null;
|
|
5253
|
-
}
|
|
5254
|
-
}
|
|
5255
|
-
|
|
5256
|
-
return 128 - cidr;
|
|
5257
|
-
};
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
// Checks if the address corresponds to one of the special ranges.
|
|
5261
|
-
IPv6.prototype.range = function () {
|
|
5262
|
-
return ipaddr.subnetMatch(this, this.SpecialRanges);
|
|
5263
|
-
};
|
|
5264
|
-
|
|
5265
|
-
// Returns an array of byte-sized values in network order (MSB first)
|
|
5266
|
-
IPv6.prototype.toByteArray = function () {
|
|
5267
|
-
let part;
|
|
5268
|
-
const bytes = [];
|
|
5269
|
-
const ref = this.parts;
|
|
5270
|
-
for (let i = 0; i < ref.length; i++) {
|
|
5271
|
-
part = ref[i];
|
|
5272
|
-
bytes.push(part >> 8);
|
|
5273
|
-
bytes.push(part & 0xff);
|
|
5274
|
-
}
|
|
5275
|
-
|
|
5276
|
-
return bytes;
|
|
5277
|
-
};
|
|
5278
|
-
|
|
5279
|
-
// Returns the address in expanded format with all zeroes included, like
|
|
5280
|
-
// 2001:0db8:0008:0066:0000:0000:0000:0001
|
|
5281
|
-
IPv6.prototype.toFixedLengthString = function () {
|
|
5282
|
-
const addr = ((function () {
|
|
5283
|
-
const results = [];
|
|
5284
|
-
for (let i = 0; i < this.parts.length; i++) {
|
|
5285
|
-
results.push(padPart(this.parts[i].toString(16), 4));
|
|
5286
|
-
}
|
|
5287
|
-
|
|
5288
|
-
return results;
|
|
5289
|
-
}).call(this)).join(':');
|
|
5290
|
-
|
|
5291
|
-
let suffix = '';
|
|
5292
|
-
|
|
5293
|
-
if (this.zoneId) {
|
|
5294
|
-
suffix = `%${this.zoneId}`;
|
|
5295
|
-
}
|
|
5296
|
-
|
|
5297
|
-
return addr + suffix;
|
|
5298
|
-
};
|
|
5299
|
-
|
|
5300
|
-
// Converts this address to IPv4 address if it is an IPv4-mapped IPv6 address.
|
|
5301
|
-
// Throws an error otherwise.
|
|
5302
|
-
IPv6.prototype.toIPv4Address = function () {
|
|
5303
|
-
if (!this.isIPv4MappedAddress()) {
|
|
5304
|
-
throw new Error('ipaddr: trying to convert a generic ipv6 address to ipv4');
|
|
5305
|
-
}
|
|
5306
|
-
|
|
5307
|
-
const ref = this.parts.slice(-2);
|
|
5308
|
-
const high = ref[0];
|
|
5309
|
-
const low = ref[1];
|
|
5310
|
-
|
|
5311
|
-
return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]);
|
|
5312
|
-
};
|
|
5313
|
-
|
|
5314
|
-
// Returns the address in expanded format with all zeroes included, like
|
|
5315
|
-
// 2001:db8:8:66:0:0:0:1
|
|
5316
|
-
//
|
|
5317
|
-
// Deprecated: use toFixedLengthString() instead.
|
|
5318
|
-
IPv6.prototype.toNormalizedString = function () {
|
|
5319
|
-
const addr = ((function () {
|
|
5320
|
-
const results = [];
|
|
5321
|
-
|
|
5322
|
-
for (let i = 0; i < this.parts.length; i++) {
|
|
5323
|
-
results.push(this.parts[i].toString(16));
|
|
5324
|
-
}
|
|
5325
|
-
|
|
5326
|
-
return results;
|
|
5327
|
-
}).call(this)).join(':');
|
|
5328
|
-
|
|
5329
|
-
let suffix = '';
|
|
5330
|
-
|
|
5331
|
-
if (this.zoneId) {
|
|
5332
|
-
suffix = `%${this.zoneId}`;
|
|
4564
|
+
static toAsnItem(schemaItem, key, target, objProp) {
|
|
4565
|
+
let asn1Item;
|
|
4566
|
+
if (typeof schemaItem.type === "number") {
|
|
4567
|
+
const converter = schemaItem.converter;
|
|
4568
|
+
if (!converter) {
|
|
4569
|
+
throw new Error(`Property '${key}' doesn't have converter for type ${AsnPropTypes[schemaItem.type]} in schema '${target.name}'`);
|
|
5333
4570
|
}
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
// Returns the address in compact, human-readable format like
|
|
5339
|
-
// 2001:db8:8:66::1
|
|
5340
|
-
// in line with RFC 5952 (see https://tools.ietf.org/html/rfc5952#section-4)
|
|
5341
|
-
IPv6.prototype.toRFC5952String = function () {
|
|
5342
|
-
const regex = /((^|:)(0(:|$)){2,})/g;
|
|
5343
|
-
const string = this.toNormalizedString();
|
|
5344
|
-
let bestMatchIndex = 0;
|
|
5345
|
-
let bestMatchLength = -1;
|
|
5346
|
-
let match;
|
|
5347
|
-
|
|
5348
|
-
while ((match = regex.exec(string))) {
|
|
5349
|
-
if (match[0].length > bestMatchLength) {
|
|
5350
|
-
bestMatchIndex = match.index;
|
|
5351
|
-
bestMatchLength = match[0].length;
|
|
4571
|
+
if (schemaItem.repeated) {
|
|
4572
|
+
if (!Array.isArray(objProp)) {
|
|
4573
|
+
throw new TypeError("Parameter 'objProp' should be type of Array.");
|
|
5352
4574
|
}
|
|
4575
|
+
const items = Array.from(objProp, (element) => converter.toASN(element));
|
|
4576
|
+
const Container = schemaItem.repeated === "sequence" ? Sequence : Set;
|
|
4577
|
+
asn1Item = new Container({
|
|
4578
|
+
value: items,
|
|
4579
|
+
});
|
|
5353
4580
|
}
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
return string;
|
|
5357
|
-
}
|
|
5358
|
-
|
|
5359
|
-
return `${string.substring(0, bestMatchIndex)}::${string.substring(bestMatchIndex + bestMatchLength)}`;
|
|
5360
|
-
};
|
|
5361
|
-
|
|
5362
|
-
// Returns the address in compact, human-readable format like
|
|
5363
|
-
// 2001:db8:8:66::1
|
|
5364
|
-
// Calls toRFC5952String under the hood.
|
|
5365
|
-
IPv6.prototype.toString = function () {
|
|
5366
|
-
return this.toRFC5952String();
|
|
5367
|
-
};
|
|
5368
|
-
|
|
5369
|
-
return IPv6;
|
|
5370
|
-
|
|
5371
|
-
})();
|
|
5372
|
-
|
|
5373
|
-
// A utility function to return broadcast address given the IPv6 interface and prefix length in CIDR notation
|
|
5374
|
-
ipaddr.IPv6.broadcastAddressFromCIDR = function (string) {
|
|
5375
|
-
try {
|
|
5376
|
-
const cidr = this.parseCIDR(string);
|
|
5377
|
-
const ipInterfaceOctets = cidr[0].toByteArray();
|
|
5378
|
-
const subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
|
|
5379
|
-
const octets = [];
|
|
5380
|
-
let i = 0;
|
|
5381
|
-
while (i < 16) {
|
|
5382
|
-
// Broadcast address is bitwise OR between ip interface and inverted mask
|
|
5383
|
-
octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255);
|
|
5384
|
-
i++;
|
|
5385
|
-
}
|
|
5386
|
-
|
|
5387
|
-
return new this(octets);
|
|
5388
|
-
} catch (e) {
|
|
5389
|
-
throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`);
|
|
5390
|
-
}
|
|
5391
|
-
};
|
|
5392
|
-
|
|
5393
|
-
// Checks if a given string is formatted like IPv6 address.
|
|
5394
|
-
ipaddr.IPv6.isIPv6 = function (string) {
|
|
5395
|
-
return this.parser(string) !== null;
|
|
5396
|
-
};
|
|
5397
|
-
|
|
5398
|
-
// Checks to see if string is a valid IPv6 Address
|
|
5399
|
-
ipaddr.IPv6.isValid = function (string) {
|
|
5400
|
-
|
|
5401
|
-
// Since IPv6.isValid is always called first, this shortcut
|
|
5402
|
-
// provides a substantial performance gain.
|
|
5403
|
-
if (typeof string === 'string' && string.indexOf(':') === -1) {
|
|
5404
|
-
return false;
|
|
5405
|
-
}
|
|
5406
|
-
|
|
5407
|
-
try {
|
|
5408
|
-
const addr = this.parser(string);
|
|
5409
|
-
new this(addr.parts, addr.zoneId);
|
|
5410
|
-
return true;
|
|
5411
|
-
} catch (e) {
|
|
5412
|
-
return false;
|
|
5413
|
-
}
|
|
5414
|
-
};
|
|
5415
|
-
|
|
5416
|
-
// A utility function to return network address given the IPv6 interface and prefix length in CIDR notation
|
|
5417
|
-
ipaddr.IPv6.networkAddressFromCIDR = function (string) {
|
|
5418
|
-
let cidr, i, ipInterfaceOctets, octets, subnetMaskOctets;
|
|
5419
|
-
|
|
5420
|
-
try {
|
|
5421
|
-
cidr = this.parseCIDR(string);
|
|
5422
|
-
ipInterfaceOctets = cidr[0].toByteArray();
|
|
5423
|
-
subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();
|
|
5424
|
-
octets = [];
|
|
5425
|
-
i = 0;
|
|
5426
|
-
while (i < 16) {
|
|
5427
|
-
// Network address is bitwise AND between ip interface and mask
|
|
5428
|
-
octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10));
|
|
5429
|
-
i++;
|
|
4581
|
+
else {
|
|
4582
|
+
asn1Item = converter.toASN(objProp);
|
|
5430
4583
|
}
|
|
5431
|
-
|
|
5432
|
-
return new this(octets);
|
|
5433
|
-
} catch (e) {
|
|
5434
|
-
throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`);
|
|
5435
|
-
}
|
|
5436
|
-
};
|
|
5437
|
-
|
|
5438
|
-
// Tries to parse and validate a string with IPv6 address.
|
|
5439
|
-
// Throws an error if it fails.
|
|
5440
|
-
ipaddr.IPv6.parse = function (string) {
|
|
5441
|
-
const addr = this.parser(string);
|
|
5442
|
-
|
|
5443
|
-
if (addr.parts === null) {
|
|
5444
|
-
throw new Error('ipaddr: string is not formatted like an IPv6 Address');
|
|
5445
4584
|
}
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
if (maskLength >= 0 && maskLength <= 128) {
|
|
5456
|
-
parsed = [this.parse(match[1]), maskLength];
|
|
5457
|
-
Object.defineProperty(parsed, 'toString', {
|
|
5458
|
-
value: function () {
|
|
5459
|
-
return this.join('/');
|
|
5460
|
-
}
|
|
4585
|
+
else {
|
|
4586
|
+
if (schemaItem.repeated) {
|
|
4587
|
+
if (!Array.isArray(objProp)) {
|
|
4588
|
+
throw new TypeError("Parameter 'objProp' should be type of Array.");
|
|
4589
|
+
}
|
|
4590
|
+
const items = Array.from(objProp, (element) => this.toASN(element));
|
|
4591
|
+
const Container = schemaItem.repeated === "sequence" ? Sequence : Set;
|
|
4592
|
+
asn1Item = new Container({
|
|
4593
|
+
value: items,
|
|
5461
4594
|
});
|
|
5462
|
-
|
|
4595
|
+
}
|
|
4596
|
+
else {
|
|
4597
|
+
asn1Item = this.toASN(objProp);
|
|
5463
4598
|
}
|
|
5464
4599
|
}
|
|
4600
|
+
return asn1Item;
|
|
4601
|
+
}
|
|
4602
|
+
}
|
|
5465
4603
|
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
ipaddr.IPv6.parser = function (string) {
|
|
5471
|
-
let addr, i, match, octet, octets, zoneId;
|
|
5472
|
-
|
|
5473
|
-
if ((match = string.match(ipv6Regexes.deprecatedTransitional))) {
|
|
5474
|
-
return this.parser(`::ffff:${match[1]}`);
|
|
5475
|
-
}
|
|
5476
|
-
if (ipv6Regexes.native.test(string)) {
|
|
5477
|
-
return expandIPv6(string, 8);
|
|
4604
|
+
class AsnArray extends Array {
|
|
4605
|
+
constructor(items = []) {
|
|
4606
|
+
if (typeof items === "number") {
|
|
4607
|
+
super(items);
|
|
5478
4608
|
}
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
octets = [
|
|
5484
|
-
parseInt(match[2]),
|
|
5485
|
-
parseInt(match[3]),
|
|
5486
|
-
parseInt(match[4]),
|
|
5487
|
-
parseInt(match[5])
|
|
5488
|
-
];
|
|
5489
|
-
for (i = 0; i < octets.length; i++) {
|
|
5490
|
-
octet = octets[i];
|
|
5491
|
-
if (!((0 <= octet && octet <= 255))) {
|
|
5492
|
-
return null;
|
|
5493
|
-
}
|
|
5494
|
-
}
|
|
5495
|
-
|
|
5496
|
-
addr.parts.push(octets[0] << 8 | octets[1]);
|
|
5497
|
-
addr.parts.push(octets[2] << 8 | octets[3]);
|
|
5498
|
-
return {
|
|
5499
|
-
parts: addr.parts,
|
|
5500
|
-
zoneId: addr.zoneId
|
|
5501
|
-
};
|
|
4609
|
+
else {
|
|
4610
|
+
super();
|
|
4611
|
+
for (const item of items) {
|
|
4612
|
+
this.push(item);
|
|
5502
4613
|
}
|
|
5503
4614
|
}
|
|
4615
|
+
}
|
|
4616
|
+
}
|
|
5504
4617
|
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
while (j < filledOctetCount) {
|
|
5520
|
-
octets[j] = 255;
|
|
5521
|
-
j++;
|
|
4618
|
+
class AsnConvert {
|
|
4619
|
+
static serialize(obj) {
|
|
4620
|
+
return AsnSerializer.serialize(obj);
|
|
4621
|
+
}
|
|
4622
|
+
static parse(data, target) {
|
|
4623
|
+
return AsnParser.parse(data, target);
|
|
4624
|
+
}
|
|
4625
|
+
static toString(data) {
|
|
4626
|
+
const buf = buildExports.BufferSourceConverter.isBufferSource(data)
|
|
4627
|
+
? buildExports.BufferSourceConverter.toArrayBuffer(data)
|
|
4628
|
+
: AsnConvert.serialize(data);
|
|
4629
|
+
const asn = fromBER(buf);
|
|
4630
|
+
if (asn.offset === -1) {
|
|
4631
|
+
throw new Error(`Cannot decode ASN.1 data. ${asn.result.error}`);
|
|
5522
4632
|
}
|
|
4633
|
+
return asn.result.toString();
|
|
4634
|
+
}
|
|
4635
|
+
}
|
|
5523
4636
|
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
}
|
|
4637
|
+
/******************************************************************************
|
|
4638
|
+
Copyright (c) Microsoft Corporation.
|
|
5527
4639
|
|
|
5528
|
-
|
|
5529
|
-
|
|
4640
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
4641
|
+
purpose with or without fee is hereby granted.
|
|
5530
4642
|
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
4643
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
4644
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
4645
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
4646
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
4647
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
4648
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
4649
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
4650
|
+
***************************************************************************** */
|
|
4651
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
5534
4652
|
|
|
5535
|
-
if (length === 4) {
|
|
5536
|
-
return new ipaddr.IPv4(bytes);
|
|
5537
|
-
} else if (length === 16) {
|
|
5538
|
-
return new ipaddr.IPv6(bytes);
|
|
5539
|
-
} else {
|
|
5540
|
-
throw new Error('ipaddr: the binary input is neither an IPv6 nor IPv4 address');
|
|
5541
|
-
}
|
|
5542
|
-
};
|
|
5543
4653
|
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
4654
|
+
function __decorate$1(decorators, target, key, desc) {
|
|
4655
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4656
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4657
|
+
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;
|
|
4658
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4659
|
+
}
|
|
5548
4660
|
|
|
4661
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
4662
|
+
var e = new Error(message);
|
|
4663
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
4664
|
+
};
|
|
5549
4665
|
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
4666
|
+
class IpConverter {
|
|
4667
|
+
static isIPv4(ip) {
|
|
4668
|
+
return /^(\d{1,3}\.){3}\d{1,3}$/.test(ip);
|
|
4669
|
+
}
|
|
4670
|
+
static parseIPv4(ip) {
|
|
4671
|
+
const parts = ip.split(".");
|
|
4672
|
+
if (parts.length !== 4) {
|
|
4673
|
+
throw new Error("Invalid IPv4 address");
|
|
4674
|
+
}
|
|
4675
|
+
return parts.map((part) => {
|
|
4676
|
+
const num = parseInt(part, 10);
|
|
4677
|
+
if (isNaN(num) || num < 0 || num > 255) {
|
|
4678
|
+
throw new Error("Invalid IPv4 address part");
|
|
4679
|
+
}
|
|
4680
|
+
return num;
|
|
4681
|
+
});
|
|
4682
|
+
}
|
|
4683
|
+
static parseIPv6(ip) {
|
|
4684
|
+
const expandedIP = this.expandIPv6(ip);
|
|
4685
|
+
const parts = expandedIP.split(":");
|
|
4686
|
+
if (parts.length !== 8) {
|
|
4687
|
+
throw new Error("Invalid IPv6 address");
|
|
5559
4688
|
}
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
4689
|
+
return parts.reduce((bytes, part) => {
|
|
4690
|
+
const num = parseInt(part, 16);
|
|
4691
|
+
if (isNaN(num) || num < 0 || num > 0xffff) {
|
|
4692
|
+
throw new Error("Invalid IPv6 address part");
|
|
4693
|
+
}
|
|
4694
|
+
bytes.push((num >> 8) & 0xff);
|
|
4695
|
+
bytes.push(num & 0xff);
|
|
4696
|
+
return bytes;
|
|
4697
|
+
}, []);
|
|
4698
|
+
}
|
|
4699
|
+
static expandIPv6(ip) {
|
|
4700
|
+
if (!ip.includes("::")) {
|
|
4701
|
+
return ip;
|
|
4702
|
+
}
|
|
4703
|
+
const parts = ip.split("::");
|
|
4704
|
+
if (parts.length > 2) {
|
|
4705
|
+
throw new Error("Invalid IPv6 address");
|
|
4706
|
+
}
|
|
4707
|
+
const left = parts[0] ? parts[0].split(":") : [];
|
|
4708
|
+
const right = parts[1] ? parts[1].split(":") : [];
|
|
4709
|
+
const missing = 8 - (left.length + right.length);
|
|
4710
|
+
if (missing < 0) {
|
|
4711
|
+
throw new Error("Invalid IPv6 address");
|
|
4712
|
+
}
|
|
4713
|
+
return [...left, ...Array(missing).fill("0"), ...right].join(":");
|
|
4714
|
+
}
|
|
4715
|
+
static formatIPv6(bytes) {
|
|
4716
|
+
const parts = [];
|
|
4717
|
+
for (let i = 0; i < 16; i += 2) {
|
|
4718
|
+
parts.push(((bytes[i] << 8) | bytes[i + 1]).toString(16));
|
|
4719
|
+
}
|
|
4720
|
+
return this.compressIPv6(parts.join(":"));
|
|
4721
|
+
}
|
|
4722
|
+
static compressIPv6(ip) {
|
|
4723
|
+
const parts = ip.split(":");
|
|
4724
|
+
let longestZeroStart = -1;
|
|
4725
|
+
let longestZeroLength = 0;
|
|
4726
|
+
let currentZeroStart = -1;
|
|
4727
|
+
let currentZeroLength = 0;
|
|
4728
|
+
for (let i = 0; i < parts.length; i++) {
|
|
4729
|
+
if (parts[i] === "0") {
|
|
4730
|
+
if (currentZeroStart === -1) {
|
|
4731
|
+
currentZeroStart = i;
|
|
4732
|
+
}
|
|
4733
|
+
currentZeroLength++;
|
|
4734
|
+
}
|
|
4735
|
+
else {
|
|
4736
|
+
if (currentZeroLength > longestZeroLength) {
|
|
4737
|
+
longestZeroStart = currentZeroStart;
|
|
4738
|
+
longestZeroLength = currentZeroLength;
|
|
4739
|
+
}
|
|
4740
|
+
currentZeroStart = -1;
|
|
4741
|
+
currentZeroLength = 0;
|
|
5572
4742
|
}
|
|
5573
4743
|
}
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
ipaddr.process = function (string) {
|
|
5578
|
-
const addr = this.parse(string);
|
|
5579
|
-
|
|
5580
|
-
if (addr.kind() === 'ipv6' && addr.isIPv4MappedAddress()) {
|
|
5581
|
-
return addr.toIPv4Address();
|
|
5582
|
-
} else {
|
|
5583
|
-
return addr;
|
|
4744
|
+
if (currentZeroLength > longestZeroLength) {
|
|
4745
|
+
longestZeroStart = currentZeroStart;
|
|
4746
|
+
longestZeroLength = currentZeroLength;
|
|
5584
4747
|
}
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
// on matching IPv4 addresses to IPv6 ranges or vice versa.
|
|
5590
|
-
ipaddr.subnetMatch = function (address, rangeList, defaultName) {
|
|
5591
|
-
let i, rangeName, rangeSubnets, subnet;
|
|
5592
|
-
|
|
5593
|
-
if (defaultName === undefined || defaultName === null) {
|
|
5594
|
-
defaultName = 'unicast';
|
|
4748
|
+
if (longestZeroLength > 1) {
|
|
4749
|
+
const before = parts.slice(0, longestZeroStart).join(":");
|
|
4750
|
+
const after = parts.slice(longestZeroStart + longestZeroLength).join(":");
|
|
4751
|
+
return `${before}::${after}`;
|
|
5595
4752
|
}
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
for (i = 0; i < rangeSubnets.length; i++) {
|
|
5606
|
-
subnet = rangeSubnets[i];
|
|
5607
|
-
if (address.kind() === subnet[0].kind() && address.match.apply(address, subnet)) {
|
|
5608
|
-
return rangeName;
|
|
5609
|
-
}
|
|
5610
|
-
}
|
|
4753
|
+
return ip;
|
|
4754
|
+
}
|
|
4755
|
+
static parseCIDR(text) {
|
|
4756
|
+
const [addr, prefixStr] = text.split("/");
|
|
4757
|
+
const prefix = parseInt(prefixStr, 10);
|
|
4758
|
+
if (this.isIPv4(addr)) {
|
|
4759
|
+
if (prefix < 0 || prefix > 32) {
|
|
4760
|
+
throw new Error("Invalid IPv4 prefix length");
|
|
5611
4761
|
}
|
|
4762
|
+
return [this.parseIPv4(addr), prefix];
|
|
4763
|
+
}
|
|
4764
|
+
else {
|
|
4765
|
+
if (prefix < 0 || prefix > 128) {
|
|
4766
|
+
throw new Error("Invalid IPv6 prefix length");
|
|
4767
|
+
}
|
|
4768
|
+
return [this.parseIPv6(addr), prefix];
|
|
5612
4769
|
}
|
|
5613
|
-
|
|
5614
|
-
return defaultName;
|
|
5615
|
-
};
|
|
5616
|
-
|
|
5617
|
-
// Export for both the CommonJS and browser-like environment
|
|
5618
|
-
if (module.exports) {
|
|
5619
|
-
module.exports = ipaddr;
|
|
5620
|
-
|
|
5621
|
-
} else {
|
|
5622
|
-
root.ipaddr = ipaddr;
|
|
5623
4770
|
}
|
|
5624
|
-
|
|
5625
|
-
}(commonjsGlobal));
|
|
5626
|
-
}(ipaddr));
|
|
5627
|
-
|
|
5628
|
-
class IpConverter {
|
|
5629
4771
|
static decodeIP(value) {
|
|
5630
4772
|
if (value.length === 64 && parseInt(value, 16) === 0) {
|
|
5631
4773
|
return "::/0";
|
|
@@ -5635,24 +4777,62 @@ class IpConverter {
|
|
|
5635
4777
|
}
|
|
5636
4778
|
const mask = parseInt(value.slice(8), 16)
|
|
5637
4779
|
.toString(2)
|
|
5638
|
-
.split(
|
|
5639
|
-
.reduce((a, k) => a +
|
|
5640
|
-
let ip = value.slice(0, 8)
|
|
5641
|
-
.replace(/(.{2})/g, match => `${parseInt(match, 16)}.`);
|
|
4780
|
+
.split("")
|
|
4781
|
+
.reduce((a, k) => a + +k, 0);
|
|
4782
|
+
let ip = value.slice(0, 8).replace(/(.{2})/g, (match) => `${parseInt(match, 16)}.`);
|
|
5642
4783
|
ip = ip.slice(0, -1);
|
|
5643
4784
|
return `${ip}/${mask}`;
|
|
5644
4785
|
}
|
|
5645
4786
|
static toString(buf) {
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
4787
|
+
const uint8 = new Uint8Array(buf);
|
|
4788
|
+
if (uint8.length === 4) {
|
|
4789
|
+
return Array.from(uint8).join(".");
|
|
4790
|
+
}
|
|
4791
|
+
if (uint8.length === 16) {
|
|
4792
|
+
return this.formatIPv6(uint8);
|
|
4793
|
+
}
|
|
4794
|
+
if (uint8.length === 8 || uint8.length === 32) {
|
|
4795
|
+
const half = uint8.length / 2;
|
|
4796
|
+
const addrBytes = uint8.slice(0, half);
|
|
4797
|
+
const maskBytes = uint8.slice(half);
|
|
4798
|
+
const isAllZeros = uint8.every((byte) => byte === 0);
|
|
4799
|
+
if (isAllZeros) {
|
|
4800
|
+
return uint8.length === 8 ? "0.0.0.0/0" : "::/0";
|
|
4801
|
+
}
|
|
4802
|
+
const prefixLen = maskBytes.reduce((a, b) => a + (b.toString(2).match(/1/g) || []).length, 0);
|
|
4803
|
+
if (uint8.length === 8) {
|
|
4804
|
+
const addrStr = Array.from(addrBytes).join(".");
|
|
4805
|
+
return `${addrStr}/${prefixLen}`;
|
|
4806
|
+
}
|
|
4807
|
+
else {
|
|
4808
|
+
const addrStr = this.formatIPv6(addrBytes);
|
|
4809
|
+
return `${addrStr}/${prefixLen}`;
|
|
4810
|
+
}
|
|
5650
4811
|
}
|
|
5651
|
-
return this.decodeIP(
|
|
4812
|
+
return this.decodeIP(buildExports.Convert.ToHex(buf));
|
|
5652
4813
|
}
|
|
5653
4814
|
static fromString(text) {
|
|
5654
|
-
|
|
5655
|
-
|
|
4815
|
+
if (text.includes("/")) {
|
|
4816
|
+
const [addr, prefix] = this.parseCIDR(text);
|
|
4817
|
+
const maskBytes = new Uint8Array(addr.length);
|
|
4818
|
+
let bitsLeft = prefix;
|
|
4819
|
+
for (let i = 0; i < maskBytes.length; i++) {
|
|
4820
|
+
if (bitsLeft >= 8) {
|
|
4821
|
+
maskBytes[i] = 0xff;
|
|
4822
|
+
bitsLeft -= 8;
|
|
4823
|
+
}
|
|
4824
|
+
else if (bitsLeft > 0) {
|
|
4825
|
+
maskBytes[i] = 0xff << (8 - bitsLeft);
|
|
4826
|
+
bitsLeft = 0;
|
|
4827
|
+
}
|
|
4828
|
+
}
|
|
4829
|
+
const out = new Uint8Array(addr.length * 2);
|
|
4830
|
+
out.set(addr, 0);
|
|
4831
|
+
out.set(maskBytes, addr.length);
|
|
4832
|
+
return out.buffer;
|
|
4833
|
+
}
|
|
4834
|
+
const bytes = this.isIPv4(text) ? this.parseIPv4(text) : this.parseIPv6(text);
|
|
4835
|
+
return new Uint8Array(bytes).buffer;
|
|
5656
4836
|
}
|
|
5657
4837
|
}
|
|
5658
4838
|
|
|
@@ -5662,8 +4842,12 @@ let DirectoryString = class DirectoryString {
|
|
|
5662
4842
|
Object.assign(this, params);
|
|
5663
4843
|
}
|
|
5664
4844
|
toString() {
|
|
5665
|
-
return this.bmpString ||
|
|
5666
|
-
|
|
4845
|
+
return (this.bmpString ||
|
|
4846
|
+
this.printableString ||
|
|
4847
|
+
this.teletexString ||
|
|
4848
|
+
this.universalString ||
|
|
4849
|
+
this.utf8String ||
|
|
4850
|
+
"");
|
|
5667
4851
|
}
|
|
5668
4852
|
};
|
|
5669
4853
|
__decorate$1([
|
|
@@ -5690,7 +4874,7 @@ let AttributeValue = class AttributeValue extends DirectoryString {
|
|
|
5690
4874
|
Object.assign(this, params);
|
|
5691
4875
|
}
|
|
5692
4876
|
toString() {
|
|
5693
|
-
return this.ia5String || (this.anyValue ?
|
|
4877
|
+
return this.ia5String || (this.anyValue ? buildExports.Convert.ToHex(this.anyValue) : super.toString());
|
|
5694
4878
|
}
|
|
5695
4879
|
};
|
|
5696
4880
|
__decorate$1([
|
|
@@ -5799,7 +4983,12 @@ __decorate$1([
|
|
|
5799
4983
|
AsnProp({ type: AsnPropTypes.IA5String, context: 6, implicit: true })
|
|
5800
4984
|
], GeneralName.prototype, "uniformResourceIdentifier", void 0);
|
|
5801
4985
|
__decorate$1([
|
|
5802
|
-
AsnProp({
|
|
4986
|
+
AsnProp({
|
|
4987
|
+
type: AsnPropTypes.OctetString,
|
|
4988
|
+
context: 7,
|
|
4989
|
+
implicit: true,
|
|
4990
|
+
converter: AsnIpConverter,
|
|
4991
|
+
})
|
|
5803
4992
|
], GeneralName.prototype, "iPAddress", void 0);
|
|
5804
4993
|
__decorate$1([
|
|
5805
4994
|
AsnProp({ type: AsnPropTypes.ObjectIdentifier, context: 8, implicit: true })
|
|
@@ -6133,19 +5322,39 @@ __decorate$1([
|
|
|
6133
5322
|
AsnProp({ type: DistributionPointName, context: 0, optional: true })
|
|
6134
5323
|
], IssuingDistributionPoint.prototype, "distributionPoint", void 0);
|
|
6135
5324
|
__decorate$1([
|
|
6136
|
-
AsnProp({
|
|
5325
|
+
AsnProp({
|
|
5326
|
+
type: AsnPropTypes.Boolean,
|
|
5327
|
+
context: 1,
|
|
5328
|
+
defaultValue: IssuingDistributionPoint.ONLY,
|
|
5329
|
+
implicit: true,
|
|
5330
|
+
})
|
|
6137
5331
|
], IssuingDistributionPoint.prototype, "onlyContainsUserCerts", void 0);
|
|
6138
5332
|
__decorate$1([
|
|
6139
|
-
AsnProp({
|
|
5333
|
+
AsnProp({
|
|
5334
|
+
type: AsnPropTypes.Boolean,
|
|
5335
|
+
context: 2,
|
|
5336
|
+
defaultValue: IssuingDistributionPoint.ONLY,
|
|
5337
|
+
implicit: true,
|
|
5338
|
+
})
|
|
6140
5339
|
], IssuingDistributionPoint.prototype, "onlyContainsCACerts", void 0);
|
|
6141
5340
|
__decorate$1([
|
|
6142
5341
|
AsnProp({ type: Reason, context: 3, optional: true, implicit: true })
|
|
6143
5342
|
], IssuingDistributionPoint.prototype, "onlySomeReasons", void 0);
|
|
6144
5343
|
__decorate$1([
|
|
6145
|
-
AsnProp({
|
|
5344
|
+
AsnProp({
|
|
5345
|
+
type: AsnPropTypes.Boolean,
|
|
5346
|
+
context: 4,
|
|
5347
|
+
defaultValue: IssuingDistributionPoint.ONLY,
|
|
5348
|
+
implicit: true,
|
|
5349
|
+
})
|
|
6146
5350
|
], IssuingDistributionPoint.prototype, "indirectCRL", void 0);
|
|
6147
5351
|
__decorate$1([
|
|
6148
|
-
AsnProp({
|
|
5352
|
+
AsnProp({
|
|
5353
|
+
type: AsnPropTypes.Boolean,
|
|
5354
|
+
context: 5,
|
|
5355
|
+
defaultValue: IssuingDistributionPoint.ONLY,
|
|
5356
|
+
implicit: true,
|
|
5357
|
+
})
|
|
6149
5358
|
], IssuingDistributionPoint.prototype, "onlyContainsAttributeCerts", void 0);
|
|
6150
5359
|
|
|
6151
5360
|
const id_ce_cRLReasons = `${id_ce}.21`;
|
|
@@ -6332,13 +5541,19 @@ class PolicyConstraints {
|
|
|
6332
5541
|
}
|
|
6333
5542
|
__decorate$1([
|
|
6334
5543
|
AsnProp({
|
|
6335
|
-
type: AsnPropTypes.Integer,
|
|
5544
|
+
type: AsnPropTypes.Integer,
|
|
5545
|
+
context: 0,
|
|
5546
|
+
implicit: true,
|
|
5547
|
+
optional: true,
|
|
6336
5548
|
converter: AsnIntegerArrayBufferConverter,
|
|
6337
5549
|
})
|
|
6338
5550
|
], PolicyConstraints.prototype, "requireExplicitPolicy", void 0);
|
|
6339
5551
|
__decorate$1([
|
|
6340
5552
|
AsnProp({
|
|
6341
|
-
type: AsnPropTypes.Integer,
|
|
5553
|
+
type: AsnPropTypes.Integer,
|
|
5554
|
+
context: 1,
|
|
5555
|
+
implicit: true,
|
|
5556
|
+
optional: true,
|
|
6342
5557
|
converter: AsnIntegerArrayBufferConverter,
|
|
6343
5558
|
})
|
|
6344
5559
|
], PolicyConstraints.prototype, "inhibitPolicyMapping", void 0);
|
|
@@ -6380,13 +5595,13 @@ SubjectAlternativeName = SubjectAlternativeName_1 = __decorate$1([
|
|
|
6380
5595
|
AsnType({ type: AsnTypeTypes.Sequence })
|
|
6381
5596
|
], SubjectAlternativeName);
|
|
6382
5597
|
|
|
6383
|
-
|
|
5598
|
+
let Attribute$1 = class Attribute {
|
|
6384
5599
|
constructor(params = {}) {
|
|
6385
5600
|
this.type = "";
|
|
6386
5601
|
this.values = [];
|
|
6387
5602
|
Object.assign(this, params);
|
|
6388
5603
|
}
|
|
6389
|
-
}
|
|
5604
|
+
};
|
|
6390
5605
|
__decorate$1([
|
|
6391
5606
|
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
|
|
6392
5607
|
], Attribute$1.prototype, "type", void 0);
|
|
@@ -6420,7 +5635,7 @@ __decorate$1([
|
|
|
6420
5635
|
AsnProp({ type: AsnPropTypes.GeneralizedTime, context: 0, implicit: true, optional: true })
|
|
6421
5636
|
], PrivateKeyUsagePeriod.prototype, "notBefore", void 0);
|
|
6422
5637
|
__decorate$1([
|
|
6423
|
-
AsnProp({ type: AsnPropTypes.GeneralizedTime, context: 1, implicit: true, optional: true
|
|
5638
|
+
AsnProp({ type: AsnPropTypes.GeneralizedTime, context: 1, implicit: true, optional: true })
|
|
6424
5639
|
], PrivateKeyUsagePeriod.prototype, "notAfter", void 0);
|
|
6425
5640
|
|
|
6426
5641
|
const id_entrust_entrustVersInfo = "1.2.840.113533.7.65.0";
|
|
@@ -6451,7 +5666,7 @@ class EntrustInfo extends BitString {
|
|
|
6451
5666
|
}
|
|
6452
5667
|
class EntrustVersionInfo {
|
|
6453
5668
|
constructor(params = {}) {
|
|
6454
|
-
this.entrustVers =
|
|
5669
|
+
this.entrustVers = "";
|
|
6455
5670
|
this.entrustInfoFlags = new EntrustInfo();
|
|
6456
5671
|
Object.assign(this, params);
|
|
6457
5672
|
}
|
|
@@ -6481,12 +5696,12 @@ class AlgorithmIdentifier {
|
|
|
6481
5696
|
Object.assign(this, params);
|
|
6482
5697
|
}
|
|
6483
5698
|
isEqual(data) {
|
|
6484
|
-
return data instanceof AlgorithmIdentifier
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
||
|
|
6489
|
-
|
|
5699
|
+
return (data instanceof AlgorithmIdentifier &&
|
|
5700
|
+
data.algorithm == this.algorithm &&
|
|
5701
|
+
((data.parameters &&
|
|
5702
|
+
this.parameters &&
|
|
5703
|
+
buildExports.isEqual(data.parameters, this.parameters)) ||
|
|
5704
|
+
data.parameters === this.parameters));
|
|
6490
5705
|
}
|
|
6491
5706
|
}
|
|
6492
5707
|
__decorate$1([
|
|
@@ -6572,14 +5787,14 @@ __decorate$1([
|
|
|
6572
5787
|
], Validity.prototype, "notAfter", void 0);
|
|
6573
5788
|
|
|
6574
5789
|
var Extensions_1;
|
|
6575
|
-
|
|
5790
|
+
let Extension$1 = class Extension {
|
|
6576
5791
|
constructor(params = {}) {
|
|
6577
5792
|
this.extnID = "";
|
|
6578
|
-
this.critical = Extension
|
|
5793
|
+
this.critical = Extension.CRITICAL;
|
|
6579
5794
|
this.extnValue = new OctetString();
|
|
6580
5795
|
Object.assign(this, params);
|
|
6581
5796
|
}
|
|
6582
|
-
}
|
|
5797
|
+
};
|
|
6583
5798
|
Extension$1.CRITICAL = false;
|
|
6584
5799
|
__decorate$1([
|
|
6585
5800
|
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
|
|
@@ -6921,7 +6136,10 @@ const mgf1SHA1 = new AlgorithmIdentifier({
|
|
|
6921
6136
|
});
|
|
6922
6137
|
const pSpecifiedEmpty = new AlgorithmIdentifier({
|
|
6923
6138
|
algorithm: id_pSpecified,
|
|
6924
|
-
parameters: AsnConvert.serialize(AsnOctetStringConverter.toASN(new Uint8Array([
|
|
6139
|
+
parameters: AsnConvert.serialize(AsnOctetStringConverter.toASN(new Uint8Array([
|
|
6140
|
+
0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d, 0x32, 0x55, 0xbf, 0xef, 0x95, 0x60, 0x18,
|
|
6141
|
+
0x90, 0xaf, 0xd8, 0x07, 0x09,
|
|
6142
|
+
]).buffer)),
|
|
6925
6143
|
});
|
|
6926
6144
|
create(id_rsaEncryption);
|
|
6927
6145
|
create(id_md2WithRSAEncryption);
|
|
@@ -7112,13 +6330,13 @@ CompositeSignatureValue = CompositeSignatureValue_1 = __decorate$1([
|
|
|
7112
6330
|
|
|
7113
6331
|
class EncryptedData extends OctetString {
|
|
7114
6332
|
}
|
|
7115
|
-
|
|
6333
|
+
let EncryptedPrivateKeyInfo$1 = class EncryptedPrivateKeyInfo {
|
|
7116
6334
|
constructor(params = {}) {
|
|
7117
6335
|
this.encryptionAlgorithm = new AlgorithmIdentifier();
|
|
7118
6336
|
this.encryptedData = new EncryptedData();
|
|
7119
6337
|
Object.assign(this, params);
|
|
7120
6338
|
}
|
|
7121
|
-
}
|
|
6339
|
+
};
|
|
7122
6340
|
__decorate$1([
|
|
7123
6341
|
AsnProp({ type: AlgorithmIdentifier })
|
|
7124
6342
|
], EncryptedPrivateKeyInfo$1.prototype, "encryptionAlgorithm", void 0);
|
|
@@ -7142,14 +6360,14 @@ let Attributes$1 = Attributes_1$1 = class Attributes extends AsnArray {
|
|
|
7142
6360
|
Attributes$1 = Attributes_1$1 = __decorate$1([
|
|
7143
6361
|
AsnType({ type: AsnTypeTypes.Sequence, itemType: Attribute$1 })
|
|
7144
6362
|
], Attributes$1);
|
|
7145
|
-
|
|
6363
|
+
let PrivateKeyInfo$1 = class PrivateKeyInfo {
|
|
7146
6364
|
constructor(params = {}) {
|
|
7147
6365
|
this.version = Version$3.v1;
|
|
7148
6366
|
this.privateKeyAlgorithm = new AlgorithmIdentifier();
|
|
7149
6367
|
this.privateKey = new PrivateKey();
|
|
7150
6368
|
Object.assign(this, params);
|
|
7151
6369
|
}
|
|
7152
|
-
}
|
|
6370
|
+
};
|
|
7153
6371
|
__decorate$1([
|
|
7154
6372
|
AsnProp({ type: AsnPropTypes.Integer })
|
|
7155
6373
|
], PrivateKeyInfo$1.prototype, "version", void 0);
|
|
@@ -7240,21 +6458,41 @@ CompositePrivateKey = CompositePrivateKey_1 = __decorate$1([
|
|
|
7240
6458
|
AsnType({ type: AsnTypeTypes.Sequence, itemType: OneAsymmetricKey })
|
|
7241
6459
|
], CompositePrivateKey);
|
|
7242
6460
|
|
|
7243
|
-
var dayjs_min = {exports: {}};
|
|
6461
|
+
var dayjs_min$1 = {exports: {}};
|
|
6462
|
+
|
|
6463
|
+
var dayjs_min = dayjs_min$1.exports;
|
|
6464
|
+
|
|
6465
|
+
var hasRequiredDayjs_min;
|
|
6466
|
+
|
|
6467
|
+
function requireDayjs_min () {
|
|
6468
|
+
if (hasRequiredDayjs_min) return dayjs_min$1.exports;
|
|
6469
|
+
hasRequiredDayjs_min = 1;
|
|
6470
|
+
(function (module, exports) {
|
|
6471
|
+
!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}));
|
|
6472
|
+
} (dayjs_min$1));
|
|
6473
|
+
return dayjs_min$1.exports;
|
|
6474
|
+
}
|
|
6475
|
+
|
|
6476
|
+
var dayjs_minExports = requireDayjs_min();
|
|
6477
|
+
var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
|
|
7244
6478
|
|
|
7245
|
-
|
|
7246
|
-
!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}));
|
|
7247
|
-
}(dayjs_min));
|
|
6479
|
+
var relativeTime$2 = {exports: {}};
|
|
7248
6480
|
|
|
7249
|
-
|
|
6481
|
+
var relativeTime$1 = relativeTime$2.exports;
|
|
7250
6482
|
|
|
7251
|
-
var
|
|
6483
|
+
var hasRequiredRelativeTime;
|
|
7252
6484
|
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
6485
|
+
function requireRelativeTime () {
|
|
6486
|
+
if (hasRequiredRelativeTime) return relativeTime$2.exports;
|
|
6487
|
+
hasRequiredRelativeTime = 1;
|
|
6488
|
+
(function (module, exports) {
|
|
6489
|
+
!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)};}}));
|
|
6490
|
+
} (relativeTime$2));
|
|
6491
|
+
return relativeTime$2.exports;
|
|
6492
|
+
}
|
|
7256
6493
|
|
|
7257
|
-
|
|
6494
|
+
var relativeTimeExports = requireRelativeTime();
|
|
6495
|
+
var relativeTime = /*@__PURE__*/getDefaultExportFromCjs(relativeTimeExports);
|
|
7258
6496
|
|
|
7259
6497
|
/**
|
|
7260
6498
|
* @license
|
|
@@ -7319,7 +6557,7 @@ const crlEntryExtensions = "CRL Entry Extensions";
|
|
|
7319
6557
|
const previewCertificate = "Preview certificate";
|
|
7320
6558
|
const viewDetails = "View details";
|
|
7321
6559
|
const downloadOptions = "Download options";
|
|
7322
|
-
|
|
6560
|
+
var en = {
|
|
7323
6561
|
basicInformation: basicInformation,
|
|
7324
6562
|
subjectName: subjectName,
|
|
7325
6563
|
issuerName: issuerName,
|
|
@@ -9756,6 +8994,22 @@ const OIDs = {
|
|
|
9756
8994
|
'2.23.140.1.31': 'CA/B Forum Onion EV',
|
|
9757
8995
|
'2.23.140.2.1': 'CA/B Forum Test Certificate',
|
|
9758
8996
|
'2.23.140.3.1': 'CA/B Forum Organization Identifier',
|
|
8997
|
+
// https://github.com/IETF-Hackathon/pqc-certificates/blob/master/docs/oid_mapping.md
|
|
8998
|
+
'2.16.840.1.101.3.4.3.17': 'ML-DSA-44',
|
|
8999
|
+
'2.16.840.1.101.3.4.3.18': 'ML-DSA-65',
|
|
9000
|
+
'2.16.840.1.101.3.4.3.19': 'ML-DSA-87',
|
|
9001
|
+
'2.16.840.1.101.3.4.3.20': 'SLH-DSA-SHA2-128s',
|
|
9002
|
+
'2.16.840.1.101.3.4.3.21': 'SLH-DSA-SHA2-128f',
|
|
9003
|
+
'2.16.840.1.101.3.4.3.22': 'SLH-DSA-SHA2-192s',
|
|
9004
|
+
'2.16.840.1.101.3.4.3.23': 'SLH-DSA-SHA2-192f',
|
|
9005
|
+
'2.16.840.1.101.3.4.3.24': 'SLH-DSA-SHA2-256s',
|
|
9006
|
+
'2.16.840.1.101.3.4.3.25': 'SLH-DSA-SHA2-256f',
|
|
9007
|
+
'2.16.840.1.101.3.4.3.26': 'SLH-DSA-SHAKE-128s',
|
|
9008
|
+
'2.16.840.1.101.3.4.3.27': 'SLH-DSA-SHAKE-128f',
|
|
9009
|
+
'2.16.840.1.101.3.4.3.28': 'SLH-DSA-SHAKE-192f',
|
|
9010
|
+
'2.16.840.1.101.3.4.3.29': 'SLH-DSA-SHAKE-256s',
|
|
9011
|
+
'2.16.840.1.101.3.4.3.30': 'SLH-DSA-SHAKE-256f',
|
|
9012
|
+
'2.16.840.1.101.3.4.3.31': 'SLH-DSA-SHAKE-256f',
|
|
9759
9013
|
};
|
|
9760
9014
|
|
|
9761
9015
|
/**
|
|
@@ -9780,7 +9034,7 @@ var _Name_asn;
|
|
|
9780
9034
|
class Name {
|
|
9781
9035
|
constructor(data) {
|
|
9782
9036
|
_Name_asn.set(this, new Name$1());
|
|
9783
|
-
if (
|
|
9037
|
+
if (buildExports.BufferSourceConverter.isBufferSource(data)) {
|
|
9784
9038
|
__classPrivateFieldSet$1(this, _Name_asn, AsnParser.parse(data, Name$1), "f");
|
|
9785
9039
|
}
|
|
9786
9040
|
else {
|
|
@@ -9988,8 +9242,8 @@ let CaVersion = class CaVersion {
|
|
|
9988
9242
|
data.set(new Uint8Array(this.value), 4 - this.value.byteLength);
|
|
9989
9243
|
}
|
|
9990
9244
|
return {
|
|
9991
|
-
keyIndex: parseInt(
|
|
9992
|
-
certificateIndex: parseInt(
|
|
9245
|
+
keyIndex: parseInt(buildExports.Convert.ToHex(data.slice(0, 2)), 16),
|
|
9246
|
+
certificateIndex: parseInt(buildExports.Convert.ToHex(data.slice(2)), 16),
|
|
9993
9247
|
};
|
|
9994
9248
|
}
|
|
9995
9249
|
};
|
|
@@ -10410,7 +9664,7 @@ class ByteStream {
|
|
|
10410
9664
|
}
|
|
10411
9665
|
constructor(bytes) {
|
|
10412
9666
|
this.offset = 0;
|
|
10413
|
-
this.view =
|
|
9667
|
+
this.view = buildExports.BufferSourceConverter.toUint8Array(bytes);
|
|
10414
9668
|
}
|
|
10415
9669
|
read(size = 1) {
|
|
10416
9670
|
const res = this.view.slice(this.offset, this.offset + size);
|
|
@@ -10426,7 +9680,7 @@ class ByteStream {
|
|
|
10426
9680
|
}
|
|
10427
9681
|
readNumber(size) {
|
|
10428
9682
|
const bytes = this.read(size);
|
|
10429
|
-
const hex =
|
|
9683
|
+
const hex = buildExports.Convert.ToHex(bytes);
|
|
10430
9684
|
return parseInt(hex, 16);
|
|
10431
9685
|
}
|
|
10432
9686
|
readEnd() {
|
|
@@ -10439,7 +9693,7 @@ class ByteStream {
|
|
|
10439
9693
|
|
|
10440
9694
|
class Structure {
|
|
10441
9695
|
static createStream(bytes) {
|
|
10442
|
-
const view =
|
|
9696
|
+
const view = buildExports.BufferSourceConverter.toUint8Array(bytes);
|
|
10443
9697
|
return new ByteStream(view);
|
|
10444
9698
|
}
|
|
10445
9699
|
}
|
|
@@ -10483,7 +9737,7 @@ class SignedCertificateTimestamp extends Structure {
|
|
|
10483
9737
|
parse(stream) {
|
|
10484
9738
|
this.version = stream.readByte();
|
|
10485
9739
|
stream.read(2);
|
|
10486
|
-
this.logId =
|
|
9740
|
+
this.logId = buildExports.BufferSourceConverter.toArrayBuffer(stream.read(32));
|
|
10487
9741
|
this.timestamp = new Date(stream.readNumber(8));
|
|
10488
9742
|
const extLen = stream.readNumber(2);
|
|
10489
9743
|
this.extensions = stream.read(extLen).buffer;
|
|
@@ -10494,12 +9748,12 @@ class SignedCertificateTimestamp extends Structure {
|
|
|
10494
9748
|
toJSON() {
|
|
10495
9749
|
return {
|
|
10496
9750
|
version: this.version,
|
|
10497
|
-
logId:
|
|
9751
|
+
logId: buildExports.Convert.ToHex(this.logId),
|
|
10498
9752
|
timestamp: this.timestamp,
|
|
10499
|
-
extensions:
|
|
9753
|
+
extensions: buildExports.Convert.ToBase64(this.extensions),
|
|
10500
9754
|
hashAlgorithm: HashAlgorithm[this.hashAlgorithm] || "undefined",
|
|
10501
9755
|
signatureAlgorithm: SignatureAlgorithm[this.signatureAlgorithm] || "undefined",
|
|
10502
|
-
signature:
|
|
9756
|
+
signature: buildExports.Convert.ToBase64(this.signature),
|
|
10503
9757
|
};
|
|
10504
9758
|
}
|
|
10505
9759
|
}
|
|
@@ -10521,7 +9775,7 @@ class CertificateTransparency extends OctetString {
|
|
|
10521
9775
|
return this;
|
|
10522
9776
|
}
|
|
10523
9777
|
toJSON() {
|
|
10524
|
-
return this.items.map(o => o.toJSON());
|
|
9778
|
+
return this.items.map((o) => o.toJSON());
|
|
10525
9779
|
}
|
|
10526
9780
|
}
|
|
10527
9781
|
|
|
@@ -10665,7 +9919,12 @@ class LogotypeImageInfo {
|
|
|
10665
9919
|
}
|
|
10666
9920
|
}
|
|
10667
9921
|
__decorate$1([
|
|
10668
|
-
AsnProp({
|
|
9922
|
+
AsnProp({
|
|
9923
|
+
type: AsnPropTypes.Integer,
|
|
9924
|
+
context: 0,
|
|
9925
|
+
implicit: true,
|
|
9926
|
+
defaultValue: LogotypeImageType.color,
|
|
9927
|
+
})
|
|
10669
9928
|
], LogotypeImageInfo.prototype, "type", void 0);
|
|
10670
9929
|
__decorate$1([
|
|
10671
9930
|
AsnProp({ type: AsnPropTypes.Integer })
|
|
@@ -10783,7 +10042,7 @@ let JWTClaimNames = JWTClaimNames_1 = class JWTClaimNames extends AsnArray {
|
|
|
10783
10042
|
JWTClaimNames = JWTClaimNames_1 = __decorate$1([
|
|
10784
10043
|
AsnType({
|
|
10785
10044
|
type: AsnTypeTypes.Sequence,
|
|
10786
|
-
itemType: AsnPropTypes.IA5String
|
|
10045
|
+
itemType: AsnPropTypes.IA5String,
|
|
10787
10046
|
})
|
|
10788
10047
|
], JWTClaimNames);
|
|
10789
10048
|
class JWTClaimPermittedValues {
|
|
@@ -10813,7 +10072,7 @@ let JWTClaimPermittedValuesList = JWTClaimPermittedValuesList_1 = class JWTClaim
|
|
|
10813
10072
|
JWTClaimPermittedValuesList = JWTClaimPermittedValuesList_1 = __decorate$1([
|
|
10814
10073
|
AsnType({
|
|
10815
10074
|
type: AsnTypeTypes.Sequence,
|
|
10816
|
-
itemType: JWTClaimPermittedValues
|
|
10075
|
+
itemType: JWTClaimPermittedValues,
|
|
10817
10076
|
})
|
|
10818
10077
|
], JWTClaimPermittedValuesList);
|
|
10819
10078
|
class JWTClaimConstraints {
|
|
@@ -11055,6 +10314,12 @@ __decorate$1([
|
|
|
11055
10314
|
__decorate$1([
|
|
11056
10315
|
AsnProp({ context: 720, type: AsnPropTypes.Null, optional: true })
|
|
11057
10316
|
], AuthorizationList.prototype, "deviceUniqueAttestation", void 0);
|
|
10317
|
+
__decorate$1([
|
|
10318
|
+
AsnProp({ context: 723, type: OctetString, optional: true })
|
|
10319
|
+
], AuthorizationList.prototype, "attestationIdSecondImei", void 0);
|
|
10320
|
+
__decorate$1([
|
|
10321
|
+
AsnProp({ context: 724, type: OctetString, optional: true })
|
|
10322
|
+
], AuthorizationList.prototype, "moduleHash", void 0);
|
|
11058
10323
|
var SecurityLevel;
|
|
11059
10324
|
(function (SecurityLevel) {
|
|
11060
10325
|
SecurityLevel[SecurityLevel["software"] = 0] = "software";
|
|
@@ -11069,6 +10334,8 @@ var Version;
|
|
|
11069
10334
|
Version[Version["KM4_1"] = 4] = "KM4_1";
|
|
11070
10335
|
Version[Version["keyMint1"] = 100] = "keyMint1";
|
|
11071
10336
|
Version[Version["keyMint2"] = 200] = "keyMint2";
|
|
10337
|
+
Version[Version["keyMint3"] = 300] = "keyMint3";
|
|
10338
|
+
Version[Version["keyMint4"] = 400] = "keyMint4";
|
|
11072
10339
|
})(Version || (Version = {}));
|
|
11073
10340
|
class KeyDescription {
|
|
11074
10341
|
constructor(params = {}) {
|
|
@@ -11107,6 +10374,67 @@ __decorate$1([
|
|
|
11107
10374
|
__decorate$1([
|
|
11108
10375
|
AsnProp({ type: AuthorizationList })
|
|
11109
10376
|
], KeyDescription.prototype, "teeEnforced", void 0);
|
|
10377
|
+
class KeyMintKeyDescription {
|
|
10378
|
+
constructor(params = {}) {
|
|
10379
|
+
this.attestationVersion = Version.keyMint4;
|
|
10380
|
+
this.attestationSecurityLevel = SecurityLevel.software;
|
|
10381
|
+
this.keyMintVersion = 0;
|
|
10382
|
+
this.keyMintSecurityLevel = SecurityLevel.software;
|
|
10383
|
+
this.attestationChallenge = new OctetString();
|
|
10384
|
+
this.uniqueId = new OctetString();
|
|
10385
|
+
this.softwareEnforced = new AuthorizationList();
|
|
10386
|
+
this.hardwareEnforced = new AuthorizationList();
|
|
10387
|
+
Object.assign(this, params);
|
|
10388
|
+
}
|
|
10389
|
+
toLegacyKeyDescription() {
|
|
10390
|
+
return new KeyDescription({
|
|
10391
|
+
attestationVersion: this.attestationVersion,
|
|
10392
|
+
attestationSecurityLevel: this.attestationSecurityLevel,
|
|
10393
|
+
keymasterVersion: this.keyMintVersion,
|
|
10394
|
+
keymasterSecurityLevel: this.keyMintSecurityLevel,
|
|
10395
|
+
attestationChallenge: this.attestationChallenge,
|
|
10396
|
+
uniqueId: this.uniqueId,
|
|
10397
|
+
softwareEnforced: this.softwareEnforced,
|
|
10398
|
+
teeEnforced: this.hardwareEnforced,
|
|
10399
|
+
});
|
|
10400
|
+
}
|
|
10401
|
+
static fromLegacyKeyDescription(keyDesc) {
|
|
10402
|
+
return new KeyMintKeyDescription({
|
|
10403
|
+
attestationVersion: keyDesc.attestationVersion,
|
|
10404
|
+
attestationSecurityLevel: keyDesc.attestationSecurityLevel,
|
|
10405
|
+
keyMintVersion: keyDesc.keymasterVersion,
|
|
10406
|
+
keyMintSecurityLevel: keyDesc.keymasterSecurityLevel,
|
|
10407
|
+
attestationChallenge: keyDesc.attestationChallenge,
|
|
10408
|
+
uniqueId: keyDesc.uniqueId,
|
|
10409
|
+
softwareEnforced: keyDesc.softwareEnforced,
|
|
10410
|
+
hardwareEnforced: keyDesc.teeEnforced,
|
|
10411
|
+
});
|
|
10412
|
+
}
|
|
10413
|
+
}
|
|
10414
|
+
__decorate$1([
|
|
10415
|
+
AsnProp({ type: AsnPropTypes.Integer })
|
|
10416
|
+
], KeyMintKeyDescription.prototype, "attestationVersion", void 0);
|
|
10417
|
+
__decorate$1([
|
|
10418
|
+
AsnProp({ type: AsnPropTypes.Enumerated })
|
|
10419
|
+
], KeyMintKeyDescription.prototype, "attestationSecurityLevel", void 0);
|
|
10420
|
+
__decorate$1([
|
|
10421
|
+
AsnProp({ type: AsnPropTypes.Integer })
|
|
10422
|
+
], KeyMintKeyDescription.prototype, "keyMintVersion", void 0);
|
|
10423
|
+
__decorate$1([
|
|
10424
|
+
AsnProp({ type: AsnPropTypes.Enumerated })
|
|
10425
|
+
], KeyMintKeyDescription.prototype, "keyMintSecurityLevel", void 0);
|
|
10426
|
+
__decorate$1([
|
|
10427
|
+
AsnProp({ type: OctetString })
|
|
10428
|
+
], KeyMintKeyDescription.prototype, "attestationChallenge", void 0);
|
|
10429
|
+
__decorate$1([
|
|
10430
|
+
AsnProp({ type: OctetString })
|
|
10431
|
+
], KeyMintKeyDescription.prototype, "uniqueId", void 0);
|
|
10432
|
+
__decorate$1([
|
|
10433
|
+
AsnProp({ type: AuthorizationList })
|
|
10434
|
+
], KeyMintKeyDescription.prototype, "softwareEnforced", void 0);
|
|
10435
|
+
__decorate$1([
|
|
10436
|
+
AsnProp({ type: AuthorizationList })
|
|
10437
|
+
], KeyMintKeyDescription.prototype, "hardwareEnforced", void 0);
|
|
11110
10438
|
|
|
11111
10439
|
var NonStandardAuthorizationList_1;
|
|
11112
10440
|
let NonStandardAuthorization = class NonStandardAuthorization extends AuthorizationList {
|
|
@@ -11120,7 +10448,7 @@ let NonStandardAuthorizationList = NonStandardAuthorizationList_1 = class NonSta
|
|
|
11120
10448
|
Object.setPrototypeOf(this, NonStandardAuthorizationList_1.prototype);
|
|
11121
10449
|
}
|
|
11122
10450
|
findProperty(key) {
|
|
11123
|
-
const prop = this.find((o => key in o)
|
|
10451
|
+
const prop = this.find((o) => key in o);
|
|
11124
10452
|
if (prop) {
|
|
11125
10453
|
return prop[key];
|
|
11126
10454
|
}
|
|
@@ -11131,6 +10459,24 @@ NonStandardAuthorizationList = NonStandardAuthorizationList_1 = __decorate$1([
|
|
|
11131
10459
|
AsnType({ type: AsnTypeTypes.Sequence, itemType: NonStandardAuthorization })
|
|
11132
10460
|
], NonStandardAuthorizationList);
|
|
11133
10461
|
class NonStandardKeyDescription {
|
|
10462
|
+
get keyMintVersion() {
|
|
10463
|
+
return this.keymasterVersion;
|
|
10464
|
+
}
|
|
10465
|
+
set keyMintVersion(value) {
|
|
10466
|
+
this.keymasterVersion = value;
|
|
10467
|
+
}
|
|
10468
|
+
get keyMintSecurityLevel() {
|
|
10469
|
+
return this.keymasterSecurityLevel;
|
|
10470
|
+
}
|
|
10471
|
+
set keyMintSecurityLevel(value) {
|
|
10472
|
+
this.keymasterSecurityLevel = value;
|
|
10473
|
+
}
|
|
10474
|
+
get hardwareEnforced() {
|
|
10475
|
+
return this.teeEnforced;
|
|
10476
|
+
}
|
|
10477
|
+
set hardwareEnforced(value) {
|
|
10478
|
+
this.teeEnforced = value;
|
|
10479
|
+
}
|
|
11134
10480
|
constructor(params = {}) {
|
|
11135
10481
|
this.attestationVersion = Version.KM4;
|
|
11136
10482
|
this.attestationSecurityLevel = SecurityLevel.software;
|
|
@@ -11167,6 +10513,23 @@ __decorate$1([
|
|
|
11167
10513
|
__decorate$1([
|
|
11168
10514
|
AsnProp({ type: NonStandardAuthorizationList })
|
|
11169
10515
|
], NonStandardKeyDescription.prototype, "teeEnforced", void 0);
|
|
10516
|
+
let NonStandardKeyMintKeyDescription = class NonStandardKeyMintKeyDescription extends NonStandardKeyDescription {
|
|
10517
|
+
constructor(params = {}) {
|
|
10518
|
+
if ("keymasterVersion" in params && !("keyMintVersion" in params)) {
|
|
10519
|
+
params.keyMintVersion = params.keymasterVersion;
|
|
10520
|
+
}
|
|
10521
|
+
if ("keymasterSecurityLevel" in params && !("keyMintSecurityLevel" in params)) {
|
|
10522
|
+
params.keyMintSecurityLevel = params.keymasterSecurityLevel;
|
|
10523
|
+
}
|
|
10524
|
+
if ("teeEnforced" in params && !("hardwareEnforced" in params)) {
|
|
10525
|
+
params.hardwareEnforced = params.teeEnforced;
|
|
10526
|
+
}
|
|
10527
|
+
super(params);
|
|
10528
|
+
}
|
|
10529
|
+
};
|
|
10530
|
+
NonStandardKeyMintKeyDescription = __decorate$1([
|
|
10531
|
+
AsnType({ type: AsnTypeTypes.Sequence })
|
|
10532
|
+
], NonStandardKeyMintKeyDescription);
|
|
11170
10533
|
|
|
11171
10534
|
class AttestationPackageInfo {
|
|
11172
10535
|
constructor(params = {}) {
|
|
@@ -11269,7 +10632,7 @@ class AsnData {
|
|
|
11269
10632
|
else {
|
|
11270
10633
|
// raw, type
|
|
11271
10634
|
__classPrivateFieldSet(this, _AsnData_asn, AsnConvert.parse(args[0], args[1]), "f");
|
|
11272
|
-
__classPrivateFieldSet(this, _AsnData_raw,
|
|
10635
|
+
__classPrivateFieldSet(this, _AsnData_raw, buildExports.BufferSourceConverter.toArrayBuffer(args[0]), "f");
|
|
11273
10636
|
}
|
|
11274
10637
|
}
|
|
11275
10638
|
get asn() {
|
|
@@ -11346,12 +10709,12 @@ class Extension extends AsnData {
|
|
|
11346
10709
|
}
|
|
11347
10710
|
else {
|
|
11348
10711
|
console.warn(`Didn't detect parser for "${this.asn.extnID}" extension.`);
|
|
11349
|
-
this.value =
|
|
10712
|
+
this.value = buildExports.Convert.ToHex(asnExtnValue);
|
|
11350
10713
|
}
|
|
11351
10714
|
}
|
|
11352
10715
|
catch (error) {
|
|
11353
10716
|
console.error(`Error parse "${this.asn.extnID}" extension:`, error.message);
|
|
11354
|
-
this.value =
|
|
10717
|
+
this.value = buildExports.Convert.ToHex(asnExtnValue);
|
|
11355
10718
|
}
|
|
11356
10719
|
}
|
|
11357
10720
|
}
|
|
@@ -11396,7 +10759,7 @@ class PemConverter {
|
|
|
11396
10759
|
const pemStruct = {
|
|
11397
10760
|
type: matches[1],
|
|
11398
10761
|
headers: [],
|
|
11399
|
-
rawData:
|
|
10762
|
+
rawData: buildExports.Convert.FromBase64(base64),
|
|
11400
10763
|
};
|
|
11401
10764
|
// read headers
|
|
11402
10765
|
const headersString = matches[2];
|
|
@@ -11444,12 +10807,12 @@ class PemConverter {
|
|
|
11444
10807
|
if (tag) {
|
|
11445
10808
|
// encode BufferSource[]
|
|
11446
10809
|
rawData.forEach((element) => {
|
|
11447
|
-
if (!
|
|
10810
|
+
if (!buildExports.BufferSourceConverter.isBufferSource(element)) {
|
|
11448
10811
|
throw new TypeError('Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource');
|
|
11449
10812
|
}
|
|
11450
10813
|
raws.push(this.encodeStruct({
|
|
11451
10814
|
type: tag,
|
|
11452
|
-
rawData:
|
|
10815
|
+
rawData: buildExports.BufferSourceConverter.toArrayBuffer(element),
|
|
11453
10816
|
}));
|
|
11454
10817
|
});
|
|
11455
10818
|
}
|
|
@@ -11469,7 +10832,7 @@ class PemConverter {
|
|
|
11469
10832
|
}
|
|
11470
10833
|
return this.encodeStruct({
|
|
11471
10834
|
type: tag,
|
|
11472
|
-
rawData:
|
|
10835
|
+
rawData: buildExports.BufferSourceConverter.toArrayBuffer(rawData),
|
|
11473
10836
|
});
|
|
11474
10837
|
}
|
|
11475
10838
|
/**
|
|
@@ -11489,7 +10852,7 @@ class PemConverter {
|
|
|
11489
10852
|
}
|
|
11490
10853
|
res.push(''); // blank line
|
|
11491
10854
|
}
|
|
11492
|
-
const base64 =
|
|
10855
|
+
const base64 = buildExports.Convert.ToBase64(pem.rawData);
|
|
11493
10856
|
let sliced;
|
|
11494
10857
|
let offset = 0;
|
|
11495
10858
|
const rows = Array();
|
|
@@ -11574,16 +10937,16 @@ const certificateRawToBuffer = (raw) => {
|
|
|
11574
10937
|
if (PemConverter.isPem(raw)) {
|
|
11575
10938
|
return PemConverter.decode(raw)[0];
|
|
11576
10939
|
}
|
|
11577
|
-
if (
|
|
11578
|
-
return
|
|
10940
|
+
if (buildExports.Convert.isHex(raw)) {
|
|
10941
|
+
return buildExports.Convert.FromHex(raw);
|
|
11579
10942
|
}
|
|
11580
|
-
if (
|
|
11581
|
-
return
|
|
10943
|
+
if (buildExports.Convert.isBase64(raw)) {
|
|
10944
|
+
return buildExports.Convert.FromBase64(raw);
|
|
11582
10945
|
}
|
|
11583
|
-
if (
|
|
11584
|
-
return
|
|
10946
|
+
if (buildExports.Convert.isBase64Url(raw)) {
|
|
10947
|
+
return buildExports.Convert.FromBase64Url(raw);
|
|
11585
10948
|
}
|
|
11586
|
-
|
|
10949
|
+
return buildExports.Convert.FromBinary(raw);
|
|
11587
10950
|
};
|
|
11588
10951
|
const getCertificateThumbprint = async (algorithm, data) => {
|
|
11589
10952
|
const crypto = cryptoProvider.get();
|
|
@@ -12151,7 +11514,7 @@ WebGDPR = __decorate$1([
|
|
|
12151
11514
|
|
|
12152
11515
|
class IssuerAndSerialNumber {
|
|
12153
11516
|
constructor(params = {}) {
|
|
12154
|
-
this.issuer = new Name$1;
|
|
11517
|
+
this.issuer = new Name$1();
|
|
12155
11518
|
this.serialNumber = new ArrayBuffer(0);
|
|
12156
11519
|
Object.assign(this, params);
|
|
12157
11520
|
}
|
|
@@ -12376,7 +11739,14 @@ __decorate$1([
|
|
|
12376
11739
|
AsnProp({ type: OctetString, context: 0, implicit: true, optional: true })
|
|
12377
11740
|
], EncryptedContent.prototype, "value", void 0);
|
|
12378
11741
|
__decorate$1([
|
|
12379
|
-
AsnProp({
|
|
11742
|
+
AsnProp({
|
|
11743
|
+
type: OctetString,
|
|
11744
|
+
converter: AsnConstructedOctetStringConverter,
|
|
11745
|
+
context: 0,
|
|
11746
|
+
implicit: true,
|
|
11747
|
+
optional: true,
|
|
11748
|
+
repeated: "sequence",
|
|
11749
|
+
})
|
|
12380
11750
|
], EncryptedContent.prototype, "constructedValue", void 0);
|
|
12381
11751
|
EncryptedContent = __decorate$1([
|
|
12382
11752
|
AsnType({ type: AsnTypeTypes.Choice })
|
|
@@ -13185,6 +12555,7 @@ __decorate$1([
|
|
|
13185
12555
|
AsnProp({ type: AsnPropTypes.BitString })
|
|
13186
12556
|
], CertificationRequest.prototype, "signature", void 0);
|
|
13187
12557
|
|
|
13188
|
-
export {
|
|
12558
|
+
export { SignedData as $, AsnData as A, id_pkcs9_at_unstructuredName as B, Certificate as C, Download as D, Extension as E, id_pkcs9_at_challengePassword as F, id_ValuationRanking as G, id_InsuranceValue as H, InsuranceValue as I, id_WebGDPR as J, id_ActivityDescription as K, id_TypeRelationship as L, id_DomainNameTechnicalOperator as M, Name as N, id_DomainNameOwner as O, PemConverter as P, id_DomainNameLegalRepresentative as Q, RSAPublicKey as R, id_DomainNameBeneficiary as S, TypeRelationship as T, UnstructuredName as U, ValuationRanking as V, WebGDPR as W, CertificationRequest as X, l10n as Y, dateShort as Z, OIDs as _, dateDiff as a, EncapsulatedContent as a0, OctetString as a1, CertificateSet as a2, CertificateChoices as a3, ContentInfo as a4, Name$1 as a5, CRLReason as a6, InvalidityDate as a7, CertificateIssuer as a8, OtherName as a9, NameConstraints as aA, CertificateTemplate as aB, EnrollCertTypeChoice as aC, CaVersion as aD, QCStatements as aE, NetscapeComment as aF, NetscapeCertType as aG, LeiRole as aH, LeiChoice as aI, Timestamp as aJ, ArchiveRevInfo as aK, SubjectDirectoryAttributes as aL, PrivateKeyUsagePeriod as aM, EntrustVersionInfo as aN, BiometricSyntax as aO, LogotypeExtn as aP, TNAuthorizationList as aQ, PolicyConstraints as aR, PolicyMappings as aS, CRLNumber as aT, IssuingDistributionPoint as aU, NonStandardKeyDescription as aV, CabforganizationIdentifier as aW, DisplayText as aa, UserNotice as ab, EDIPartyName as ac, __decorate$1 as ad, AsnProp as ae, AsnPropTypes as af, AsnType as ag, AsnTypeTypes as ah, AsnArray as ai, id_qcs_pkixQCSyntax_v2 as aj, SemanticsInformation as ak, AsnIntegerArrayBufferConverter as al, AttestationApplicationId as am, RootOfTrust as an, IntegerSet as ao, KeyUsage as ap, BasicConstraints as aq, ExtendedKeyUsage as ar, SubjectKeyIdentifier as as, AuthorityKeyIdentifier as at, CRLDistributionPoints as au, AuthorityInfoAccessSyntax as av, SubjectInfoAccessSyntax as aw, SubjectAlternativeName as ax, CertificatePolicies as ay, CertificateTransparency as az, buildExports as b, certificateRawToBuffer as c, downloadFromBuffer as d, AsnConvert as e, ECParameters as f, id_rsaEncryption as g, id_composite_key as h, id_ecPublicKey as i, CompositePublicKey as j, id_alg_composite as k, CompositeSignatureValue as l, CompositeParams as m, getCertificateThumbprint as n, AttributeCertificate as o, CertificateList as p, Attribute$1 as q, AsnParser as r, ExtensionRequest as s, ChallengePassword as t, ActivityDescription as u, DomainNameTechnicalOperator as v, DomainNameOwner as w, DomainNameLegalRepresentative as x, DomainNameBeneficiary as y, id_pkcs9_at_extensionRequest as z };
|
|
12559
|
+
//# sourceMappingURL=certification_request-Wtz6WM17.js.map
|
|
13189
12560
|
|
|
13190
|
-
//# sourceMappingURL=certification_request-
|
|
12561
|
+
//# sourceMappingURL=certification_request-Wtz6WM17.js.map
|