@peculiar/certificates-viewer 4.7.1-alpha.5 → 4.8.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 -2
- package/components/actions.js.map +1 -1
- package/components/arrow_top.js +2 -4
- package/components/arrow_top.js.map +1 -1
- package/components/attribute-certificate-viewer.js +7 -12
- package/components/attribute-certificate-viewer.js.map +1 -1
- package/components/button-menu.js +4 -2
- package/components/button-menu.js.map +1 -1
- package/components/button.js +5 -8
- package/components/button.js.map +1 -1
- package/components/certificate-chain-viewer.js +5 -3
- package/components/certificate-chain-viewer.js.map +1 -1
- package/components/certificate-viewer.js +4 -2
- package/components/certificate-viewer.js.map +1 -1
- package/components/circular-progress.js +4 -2
- package/components/circular-progress.js.map +1 -1
- package/components/crl-viewer.js +6 -7
- package/components/crl-viewer.js.map +1 -1
- package/components/cross.js +3 -6
- package/components/cross.js.map +1 -1
- package/components/csr-viewer.js +4 -2
- package/components/csr-viewer.js.map +1 -1
- package/components/download.js +89 -89
- package/components/download.js.map +1 -1
- package/components/highlight-words.js +4 -2
- package/components/highlight-words.js.map +1 -1
- package/components/index2.js +14 -49
- package/components/index2.js.map +1 -1
- package/components/issuer_name.js.map +1 -1
- package/components/miscellaneous.js +61 -153
- package/components/miscellaneous.js.map +1 -1
- package/components/peculiar-certificate-decoder.js +5 -3
- package/components/peculiar-certificate-decoder.js.map +1 -1
- package/components/peculiar-certificates-viewer.js +6 -16
- package/components/peculiar-certificates-viewer.js.map +1 -1
- package/components/pkcs10_certificate_request.js.map +1 -1
- package/components/row.js +6 -17
- package/components/row.js.map +1 -1
- package/components/ssh-certificate-viewer.js +5 -5
- package/components/ssh-certificate-viewer.js.map +1 -1
- package/components/subject_name.js.map +1 -1
- package/components/text-hider.js +4 -2
- package/components/text-hider.js.map +1 -1
- package/dist/cjs/{actions-ByC9jQU-.js → actions-mGiqn4uZ.js} +4 -5
- package/dist/cjs/{actions-ByC9jQU-.js.map → actions-mGiqn4uZ.js.map} +1 -1
- package/dist/cjs/{arrow_top-Cw9KN115.js → arrow_top-opfTrg-m.js} +5 -7
- package/dist/cjs/{arrow_top-Cw9KN115.js.map → arrow_top-opfTrg-m.js.map} +1 -1
- package/dist/cjs/{button-C8EWG_-r.js → button-B215SxsO.js} +8 -11
- package/dist/{esm-es5/button-Bbh7MwG6.js.map → cjs/button-B215SxsO.js.map} +1 -1
- package/dist/cjs/cross-DV79hJ_S.js +49 -0
- package/dist/cjs/{cross-3DqhA0G_.js.map → cross-DV79hJ_S.js.map} +1 -1
- package/dist/cjs/download-DAw3krU6.js +23 -0
- package/dist/cjs/{download-DQP0KR4o.js.map → download-DAw3krU6.js.map} +1 -1
- package/dist/cjs/{extension-CjXYQXbF.js → extension-BDpdRJkE.js} +3 -3
- package/dist/cjs/extension-BDpdRJkE.js.map +1 -0
- package/dist/cjs/{index-uHmGhObe.js → index-BDWR3dnW.js} +88 -47
- package/dist/cjs/index-BDWR3dnW.js.map +1 -0
- package/dist/cjs/index.cjs.js +9 -11
- package/dist/cjs/{link-Cgh8wnbs.js → link-BScgjwVZ.js} +5 -5
- package/dist/cjs/{link-Cgh8wnbs.js.map → link-BScgjwVZ.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -4
- package/dist/cjs/{miscellaneous-7gtHz795.js → miscellaneous-Bomq8zQH.js} +75 -178
- package/dist/cjs/miscellaneous-Bomq8zQH.js.map +1 -0
- package/dist/cjs/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.cjs.js.map +1 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer_5.cjs.entry.js +30 -79
- package/dist/cjs/peculiar-button-menu_3.cjs.entry.js +3 -5
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +7 -9
- package/dist/cjs/peculiar-certificate-decoder.entry.cjs.js.map +1 -1
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +8 -10
- package/dist/cjs/peculiar-certificate-viewer.entry.cjs.js.map +1 -1
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +10 -24
- package/dist/cjs/peculiar-certificates-viewer.entry.cjs.js.map +1 -1
- package/dist/cjs/peculiar-text-hider.cjs.entry.js +3 -5
- package/dist/cjs/peculiar.cjs.js +3 -5
- package/dist/cjs/peculiar.cjs.js.map +1 -1
- package/dist/cjs/{pkcs10_certificate_request-CIOxDu_Z.js → pkcs10_certificate_request-DZLiHGCV.js} +3 -3
- package/dist/cjs/{pkcs10_certificate_request-CIOxDu_Z.js.map → pkcs10_certificate_request-DZLiHGCV.js.map} +1 -1
- package/dist/cjs/{ssh_certificate-DnXj2sM0.js → ssh_certificate-Bh14rhzR.js} +89 -88
- package/dist/cjs/ssh_certificate-Bh14rhzR.js.map +1 -0
- package/dist/cjs/{x509_certificate-DPgu-mwG.js → x509_certificate-p8RMn7Hw.js} +4 -4
- package/dist/cjs/{x509_certificate-DPgu-mwG.js.map → x509_certificate-p8RMn7Hw.js.map} +1 -1
- package/dist/cjs/{x509_crl-D_DKkGcn.js → x509_crl-tjmX6l3R.js} +5 -5
- package/dist/cjs/{x509_crl-D_DKkGcn.js.map → x509_crl-tjmX6l3R.js.map} +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +14 -14
- package/dist/collection/components/button-menu/button-menu.js +1 -2
- package/dist/collection/components/button-menu/button-menu.js.map +1 -1
- package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.css +0 -447
- package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js +2 -3
- package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js.map +1 -1
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +2 -3
- package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js.map +1 -1
- package/dist/collection/components/certificate-viewer/certificate-viewer.js +16 -16
- package/dist/collection/components/certificates-viewer/certificates-viewer.js +4 -5
- package/dist/collection/components/certificates-viewer/certificates-viewer.js.map +1 -1
- package/dist/collection/components/circular-progress/circular-progress.js +2 -2
- package/dist/collection/components/crl-viewer/crl-viewer.js +12 -12
- package/dist/collection/components/csr-viewer/csr-viewer.js +10 -10
- package/dist/collection/components/highlight-words/highlight-words.js +2 -2
- package/dist/collection/components/ssh-certificate-viewer/ssh-certificate-viewer.js +6 -6
- package/dist/collection/crypto/extensions/cabforganization_identifier.js.map +1 -1
- package/dist/collection/crypto/ssh_certificate.js +8 -3
- package/dist/collection/crypto/ssh_certificate.js.map +1 -1
- package/dist/esm/{actions-BOY2Tl0T.js → actions-CabuIstu.js} +4 -5
- package/dist/esm/{actions-BOY2Tl0T.js.map → actions-CabuIstu.js.map} +1 -1
- package/dist/esm/{arrow_top-DL0RWe4n.js → arrow_top-CWdnzNJA.js} +5 -7
- package/dist/{esm-es5/arrow_top-DL0RWe4n.js.map → esm/arrow_top-CWdnzNJA.js.map} +1 -1
- package/dist/esm/{button-Bbh7MwG6.js → button-DoyFdU2L.js} +8 -11
- package/dist/esm/{button-Bbh7MwG6.js.map → button-DoyFdU2L.js.map} +1 -1
- package/dist/esm/cross-B4NPVkar.js +45 -0
- package/dist/{esm-es5/cross-G84H_-QL.js.map → esm/cross-B4NPVkar.js.map} +1 -1
- package/dist/esm/download-C7Viw-3R.js +21 -0
- package/dist/esm/{download-ykcxSgxU.js.map → download-C7Viw-3R.js.map} +1 -1
- package/dist/esm/{extension-B3br1_Py.js → extension-xW03sQxn.js} +3 -3
- package/dist/esm/extension-xW03sQxn.js.map +1 -0
- package/dist/esm/{index-CwgZaF40.js → index-B0tLzdJT.js} +88 -47
- package/dist/esm/index-B0tLzdJT.js.map +1 -0
- package/dist/esm/index.js +9 -11
- package/dist/esm/{link-CGURvKy1.js → link-BDCg-T_l.js} +5 -5
- package/dist/esm/{link-CGURvKy1.js.map → link-BDCg-T_l.js.map} +1 -1
- package/dist/esm/loader.js +3 -5
- package/dist/esm/{miscellaneous-phHcBJWR.js → miscellaneous-DxE6a1mr.js} +75 -178
- package/dist/esm/miscellaneous-DxE6a1mr.js.map +1 -0
- package/dist/esm/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -1
- package/dist/esm/peculiar-attribute-certificate-viewer_5.entry.js +30 -79
- package/dist/esm/peculiar-button-menu_3.entry.js +3 -5
- package/dist/esm/peculiar-certificate-decoder.entry.js +7 -9
- package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-viewer.entry.js +8 -10
- package/dist/esm/peculiar-certificate-viewer.entry.js.map +1 -1
- package/dist/esm/peculiar-certificates-viewer.entry.js +10 -24
- package/dist/esm/peculiar-certificates-viewer.entry.js.map +1 -1
- package/dist/esm/peculiar-text-hider.entry.js +3 -5
- package/dist/esm/peculiar.js +4 -6
- package/dist/esm/peculiar.js.map +1 -1
- package/dist/esm/{pkcs10_certificate_request-HIoLPXGQ.js → pkcs10_certificate_request-Crr9FABo.js} +3 -3
- package/dist/esm/{pkcs10_certificate_request-HIoLPXGQ.js.map → pkcs10_certificate_request-Crr9FABo.js.map} +1 -1
- package/dist/esm/{ssh_certificate-rmToyzuK.js → ssh_certificate-CmOVFH_Z.js} +89 -88
- package/dist/esm/ssh_certificate-CmOVFH_Z.js.map +1 -0
- package/dist/esm/{x509_certificate-C1VvfHQ5.js → x509_certificate-C2EVTspY.js} +4 -4
- package/dist/{esm-es5/x509_certificate-C1VvfHQ5.js.map → esm/x509_certificate-C2EVTspY.js.map} +1 -1
- package/dist/esm/{x509_crl-rfnWQkGD.js → x509_crl-Bdnys_YT.js} +5 -5
- package/dist/{esm-es5/x509_crl-rfnWQkGD.js.map → esm/x509_crl-Bdnys_YT.js.map} +1 -1
- package/dist/esm-es5/{actions-BOY2Tl0T.js → actions-CabuIstu.js} +3 -3
- package/dist/esm-es5/{actions-BOY2Tl0T.js.map → actions-CabuIstu.js.map} +1 -1
- package/dist/esm-es5/{arrow_top-DL0RWe4n.js → arrow_top-CWdnzNJA.js} +2 -2
- package/dist/{esm/arrow_top-DL0RWe4n.js.map → esm-es5/arrow_top-CWdnzNJA.js.map} +1 -1
- package/dist/esm-es5/{button-Bbh7MwG6.js → button-DoyFdU2L.js} +2 -2
- package/dist/{cjs/button-C8EWG_-r.js.map → esm-es5/button-DoyFdU2L.js.map} +1 -1
- package/dist/esm-es5/{cross-G84H_-QL.js → cross-B4NPVkar.js} +2 -2
- package/dist/{esm/cross-G84H_-QL.js.map → esm-es5/cross-B4NPVkar.js.map} +1 -1
- package/dist/esm-es5/{download-ykcxSgxU.js → download-C7Viw-3R.js} +2 -2
- package/dist/esm-es5/{download-ykcxSgxU.js.map → download-C7Viw-3R.js.map} +1 -1
- package/dist/esm-es5/{extension-B3br1_Py.js → extension-xW03sQxn.js} +2 -2
- package/dist/esm-es5/extension-xW03sQxn.js.map +1 -0
- package/dist/esm-es5/index-B0tLzdJT.js +6 -0
- package/dist/esm-es5/index-B0tLzdJT.js.map +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{link-CGURvKy1.js → link-BDCg-T_l.js} +3 -3
- package/dist/esm-es5/{link-CGURvKy1.js.map → link-BDCg-T_l.js.map} +1 -1
- package/dist/esm-es5/loader.js +2 -2
- package/dist/esm-es5/{miscellaneous-phHcBJWR.js → miscellaneous-DxE6a1mr.js} +4 -4
- package/dist/esm-es5/miscellaneous-DxE6a1mr.js.map +1 -0
- package/dist/esm-es5/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_5.entry.js +3 -3
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_5.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-button-menu_3.entry.js +1 -1
- package/dist/esm-es5/peculiar-button-menu_3.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js +2 -2
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificate-viewer.entry.js +2 -2
- package/dist/esm-es5/peculiar-certificate-viewer.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js +2 -2
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-text-hider.entry.js +1 -1
- package/dist/esm-es5/peculiar.js +2 -2
- package/dist/esm-es5/peculiar.js.map +1 -1
- package/dist/esm-es5/{pkcs10_certificate_request-HIoLPXGQ.js → pkcs10_certificate_request-Crr9FABo.js} +3 -3
- package/dist/esm-es5/{pkcs10_certificate_request-HIoLPXGQ.js.map → pkcs10_certificate_request-Crr9FABo.js.map} +1 -1
- package/dist/esm-es5/{ssh_certificate-rmToyzuK.js → ssh_certificate-CmOVFH_Z.js} +5 -5
- package/dist/esm-es5/ssh_certificate-CmOVFH_Z.js.map +1 -0
- package/dist/esm-es5/{x509_certificate-C1VvfHQ5.js → x509_certificate-C2EVTspY.js} +3 -3
- package/dist/{esm/x509_certificate-C1VvfHQ5.js.map → esm-es5/x509_certificate-C2EVTspY.js.map} +1 -1
- package/dist/esm-es5/{x509_crl-rfnWQkGD.js → x509_crl-Bdnys_YT.js} +4 -4
- package/dist/{esm/x509_crl-rfnWQkGD.js.map → esm-es5/x509_crl-Bdnys_YT.js.map} +1 -1
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/p--UIbyTPo.system.js.map +1 -0
- package/dist/peculiar/{p-872f7312.system.entry.js → p-16bd5fac.system.entry.js} +18 -18
- package/dist/peculiar/p-16bd5fac.system.entry.js.map +1 -0
- package/dist/peculiar/{p-04422929.entry.js → p-26e1e392.entry.js} +3 -3
- package/dist/peculiar/p-26e1e392.entry.js.map +1 -0
- package/dist/peculiar/{p-154dd0da.entry.js → p-2c5ec624.entry.js} +2 -2
- package/dist/peculiar/p-2c5ec624.entry.js.map +1 -0
- package/dist/peculiar/{p-27ae6a3a.entry.js → p-4111bd62.entry.js} +2 -2
- package/dist/peculiar/p-4111bd62.entry.js.map +1 -0
- package/dist/peculiar/{p-3685975d.system.entry.js → p-4b510453.system.entry.js} +3 -3
- package/dist/peculiar/p-4b510453.system.entry.js.map +1 -0
- package/dist/peculiar/{p-6f0f2749.system.entry.js → p-4fc81fd0.system.entry.js} +3 -3
- package/dist/peculiar/p-4fc81fd0.system.entry.js.map +1 -0
- package/dist/peculiar/p-51832de2.entry.js +152 -0
- package/dist/peculiar/p-51832de2.entry.js.map +1 -0
- package/dist/peculiar/{p-B4PdAFCr.system.js → p-AHlPpL1z.system.js} +2 -2
- package/dist/peculiar/{p-B4PdAFCr.system.js.map → p-AHlPpL1z.system.js.map} +1 -1
- package/dist/peculiar/p-B0tLzdJT.js +6 -0
- package/dist/peculiar/p-B0tLzdJT.js.map +1 -0
- package/dist/peculiar/{p-B1eGYq5U.js → p-B4vvBwd6.js} +3 -3
- package/dist/peculiar/{p-B1eGYq5U.js.map → p-B4vvBwd6.js.map} +1 -1
- package/dist/peculiar/{p-CYFfXlCT.js → p-B7cL9SBA.js} +4 -4
- package/dist/peculiar/{p-CYFfXlCT.js.map → p-B7cL9SBA.js.map} +1 -1
- package/dist/peculiar/{p-DanjeXNk.js → p-BAAnYCav.js} +3 -3
- package/dist/peculiar/{p-DanjeXNk.js.map → p-BAAnYCav.js.map} +1 -1
- package/dist/peculiar/{p-CHnDlTqM.js → p-BLjDwIXV.js} +3 -3
- package/dist/peculiar/{p-CHnDlTqM.js.map → p-BLjDwIXV.js.map} +1 -1
- package/dist/peculiar/{p-CutTi-2B.js → p-BNRN5kAu.js} +2 -2
- package/dist/peculiar/{p-CutTi-2B.js.map → p-BNRN5kAu.js.map} +1 -1
- package/dist/peculiar/{p-Bi5mjeeg.system.js → p-BX5m4Pk2.system.js} +2 -2
- package/dist/peculiar/{p-Bi5mjeeg.system.js.map → p-BX5m4Pk2.system.js.map} +1 -1
- package/dist/peculiar/{p-N3w4Sc5c.system.js.map → p-BdGJr6Nw.system.js.map} +1 -1
- package/dist/peculiar/{p-CTksa0ml.system.js → p-Bfl7RVFY.system.js} +4 -4
- package/dist/peculiar/{p-CTksa0ml.system.js.map → p-Bfl7RVFY.system.js.map} +1 -1
- package/dist/peculiar/{p-B8_0p5ke.js → p-BjREwt05.js} +43 -43
- package/dist/peculiar/p-BjREwt05.js.map +1 -0
- package/dist/peculiar/{p-BGASC3UX.system.js → p-BjfN0sUP.system.js} +3 -3
- package/dist/peculiar/p-BjfN0sUP.system.js.map +1 -0
- package/dist/peculiar/{p-DMZr5ztF.js → p-BrjKJZAs.js} +2 -2
- package/dist/peculiar/{p-DMZr5ztF.js.map → p-BrjKJZAs.js.map} +1 -1
- package/dist/peculiar/{p-CkePJXWQ.js → p-BxiR02Uf.js} +4 -4
- package/dist/peculiar/{p-CkePJXWQ.js.map → p-BxiR02Uf.js.map} +1 -1
- package/dist/peculiar/{p-ZT6tVIen.js → p-C-zA8CWJ.js} +2 -2
- package/dist/peculiar/{p-ZT6tVIen.js.map → p-C-zA8CWJ.js.map} +1 -1
- package/dist/peculiar/{p-Bknpl7EO.system.js → p-C9U3cZjb.system.js} +3 -3
- package/dist/peculiar/{p-Bknpl7EO.system.js.map → p-C9U3cZjb.system.js.map} +1 -1
- package/dist/peculiar/{p-DorRvFf7.system.js → p-CCPSoWEH.system.js} +43 -43
- package/dist/peculiar/p-CCPSoWEH.system.js.map +1 -0
- package/dist/peculiar/{p-ZxTK29QB.system.js → p-CGipIfjs.system.js} +5 -5
- package/dist/peculiar/{p-ZxTK29QB.system.js.map → p-CGipIfjs.system.js.map} +1 -1
- package/dist/peculiar/{p-kq9wAWxW.system.js → p-CLcRtCZ9.system.js} +5 -5
- package/dist/peculiar/p-CLcRtCZ9.system.js.map +1 -0
- package/dist/peculiar/{p-CdS84qJs.system.js → p-CNRpL2vk.system.js} +2 -2
- package/dist/peculiar/{p-CdS84qJs.system.js.map → p-CNRpL2vk.system.js.map} +1 -1
- package/dist/peculiar/{p-JyD6URnB.js → p-CVqAvraM.js} +2 -2
- package/dist/peculiar/{p-JyD6URnB.js.map → p-CVqAvraM.js.map} +1 -1
- package/dist/peculiar/{p-D8xU284r.system.js → p-CWwlqwKM.system.js} +2 -2
- package/dist/peculiar/{p-D8xU284r.system.js.map → p-CWwlqwKM.system.js.map} +1 -1
- package/dist/peculiar/p-CbJUBy06.system.js +5 -0
- package/dist/peculiar/p-CbJUBy06.system.js.map +1 -0
- package/dist/peculiar/p-CfHXB_pJ.system.js.map +1 -0
- package/dist/peculiar/p-Ckf8xErP.system.js +12 -0
- package/dist/peculiar/p-Ckf8xErP.system.js.map +1 -0
- package/dist/peculiar/{p-rmToyzuK.js → p-CmOVFH_Z.js} +4 -4
- package/dist/peculiar/p-CmOVFH_Z.js.map +1 -0
- package/dist/peculiar/{p-CbJQZ9Hh.system.js.map → p-Cp79UjaU.system.js.map} +1 -1
- package/dist/peculiar/p-D4MqnJ9p.system.js.map +1 -0
- package/dist/peculiar/p-D5BlV4_w.system.js +6 -0
- package/dist/peculiar/p-D5BlV4_w.system.js.map +1 -0
- package/dist/peculiar/{p-eziSY5IJ.system.js.map → p-DOSHmuRc.system.js.map} +1 -1
- package/dist/peculiar/p-DXA1451q.js +12 -0
- package/dist/peculiar/p-DXA1451q.js.map +1 -0
- package/dist/peculiar/{p-DkshB-5z.system.js → p-DberG072.system.js} +5 -5
- package/dist/peculiar/{p-DkshB-5z.system.js.map → p-DberG072.system.js.map} +1 -1
- package/dist/peculiar/{p-de857304.system.entry.js → p-ae88bf01.system.entry.js} +2 -2
- package/dist/peculiar/p-ae88bf01.system.entry.js.map +1 -0
- package/dist/peculiar/{p-a4454e2d.system.entry.js → p-c4bbd44c.system.entry.js} +3 -3
- package/dist/peculiar/p-c4bbd44c.system.entry.js.map +1 -0
- package/dist/peculiar/{p-9d9f24bd.entry.js → p-d212830c.entry.js} +2 -2
- package/dist/peculiar/p-d212830c.entry.js.map +1 -0
- package/dist/peculiar/{p-019339d6.entry.js → p-e40e47be.entry.js} +2 -2
- package/dist/peculiar/p-e40e47be.entry.js.map +1 -0
- package/dist/peculiar/{p-607d08e8.system.entry.js → p-ef52478f.system.entry.js} +2 -2
- package/dist/peculiar/p-ef52478f.system.entry.js.map +1 -0
- package/dist/peculiar/p-qOxEa6Ap.system.js.map +1 -0
- package/dist/peculiar/{p-NnCM1ETy.system.js → p-vusQjz44.system.js} +2 -2
- package/dist/peculiar/{p-NnCM1ETy.system.js.map → p-vusQjz44.system.js.map} +1 -1
- package/dist/peculiar/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.esm.js.map +1 -1
- package/dist/peculiar/peculiar-certificate-decoder.entry.esm.js.map +1 -1
- package/dist/peculiar/peculiar-certificate-viewer.entry.esm.js.map +1 -1
- package/dist/peculiar/peculiar-certificates-viewer.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/crypto/ssh_certificate.d.ts +1 -1
- package/dist/types/interface.d.ts +86 -86
- package/dist/types/stencil-public-runtime.d.ts +49 -2
- package/hydrate/index.d.ts +2 -0
- package/hydrate/index.js +368 -496
- package/hydrate/index.mjs +368 -496
- package/package.json +4 -4
- package/dist/cjs/cross-3DqhA0G_.js +0 -52
- package/dist/cjs/download-DQP0KR4o.js +0 -24
- package/dist/cjs/extension-CjXYQXbF.js.map +0 -1
- package/dist/cjs/index-uHmGhObe.js.map +0 -1
- package/dist/cjs/miscellaneous-7gtHz795.js.map +0 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer_5.cjs.entry.js.map +0 -1
- package/dist/cjs/peculiar-button-menu_3.cjs.entry.js.map +0 -1
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +0 -1
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js.map +0 -1
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +0 -1
- package/dist/cjs/peculiar-text-hider.cjs.entry.js.map +0 -1
- package/dist/cjs/ssh_certificate-DnXj2sM0.js.map +0 -1
- package/dist/esm/cross-G84H_-QL.js +0 -48
- package/dist/esm/download-ykcxSgxU.js +0 -22
- package/dist/esm/extension-B3br1_Py.js.map +0 -1
- package/dist/esm/index-CwgZaF40.js.map +0 -1
- package/dist/esm/miscellaneous-phHcBJWR.js.map +0 -1
- package/dist/esm/peculiar-attribute-certificate-viewer_5.entry.js.map +0 -1
- package/dist/esm/peculiar-button-menu_3.entry.js.map +0 -1
- package/dist/esm/ssh_certificate-rmToyzuK.js.map +0 -1
- package/dist/esm-es5/extension-B3br1_Py.js.map +0 -1
- package/dist/esm-es5/index-CwgZaF40.js +0 -6
- package/dist/esm-es5/index-CwgZaF40.js.map +0 -1
- package/dist/esm-es5/miscellaneous-phHcBJWR.js.map +0 -1
- package/dist/esm-es5/ssh_certificate-rmToyzuK.js.map +0 -1
- package/dist/peculiar/p-019339d6.entry.js.map +0 -1
- package/dist/peculiar/p-04422929.entry.js.map +0 -1
- package/dist/peculiar/p-154dd0da.entry.js.map +0 -1
- package/dist/peculiar/p-27ae6a3a.entry.js.map +0 -1
- package/dist/peculiar/p-3685975d.system.entry.js.map +0 -1
- package/dist/peculiar/p-607d08e8.system.entry.js.map +0 -1
- package/dist/peculiar/p-6f0f2749.system.entry.js.map +0 -1
- package/dist/peculiar/p-7385d0bb.entry.js +0 -152
- package/dist/peculiar/p-7385d0bb.entry.js.map +0 -1
- package/dist/peculiar/p-872f7312.system.entry.js.map +0 -1
- package/dist/peculiar/p-9d9f24bd.entry.js.map +0 -1
- package/dist/peculiar/p-B2GW-g6v.system.js +0 -5
- package/dist/peculiar/p-B2GW-g6v.system.js.map +0 -1
- package/dist/peculiar/p-B8_0p5ke.js.map +0 -1
- package/dist/peculiar/p-BGASC3UX.system.js.map +0 -1
- package/dist/peculiar/p-BdfvItQB.system.js.map +0 -1
- package/dist/peculiar/p-BtqN4pgo.js +0 -12
- package/dist/peculiar/p-BtqN4pgo.js.map +0 -1
- package/dist/peculiar/p-CuX3t1Hg.system.js.map +0 -1
- package/dist/peculiar/p-Cv-b9S6H.system.js.map +0 -1
- package/dist/peculiar/p-CwgZaF40.js +0 -6
- package/dist/peculiar/p-CwgZaF40.js.map +0 -1
- package/dist/peculiar/p-D0w6miI2.system.js +0 -12
- package/dist/peculiar/p-D0w6miI2.system.js.map +0 -1
- package/dist/peculiar/p-DKl0YViA.system.js +0 -6
- package/dist/peculiar/p-DKl0YViA.system.js.map +0 -1
- package/dist/peculiar/p-DOFJd-ye.system.js.map +0 -1
- package/dist/peculiar/p-DorRvFf7.system.js.map +0 -1
- package/dist/peculiar/p-a4454e2d.system.entry.js.map +0 -1
- package/dist/peculiar/p-de857304.system.entry.js.map +0 -1
- package/dist/peculiar/p-kq9wAWxW.system.js.map +0 -1
- package/dist/peculiar/p-rmToyzuK.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return e(t,r)};return function(t,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function i(){this.constructor=t}t.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,i){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i["throw"](e))}catch(e){o(e)}}function c(e){e.done?r(e.value):n(e.value).then(a,s)}c((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,a;return a=
|
|
1
|
+
var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return e(t,r)};return function(t,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function i(){this.constructor=t}t.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,i){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i["throw"](e))}catch(e){o(e)}}function c(e){e.done?r(e.value):n(e.value).then(a,s)}c((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=s(0),a["throw"]=s(1),a["return"]=s(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return c([e,t])}}function c(s){if(i)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(r=0)),r)try{if(i=1,n&&(o=s[0]&2?n["return"]:s[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;if(n=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{i=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __rest=this&&this.__rest||function(e,t){var r={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0)r[i]=e[i];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,i=Object.getOwnPropertySymbols(e);n<i.length;n++){if(t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n]))r[i[n]]=e[i[n]]}return r};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var i=0,n=t.length,o;i<n;i++){if(o||!(i in t)){if(!o)o=Array.prototype.slice.call(t,0,i);o[i]=t[i]}}return e.concat(o||Array.prototype.slice.call(t))};var _e;
|
|
2
2
|
/*!
|
|
3
3
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
4
4
|
*/
|
|
@@ -75,7 +75,7 @@ var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setP
|
|
|
75
75
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
76
76
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
77
77
|
*
|
|
78
|
-
*/function assertBigInt(){if(typeof BigInt==="undefined"){throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}}function concat(e){var t=0;var r=0;for(var i=0;i<e.length;i++){var n=e[i];t+=n.byteLength}var o=new Uint8Array(t);for(var i=0;i<e.length;i++){var n=e[i];o.set(new Uint8Array(n),r);r+=n.byteLength}return o.buffer}function checkBufferParams(e,t,r,i){if(!(t instanceof Uint8Array)){e.error="Wrong parameter: inputBuffer must be 'Uint8Array'";return false}if(!t.byteLength){e.error="Wrong parameter: inputBuffer has zero length";return false}if(r<0){e.error="Wrong parameter: inputOffset less than zero";return false}if(i<0){e.error="Wrong parameter: inputLength less than zero";return false}if(t.byteLength-r-i<0){e.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return false}return true}var ViewWriter=function(){function e(){this.items=[]}e.prototype.write=function(e){this.items.push(e)};e.prototype.final=function(){return concat(this.items)};return e}();var powers2=[new Uint8Array([1])];var digitsString="0123456789";var NAME="name";var VALUE_HEX_VIEW="valueHexView";var IS_HEX_ONLY="isHexOnly";var ID_BLOCK="idBlock";var TAG_CLASS="tagClass";var TAG_NUMBER="tagNumber";var IS_CONSTRUCTED="isConstructed";var FROM_BER="fromBER";var TO_BER="toBER";var LOCAL="local";var EMPTY_STRING="";var EMPTY_BUFFER=new ArrayBuffer(0);var EMPTY_VIEW=new Uint8Array(0);var END_OF_CONTENT_NAME="EndOfContent";var OCTET_STRING_NAME="OCTET STRING";var BIT_STRING_NAME="BIT STRING";function HexBlock(e){var t;return t=function(e){__extends(t,e);function t(){var t=[];for(var r=0;r<arguments.length;r++){t[r]=arguments[r]}var i;var n=e.apply(this,t)||this;var o=t[0]||{};n.isHexOnly=(i=o.isHexOnly)!==null&&i!==void 0?i:false;n.valueHexView=o.valueHex?buildExports.BufferSourceConverter.toUint8Array(o.valueHex):EMPTY_VIEW;return n}Object.defineProperty(t.prototype,"valueHex",{get:function(){return this.valueHexView.slice().buffer},set:function(e){this.valueHexView=new Uint8Array(e)},enumerable:false,configurable:true});t.prototype.fromBER=function(e,t,r){var i=e instanceof ArrayBuffer?new Uint8Array(e):e;if(!checkBufferParams(this,i,t,r)){return-1}var n=t+r;this.valueHexView=i.subarray(t,n);if(!this.valueHexView.length){this.warnings.push("Zero buffer length");return t}this.blockLength=r;return n};t.prototype.toBER=function(e){if(e===void 0){e=false}if(!this.isHexOnly){this.error="Flag 'isHexOnly' is not set, abort";return EMPTY_BUFFER}if(e){return new ArrayBuffer(this.valueHexView.byteLength)}return this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{isHexOnly:this.isHexOnly,valueHex:buildExports.Convert.ToHex(this.valueHexView)})};return t}(e),t.NAME="hexBlock",t}var LocalBaseBlock=function(){function e(e){var t=e===void 0?{}:e,r=t.blockLength,i=r===void 0?0:r,n=t.error,o=n===void 0?EMPTY_STRING:n,a=t.warnings,s=a===void 0?[]:a,c=t.valueBeforeDecode,u=c===void 0?EMPTY_VIEW:c;this.blockLength=i;this.error=o;this.warnings=s;this.valueBeforeDecodeView=buildExports.BufferSourceConverter.toUint8Array(u)}e.blockName=function(){return this.NAME};Object.defineProperty(e.prototype,"valueBeforeDecode",{get:function(){return this.valueBeforeDecodeView.slice().buffer},set:function(e){this.valueBeforeDecodeView=new Uint8Array(e)},enumerable:false,configurable:true});e.prototype.toJSON=function(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:buildExports.Convert.ToHex(this.valueBeforeDecodeView)}};return e}();LocalBaseBlock.NAME="baseBlock";var ValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBER=function(e,t,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")};t.prototype.toBER=function(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")};return t}(LocalBaseBlock);ValueBlock.NAME="valueBlock";var LocalIdentificationBlock=function(e){__extends(t,e);function t(t){var r=t===void 0?{}:t,i=r.idBlock,n=i===void 0?{}:i;var o,a,s,c;var u=e.call(this)||this;if(n){u.isHexOnly=(o=n.isHexOnly)!==null&&o!==void 0?o:false;u.valueHexView=n.valueHex?buildExports.BufferSourceConverter.toUint8Array(n.valueHex):EMPTY_VIEW;u.tagClass=(a=n.tagClass)!==null&&a!==void 0?a:-1;u.tagNumber=(s=n.tagNumber)!==null&&s!==void 0?s:-1;u.isConstructed=(c=n.isConstructed)!==null&&c!==void 0?c:false}else{u.tagClass=-1;u.tagNumber=-1;u.isConstructed=false}return u}t.prototype.toBER=function(e){if(e===void 0){e=false}var t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:this.error="Unknown tag class";return EMPTY_BUFFER}if(this.isConstructed)t|=32;if(this.tagNumber<31&&!this.isHexOnly){var r=new Uint8Array(1);if(!e){var i=this.tagNumber;i&=31;t|=i;r[0]=t}return r.buffer}if(!this.isHexOnly){var n=utilToBase(this.tagNumber,7);var o=new Uint8Array(n);var a=n.byteLength;var s=new Uint8Array(a+1);s[0]=t|31;if(!e){for(var c=0;c<a-1;c++)s[c+1]=o[c]|128;s[a]=o[a-1]}return s.buffer}var u=new Uint8Array(this.valueHexView.byteLength+1);u[0]=t|31;if(!e){var p=this.valueHexView;for(var c=0;c<p.length-1;c++)u[c+1]=p[c]|128;u[this.valueHexView.byteLength]=p[p.length-1]}return u.buffer};t.prototype.fromBER=function(e,t,r){var i=buildExports.BufferSourceConverter.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}var n=i.subarray(t,t+r);if(n.length===0){this.error="Zero buffer length";return-1}var o=n[0]&192;switch(o){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:this.error="Unknown tag class";return-1}this.isConstructed=(n[0]&32)===32;this.isHexOnly=false;var a=n[0]&31;if(a!==31){this.tagNumber=a;this.blockLength=1}else{var s=1;var c=this.valueHexView=new Uint8Array(255);var u=255;while(n[s]&128){c[s-1]=n[s]&127;s++;if(s>=n.length){this.error="End of input reached before message was fully decoded";return-1}if(s===u){u+=255;var p=new Uint8Array(u);for(var f=0;f<c.length;f++)p[f]=c[f];c=this.valueHexView=new Uint8Array(u)}}this.blockLength=s+1;c[s-1]=n[s]&127;var d=new Uint8Array(s);for(var f=0;f<s;f++)d[f]=c[f];c=this.valueHexView=new Uint8Array(s);c.set(d);if(this.blockLength<=9)this.tagNumber=utilFromBase(c,7);else{this.isHexOnly=true;this.warnings.push("Tag too long, represented as hex-coded")}}if(this.tagClass===1&&this.isConstructed){switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:this.error="Constructed encoding used for primitive type";return-1}}return t+this.blockLength};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed})};return t}(HexBlock(LocalBaseBlock));LocalIdentificationBlock.NAME="identificationBlock";var LocalLengthBlock=function(e){__extends(t,e);function t(t){var r=t===void 0?{}:t,i=r.lenBlock,n=i===void 0?{}:i;var o,a,s;var c=e.call(this)||this;c.isIndefiniteForm=(o=n.isIndefiniteForm)!==null&&o!==void 0?o:false;c.longFormUsed=(a=n.longFormUsed)!==null&&a!==void 0?a:false;c.length=(s=n.length)!==null&&s!==void 0?s:0;return c}t.prototype.fromBER=function(e,t,r){var i=buildExports.BufferSourceConverter.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}var n=i.subarray(t,t+r);if(n.length===0){this.error="Zero buffer length";return-1}if(n[0]===255){this.error="Length block 0xFF is reserved by standard";return-1}this.isIndefiniteForm=n[0]===128;if(this.isIndefiniteForm){this.blockLength=1;return t+this.blockLength}this.longFormUsed=!!(n[0]&128);if(this.longFormUsed===false){this.length=n[0];this.blockLength=1;return t+this.blockLength}var o=n[0]&127;if(o>8){this.error="Too big integer";return-1}if(o+1>n.length){this.error="End of input reached before message was fully decoded";return-1}var a=t+1;var s=i.subarray(a,a+o);if(s[o-1]===0)this.warnings.push("Needlessly long encoded length");this.length=utilFromBase(s,8);if(this.longFormUsed&&this.length<=127)this.warnings.push("Unnecessary usage of long length form");this.blockLength=o+1;return t+this.blockLength};t.prototype.toBER=function(e){if(e===void 0){e=false}var t;var r;if(this.length>127)this.longFormUsed=true;if(this.isIndefiniteForm){t=new ArrayBuffer(1);if(e===false){r=new Uint8Array(t);r[0]=128}return t}if(this.longFormUsed){var i=utilToBase(this.length,8);if(i.byteLength>127){this.error="Too big length";return EMPTY_BUFFER}t=new ArrayBuffer(i.byteLength+1);if(e)return t;var n=new Uint8Array(i);r=new Uint8Array(t);r[0]=i.byteLength|128;for(var o=0;o<i.byteLength;o++)r[o+1]=n[o];return t}t=new ArrayBuffer(1);if(e===false){r=new Uint8Array(t);r[0]=this.length}return t};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length})};return t}(LocalBaseBlock);LocalLengthBlock.NAME="lengthBlock";var typeStore={};var BaseBlock=function(e){__extends(t,e);function t(t,r){if(t===void 0){t={}}var i=this;var n=t.name,o=n===void 0?EMPTY_STRING:n,a=t.optional,s=a===void 0?false:a,c=t.primitiveSchema,u=__rest(t,["name","optional","primitiveSchema"]);i=e.call(this,u)||this;i.name=o;i.optional=s;if(c){i.primitiveSchema=c}i.idBlock=new LocalIdentificationBlock(u);i.lenBlock=new LocalLengthBlock(u);i.valueBlock=r?new r(u):new ValueBlock(u);return i}t.prototype.fromBER=function(e,t,r){var i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);if(i===-1){this.error=this.valueBlock.error;return i}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return i};t.prototype.toBER=function(e,t){var r=t||new ViewWriter;if(!t){prepareIndefiniteForm(this)}var i=this.idBlock.toBER(e);r.write(i);if(this.lenBlock.isIndefiniteForm){r.write(new Uint8Array([128]).buffer);this.valueBlock.toBER(e,r);r.write(new ArrayBuffer(2))}else{var n=this.valueBlock.toBER(e);this.lenBlock.length=n.byteLength;var o=this.lenBlock.toBER(e);r.write(o);r.write(n)}if(!t){return r.final()}return EMPTY_BUFFER};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional});if(this.primitiveSchema)t.primitiveSchema=this.primitiveSchema.toJSON();return t};t.prototype.toString=function(e){if(e===void 0){e="ascii"}if(e==="ascii"){return this.onAsciiEncoding()}return buildExports.Convert.ToHex(this.toBER())};t.prototype.onAsciiEncoding=function(){var e=this.constructor.NAME;var t=buildExports.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);return"".concat(e," : ").concat(t)};t.prototype.isEqual=function(e){if(this===e){return true}if(!(e instanceof this.constructor)){return false}var t=this.toBER();var r=e.toBER();return isEqualBuffer(t,r)};return t}(LocalBaseBlock);BaseBlock.NAME="BaseBlock";function prepareIndefiniteForm(e){var t;if(e instanceof typeStore.Constructed){for(var r=0,i=e.valueBlock.value;r<i.length;r++){var n=i[r];if(prepareIndefiniteForm(n)){e.lenBlock.isIndefiniteForm=true}}}return!!((t=e.lenBlock)===null||t===void 0?void 0:t.isIndefiniteForm)}var BaseStringBlock=function(e){__extends(t,e);function t(t,r){if(t===void 0){t={}}var i=this;var n=t.value,o=n===void 0?EMPTY_STRING:n,a=__rest(t,["value"]);i=e.call(this,a,r)||this;if(o){i.fromString(o)}return i}t.prototype.getValue=function(){return this.valueBlock.value};t.prototype.setValue=function(e){this.valueBlock.value=e};t.prototype.fromBER=function(e,t,r){var i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);if(i===-1){this.error=this.valueBlock.error;return i}this.fromBuffer(this.valueBlock.valueHexView);if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return i};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : '").concat(this.valueBlock.value,"'")};return t}(BaseBlock);BaseStringBlock.NAME="BaseStringBlock";var LocalPrimitiveValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.isHexOnly,n=i===void 0?true:i,o=__rest(t,["isHexOnly"]);r=e.call(this,o)||this;r.isHexOnly=n;return r}return t}(HexBlock(ValueBlock));LocalPrimitiveValueBlock.NAME="PrimitiveValueBlock";var _a$w;var Primitive=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalPrimitiveValueBlock)||this;r.idBlock.isConstructed=false;return r}return t}(BaseBlock);_a$w=Primitive;(function(){typeStore.Primitive=_a$w})();Primitive.NAME="PRIMITIVE";function localChangeType(e,t){if(e instanceof t){return e}var r=new t;r.idBlock=e.idBlock;r.lenBlock=e.lenBlock;r.warnings=e.warnings;r.valueBeforeDecodeView=e.valueBeforeDecodeView;return r}function localFromBER(e,t,r){if(t===void 0){t=0}if(r===void 0){r=e.length}var i=t;var n=new BaseBlock({},ValueBlock);var o=new LocalBaseBlock;if(!checkBufferParams(o,e,t,r)){n.error=o.error;return{offset:-1,result:n}}var a=e.subarray(t,t+r);if(!a.length){n.error="Zero buffer length";return{offset:-1,result:n}}var s=n.idBlock.fromBER(e,t,r);if(n.idBlock.warnings.length){n.warnings.concat(n.idBlock.warnings)}if(s===-1){n.error=n.idBlock.error;return{offset:-1,result:n}}t=s;r-=n.idBlock.blockLength;s=n.lenBlock.fromBER(e,t,r);if(n.lenBlock.warnings.length){n.warnings.concat(n.lenBlock.warnings)}if(s===-1){n.error=n.lenBlock.error;return{offset:-1,result:n}}t=s;r-=n.lenBlock.blockLength;if(!n.idBlock.isConstructed&&n.lenBlock.isIndefiniteForm){n.error="Indefinite length form used for primitive encoding form";return{offset:-1,result:n}}var c=BaseBlock;switch(n.idBlock.tagClass){case 1:if(n.idBlock.tagNumber>=37&&n.idBlock.isHexOnly===false){n.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard";return{offset:-1,result:n}}switch(n.idBlock.tagNumber){case 0:if(n.idBlock.isConstructed&&n.lenBlock.length>0){n.error="Type [UNIVERSAL 0] is reserved";return{offset:-1,result:n}}c=typeStore.EndOfContent;break;case 1:c=typeStore.Boolean;break;case 2:c=typeStore.Integer;break;case 3:c=typeStore.BitString;break;case 4:c=typeStore.OctetString;break;case 5:c=typeStore.Null;break;case 6:c=typeStore.ObjectIdentifier;break;case 10:c=typeStore.Enumerated;break;case 12:c=typeStore.Utf8String;break;case 13:c=typeStore.RelativeObjectIdentifier;break;case 14:c=typeStore.TIME;break;case 15:n.error="[UNIVERSAL 15] is reserved by ASN.1 standard";return{offset:-1,result:n};case 16:c=typeStore.Sequence;break;case 17:c=typeStore.Set;break;case 18:c=typeStore.NumericString;break;case 19:c=typeStore.PrintableString;break;case 20:c=typeStore.TeletexString;break;case 21:c=typeStore.VideotexString;break;case 22:c=typeStore.IA5String;break;case 23:c=typeStore.UTCTime;break;case 24:c=typeStore.GeneralizedTime;break;case 25:c=typeStore.GraphicString;break;case 26:c=typeStore.VisibleString;break;case 27:c=typeStore.GeneralString;break;case 28:c=typeStore.UniversalString;break;case 29:c=typeStore.CharacterString;break;case 30:c=typeStore.BmpString;break;case 31:c=typeStore.DATE;break;case 32:c=typeStore.TimeOfDay;break;case 33:c=typeStore.DateTime;break;case 34:c=typeStore.Duration;break;default:{var u=n.idBlock.isConstructed?new typeStore.Constructed:new typeStore.Primitive;u.idBlock=n.idBlock;u.lenBlock=n.lenBlock;u.warnings=n.warnings;n=u}}break;case 2:case 3:case 4:default:{c=n.idBlock.isConstructed?typeStore.Constructed:typeStore.Primitive}}n=localChangeType(n,c);s=n.fromBER(e,t,n.lenBlock.isIndefiniteForm?r:n.lenBlock.length);n.valueBeforeDecodeView=e.subarray(i,i+n.blockLength);return{offset:s,result:n}}function fromBER(e){if(!e.byteLength){var t=new BaseBlock({},ValueBlock);t.error="Input buffer has zero length";return{offset:-1,result:t}}return localFromBER(buildExports.BufferSourceConverter.toUint8Array(e).slice(),0,e.byteLength)}function checkLen(e,t){if(e){return 1}return t}var LocalConstructedValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?[]:i,o=t.isIndefiniteForm,a=o===void 0?false:o,s=__rest(t,["value","isIndefiniteForm"]);r=e.call(this,s)||this;r.value=n;r.isIndefiniteForm=a;return r}t.prototype.fromBER=function(e,t,r){var i=buildExports.BufferSourceConverter.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}this.valueBeforeDecodeView=i.subarray(t,t+r);if(this.valueBeforeDecodeView.length===0){this.warnings.push("Zero buffer length");return t}var n=t;while(checkLen(this.isIndefiniteForm,r)>0){var o=localFromBER(i,n,r);if(o.offset===-1){this.error=o.result.error;this.warnings.concat(o.result.warnings);return-1}n=o.offset;this.blockLength+=o.result.blockLength;r-=o.result.blockLength;this.value.push(o.result);if(this.isIndefiniteForm&&o.result.constructor.NAME===END_OF_CONTENT_NAME){break}}if(this.isIndefiniteForm){if(this.value[this.value.length-1].constructor.NAME===END_OF_CONTENT_NAME){this.value.pop()}else{this.warnings.push("No EndOfContent block encoded")}}return n};t.prototype.toBER=function(e,t){var r=t||new ViewWriter;for(var i=0;i<this.value.length;i++){this.value[i].toBER(e,r)}if(!t){return r.final()}return EMPTY_BUFFER};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{isIndefiniteForm:this.isIndefiniteForm,value:[]});for(var r=0,i=this.value;r<i.length;r++){var n=i[r];t.value.push(n.toJSON())}return t};return t}(ValueBlock);LocalConstructedValueBlock.NAME="ConstructedValueBlock";var _a$v;var Constructed=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalConstructedValueBlock)||this;r.idBlock.isConstructed=true;return r}t.prototype.fromBER=function(e,t,r){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;var i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);if(i===-1){this.error=this.valueBlock.error;return i}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return i};t.prototype.onAsciiEncoding=function(){var e=[];for(var t=0,r=this.valueBlock.value;t<r.length;t++){var i=r[t];e.push(i.toString("ascii").split("\n").map((function(e){return" ".concat(e)})).join("\n"))}var n=this.idBlock.tagClass===3?"[".concat(this.idBlock.tagNumber,"]"):this.constructor.NAME;return e.length?"".concat(n," :\n").concat(e.join("\n")):"".concat(n," :")};return t}(BaseBlock);_a$v=Constructed;(function(){typeStore.Constructed=_a$v})();Constructed.NAME="CONSTRUCTED";var LocalEndOfContentValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBER=function(e,t,r){return t};t.prototype.toBER=function(e){return EMPTY_BUFFER};return t}(ValueBlock);LocalEndOfContentValueBlock.override="EndOfContentValueBlock";var _a$u;var EndOfContent=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalEndOfContentValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=0;return r}return t}(BaseBlock);_a$u=EndOfContent;(function(){typeStore.EndOfContent=_a$u})();EndOfContent.NAME=END_OF_CONTENT_NAME;var _a$t;var Null=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,ValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=5;return r}t.prototype.fromBER=function(e,t,r){if(this.lenBlock.length>0)this.warnings.push("Non-zero length of value block for Null type");if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;this.blockLength+=r;if(t+r>e.byteLength){this.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return-1}return t+r};t.prototype.toBER=function(e,t){var r=new ArrayBuffer(2);if(!e){var i=new Uint8Array(r);i[0]=5;i[1]=0}if(t){t.write(r)}return r};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME)};return t}(BaseBlock);_a$t=Null;(function(){typeStore.Null=_a$t})();Null.NAME="NULL";var LocalBooleanValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=__rest(t,["value"]);r=e.call(this,n)||this;if(n.valueHex){r.valueHexView=buildExports.BufferSourceConverter.toUint8Array(n.valueHex)}else{r.valueHexView=new Uint8Array(1)}if(i){r.value=i}return r}Object.defineProperty(t.prototype,"value",{get:function(){for(var e=0,t=this.valueHexView;e<t.length;e++){var r=t[e];if(r>0){return true}}return false},set:function(e){this.valueHexView[0]=e?255:0},enumerable:false,configurable:true});t.prototype.fromBER=function(e,t,r){var i=buildExports.BufferSourceConverter.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}this.valueHexView=i.subarray(t,t+r);if(r>1)this.warnings.push("Boolean value encoded in more then 1 octet");this.isHexOnly=true;utilDecodeTC.call(this);this.blockLength=r;return t+r};t.prototype.toBER=function(){return this.valueHexView.slice()};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.value})};return t}(HexBlock(ValueBlock));LocalBooleanValueBlock.NAME="BooleanValueBlock";var _a$s;var Boolean=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalBooleanValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=1;return r}t.prototype.getValue=function(){return this.valueBlock.value};t.prototype.setValue=function(e){this.valueBlock.value=e};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.getValue)};return t}(BaseBlock);_a$s=Boolean;(function(){typeStore.Boolean=_a$s})();Boolean.NAME="BOOLEAN";var LocalOctetStringValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.isConstructed,n=i===void 0?false:i,o=__rest(t,["isConstructed"]);r=e.call(this,o)||this;r.isConstructed=n;return r}t.prototype.fromBER=function(t,r,i){var n=0;if(this.isConstructed){this.isHexOnly=false;n=LocalConstructedValueBlock.prototype.fromBER.call(this,t,r,i);if(n===-1)return n;for(var o=0;o<this.value.length;o++){var a=this.value[o].constructor.NAME;if(a===END_OF_CONTENT_NAME){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only";return-1}}if(a!==OCTET_STRING_NAME){this.error="OCTET STRING may consists of OCTET STRINGs only";return-1}}}else{this.isHexOnly=true;n=e.prototype.fromBER.call(this,t,r,i);this.blockLength=i}return n};t.prototype.toBER=function(e,t){if(this.isConstructed)return LocalConstructedValueBlock.prototype.toBER.call(this,e,t);return e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{isConstructed:this.isConstructed})};return t}(HexBlock(LocalConstructedValueBlock));LocalOctetStringValueBlock.NAME="OctetStringValueBlock";var _a$r;var OctetString$1=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.idBlock,n=i===void 0?{}:i,o=t.lenBlock,a=o===void 0?{}:o,s=__rest(t,["idBlock","lenBlock"]);var c,u;(c=s.isConstructed)!==null&&c!==void 0?c:s.isConstructed=!!((u=s.value)===null||u===void 0?void 0:u.length);r=e.call(this,__assign({idBlock:__assign({isConstructed:s.isConstructed},n),lenBlock:__assign(__assign({},a),{isIndefiniteForm:!!s.isIndefiniteForm})},s),LocalOctetStringValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=4;return r}t.prototype.fromBER=function(t,r,i){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;if(i===0){if(this.idBlock.error.length===0)this.blockLength+=this.idBlock.blockLength;if(this.lenBlock.error.length===0)this.blockLength+=this.lenBlock.blockLength;return r}if(!this.valueBlock.isConstructed){var n=t instanceof ArrayBuffer?new Uint8Array(t):t;var o=n.subarray(r,r+i);try{if(o.byteLength){var a=localFromBER(o,0,o.byteLength);if(a.offset!==-1&&a.offset===i){this.valueBlock.value=[a.result]}}}catch(e){}}return e.prototype.fromBER.call(this,t,r,i)};t.prototype.onAsciiEncoding=function(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return Constructed.prototype.onAsciiEncoding.call(this)}var e=this.constructor.NAME;var t=buildExports.Convert.ToHex(this.valueBlock.valueHexView);return"".concat(e," : ").concat(t)};t.prototype.getValue=function(){if(!this.idBlock.isConstructed){return this.valueBlock.valueHexView.slice().buffer}var e=[];for(var t=0,r=this.valueBlock.value;t<r.length;t++){var i=r[t];if(i instanceof _a$r){e.push(i.valueBlock.valueHexView)}}return buildExports.BufferSourceConverter.concat(e)};return t}(BaseBlock);_a$r=OctetString$1;(function(){typeStore.OctetString=_a$r})();OctetString$1.NAME=OCTET_STRING_NAME;var LocalBitStringValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.unusedBits,n=i===void 0?0:i,o=t.isConstructed,a=o===void 0?false:o,s=__rest(t,["unusedBits","isConstructed"]);r=e.call(this,s)||this;r.unusedBits=n;r.isConstructed=a;r.blockLength=r.valueHexView.byteLength;return r}t.prototype.fromBER=function(e,t,r){if(!r){return t}var i=-1;if(this.isConstructed){i=LocalConstructedValueBlock.prototype.fromBER.call(this,e,t,r);if(i===-1)return i;for(var n=0,o=this.value;n<o.length;n++){var a=o[n];var s=a.constructor.NAME;if(s===END_OF_CONTENT_NAME){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only";return-1}}if(s!==BIT_STRING_NAME){this.error="BIT STRING may consists of BIT STRINGs only";return-1}var c=a.valueBlock;if(this.unusedBits>0&&c.unusedBits>0){this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only';return-1}this.unusedBits=c.unusedBits}return i}var u=buildExports.BufferSourceConverter.toUint8Array(e);if(!checkBufferParams(this,u,t,r)){return-1}var p=u.subarray(t,t+r);this.unusedBits=p[0];if(this.unusedBits>7){this.error="Unused bits for BitString must be in range 0-7";return-1}if(!this.unusedBits){var f=p.subarray(1);try{if(f.byteLength){var d=localFromBER(f,0,f.byteLength);if(d.offset!==-1&&d.offset===r-1){this.value=[d.result]}}}catch(e){}}this.valueHexView=p.subarray(1);this.blockLength=p.length;return t+r};t.prototype.toBER=function(e,t){if(this.isConstructed){return LocalConstructedValueBlock.prototype.toBER.call(this,e,t)}if(e){return new ArrayBuffer(this.valueHexView.byteLength+1)}if(!this.valueHexView.byteLength){return EMPTY_BUFFER}var r=new Uint8Array(this.valueHexView.length+1);r[0]=this.unusedBits;r.set(this.valueHexView,1);return r.buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{unusedBits:this.unusedBits,isConstructed:this.isConstructed})};return t}(HexBlock(LocalConstructedValueBlock));LocalBitStringValueBlock.NAME="BitStringValueBlock";var _a$q;var BitString$1=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.idBlock,n=i===void 0?{}:i,o=t.lenBlock,a=o===void 0?{}:o,s=__rest(t,["idBlock","lenBlock"]);var c,u;(c=s.isConstructed)!==null&&c!==void 0?c:s.isConstructed=!!((u=s.value)===null||u===void 0?void 0:u.length);r=e.call(this,__assign({idBlock:__assign({isConstructed:s.isConstructed},n),lenBlock:__assign(__assign({},a),{isIndefiniteForm:!!s.isIndefiniteForm})},s),LocalBitStringValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=3;return r}t.prototype.fromBER=function(t,r,i){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;return e.prototype.fromBER.call(this,t,r,i)};t.prototype.onAsciiEncoding=function(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return Constructed.prototype.onAsciiEncoding.call(this)}else{var e=[];var t=this.valueBlock.valueHexView;for(var r=0,i=t;r<i.length;r++){var n=i[r];e.push(n.toString(2).padStart(8,"0"))}var o=e.join("");var a=this.constructor.NAME;var s=o.substring(0,o.length-this.valueBlock.unusedBits);return"".concat(a," : ").concat(s)}};return t}(BaseBlock);_a$q=BitString$1;(function(){typeStore.BitString=_a$q})();BitString$1.NAME=BIT_STRING_NAME;var _a$p;function viewAdd(e,t){var r=new Uint8Array([0]);var i=new Uint8Array(e);var n=new Uint8Array(t);var o=i.slice(0);var a=o.length-1;var s=n.slice(0);var c=s.length-1;var u=0;var p=c<a?a:c;var f=0;for(var d=p;d>=0;d--,f++){switch(true){case f<s.length:u=o[a-f]+s[c-f]+r[0];break;default:u=o[a-f]+r[0]}r[0]=u/10;switch(true){case f>=o.length:o=utilConcatView(new Uint8Array([u%10]),o);break;default:o[a-f]=u%10}}if(r[0]>0)o=utilConcatView(r,o);return o}function power2(e){if(e>=powers2.length){for(var t=powers2.length;t<=e;t++){var r=new Uint8Array([0]);var i=powers2[t-1].slice(0);for(var n=i.length-1;n>=0;n--){var o=new Uint8Array([(i[n]<<1)+r[0]]);r[0]=o[0]/10;i[n]=o[0]%10}if(r[0]>0)i=utilConcatView(r,i);powers2.push(i)}}return powers2[e]}function viewSub(e,t){var r=0;var i=new Uint8Array(e);var n=new Uint8Array(t);var o=i.slice(0);var a=o.length-1;var s=n.slice(0);var c=s.length-1;var u;var p=0;for(var f=c;f>=0;f--,p++){u=o[a-p]-s[c-p]-r;switch(true){case u<0:r=1;o[a-p]=u+10;break;default:r=0;o[a-p]=u}}if(r>0){for(var f=a-c+1;f>=0;f--,p++){u=o[a-p]-r;if(u<0){r=1;o[a-p]=u+10}else{r=0;o[a-p]=u;break}}}return o.slice()}var LocalIntegerValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=__rest(t,["value"]);r=e.call(this,n)||this;r._valueDec=0;if(n.valueHex){r.setValueHex()}if(i!==undefined){r.valueDec=i}return r}t.prototype.setValueHex=function(){if(this.valueHexView.length>=4){this.warnings.push("Too big Integer for decoding, hex only");this.isHexOnly=true;this._valueDec=0}else{this.isHexOnly=false;if(this.valueHexView.length>0){this._valueDec=utilDecodeTC.call(this)}}};Object.defineProperty(t.prototype,"valueDec",{get:function(){return this._valueDec},set:function(e){this._valueDec=e;this.isHexOnly=false;this.valueHexView=new Uint8Array(utilEncodeTC(e))},enumerable:false,configurable:true});t.prototype.fromDER=function(e,t,r,i){if(i===void 0){i=0}var n=this.fromBER(e,t,r);if(n===-1)return n;var o=this.valueHexView;if(o[0]===0&&(o[1]&128)!==0){this.valueHexView=o.subarray(1)}else{if(i!==0){if(o.length<i){if(i-o.length>1)i=o.length+1;this.valueHexView=o.subarray(i-o.length)}}}return n};t.prototype.toDER=function(e){if(e===void 0){e=false}var t=this.valueHexView;switch(true){case(t[0]&128)!==0:{var r=new Uint8Array(this.valueHexView.length+1);r[0]=0;r.set(t,1);this.valueHexView=r}break;case t[0]===0&&(t[1]&128)===0:{this.valueHexView=this.valueHexView.subarray(1)}break}return this.toBER(e)};t.prototype.fromBER=function(t,r,i){var n=e.prototype.fromBER.call(this,t,r,i);if(n===-1){return n}this.setValueHex();return n};t.prototype.toBER=function(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{valueDec:this.valueDec})};t.prototype.toString=function(){var e=this.valueHexView.length*8-1;var t=new Uint8Array(this.valueHexView.length*8/3);var r=0;var i;var n=this.valueHexView;var o="";var a=false;for(var s=n.byteLength-1;s>=0;s--){i=n[s];for(var c=0;c<8;c++){if((i&1)===1){switch(r){case e:t=viewSub(power2(r),t);o="-";break;default:t=viewAdd(t,power2(r))}}r++;i>>=1}}for(var c=0;c<t.length;c++){if(t[c])a=true;if(a)o+=digitsString.charAt(t[c])}if(a===false)o+=digitsString.charAt(0);return o};return t}(HexBlock(ValueBlock));_a$p=LocalIntegerValueBlock;LocalIntegerValueBlock.NAME="IntegerValueBlock";(function(){Object.defineProperty(_a$p.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e);this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}})})();var _a$o;var Integer=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalIntegerValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=2;return r}t.prototype.toBigInt=function(){assertBigInt();return BigInt(this.valueBlock.toString())};t.fromBigInt=function(e){assertBigInt();var t=BigInt(e);var r=new ViewWriter;var i=t.toString(16).replace(/^-/,"");var n=new Uint8Array(buildExports.Convert.FromHex(i));if(t<0){var o=new Uint8Array(n.length+(n[0]&128?1:0));o[0]|=128;var a=BigInt("0x".concat(buildExports.Convert.ToHex(o)));var s=a+t;var c=buildExports.BufferSourceConverter.toUint8Array(buildExports.Convert.FromHex(s.toString(16)));c[0]|=128;r.write(c)}else{if(n[0]&128){r.write(new Uint8Array([0]))}r.write(n)}var u=new _a$o({valueHex:r.final()});return u};t.prototype.convertToDER=function(){var e=new _a$o({valueHex:this.valueBlock.valueHexView});e.valueBlock.toDER();return e};t.prototype.convertFromDER=function(){return new _a$o({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString())};return t}(BaseBlock);_a$o=Integer;(function(){typeStore.Integer=_a$o})();Integer.NAME="INTEGER";var _a$n;var Enumerated=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=10;return r}return t}(Integer);_a$n=Enumerated;(function(){typeStore.Enumerated=_a$n})();Enumerated.NAME="ENUMERATED";var LocalSidValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.valueDec,n=i===void 0?-1:i,o=t.isFirstSid,a=o===void 0?false:o,s=__rest(t,["valueDec","isFirstSid"]);r=e.call(this,s)||this;r.valueDec=n;r.isFirstSid=a;return r}t.prototype.fromBER=function(e,t,r){if(!r){return t}var i=buildExports.BufferSourceConverter.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}var n=i.subarray(t,t+r);this.valueHexView=new Uint8Array(r);for(var o=0;o<r;o++){this.valueHexView[o]=n[o]&127;this.blockLength++;if((n[o]&128)===0)break}var a=new Uint8Array(this.blockLength);for(var o=0;o<this.blockLength;o++){a[o]=this.valueHexView[o]}this.valueHexView=a;if((n[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=utilFromBase(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return t+this.blockLength};Object.defineProperty(t.prototype,"valueBigInt",{set:function(e){assertBigInt();var t=BigInt(e).toString(2);while(t.length%7){t="0"+t}var r=new Uint8Array(t.length/7);for(var i=0;i<r.length;i++){r[i]=parseInt(t.slice(i*7,i*7+7),2)+(i+1<r.length?128:0)}this.fromBER(r.buffer,0,r.length)},enumerable:false,configurable:true});t.prototype.toBER=function(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);var t=this.valueHexView;var r=new Uint8Array(this.blockLength);for(var i=0;i<this.blockLength-1;i++)r[i]=t[i]|128;r[this.blockLength-1]=t[this.blockLength-1];return r.buffer}var n=utilToBase(this.valueDec,7);if(n.byteLength===0){this.error="Error during encoding SID value";return EMPTY_BUFFER}var o=new Uint8Array(n.byteLength);if(!e){var a=new Uint8Array(n);var s=n.byteLength-1;for(var i=0;i<s;i++)o[i]=a[i]|128;o[s]=a[s]}return o};t.prototype.toString=function(){var e="";if(this.isHexOnly)e=buildExports.Convert.ToHex(this.valueHexView);else{if(this.isFirstSid){var t=this.valueDec;if(this.valueDec<=39)e="0.";else{if(this.valueDec<=79){e="1.";t-=40}else{e="2.";t-=80}}e+=t.toString()}else e=this.valueDec.toString()}return e};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{valueDec:this.valueDec,isFirstSid:this.isFirstSid})};return t}(HexBlock(ValueBlock));LocalSidValueBlock.NAME="sidBlock";var LocalObjectIdentifierValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?EMPTY_STRING:i,o=__rest(t,["value"]);r=e.call(this,o)||this;r.value=[];if(n){r.fromString(n)}return r}t.prototype.fromBER=function(e,t,r){var i=t;while(r>0){var n=new LocalSidValueBlock;i=n.fromBER(e,i,r);if(i===-1){this.blockLength=0;this.error=n.error;return i}if(this.value.length===0)n.isFirstSid=true;this.blockLength+=n.blockLength;r-=n.blockLength;this.value.push(n)}return i};t.prototype.toBER=function(e){var t=[];for(var r=0;r<this.value.length;r++){var i=this.value[r].toBER(e);if(i.byteLength===0){this.error=this.value[r].error;return EMPTY_BUFFER}t.push(i)}return concat(t)};t.prototype.fromString=function(e){this.value=[];var t=0;var r=0;var i="";var n=false;do{r=e.indexOf(".",t);if(r===-1)i=e.substring(t);else i=e.substring(t,r);t=r+1;if(n){var o=this.value[0];var a=0;switch(o.valueDec){case 0:break;case 1:a=40;break;case 2:a=80;break;default:this.value=[];return}var s=parseInt(i,10);if(isNaN(s))return;o.valueDec=s+a;n=false}else{var o=new LocalSidValueBlock;if(i>Number.MAX_SAFE_INTEGER){assertBigInt();var c=BigInt(i);o.valueBigInt=c}else{o.valueDec=parseInt(i,10);if(isNaN(o.valueDec))return}if(!this.value.length){o.isFirstSid=true;n=true}this.value.push(o)}}while(r!==-1)};t.prototype.toString=function(){var e="";var t=false;for(var r=0;r<this.value.length;r++){t=this.value[r].isHexOnly;var i=this.value[r].toString();if(r!==0)e="".concat(e,".");if(t){i="{".concat(i,"}");if(this.value[r].isFirstSid)e="2.{".concat(i," - 80}");else e+=i}else e+=i}return e};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{value:this.toString(),sidArray:[]});for(var r=0;r<this.value.length;r++){t.sidArray.push(this.value[r].toJSON())}return t};return t}(ValueBlock);LocalObjectIdentifierValueBlock.NAME="ObjectIdentifierValueBlock";var _a$m;var ObjectIdentifier=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalObjectIdentifierValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=6;return r}t.prototype.getValue=function(){return this.valueBlock.toString()};t.prototype.setValue=function(e){this.valueBlock.fromString(e)};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString()||"empty")};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.getValue()})};return t}(BaseBlock);_a$m=ObjectIdentifier;(function(){typeStore.ObjectIdentifier=_a$m})();ObjectIdentifier.NAME="OBJECT IDENTIFIER";var LocalRelativeSidValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.valueDec,n=i===void 0?0:i,o=__rest(t,["valueDec"]);r=e.call(this,o)||this;r.valueDec=n;return r}t.prototype.fromBER=function(e,t,r){if(r===0)return t;var i=buildExports.BufferSourceConverter.toUint8Array(e);if(!checkBufferParams(this,i,t,r))return-1;var n=i.subarray(t,t+r);this.valueHexView=new Uint8Array(r);for(var o=0;o<r;o++){this.valueHexView[o]=n[o]&127;this.blockLength++;if((n[o]&128)===0)break}var a=new Uint8Array(this.blockLength);for(var o=0;o<this.blockLength;o++)a[o]=this.valueHexView[o];this.valueHexView=a;if((n[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=utilFromBase(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return t+this.blockLength};t.prototype.toBER=function(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);var t=this.valueHexView;var r=new Uint8Array(this.blockLength);for(var i=0;i<this.blockLength-1;i++)r[i]=t[i]|128;r[this.blockLength-1]=t[this.blockLength-1];return r.buffer}var n=utilToBase(this.valueDec,7);if(n.byteLength===0){this.error="Error during encoding SID value";return EMPTY_BUFFER}var o=new Uint8Array(n.byteLength);if(!e){var a=new Uint8Array(n);var s=n.byteLength-1;for(var i=0;i<s;i++)o[i]=a[i]|128;o[s]=a[s]}return o.buffer};t.prototype.toString=function(){var e="";if(this.isHexOnly)e=buildExports.Convert.ToHex(this.valueHexView);else{e=this.valueDec.toString()}return e};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{valueDec:this.valueDec})};return t}(HexBlock(LocalBaseBlock));LocalRelativeSidValueBlock.NAME="relativeSidBlock";var LocalRelativeObjectIdentifierValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?EMPTY_STRING:i,o=__rest(t,["value"]);r=e.call(this,o)||this;r.value=[];if(n){r.fromString(n)}return r}t.prototype.fromBER=function(e,t,r){var i=t;while(r>0){var n=new LocalRelativeSidValueBlock;i=n.fromBER(e,i,r);if(i===-1){this.blockLength=0;this.error=n.error;return i}this.blockLength+=n.blockLength;r-=n.blockLength;this.value.push(n)}return i};t.prototype.toBER=function(e,t){var r=[];for(var i=0;i<this.value.length;i++){var n=this.value[i].toBER(e);if(n.byteLength===0){this.error=this.value[i].error;return EMPTY_BUFFER}r.push(n)}return concat(r)};t.prototype.fromString=function(e){this.value=[];var t=0;var r=0;var i="";do{r=e.indexOf(".",t);if(r===-1)i=e.substring(t);else i=e.substring(t,r);t=r+1;var n=new LocalRelativeSidValueBlock;n.valueDec=parseInt(i,10);if(isNaN(n.valueDec))return true;this.value.push(n)}while(r!==-1);return true};t.prototype.toString=function(){var e="";var t=false;for(var r=0;r<this.value.length;r++){t=this.value[r].isHexOnly;var i=this.value[r].toString();if(r!==0)e="".concat(e,".");if(t){i="{".concat(i,"}");e+=i}else e+=i}return e};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{value:this.toString(),sidArray:[]});for(var r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t};return t}(ValueBlock);LocalRelativeObjectIdentifierValueBlock.NAME="RelativeObjectIdentifierValueBlock";var _a$l;var RelativeObjectIdentifier=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalRelativeObjectIdentifierValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=13;return r}t.prototype.getValue=function(){return this.valueBlock.toString()};t.prototype.setValue=function(e){this.valueBlock.fromString(e)};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString()||"empty")};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.getValue()})};return t}(BaseBlock);_a$l=RelativeObjectIdentifier;(function(){typeStore.RelativeObjectIdentifier=_a$l})();RelativeObjectIdentifier.NAME="RelativeObjectIdentifier";var _a$k;var Sequence=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=16;return r}return t}(Constructed);_a$k=Sequence;(function(){typeStore.Sequence=_a$k})();Sequence.NAME="SEQUENCE";var _a$j;var Set=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=17;return r}return t}(Constructed);_a$j=Set;(function(){typeStore.Set=_a$j})();Set.NAME="SET";var LocalStringValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=__rest(t,[]);r=e.call(this,i)||this;r.isHexOnly=true;r.value=EMPTY_STRING;return r}t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.value})};return t}(HexBlock(ValueBlock));LocalStringValueBlock.NAME="StringValueBlock";var LocalSimpleStringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(LocalStringValueBlock);LocalSimpleStringValueBlock.NAME="SimpleStringValueBlock";var LocalSimpleStringBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=__rest(t,[]);return e.call(this,r,LocalSimpleStringValueBlock)||this}t.prototype.fromBuffer=function(e){this.valueBlock.value=String.fromCharCode.apply(null,buildExports.BufferSourceConverter.toUint8Array(e))};t.prototype.fromString=function(e){var t=e.length;var r=this.valueBlock.valueHexView=new Uint8Array(t);for(var i=0;i<t;i++)r[i]=e.charCodeAt(i);this.valueBlock.value=e};return t}(BaseStringBlock);LocalSimpleStringBlock.NAME="SIMPLE STRING";var LocalUtf8StringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBuffer=function(e){this.valueBlock.valueHexView=buildExports.BufferSourceConverter.toUint8Array(e);try{this.valueBlock.value=buildExports.Convert.ToUtf8String(e)}catch(t){this.warnings.push('Error during "decodeURIComponent": '.concat(t,", using raw string"));this.valueBlock.value=buildExports.Convert.ToBinary(e)}};t.prototype.fromString=function(e){this.valueBlock.valueHexView=new Uint8Array(buildExports.Convert.FromUtf8String(e));this.valueBlock.value=e};return t}(LocalSimpleStringBlock);LocalUtf8StringValueBlock.NAME="Utf8StringValueBlock";var _a$i;var Utf8String=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=12;return r}return t}(LocalUtf8StringValueBlock);_a$i=Utf8String;(function(){typeStore.Utf8String=_a$i})();Utf8String.NAME="UTF8String";var LocalBmpStringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBuffer=function(e){this.valueBlock.value=buildExports.Convert.ToUtf16String(e);this.valueBlock.valueHexView=buildExports.BufferSourceConverter.toUint8Array(e)};t.prototype.fromString=function(e){this.valueBlock.value=e;this.valueBlock.valueHexView=new Uint8Array(buildExports.Convert.FromUtf16String(e))};return t}(LocalSimpleStringBlock);LocalBmpStringValueBlock.NAME="BmpStringValueBlock";var _a$h;var BmpString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=__rest(t,[]);r=e.call(this,i)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=30;return r}return t}(LocalBmpStringValueBlock);_a$h=BmpString;(function(){typeStore.BmpString=_a$h})();BmpString.NAME="BMPString";var LocalUniversalStringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBuffer=function(e){var t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0);var r=new Uint8Array(t);for(var i=0;i<r.length;i+=4){r[i]=r[i+3];r[i+1]=r[i+2];r[i+2]=0;r[i+3]=0}this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))};t.prototype.fromString=function(e){var t=e.length;var r=this.valueBlock.valueHexView=new Uint8Array(t*4);for(var i=0;i<t;i++){var n=utilToBase(e.charCodeAt(i),8);var o=new Uint8Array(n);if(o.length>4)continue;var a=4-o.length;for(var s=o.length-1;s>=0;s--)r[i*4+s+a]=o[s]}this.valueBlock.value=e};return t}(LocalSimpleStringBlock);LocalUniversalStringValueBlock.NAME="UniversalStringValueBlock";var _a$g;var UniversalString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=__rest(t,[]);r=e.call(this,i)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=28;return r}return t}(LocalUniversalStringValueBlock);_a$g=UniversalString;(function(){typeStore.UniversalString=_a$g})();UniversalString.NAME="UniversalString";var _a$f;var NumericString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=18;return r}return t}(LocalSimpleStringBlock);_a$f=NumericString;(function(){typeStore.NumericString=_a$f})();NumericString.NAME="NumericString";var _a$e;var PrintableString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=19;return r}return t}(LocalSimpleStringBlock);_a$e=PrintableString;(function(){typeStore.PrintableString=_a$e})();PrintableString.NAME="PrintableString";var _a$d;var TeletexString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=20;return r}return t}(LocalSimpleStringBlock);_a$d=TeletexString;(function(){typeStore.TeletexString=_a$d})();TeletexString.NAME="TeletexString";var _a$c;var VideotexString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=21;return r}return t}(LocalSimpleStringBlock);_a$c=VideotexString;(function(){typeStore.VideotexString=_a$c})();VideotexString.NAME="VideotexString";var _a$b;var IA5String=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=22;return r}return t}(LocalSimpleStringBlock);_a$b=IA5String;(function(){typeStore.IA5String=_a$b})();IA5String.NAME="IA5String";var _a$a;var GraphicString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=25;return r}return t}(LocalSimpleStringBlock);_a$a=GraphicString;(function(){typeStore.GraphicString=_a$a})();GraphicString.NAME="GraphicString";var _a$9;var VisibleString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=26;return r}return t}(LocalSimpleStringBlock);_a$9=VisibleString;(function(){typeStore.VisibleString=_a$9})();VisibleString.NAME="VisibleString";var _a$8;var GeneralString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=27;return r}return t}(LocalSimpleStringBlock);_a$8=GeneralString;(function(){typeStore.GeneralString=_a$8})();GeneralString.NAME="GeneralString";var _a$7;var CharacterString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=29;return r}return t}(LocalSimpleStringBlock);_a$7=CharacterString;(function(){typeStore.CharacterString=_a$7})();CharacterString.NAME="CharacterString";var _a$6;var UTCTime=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=t.valueDate,o=__rest(t,["value","valueDate"]);r=e.call(this,o)||this;r.year=0;r.month=0;r.day=0;r.hour=0;r.minute=0;r.second=0;if(i){r.fromString(i);r.valueBlock.valueHexView=new Uint8Array(i.length);for(var a=0;a<i.length;a++)r.valueBlock.valueHexView[a]=i.charCodeAt(a)}if(n){r.fromDate(n);r.valueBlock.valueHexView=new Uint8Array(r.toBuffer())}r.idBlock.tagClass=1;r.idBlock.tagNumber=23;return r}t.prototype.fromBuffer=function(e){this.fromString(String.fromCharCode.apply(null,buildExports.BufferSourceConverter.toUint8Array(e)))};t.prototype.toBuffer=function(){var e=this.toString();var t=new ArrayBuffer(e.length);var r=new Uint8Array(t);for(var i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return t};t.prototype.fromDate=function(e){this.year=e.getUTCFullYear();this.month=e.getUTCMonth()+1;this.day=e.getUTCDate();this.hour=e.getUTCHours();this.minute=e.getUTCMinutes();this.second=e.getUTCSeconds()};t.prototype.toDate=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))};t.prototype.fromString=function(e){var t=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/gi;var r=t.exec(e);if(r===null){this.error="Wrong input string for conversion";return}var i=parseInt(r[1],10);if(i>=50)this.year=1900+i;else this.year=2e3+i;this.month=parseInt(r[2],10);this.day=parseInt(r[3],10);this.hour=parseInt(r[4],10);this.minute=parseInt(r[5],10);this.second=parseInt(r[6],10)};t.prototype.toString=function(t){if(t===void 0){t="iso"}if(t==="iso"){var r=new Array(7);r[0]=padNumber(this.year<2e3?this.year-1900:this.year-2e3,2);r[1]=padNumber(this.month,2);r[2]=padNumber(this.day,2);r[3]=padNumber(this.hour,2);r[4]=padNumber(this.minute,2);r[5]=padNumber(this.second,2);r[6]="Z";return r.join("")}return e.prototype.toString.call(this,t)};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.toDate().toISOString())};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second})};return t}(VisibleString);_a$6=UTCTime;(function(){typeStore.UTCTime=_a$6})();UTCTime.NAME="UTCTime";var _a$5;var GeneralizedTime=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r;var i=e.call(this,t)||this;(r=i.millisecond)!==null&&r!==void 0?r:i.millisecond=0;i.idBlock.tagClass=1;i.idBlock.tagNumber=24;return i}t.prototype.fromDate=function(t){e.prototype.fromDate.call(this,t);this.millisecond=t.getUTCMilliseconds()};t.prototype.toDate=function(){var e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)};t.prototype.fromString=function(e){var t=false;var r="";var i="";var n=0;var o;var a=0;var s=0;if(e[e.length-1]==="Z"){r=e.substring(0,e.length-1);t=true}else{var c=new Number(e[e.length-1]);if(isNaN(c.valueOf()))throw new Error("Wrong input string for conversion");r=e}if(t){if(r.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(r.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{var u=1;var p=r.indexOf("+");var f="";if(p===-1){p=r.indexOf("-");u=-1}if(p!==-1){f=r.substring(p+1);r=r.substring(0,p);if(f.length!==2&&f.length!==4)throw new Error("Wrong input string for conversion");var c=parseInt(f.substring(0,2),10);if(isNaN(c.valueOf()))throw new Error("Wrong input string for conversion");a=u*c;if(f.length===4){c=parseInt(f.substring(2,4),10);if(isNaN(c.valueOf()))throw new Error("Wrong input string for conversion");s=u*c}}}var d=r.indexOf(".");if(d===-1)d=r.indexOf(",");if(d!==-1){var l=new Number("0".concat(r.substring(d)));if(isNaN(l.valueOf()))throw new Error("Wrong input string for conversion");n=l.valueOf();i=r.substring(0,d)}else i=r;switch(true){case i.length===8:o=/(\d{4})(\d{2})(\d{2})/gi;if(d!==-1)throw new Error("Wrong input string for conversion");break;case i.length===10:o=/(\d{4})(\d{2})(\d{2})(\d{2})/gi;if(d!==-1){var y=60*n;this.minute=Math.floor(y);y=60*(y-this.minute);this.second=Math.floor(y);y=1e3*(y-this.second);this.millisecond=Math.floor(y)}break;case i.length===12:o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(d!==-1){var y=60*n;this.second=Math.floor(y);y=1e3*(y-this.second);this.millisecond=Math.floor(y)}break;case i.length===14:o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(d!==-1){var y=1e3*n;this.millisecond=Math.floor(y)}break;default:throw new Error("Wrong input string for conversion")}var v=o.exec(i);if(v===null)throw new Error("Wrong input string for conversion");for(var h=1;h<v.length;h++){switch(h){case 1:this.year=parseInt(v[h],10);break;case 2:this.month=parseInt(v[h],10);break;case 3:this.day=parseInt(v[h],10);break;case 4:this.hour=parseInt(v[h],10)+a;break;case 5:this.minute=parseInt(v[h],10)+s;break;case 6:this.second=parseInt(v[h],10);break;default:throw new Error("Wrong input string for conversion")}}if(t===false){var A=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=A.getUTCFullYear();this.month=A.getUTCMonth();this.day=A.getUTCDay();this.hour=A.getUTCHours();this.minute=A.getUTCMinutes();this.second=A.getUTCSeconds();this.millisecond=A.getUTCMilliseconds()}};t.prototype.toString=function(t){if(t===void 0){t="iso"}if(t==="iso"){var r=[];r.push(padNumber(this.year,4));r.push(padNumber(this.month,2));r.push(padNumber(this.day,2));r.push(padNumber(this.hour,2));r.push(padNumber(this.minute,2));r.push(padNumber(this.second,2));if(this.millisecond!==0){r.push(".");r.push(padNumber(this.millisecond,3))}r.push("Z");return r.join("")}return e.prototype.toString.call(this,t)};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{millisecond:this.millisecond})};return t}(UTCTime);_a$5=GeneralizedTime;(function(){typeStore.GeneralizedTime=_a$5})();GeneralizedTime.NAME="GeneralizedTime";var _a$4;var DATE=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=31;return r}return t}(Utf8String);_a$4=DATE;(function(){typeStore.DATE=_a$4})();DATE.NAME="DATE";var _a$3;var TimeOfDay=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=32;return r}return t}(Utf8String);_a$3=TimeOfDay;(function(){typeStore.TimeOfDay=_a$3})();TimeOfDay.NAME="TimeOfDay";var _a$2;var DateTime=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=33;return r}return t}(Utf8String);_a$2=DateTime;(function(){typeStore.DateTime=_a$2})();DateTime.NAME="DateTime";var _a$1;var Duration=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=34;return r}return t}(Utf8String);_a$1=Duration;(function(){typeStore.Duration=_a$1})();Duration.NAME="Duration";var _a;var TIME=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=14;return r}return t}(Utf8String);_a=TIME;(function(){typeStore.TIME=_a})();TIME.NAME="TIME";var Any=function(){function e(e){var t=e===void 0?{}:e,r=t.name,i=r===void 0?EMPTY_STRING:r,n=t.optional,o=n===void 0?false:n;this.name=i;this.optional=o}return e}();var Choice=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?[]:i,o=__rest(t,["value"]);r=e.call(this,o)||this;r.value=n;return r}return t}(Any);var Repeated=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?new Any:i,o=t.local,a=o===void 0?false:o,s=__rest(t,["value","local"]);r=e.call(this,s)||this;r.value=n;r.local=a;return r}return t}(Any);var RawData=function(){function e(e){var t=e===void 0?{}:e,r=t.data,i=r===void 0?EMPTY_VIEW:r;this.dataView=buildExports.BufferSourceConverter.toUint8Array(i)}Object.defineProperty(e.prototype,"data",{get:function(){return this.dataView.slice().buffer},set:function(e){this.dataView=buildExports.BufferSourceConverter.toUint8Array(e)},enumerable:false,configurable:true});e.prototype.fromBER=function(e,t,r){var i=t+r;this.dataView=buildExports.BufferSourceConverter.toUint8Array(e).subarray(t,i);return i};e.prototype.toBER=function(e){return this.dataView.slice().buffer};return e}();function compareSchema(e,t,r){if(r instanceof Choice){for(var i=0,n=r.value;i<n.length;i++){var o=n[i];var a=compareSchema(e,t,o);if(a.verified){return{verified:true,result:e}}}{var s={verified:false,result:{error:"Wrong values for Choice type"}};if(r.hasOwnProperty(NAME))s.name=r.name;return s}}if(r instanceof Any){if(r.hasOwnProperty(NAME))e[r.name]=t;return{verified:true,result:e}}if(e instanceof Object===false){return{verified:false,result:{error:"Wrong root object"}}}if(t instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 data"}}}if(r instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(ID_BLOCK in r===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(FROM_BER in r.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(TO_BER in r.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}var c=r.idBlock.toBER(false);if(c.byteLength===0){return{verified:false,result:{error:"Error encoding idBlock for ASN.1 schema"}}}var u=r.idBlock.fromBER(c,0,c.byteLength);if(u===-1){return{verified:false,result:{error:"Error decoding idBlock for ASN.1 schema"}}}if(r.idBlock.hasOwnProperty(TAG_CLASS)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.tagClass!==t.idBlock.tagClass){return{verified:false,result:e}}if(r.idBlock.hasOwnProperty(TAG_NUMBER)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.tagNumber!==t.idBlock.tagNumber){return{verified:false,result:e}}if(r.idBlock.hasOwnProperty(IS_CONSTRUCTED)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.isConstructed!==t.idBlock.isConstructed){return{verified:false,result:e}}if(!(IS_HEX_ONLY in r.idBlock)){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.isHexOnly!==t.idBlock.isHexOnly){return{verified:false,result:e}}if(r.idBlock.isHexOnly){if(VALUE_HEX_VIEW in r.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}var p=r.idBlock.valueHexView;var f=t.idBlock.valueHexView;if(p.length!==f.length){return{verified:false,result:e}}for(var d=0;d<p.length;d++){if(p[d]!==f[1]){return{verified:false,result:e}}}}if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)e[r.name]=t}if(r instanceof typeStore.Constructed){var l=0;var a={verified:false,result:{error:"Unknown error"}};var y=r.valueBlock.value.length;if(y>0){if(r.valueBlock.value[0]instanceof Repeated){y=t.valueBlock.value.length}}if(y===0){return{verified:true,result:e}}if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){var v=true;for(var d=0;d<r.valueBlock.value.length;d++)v=v&&(r.valueBlock.value[d].optional||false);if(v){return{verified:true,result:e}}if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)delete e[r.name]}e.error="Inconsistent object length";return{verified:false,result:e}}for(var d=0;d<y;d++){if(d-l>=t.valueBlock.value.length){if(r.valueBlock.value[d].optional===false){var s={verified:false,result:e};e.error="Inconsistent length between ASN.1 data and schema";if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name){delete e[r.name];s.name=r.name}}return s}}else{if(r.valueBlock.value[0]instanceof Repeated){a=compareSchema(e,t.valueBlock.value[d],r.valueBlock.value[0].value);if(a.verified===false){if(r.valueBlock.value[0].optional)l++;else{if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)delete e[r.name]}return a}}if(NAME in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){var h={};if(LOCAL in r.valueBlock.value[0]&&r.valueBlock.value[0].local)h=t;else h=e;if(typeof h[r.valueBlock.value[0].name]==="undefined")h[r.valueBlock.value[0].name]=[];h[r.valueBlock.value[0].name].push(t.valueBlock.value[d])}}else{a=compareSchema(e,t.valueBlock.value[d-l],r.valueBlock.value[d]);if(a.verified===false){if(r.valueBlock.value[d].optional)l++;else{if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)delete e[r.name]}return a}}}}}if(a.verified===false){var s={verified:false,result:e};if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name){delete e[r.name];s.name=r.name}}return s}return{verified:true,result:e}}if(r.primitiveSchema&&VALUE_HEX_VIEW in t.valueBlock){var A=localFromBER(t.valueBlock.valueHexView);if(A.offset===-1){var s={verified:false,result:A.result};if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name){delete e[r.name];s.name=r.name}}return s}return compareSchema(e,A.result,r.primitiveSchema)}return{verified:true,result:e}}function verifySchema(e,t){if(t instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema type"}}}var r=localFromBER(buildExports.BufferSourceConverter.toUint8Array(e));if(r.offset===-1){return{verified:false,result:r.result}}return compareSchema(r.result,r.result,t)}var asn1js=Object.freeze({__proto__:null,Any:Any,BaseBlock:BaseBlock,BaseStringBlock:BaseStringBlock,BitString:BitString$1,BmpString:BmpString,Boolean:Boolean,CharacterString:CharacterString,Choice:Choice,Constructed:Constructed,DATE:DATE,DateTime:DateTime,Duration:Duration,EndOfContent:EndOfContent,Enumerated:Enumerated,GeneralString:GeneralString,GeneralizedTime:GeneralizedTime,GraphicString:GraphicString,HexBlock:HexBlock,IA5String:IA5String,Integer:Integer,Null:Null,NumericString:NumericString,ObjectIdentifier:ObjectIdentifier,OctetString:OctetString$1,Primitive:Primitive,PrintableString:PrintableString,RawData:RawData,RelativeObjectIdentifier:RelativeObjectIdentifier,Repeated:Repeated,Sequence:Sequence,Set:Set,TIME:TIME,TeletexString:TeletexString,TimeOfDay:TimeOfDay,UTCTime:UTCTime,UniversalString:UniversalString,Utf8String:Utf8String,ValueBlock:ValueBlock,VideotexString:VideotexString,ViewWriter:ViewWriter,VisibleString:VisibleString,compareSchema:compareSchema,fromBER:fromBER,verifySchema:verifySchema});var AsnTypeTypes;(function(e){e[e["Sequence"]=0]="Sequence";e[e["Set"]=1]="Set";e[e["Choice"]=2]="Choice"})(AsnTypeTypes||(AsnTypeTypes={}));var AsnPropTypes;(function(e){e[e["Any"]=1]="Any";e[e["Boolean"]=2]="Boolean";e[e["OctetString"]=3]="OctetString";e[e["BitString"]=4]="BitString";e[e["Integer"]=5]="Integer";e[e["Enumerated"]=6]="Enumerated";e[e["ObjectIdentifier"]=7]="ObjectIdentifier";e[e["Utf8String"]=8]="Utf8String";e[e["BmpString"]=9]="BmpString";e[e["UniversalString"]=10]="UniversalString";e[e["NumericString"]=11]="NumericString";e[e["PrintableString"]=12]="PrintableString";e[e["TeletexString"]=13]="TeletexString";e[e["VideotexString"]=14]="VideotexString";e[e["IA5String"]=15]="IA5String";e[e["GraphicString"]=16]="GraphicString";e[e["VisibleString"]=17]="VisibleString";e[e["GeneralString"]=18]="GeneralString";e[e["CharacterString"]=19]="CharacterString";e[e["UTCTime"]=20]="UTCTime";e[e["GeneralizedTime"]=21]="GeneralizedTime";e[e["DATE"]=22]="DATE";e[e["TimeOfDay"]=23]="TimeOfDay";e[e["DateTime"]=24]="DateTime";e[e["Duration"]=25]="Duration";e[e["TIME"]=26]="TIME";e[e["Null"]=27]="Null"})(AsnPropTypes||(AsnPropTypes={}));var BitString=function(){function e(e,t){if(t===void 0){t=0}this.unusedBits=0;this.value=new ArrayBuffer(0);if(e){if(typeof e==="number"){this.fromNumber(e)}else if(buildExports.BufferSourceConverter.isBufferSource(e)){this.unusedBits=t;this.value=buildExports.BufferSourceConverter.toArrayBuffer(e)}else{throw TypeError("Unsupported type of 'params' argument for BitString")}}}e.prototype.fromASN=function(e){if(!(e instanceof BitString$1)){throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString")}this.unusedBits=e.valueBlock.unusedBits;this.value=e.valueBlock.valueHex;return this};e.prototype.toASN=function(){return new BitString$1({unusedBits:this.unusedBits,valueHex:this.value})};e.prototype.toSchema=function(e){return new BitString$1({name:e})};e.prototype.toNumber=function(){var e="";var t=new Uint8Array(this.value);for(var r=0,i=t;r<i.length;r++){var n=i[r];e+=n.toString(2).padStart(8,"0")}e=e.split("").reverse().join("");if(this.unusedBits){e=e.slice(this.unusedBits).padStart(this.unusedBits,"0")}return parseInt(e,2)};e.prototype.fromNumber=function(e){var t=e.toString(2);var r=t.length+7>>3;this.unusedBits=(r<<3)-t.length;var i=new Uint8Array(r);t=t.padStart(r<<3,"0").split("").reverse().join("");var n=0;while(n<r){i[n]=parseInt(t.slice(n<<3,(n<<3)+8),2);n++}this.value=i.buffer};return e}();var OctetString=function(){function e(e){if(typeof e==="number"){this.buffer=new ArrayBuffer(e)}else{if(buildExports.BufferSourceConverter.isBufferSource(e)){this.buffer=buildExports.BufferSourceConverter.toArrayBuffer(e)}else if(Array.isArray(e)){this.buffer=new Uint8Array(e)}else{this.buffer=new ArrayBuffer(0)}}}Object.defineProperty(e.prototype,"byteLength",{get:function(){return this.buffer.byteLength},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"byteOffset",{get:function(){return 0},enumerable:false,configurable:true});e.prototype.fromASN=function(e){if(!(e instanceof OctetString$1)){throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString")}this.buffer=e.valueBlock.valueHex;return this};e.prototype.toASN=function(){return new OctetString$1({valueHex:this.buffer})};e.prototype.toSchema=function(e){return new OctetString$1({name:e})};return e}();var AsnAnyConverter={fromASN:function(e){return e instanceof Null?null:e.valueBeforeDecodeView},toASN:function(e){if(e===null){return new Null}var t=fromBER(e);if(t.result.error){throw new Error(t.result.error)}return t.result}};var AsnIntegerConverter={fromASN:function(e){return e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec},toASN:function(e){return new Integer({value:+e})}};var AsnEnumeratedConverter={fromASN:function(e){return e.valueBlock.valueDec},toASN:function(e){return new Enumerated({value:e})}};var AsnIntegerArrayBufferConverter={fromASN:function(e){return e.valueBlock.valueHexView},toASN:function(e){return new Integer({valueHex:e})}};var AsnBitStringConverter={fromASN:function(e){return e.valueBlock.valueHexView},toASN:function(e){return new BitString$1({valueHex:e})}};var AsnObjectIdentifierConverter={fromASN:function(e){return e.valueBlock.toString()},toASN:function(e){return new ObjectIdentifier({value:e})}};var AsnBooleanConverter={fromASN:function(e){return e.valueBlock.value},toASN:function(e){return new Boolean({value:e})}};var AsnOctetStringConverter={fromASN:function(e){return e.valueBlock.valueHexView},toASN:function(e){return new OctetString$1({valueHex:e})}};var AsnConstructedOctetStringConverter={fromASN:function(e){return new OctetString(e.getValue())},toASN:function(e){return e.toASN()}};function createStringConverter(e){return{fromASN:function(e){return e.valueBlock.value},toASN:function(t){return new e({value:t})}}}var AsnUtf8StringConverter=createStringConverter(Utf8String);var AsnBmpStringConverter=createStringConverter(BmpString);var AsnUniversalStringConverter=createStringConverter(UniversalString);var AsnNumericStringConverter=createStringConverter(NumericString);var AsnPrintableStringConverter=createStringConverter(PrintableString);var AsnTeletexStringConverter=createStringConverter(TeletexString);var AsnVideotexStringConverter=createStringConverter(VideotexString);var AsnIA5StringConverter=createStringConverter(IA5String);var AsnGraphicStringConverter=createStringConverter(GraphicString);var AsnVisibleStringConverter=createStringConverter(VisibleString);var AsnGeneralStringConverter=createStringConverter(GeneralString);var AsnCharacterStringConverter=createStringConverter(CharacterString);var AsnUTCTimeConverter={fromASN:function(e){return e.toDate()},toASN:function(e){return new UTCTime({valueDate:e})}};var AsnGeneralizedTimeConverter={fromASN:function(e){return e.toDate()},toASN:function(e){return new GeneralizedTime({valueDate:e})}};var AsnNullConverter={fromASN:function(){return null},toASN:function(){return new Null}};function defaultConverter(e){switch(e){case AsnPropTypes.Any:return AsnAnyConverter;case AsnPropTypes.BitString:return AsnBitStringConverter;case AsnPropTypes.BmpString:return AsnBmpStringConverter;case AsnPropTypes.Boolean:return AsnBooleanConverter;case AsnPropTypes.CharacterString:return AsnCharacterStringConverter;case AsnPropTypes.Enumerated:return AsnEnumeratedConverter;case AsnPropTypes.GeneralString:return AsnGeneralStringConverter;case AsnPropTypes.GeneralizedTime:return AsnGeneralizedTimeConverter;case AsnPropTypes.GraphicString:return AsnGraphicStringConverter;case AsnPropTypes.IA5String:return AsnIA5StringConverter;case AsnPropTypes.Integer:return AsnIntegerConverter;case AsnPropTypes.Null:return AsnNullConverter;case AsnPropTypes.NumericString:return AsnNumericStringConverter;case AsnPropTypes.ObjectIdentifier:return AsnObjectIdentifierConverter;case AsnPropTypes.OctetString:return AsnOctetStringConverter;case AsnPropTypes.PrintableString:return AsnPrintableStringConverter;case AsnPropTypes.TeletexString:return AsnTeletexStringConverter;case AsnPropTypes.UTCTime:return AsnUTCTimeConverter;case AsnPropTypes.UniversalString:return AsnUniversalStringConverter;case AsnPropTypes.Utf8String:return AsnUtf8StringConverter;case AsnPropTypes.VideotexString:return AsnVideotexStringConverter;case AsnPropTypes.VisibleString:return AsnVisibleStringConverter;default:return null}}function isConvertible(e){if(typeof e==="function"&&e.prototype){if(e.prototype.toASN&&e.prototype.fromASN){return true}else{return isConvertible(e.prototype)}}else{return!!(e&&typeof e==="object"&&"toASN"in e&&"fromASN"in e)}}function isTypeOfArray(e){var t;if(e){var r=Object.getPrototypeOf(e);if(((t=r===null||r===void 0?void 0:r.prototype)===null||t===void 0?void 0:t.constructor)===Array){return true}return isTypeOfArray(r)}return false}function isArrayEqual(e,t){if(!(e&&t)){return false}if(e.byteLength!==t.byteLength){return false}var r=new Uint8Array(e);var i=new Uint8Array(t);for(var n=0;n<e.byteLength;n++){if(r[n]!==i[n]){return false}}return true}var AsnSchemaStorage=function(){function e(){this.items=new WeakMap}e.prototype.has=function(e){return this.items.has(e)};e.prototype.get=function(e,t){if(t===void 0){t=false}var r=this.items.get(e);if(!r){throw new Error("Cannot get schema for '".concat(e.prototype.constructor.name,"' target"))}if(t&&!r.schema){throw new Error("Schema '".concat(e.prototype.constructor.name,"' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'."))}return r};e.prototype.cache=function(e){var t=this.get(e);if(!t.schema){t.schema=this.create(e,true)}};e.prototype.createDefault=function(e){var t={type:AsnTypeTypes.Sequence,items:{}};var r=this.findParentSchema(e);if(r){Object.assign(t,r);t.items=Object.assign({},t.items,r.items)}return t};e.prototype.create=function(e,t){var r=this.items.get(e)||this.createDefault(e);var i=[];for(var n in r.items){var o=r.items[n];var a=t?n:"";var s=void 0;if(typeof o.type==="number"){var c=AsnPropTypes[o.type];var u=asn1js[c];if(!u){throw new Error("Cannot get ASN1 class by name '".concat(c,"'"))}s=new u({name:a})}else if(isConvertible(o.type)){var p=new o.type;s=p.toSchema(a)}else if(o.optional){var f=this.get(o.type);if(f.type===AsnTypeTypes.Choice){s=new Any({name:a})}else{s=this.create(o.type,false);s.name=a}}else{s=new Any({name:a})}var d=!!o.optional||o.defaultValue!==undefined;if(o.repeated){s.name="";var l=o.repeated==="set"?Set:Sequence;s=new l({name:"",value:[new Repeated({name:a,value:s})]})}if(o.context!==null&&o.context!==undefined){if(o.implicit){if(typeof o.type==="number"||isConvertible(o.type)){var l=o.repeated?Constructed:Primitive;i.push(new l({name:a,optional:d,idBlock:{tagClass:3,tagNumber:o.context}}))}else{this.cache(o.type);var y=!!o.repeated;var v=!y?this.get(o.type,true).schema:s;v="valueBlock"in v?v.valueBlock.value:v.value;i.push(new Constructed({name:!y?a:"",optional:d,idBlock:{tagClass:3,tagNumber:o.context},value:v}))}}else{i.push(new Constructed({optional:d,idBlock:{tagClass:3,tagNumber:o.context},value:[s]}))}}else{s.optional=d;i.push(s)}}switch(r.type){case AsnTypeTypes.Sequence:return new Sequence({value:i,name:""});case AsnTypeTypes.Set:return new Set({value:i,name:""});case AsnTypeTypes.Choice:return new Choice({value:i,name:""});default:throw new Error("Unsupported ASN1 type in use")}};e.prototype.set=function(e,t){this.items.set(e,t);return this};e.prototype.findParentSchema=function(e){var t=Object.getPrototypeOf(e);if(t){var r=this.items.get(t);return r||this.findParentSchema(t)}return null};return e}();var schemaStorage=new AsnSchemaStorage;var AsnType=function(e){return function(t){var r;if(!schemaStorage.has(t)){r=schemaStorage.createDefault(t);schemaStorage.set(t,r)}else{r=schemaStorage.get(t)}Object.assign(r,e)}};var AsnProp=function(e){return function(t,r){var i;if(!schemaStorage.has(t.constructor)){i=schemaStorage.createDefault(t.constructor);schemaStorage.set(t.constructor,i)}else{i=schemaStorage.get(t.constructor)}var n=Object.assign({},e);if(typeof n.type==="number"&&!n.converter){var o=defaultConverter(e.type);if(!o){throw new Error("Cannot get default converter for property '".concat(r,"' of ").concat(t.constructor.name))}n.converter=o}i.items[r]=n}};var AsnSchemaValidationError=function(e){__extends(t,e);function t(){var t=e.apply(this,arguments)||this;t.schemas=[];return t}return t}(Error);var AsnParser=function(){function e(){}e.parse=function(e,t){var r=fromBER(e);if(r.result.error){throw new Error(r.result.error)}var i=this.fromASN(r.result,t);return i};e.fromASN=function(e,t){try{if(isConvertible(t)){var r=new t;return r.fromASN(e)}var i=schemaStorage.get(t);schemaStorage.cache(t);var n=i.schema;var o=this.handleChoiceTypes(e,i,t,n);if(o===null||o===void 0?void 0:o.result){return o.result}if(o===null||o===void 0?void 0:o.targetSchema){n=o.targetSchema}var a=this.handleSequenceTypes(e,i,t,n);if(a&&"isManualMapping"in a){return a.result}var s=a;var c=new t;if(isTypeOfArray(t)){return this.handleArrayTypes(e,i,t)}this.processSchemaItems(i,s,c);return c}catch(e){if(e instanceof AsnSchemaValidationError){e.schemas.push(t.name)}throw e}};e.handleChoiceTypes=function(e,t,r,i){if(e.constructor===Constructed&&t.type===AsnTypeTypes.Choice&&e.idBlock.tagClass===3){for(var n in t.items){var o=t.items[n];if(o.context===e.idBlock.tagNumber&&o.implicit){if(typeof o.type==="function"&&schemaStorage.has(o.type)){var a=schemaStorage.get(o.type);if(a&&a.type===AsnTypeTypes.Sequence){var s=new Sequence;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock){s.valueBlock.value=e.valueBlock.value;var c=this.fromASN(s,o.type);var u=new r;u[n]=c;return{result:u}}}}}}}else if(e.constructor===Constructed&&t.type!==AsnTypeTypes.Choice){var p=new Constructed({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:t.schema.valueBlock.value});for(var n in t.items){delete e[n]}return{targetSchema:p}}return null};e.handleSequenceTypes=function(e,t,r,i){if(t.type===AsnTypeTypes.Sequence){var n=Object.keys(t.items).filter((function(e){var r=t.items[e];return r.optional&&typeof r.type==="function"&&schemaStorage.has(r.type)&&schemaStorage.get(r.type).type===AsnTypeTypes.Choice}));if(n.length>0&&"value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&r.name==="CertReqMsg"){return this.handleManualMapping(e,t,r)}var o=compareSchema({},e,i);if(!o.verified){throw new AsnSchemaValidationError("Data does not match to ".concat(r.name," ASN1 schema. ").concat(o.result.error))}return o}else{var o=compareSchema({},e,i);if(!o.verified){throw new AsnSchemaValidationError("Data does not match to ".concat(r.name," ASN1 schema. ").concat(o.result.error))}return o}};e.handleManualMapping=function(e,t,r){var i=new r;var n=e.valueBlock.value;var o=Object.keys(t.items);var a=0;for(var s=0;s<o.length;s++){var c=o[s];var u=t.items[c];if(a>=n.length)break;if(u.repeated){i[c]=this.processRepeatedField(n,a,u);break}else if(typeof u.type==="number"){i[c]=this.processPrimitiveField(n[a],u);a++}else if(this.isOptionalChoiceField(u)){var p=this.processOptionalChoiceField(n[a],u);if(p.processed){i[c]=p.value;a++}}else{i[c]=this.fromASN(n[a],u.type);a++}}return{result:i,verified:true,isManualMapping:true}};e.processRepeatedField=function(e,t,r){var i=this;var n=e.slice(t);if(n.length===1&&n[0].constructor.name==="Sequence"){var o=n[0];if(o.valueBlock&&o.valueBlock.value&&Array.isArray(o.valueBlock.value)){n=o.valueBlock.value}}if(typeof r.type==="number"){var a=defaultConverter(r.type);if(!a)throw new Error("No converter for ASN.1 type ".concat(r.type));return n.filter((function(e){return e&&e.valueBlock})).map((function(e){try{return a.fromASN(e)}catch(e){return undefined}})).filter((function(e){return e!==undefined}))}else{return n.filter((function(e){return e&&e.valueBlock})).map((function(e){try{return i.fromASN(e,r.type)}catch(e){return undefined}})).filter((function(e){return e!==undefined}))}};e.processPrimitiveField=function(e,t){var r=defaultConverter(t.type);if(!r)throw new Error("No converter for ASN.1 type ".concat(t.type));return r.fromASN(e)};e.isOptionalChoiceField=function(e){return e.optional&&typeof e.type==="function"&&schemaStorage.has(e.type)&&schemaStorage.get(e.type).type===AsnTypeTypes.Choice};e.processOptionalChoiceField=function(e,t){try{var r=this.fromASN(e,t.type);return{processed:true,value:r}}catch(e){if(e instanceof AsnSchemaValidationError&&/Wrong values for Choice type/.test(e.message)){return{processed:false}}throw e}};e.handleArrayTypes=function(e,t,r){var i=this;if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value))){throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.")}var n=t.itemType;if(typeof n==="number"){var o=defaultConverter(n);if(!o){throw new Error("Cannot get default converter for array item of ".concat(r.name," ASN1 schema"))}return r.from(e.valueBlock.value,(function(e){return o.fromASN(e)}))}else{return r.from(e.valueBlock.value,(function(e){return i.fromASN(e,n)}))}};e.processSchemaItems=function(e,t,r){for(var i in e.items){var n=t.result[i];if(!n){continue}var o=e.items[i];var a=o.type;if(typeof a==="number"||isConvertible(a)){r[i]=this.processPrimitiveSchemaItem(n,o,a)}else{r[i]=this.processComplexSchemaItem(n,o,a)}}};e.processPrimitiveSchemaItem=function(e,t,r){var i;var n=(i=t.converter)!==null&&i!==void 0?i:isConvertible(r)?new r:null;if(!n){throw new Error("Converter is empty")}if(t.repeated){return this.processRepeatedPrimitiveItem(e,t,n)}else{return this.processSinglePrimitiveItem(e,t,r,n)}};e.processRepeatedPrimitiveItem=function(e,t,r){if(t.implicit){var i=t.repeated==="sequence"?Sequence:Set;var n=new i;n.valueBlock=e.valueBlock;var o=fromBER(n.toBER(false));if(o.offset===-1){throw new Error("Cannot parse the child item. ".concat(o.result.error))}if(!("value"in o.result.valueBlock&&Array.isArray(o.result.valueBlock.value))){throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.")}var a=o.result.valueBlock.value;return Array.from(a,(function(e){return r.fromASN(e)}))}else{return Array.from(e,(function(e){return r.fromASN(e)}))}};e.processSinglePrimitiveItem=function(e,t,r,i){var n=e;if(t.implicit){var o=void 0;if(isConvertible(r)){o=(new r).toSchema("")}else{var a=AsnPropTypes[r];var s=asn1js[a];if(!s){throw new Error("Cannot get '".concat(a,"' class from asn1js module"))}o=new s}o.valueBlock=n.valueBlock;n=fromBER(o.toBER(false)).result}return i.fromASN(n)};e.processComplexSchemaItem=function(e,t,r){var i=this;if(t.repeated){if(!Array.isArray(e)){throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.")}return Array.from(e,(function(e){return i.fromASN(e,r)}))}else{var n=this.handleImplicitTagging(e,t,r);if(this.isOptionalChoiceField(t)){try{return this.fromASN(n,r)}catch(e){if(e instanceof AsnSchemaValidationError&&/Wrong values for Choice type/.test(e.message)){return undefined}throw e}}else{return this.fromASN(n,r)}}};e.handleImplicitTagging=function(e,t,r){if(t.implicit&&typeof t.context==="number"){var i=schemaStorage.get(r);if(i.type===AsnTypeTypes.Sequence){var n=new Sequence;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in n.valueBlock){n.valueBlock.value=e.valueBlock.value;return n}}else if(i.type===AsnTypeTypes.Set){var o=new Set;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in o.valueBlock){o.valueBlock.value=e.valueBlock.value;return o}}}return e};return e}();var AsnSerializer=function(){function e(){}e.serialize=function(e){if(e instanceof BaseBlock){return e.toBER(false)}return this.toASN(e).toBER(false)};e.toASN=function(t){var r=this;if(t&&typeof t==="object"&&isConvertible(t)){return t.toASN()}if(!(t&&typeof t==="object")){throw new TypeError("Parameter 1 should be type of Object.")}var i=t.constructor;var n=schemaStorage.get(i);schemaStorage.cache(i);var o=[];if(n.itemType){if(!Array.isArray(t)){throw new TypeError("Parameter 1 should be type of Array.")}if(typeof n.itemType==="number"){var a=defaultConverter(n.itemType);if(!a){throw new Error("Cannot get default converter for array item of ".concat(i.name," ASN1 schema"))}o=t.map((function(e){return a.toASN(e)}))}else{o=t.map((function(e){return r.toAsnItem({type:n.itemType},"[]",i,e)}))}}else{for(var s in n.items){var c=n.items[s];var u=t[s];if(u===undefined||c.defaultValue===u||typeof c.defaultValue==="object"&&typeof u==="object"&&isArrayEqual(this.serialize(c.defaultValue),this.serialize(u))){continue}var p=e.toAsnItem(c,s,i,u);if(typeof c.context==="number"){if(c.implicit){if(!c.repeated&&(typeof c.type==="number"||isConvertible(c.type))){var f={};f.valueHex=p instanceof Null?p.valueBeforeDecodeView:p.valueBlock.toBER();o.push(new Primitive(__assign({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context}},f)))}else{o.push(new Constructed({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:p.valueBlock.value}))}}else{o.push(new Constructed({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[p]}))}}else if(c.repeated){o=o.concat(p)}else{o.push(p)}}}var d;switch(n.type){case AsnTypeTypes.Sequence:d=new Sequence({value:o});break;case AsnTypeTypes.Set:d=new Set({value:o});break;case AsnTypeTypes.Choice:if(!o[0]){throw new Error("Schema '".concat(i.name,"' has wrong data. Choice cannot be empty."))}d=o[0];break}return d};e.toAsnItem=function(e,t,r,i){var n=this;var o;if(typeof e.type==="number"){var a=e.converter;if(!a){throw new Error("Property '".concat(t,"' doesn't have converter for type ").concat(AsnPropTypes[e.type]," in schema '").concat(r.name,"'"))}if(e.repeated){if(!Array.isArray(i)){throw new TypeError("Parameter 'objProp' should be type of Array.")}var s=Array.from(i,(function(e){return a.toASN(e)}));var c=e.repeated==="sequence"?Sequence:Set;o=new c({value:s})}else{o=a.toASN(i)}}else{if(e.repeated){if(!Array.isArray(i)){throw new TypeError("Parameter 'objProp' should be type of Array.")}var s=Array.from(i,(function(e){return n.toASN(e)}));var c=e.repeated==="sequence"?Sequence:Set;o=new c({value:s})}else{o=this.toASN(i)}}return o};return e}();var AsnArray=function(e){__extends(t,e);function t(t){if(t===void 0){t=[]}var r=this;if(typeof t==="number"){r=e.call(this,t)||this}else{r=e.call(this)||this;for(var i=0,n=t;i<n.length;i++){var o=n[i];r.push(o)}}return r}return t}(Array);var AsnConvert=function(){function e(){}e.serialize=function(e){return AsnSerializer.serialize(e)};e.parse=function(e,t){return AsnParser.parse(e,t)};e.toString=function(t){var r=buildExports.BufferSourceConverter.isBufferSource(t)?buildExports.BufferSourceConverter.toArrayBuffer(t):e.serialize(t);var i=fromBER(r);if(i.offset===-1){throw new Error("Cannot decode ASN.1 data. ".concat(i.result.error))}return i.result.toString()};return e}();function __decorate$1(e,t,r,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(n<3?a(o):n>3?a(t,r,o):a(t,r))||o;return n>3&&o&&Object.defineProperty(t,r,o),o}typeof SuppressedError==="function"?SuppressedError:function(e,t,r){var i=new Error(r);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};var IpConverter=function(){function e(){}e.isIPv4=function(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)};e.parseIPv4=function(e){var t=e.split(".");if(t.length!==4){throw new Error("Invalid IPv4 address")}return t.map((function(e){var t=parseInt(e,10);if(isNaN(t)||t<0||t>255){throw new Error("Invalid IPv4 address part")}return t}))};e.parseIPv6=function(e){var t=this.expandIPv6(e);var r=t.split(":");if(r.length!==8){throw new Error("Invalid IPv6 address")}return r.reduce((function(e,t){var r=parseInt(t,16);if(isNaN(r)||r<0||r>65535){throw new Error("Invalid IPv6 address part")}e.push(r>>8&255);e.push(r&255);return e}),[])};e.expandIPv6=function(e){if(!e.includes("::")){return e}var t=e.split("::");if(t.length>2){throw new Error("Invalid IPv6 address")}var r=t[0]?t[0].split(":"):[];var i=t[1]?t[1].split(":"):[];var n=8-(r.length+i.length);if(n<0){throw new Error("Invalid IPv6 address")}return __spreadArray(__spreadArray(__spreadArray([],r,true),Array(n).fill("0"),true),i,true).join(":")};e.formatIPv6=function(e){var t=[];for(var r=0;r<16;r+=2){t.push((e[r]<<8|e[r+1]).toString(16))}return this.compressIPv6(t.join(":"))};e.compressIPv6=function(e){var t=e.split(":");var r=-1;var i=0;var n=-1;var o=0;for(var a=0;a<t.length;a++){if(t[a]==="0"){if(n===-1){n=a}o++}else{if(o>i){r=n;i=o}n=-1;o=0}}if(o>i){r=n;i=o}if(i>1){var s=t.slice(0,r).join(":");var c=t.slice(r+i).join(":");return"".concat(s,"::").concat(c)}return e};e.parseCIDR=function(e){var t=e.split("/"),r=t[0],i=t[1];var n=parseInt(i,10);if(this.isIPv4(r)){if(n<0||n>32){throw new Error("Invalid IPv4 prefix length")}return[this.parseIPv4(r),n]}else{if(n<0||n>128){throw new Error("Invalid IPv6 prefix length")}return[this.parseIPv6(r),n]}};e.decodeIP=function(e){if(e.length===64&&parseInt(e,16)===0){return"::/0"}if(e.length!==16){return e}var t=parseInt(e.slice(8),16).toString(2).split("").reduce((function(e,t){return e+ +t}),0);var r=e.slice(0,8).replace(/(.{2})/g,(function(e){return"".concat(parseInt(e,16),".")}));r=r.slice(0,-1);return"".concat(r,"/").concat(t)};e.toString=function(e){var t=new Uint8Array(e);if(t.length===4){return Array.from(t).join(".")}if(t.length===16){return this.formatIPv6(t)}if(t.length===8||t.length===32){var r=t.length/2;var i=t.slice(0,r);var n=t.slice(r);var o=t.every((function(e){return e===0}));if(o){return t.length===8?"0.0.0.0/0":"::/0"}var a=n.reduce((function(e,t){return e+(t.toString(2).match(/1/g)||[]).length}),0);if(t.length===8){var s=Array.from(i).join(".");return"".concat(s,"/").concat(a)}else{var s=this.formatIPv6(i);return"".concat(s,"/").concat(a)}}return this.decodeIP(buildExports.Convert.ToHex(e))};e.fromString=function(e){if(e.includes("/")){var t=this.parseCIDR(e),r=t[0],i=t[1];var n=new Uint8Array(r.length);var o=i;for(var a=0;a<n.length;a++){if(o>=8){n[a]=255;o-=8}else if(o>0){n[a]=255<<8-o;o=0}}var s=new Uint8Array(r.length*2);s.set(r,0);s.set(n,r.length);return s.buffer}var c=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(c).buffer};return e}();var RelativeDistinguishedName_1,RDNSequence_1,Name_1;var DirectoryString=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}e.prototype.toString=function(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""};return e}();__decorate$1([AsnProp({type:AsnPropTypes.TeletexString})],DirectoryString.prototype,"teletexString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],DirectoryString.prototype,"printableString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.UniversalString})],DirectoryString.prototype,"universalString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],DirectoryString.prototype,"utf8String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],DirectoryString.prototype,"bmpString",void 0);DirectoryString=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DirectoryString);var AttributeValue=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;Object.assign(r,t);return r}t.prototype.toString=function(){return this.ia5String||(this.anyValue?buildExports.Convert.ToHex(this.anyValue):e.prototype.toString.call(this))};return t}(DirectoryString);__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],AttributeValue.prototype,"ia5String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],AttributeValue.prototype,"anyValue",void 0);AttributeValue=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],AttributeValue);var AttributeTypeAndValue=function(){function e(e){if(e===void 0){e={}}this.type="";this.value=new AttributeValue;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],AttributeTypeAndValue.prototype,"type",void 0);__decorate$1([AsnProp({type:AttributeValue})],AttributeTypeAndValue.prototype,"value",void 0);var RelativeDistinguishedName=RelativeDistinguishedName_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RelativeDistinguishedName_1.prototype);return r}return t}(AsnArray);RelativeDistinguishedName=RelativeDistinguishedName_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:AttributeTypeAndValue})],RelativeDistinguishedName);var RDNSequence=RDNSequence_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RDNSequence_1.prototype);return r}return t}(AsnArray);RDNSequence=RDNSequence_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:RelativeDistinguishedName})],RDNSequence);var Name$1=Name_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name_1.prototype);return r}return t}(RDNSequence);Name$1=Name_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],Name$1);var AsnIpConverter={fromASN:function(e){return IpConverter.toString(AsnOctetStringConverter.fromASN(e))},toASN:function(e){return AsnOctetStringConverter.toASN(IpConverter.fromString(e))}};var OtherName=function(){function e(e){if(e===void 0){e={}}this.typeId="";this.value=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherName.prototype,"typeId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],OtherName.prototype,"value",void 0);var EDIPartyName=function(){function e(e){if(e===void 0){e={}}this.partyName=new DirectoryString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DirectoryString,optional:true,context:0,implicit:true})],EDIPartyName.prototype,"nameAssigner",void 0);__decorate$1([AsnProp({type:DirectoryString,context:1,implicit:true})],EDIPartyName.prototype,"partyName",void 0);var GeneralName=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OtherName,context:0,implicit:true})],GeneralName.prototype,"otherName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:1,implicit:true})],GeneralName.prototype,"rfc822Name",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:2,implicit:true})],GeneralName.prototype,"dNSName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:3,implicit:true})],GeneralName.prototype,"x400Address",void 0);__decorate$1([AsnProp({type:Name$1,context:4,implicit:false})],GeneralName.prototype,"directoryName",void 0);__decorate$1([AsnProp({type:EDIPartyName,context:5})],GeneralName.prototype,"ediPartyName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:6,implicit:true})],GeneralName.prototype,"uniformResourceIdentifier",void 0);__decorate$1([AsnProp({type:AsnPropTypes.OctetString,context:7,implicit:true,converter:AsnIpConverter})],GeneralName.prototype,"iPAddress",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier,context:8,implicit:true})],GeneralName.prototype,"registeredID",void 0);GeneralName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],GeneralName);var id_pkix$1="1.3.6.1.5.5.7";var id_pe$1="".concat(id_pkix$1,".1");var id_ce="2.5.29";var AuthorityInfoAccessSyntax_1;var id_pe_authorityInfoAccess="".concat(id_pe$1,".1");var AccessDescription=function(){function e(e){if(e===void 0){e={}}this.accessMethod="";this.accessLocation=new GeneralName;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],AccessDescription.prototype,"accessMethod",void 0);__decorate$1([AsnProp({type:GeneralName})],AccessDescription.prototype,"accessLocation",void 0);var AuthorityInfoAccessSyntax=AuthorityInfoAccessSyntax_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AuthorityInfoAccessSyntax_1.prototype);return r}return t}(AsnArray);AuthorityInfoAccessSyntax=AuthorityInfoAccessSyntax_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AccessDescription})],AuthorityInfoAccessSyntax);var id_ce_authorityKeyIdentifier="".concat(id_ce,".35");var KeyIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var AuthorityKeyIdentifier=function(){function e(e){if(e===void 0){e={}}if(e){Object.assign(this,e)}}return e}();__decorate$1([AsnProp({type:KeyIdentifier,context:0,optional:true,implicit:true})],AuthorityKeyIdentifier.prototype,"keyIdentifier",void 0);__decorate$1([AsnProp({type:GeneralName,context:1,optional:true,implicit:true,repeated:"sequence"})],AuthorityKeyIdentifier.prototype,"authorityCertIssuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:2,optional:true,implicit:true,converter:AsnIntegerArrayBufferConverter})],AuthorityKeyIdentifier.prototype,"authorityCertSerialNumber",void 0);var id_ce_basicConstraints="".concat(id_ce,".19");var BasicConstraints=function(){function e(e){if(e===void 0){e={}}this.cA=false;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Boolean,defaultValue:false})],BasicConstraints.prototype,"cA",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],BasicConstraints.prototype,"pathLenConstraint",void 0);var GeneralNames_1;var GeneralNames=GeneralNames_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,GeneralNames_1.prototype);return r}return t}(AsnArray);GeneralNames=GeneralNames_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:GeneralName})],GeneralNames);var CertificateIssuer_1;var id_ce_certificateIssuer="".concat(id_ce,".29");var CertificateIssuer=CertificateIssuer_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertificateIssuer_1.prototype);return r}return t}(GeneralNames);CertificateIssuer=CertificateIssuer_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CertificateIssuer);var CertificatePolicies_1;var id_ce_certificatePolicies="".concat(id_ce,".32");var DisplayText=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}e.prototype.toString=function(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""};return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],DisplayText.prototype,"ia5String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.VisibleString})],DisplayText.prototype,"visibleString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],DisplayText.prototype,"bmpString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],DisplayText.prototype,"utf8String",void 0);DisplayText=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DisplayText);var NoticeReference=function(){function e(e){if(e===void 0){e={}}this.organization=new DisplayText;this.noticeNumbers=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DisplayText})],NoticeReference.prototype,"organization",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,repeated:"sequence"})],NoticeReference.prototype,"noticeNumbers",void 0);var UserNotice=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:NoticeReference,optional:true})],UserNotice.prototype,"noticeRef",void 0);__decorate$1([AsnProp({type:DisplayText,optional:true})],UserNotice.prototype,"explicitText",void 0);var Qualifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],Qualifier.prototype,"cPSuri",void 0);__decorate$1([AsnProp({type:UserNotice})],Qualifier.prototype,"userNotice",void 0);Qualifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Qualifier);var PolicyQualifierInfo=function(){function e(e){if(e===void 0){e={}}this.policyQualifierId="";this.qualifier=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyQualifierInfo.prototype,"policyQualifierId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],PolicyQualifierInfo.prototype,"qualifier",void 0);var PolicyInformation=function(){function e(e){if(e===void 0){e={}}this.policyIdentifier="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyInformation.prototype,"policyIdentifier",void 0);__decorate$1([AsnProp({type:PolicyQualifierInfo,repeated:"sequence",optional:true})],PolicyInformation.prototype,"policyQualifiers",void 0);var CertificatePolicies=CertificatePolicies_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertificatePolicies_1.prototype);return r}return t}(AsnArray);CertificatePolicies=CertificatePolicies_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:PolicyInformation})],CertificatePolicies);var id_ce_cRLNumber="".concat(id_ce,".20");var CRLNumber=function(){function e(e){if(e===void 0){e=0}this.value=e}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],CRLNumber.prototype,"value",void 0);CRLNumber=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CRLNumber);var id_ce_deltaCRLIndicator="".concat(id_ce,".27");var BaseCRLNumber=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(CRLNumber);BaseCRLNumber=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],BaseCRLNumber);var CRLDistributionPoints_1;var id_ce_cRLDistributionPoints="".concat(id_ce,".31");var ReasonFlags;(function(e){e[e["unused"]=1]="unused";e[e["keyCompromise"]=2]="keyCompromise";e[e["cACompromise"]=4]="cACompromise";e[e["affiliationChanged"]=8]="affiliationChanged";e[e["superseded"]=16]="superseded";e[e["cessationOfOperation"]=32]="cessationOfOperation";e[e["certificateHold"]=64]="certificateHold";e[e["privilegeWithdrawn"]=128]="privilegeWithdrawn";e[e["aACompromise"]=256]="aACompromise"})(ReasonFlags||(ReasonFlags={}));var Reason=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.toJSON=function(){var e=[];var t=this.toNumber();if(t&ReasonFlags.aACompromise){e.push("aACompromise")}if(t&ReasonFlags.affiliationChanged){e.push("affiliationChanged")}if(t&ReasonFlags.cACompromise){e.push("cACompromise")}if(t&ReasonFlags.certificateHold){e.push("certificateHold")}if(t&ReasonFlags.cessationOfOperation){e.push("cessationOfOperation")}if(t&ReasonFlags.keyCompromise){e.push("keyCompromise")}if(t&ReasonFlags.privilegeWithdrawn){e.push("privilegeWithdrawn")}if(t&ReasonFlags.superseded){e.push("superseded")}if(t&ReasonFlags.unused){e.push("unused")}return e};t.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return t}(BitString);var DistributionPointName=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0,repeated:"sequence",implicit:true})],DistributionPointName.prototype,"fullName",void 0);__decorate$1([AsnProp({type:RelativeDistinguishedName,context:1,implicit:true})],DistributionPointName.prototype,"nameRelativeToCRLIssuer",void 0);DistributionPointName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DistributionPointName);var DistributionPoint=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DistributionPointName,context:0,optional:true})],DistributionPoint.prototype,"distributionPoint",void 0);__decorate$1([AsnProp({type:Reason,context:1,optional:true,implicit:true})],DistributionPoint.prototype,"reasons",void 0);__decorate$1([AsnProp({type:GeneralName,context:2,optional:true,repeated:"sequence",implicit:true})],DistributionPoint.prototype,"cRLIssuer",void 0);var CRLDistributionPoints=CRLDistributionPoints_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CRLDistributionPoints_1.prototype);return r}return t}(AsnArray);CRLDistributionPoints=CRLDistributionPoints_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:DistributionPoint})],CRLDistributionPoints);var FreshestCRL_1;var FreshestCRL=FreshestCRL_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,FreshestCRL_1.prototype);return r}return t}(CRLDistributionPoints);FreshestCRL=FreshestCRL_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:DistributionPoint})],FreshestCRL);var id_ce_issuingDistributionPoint="".concat(id_ce,".28");var IssuingDistributionPoint=function(){function e(t){if(t===void 0){t={}}this.onlyContainsUserCerts=e.ONLY;this.onlyContainsCACerts=e.ONLY;this.indirectCRL=e.ONLY;this.onlyContainsAttributeCerts=e.ONLY;Object.assign(this,t)}return e}();IssuingDistributionPoint.ONLY=false;__decorate$1([AsnProp({type:DistributionPointName,context:0,optional:true})],IssuingDistributionPoint.prototype,"distributionPoint",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:1,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"onlyContainsUserCerts",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:2,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"onlyContainsCACerts",void 0);__decorate$1([AsnProp({type:Reason,context:3,optional:true,implicit:true})],IssuingDistributionPoint.prototype,"onlySomeReasons",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:4,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"indirectCRL",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:5,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"onlyContainsAttributeCerts",void 0);var id_ce_cRLReasons="".concat(id_ce,".21");var CRLReasons;(function(e){e[e["unspecified"]=0]="unspecified";e[e["keyCompromise"]=1]="keyCompromise";e[e["cACompromise"]=2]="cACompromise";e[e["affiliationChanged"]=3]="affiliationChanged";e[e["superseded"]=4]="superseded";e[e["cessationOfOperation"]=5]="cessationOfOperation";e[e["certificateHold"]=6]="certificateHold";e[e["removeFromCRL"]=8]="removeFromCRL";e[e["privilegeWithdrawn"]=9]="privilegeWithdrawn";e[e["aACompromise"]=10]="aACompromise"})(CRLReasons||(CRLReasons={}));var CRLReason=function(){function e(e){if(e===void 0){e=CRLReasons.unspecified}this.reason=CRLReasons.unspecified;this.reason=e}e.prototype.toJSON=function(){return CRLReasons[this.reason]};e.prototype.toString=function(){return this.toJSON()};return e}();__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],CRLReason.prototype,"reason",void 0);CRLReason=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CRLReason);var ExtendedKeyUsage_1;var id_ce_extKeyUsage="".concat(id_ce,".37");var ExtendedKeyUsage=ExtendedKeyUsage_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ExtendedKeyUsage_1.prototype);return r}return t}(AsnArray);ExtendedKeyUsage=ExtendedKeyUsage_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.ObjectIdentifier})],ExtendedKeyUsage);var id_ce_inhibitAnyPolicy="".concat(id_ce,".54");var InhibitAnyPolicy=function(){function e(e){if(e===void 0){e=new ArrayBuffer(0)}this.value=e}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],InhibitAnyPolicy.prototype,"value",void 0);InhibitAnyPolicy=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],InhibitAnyPolicy);var id_ce_invalidityDate="".concat(id_ce,".24");var InvalidityDate=function(){function e(e){this.value=new Date;if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],InvalidityDate.prototype,"value",void 0);InvalidityDate=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],InvalidityDate);var IssueAlternativeName_1;var id_ce_issuerAltName="".concat(id_ce,".18");var IssueAlternativeName=IssueAlternativeName_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,IssueAlternativeName_1.prototype);return r}return t}(GeneralNames);IssueAlternativeName=IssueAlternativeName_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],IssueAlternativeName);var id_ce_keyUsage="".concat(id_ce,".15");var KeyUsageFlags;(function(e){e[e["digitalSignature"]=1]="digitalSignature";e[e["nonRepudiation"]=2]="nonRepudiation";e[e["keyEncipherment"]=4]="keyEncipherment";e[e["dataEncipherment"]=8]="dataEncipherment";e[e["keyAgreement"]=16]="keyAgreement";e[e["keyCertSign"]=32]="keyCertSign";e[e["cRLSign"]=64]="cRLSign";e[e["encipherOnly"]=128]="encipherOnly";e[e["decipherOnly"]=256]="decipherOnly"})(KeyUsageFlags||(KeyUsageFlags={}));var KeyUsage=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.toJSON=function(){var e=this.toNumber();var t=[];if(e&KeyUsageFlags.cRLSign){t.push("crlSign")}if(e&KeyUsageFlags.dataEncipherment){t.push("dataEncipherment")}if(e&KeyUsageFlags.decipherOnly){t.push("decipherOnly")}if(e&KeyUsageFlags.digitalSignature){t.push("digitalSignature")}if(e&KeyUsageFlags.encipherOnly){t.push("encipherOnly")}if(e&KeyUsageFlags.keyAgreement){t.push("keyAgreement")}if(e&KeyUsageFlags.keyCertSign){t.push("keyCertSign")}if(e&KeyUsageFlags.keyEncipherment){t.push("keyEncipherment")}if(e&KeyUsageFlags.nonRepudiation){t.push("nonRepudiation")}return t};t.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return t}(BitString);var GeneralSubtrees_1;var id_ce_nameConstraints="".concat(id_ce,".30");var GeneralSubtree=function(){function e(e){if(e===void 0){e={}}this.base=new GeneralName;this.minimum=0;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName})],GeneralSubtree.prototype,"base",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:0,defaultValue:0,implicit:true})],GeneralSubtree.prototype,"minimum",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:1,optional:true,implicit:true})],GeneralSubtree.prototype,"maximum",void 0);var GeneralSubtrees=GeneralSubtrees_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,GeneralSubtrees_1.prototype);return r}return t}(AsnArray);GeneralSubtrees=GeneralSubtrees_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:GeneralSubtree})],GeneralSubtrees);var NameConstraints=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralSubtrees,context:0,optional:true,implicit:true})],NameConstraints.prototype,"permittedSubtrees",void 0);__decorate$1([AsnProp({type:GeneralSubtrees,context:1,optional:true,implicit:true})],NameConstraints.prototype,"excludedSubtrees",void 0);var id_ce_policyConstraints="".concat(id_ce,".36");var PolicyConstraints=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:0,implicit:true,optional:true,converter:AsnIntegerArrayBufferConverter})],PolicyConstraints.prototype,"requireExplicitPolicy",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:1,implicit:true,optional:true,converter:AsnIntegerArrayBufferConverter})],PolicyConstraints.prototype,"inhibitPolicyMapping",void 0);var PolicyMappings_1;var id_ce_policyMappings="".concat(id_ce,".33");var PolicyMapping=function(){function e(e){if(e===void 0){e={}}this.issuerDomainPolicy="";this.subjectDomainPolicy="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyMapping.prototype,"issuerDomainPolicy",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyMapping.prototype,"subjectDomainPolicy",void 0);var PolicyMappings=PolicyMappings_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,PolicyMappings_1.prototype);return r}return t}(AsnArray);PolicyMappings=PolicyMappings_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:PolicyMapping})],PolicyMappings);var SubjectAlternativeName_1;var id_ce_subjectAltName="".concat(id_ce,".17");var SubjectAlternativeName=SubjectAlternativeName_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SubjectAlternativeName_1.prototype);return r}return t}(GeneralNames);SubjectAlternativeName=SubjectAlternativeName_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SubjectAlternativeName);var Attribute$1=function(){function e(e){if(e===void 0){e={}}this.type="";this.values=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Attribute$1.prototype,"type",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,repeated:"set"})],Attribute$1.prototype,"values",void 0);var SubjectDirectoryAttributes_1;var id_ce_subjectDirectoryAttributes="".concat(id_ce,".9");var SubjectDirectoryAttributes=SubjectDirectoryAttributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SubjectDirectoryAttributes_1.prototype);return r}return t}(AsnArray);SubjectDirectoryAttributes=SubjectDirectoryAttributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Attribute$1})],SubjectDirectoryAttributes);var id_ce_subjectKeyIdentifier="".concat(id_ce,".14");var SubjectKeyIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(KeyIdentifier);var id_ce_privateKeyUsagePeriod="".concat(id_ce,".16");var PrivateKeyUsagePeriod=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,context:0,implicit:true,optional:true})],PrivateKeyUsagePeriod.prototype,"notBefore",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,context:1,implicit:true,optional:true})],PrivateKeyUsagePeriod.prototype,"notAfter",void 0);var id_entrust_entrustVersInfo="1.2.840.113533.7.65.0";var EntrustInfoFlags;(function(e){e[e["keyUpdateAllowed"]=1]="keyUpdateAllowed";e[e["newExtensions"]=2]="newExtensions";e[e["pKIXCertificate"]=4]="pKIXCertificate"})(EntrustInfoFlags||(EntrustInfoFlags={}));var EntrustInfo=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.toJSON=function(){var e=[];var t=this.toNumber();if(t&EntrustInfoFlags.pKIXCertificate){e.push("pKIXCertificate")}if(t&EntrustInfoFlags.newExtensions){e.push("newExtensions")}if(t&EntrustInfoFlags.keyUpdateAllowed){e.push("keyUpdateAllowed")}return e};t.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return t}(BitString);var EntrustVersionInfo=function(){function e(e){if(e===void 0){e={}}this.entrustVers="";this.entrustInfoFlags=new EntrustInfo;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralString})],EntrustVersionInfo.prototype,"entrustVers",void 0);__decorate$1([AsnProp({type:EntrustInfo})],EntrustVersionInfo.prototype,"entrustInfoFlags",void 0);var SubjectInfoAccessSyntax_1;var id_pe_subjectInfoAccess="".concat(id_pe$1,".11");var SubjectInfoAccessSyntax=SubjectInfoAccessSyntax_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SubjectInfoAccessSyntax_1.prototype);return r}return t}(AsnArray);SubjectInfoAccessSyntax=SubjectInfoAccessSyntax_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AccessDescription})],SubjectInfoAccessSyntax);var AlgorithmIdentifier=function(){function e(e){if(e===void 0){e={}}this.algorithm="";Object.assign(this,e)}e.prototype.isEqual=function(t){return t instanceof e&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&buildExports.isEqual(t.parameters,this.parameters)||t.parameters===this.parameters)};return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],AlgorithmIdentifier.prototype,"algorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,optional:true})],AlgorithmIdentifier.prototype,"parameters",void 0);var SubjectPublicKeyInfo=function(){function e(e){if(e===void 0){e={}}this.algorithm=new AlgorithmIdentifier;this.subjectPublicKey=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],SubjectPublicKeyInfo.prototype,"algorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],SubjectPublicKeyInfo.prototype,"subjectPublicKey",void 0);var Time=function(){function e(e){if(e){if(typeof e==="string"||typeof e==="number"||e instanceof Date){var t=new Date(e);if(t.getUTCFullYear()>2049){this.generalTime=t}else{this.utcTime=t}}else{Object.assign(this,e)}}}e.prototype.getTime=function(){var e=this.utcTime||this.generalTime;if(!e){throw new Error("Cannot get time from CHOICE object")}return e};return e}();__decorate$1([AsnProp({type:AsnPropTypes.UTCTime})],Time.prototype,"utcTime",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],Time.prototype,"generalTime",void 0);Time=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Time);var Validity=function(){function e(e){this.notBefore=new Time(new Date);this.notAfter=new Time(new Date);if(e){this.notBefore=new Time(e.notBefore);this.notAfter=new Time(e.notAfter)}}return e}();__decorate$1([AsnProp({type:Time})],Validity.prototype,"notBefore",void 0);__decorate$1([AsnProp({type:Time})],Validity.prototype,"notAfter",void 0);var Extensions_1;var Extension$1=function(){function e(t){if(t===void 0){t={}}this.extnID="";this.critical=e.CRITICAL;this.extnValue=new OctetString;Object.assign(this,t)}return e}();Extension$1.CRITICAL=false;__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Extension$1.prototype,"extnID",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,defaultValue:Extension$1.CRITICAL})],Extension$1.prototype,"critical",void 0);__decorate$1([AsnProp({type:OctetString})],Extension$1.prototype,"extnValue",void 0);var Extensions=Extensions_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Extensions_1.prototype);return r}return t}(AsnArray);Extensions=Extensions_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Extension$1})],Extensions);var Version$4;(function(e){e[e["v1"]=0]="v1";e[e["v2"]=1]="v2";e[e["v3"]=2]="v3"})(Version$4||(Version$4={}));var TBSCertificate=function(){function e(e){if(e===void 0){e={}}this.version=Version$4.v1;this.serialNumber=new ArrayBuffer(0);this.signature=new AlgorithmIdentifier;this.issuer=new Name$1;this.validity=new Validity;this.subject=new Name$1;this.subjectPublicKeyInfo=new SubjectPublicKeyInfo;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:0,defaultValue:Version$4.v1})],TBSCertificate.prototype,"version",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],TBSCertificate.prototype,"serialNumber",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],TBSCertificate.prototype,"signature",void 0);__decorate$1([AsnProp({type:Name$1})],TBSCertificate.prototype,"issuer",void 0);__decorate$1([AsnProp({type:Validity})],TBSCertificate.prototype,"validity",void 0);__decorate$1([AsnProp({type:Name$1})],TBSCertificate.prototype,"subject",void 0);__decorate$1([AsnProp({type:SubjectPublicKeyInfo})],TBSCertificate.prototype,"subjectPublicKeyInfo",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:1,implicit:true,optional:true})],TBSCertificate.prototype,"issuerUniqueID",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:2,implicit:true,optional:true})],TBSCertificate.prototype,"subjectUniqueID",void 0);__decorate$1([AsnProp({type:Extensions,context:3,optional:true})],TBSCertificate.prototype,"extensions",void 0);var Certificate=function(){function e(e){if(e===void 0){e={}}this.tbsCertificate=new TBSCertificate;this.signatureAlgorithm=new AlgorithmIdentifier;this.signatureValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:TBSCertificate})],Certificate.prototype,"tbsCertificate",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],Certificate.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],Certificate.prototype,"signatureValue",void 0);var RevokedCertificate=function(){function e(e){if(e===void 0){e={}}this.userCertificate=new ArrayBuffer(0);this.revocationDate=new Time;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RevokedCertificate.prototype,"userCertificate",void 0);__decorate$1([AsnProp({type:Time})],RevokedCertificate.prototype,"revocationDate",void 0);__decorate$1([AsnProp({type:Extension$1,optional:true,repeated:"sequence"})],RevokedCertificate.prototype,"crlEntryExtensions",void 0);var TBSCertList=function(){function e(e){if(e===void 0){e={}}this.signature=new AlgorithmIdentifier;this.issuer=new Name$1;this.thisUpdate=new Time;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],TBSCertList.prototype,"version",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],TBSCertList.prototype,"signature",void 0);__decorate$1([AsnProp({type:Name$1})],TBSCertList.prototype,"issuer",void 0);__decorate$1([AsnProp({type:Time})],TBSCertList.prototype,"thisUpdate",void 0);__decorate$1([AsnProp({type:Time,optional:true})],TBSCertList.prototype,"nextUpdate",void 0);__decorate$1([AsnProp({type:RevokedCertificate,repeated:"sequence",optional:true})],TBSCertList.prototype,"revokedCertificates",void 0);__decorate$1([AsnProp({type:Extension$1,optional:true,context:0,repeated:"sequence"})],TBSCertList.prototype,"crlExtensions",void 0);var CertificateList=function(){function e(e){if(e===void 0){e={}}this.tbsCertList=new TBSCertList;this.signatureAlgorithm=new AlgorithmIdentifier;this.signature=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:TBSCertList})],CertificateList.prototype,"tbsCertList",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],CertificateList.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],CertificateList.prototype,"signature",void 0);var id_ecPublicKey="1.2.840.10045.2.1";var id_ecdsaWithSHA1="1.2.840.10045.4.1";var id_ecdsaWithSHA224="1.2.840.10045.4.3.1";var id_ecdsaWithSHA256="1.2.840.10045.4.3.2";var id_ecdsaWithSHA384="1.2.840.10045.4.3.3";var id_ecdsaWithSHA512="1.2.840.10045.4.3.4";function create$1(e){return new AlgorithmIdentifier({algorithm:e})}create$1(id_ecdsaWithSHA1);create$1(id_ecdsaWithSHA224);create$1(id_ecdsaWithSHA256);create$1(id_ecdsaWithSHA384);create$1(id_ecdsaWithSHA512);var FieldID=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],FieldID.prototype,"fieldType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],FieldID.prototype,"parameters",void 0);FieldID=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],FieldID);var ECPoint=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var Curve=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.OctetString})],Curve.prototype,"a",void 0);__decorate$1([AsnProp({type:AsnPropTypes.OctetString})],Curve.prototype,"b",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,optional:true})],Curve.prototype,"seed",void 0);Curve=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],Curve);var ECPVer;(function(e){e[e["ecpVer1"]=1]="ecpVer1"})(ECPVer||(ECPVer={}));var SpecifiedECDomain=function(){function e(e){if(e===void 0){e={}}this.version=ECPVer.ecpVer1;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SpecifiedECDomain.prototype,"version",void 0);__decorate$1([AsnProp({type:FieldID})],SpecifiedECDomain.prototype,"fieldID",void 0);__decorate$1([AsnProp({type:Curve})],SpecifiedECDomain.prototype,"curve",void 0);__decorate$1([AsnProp({type:ECPoint})],SpecifiedECDomain.prototype,"base",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],SpecifiedECDomain.prototype,"order",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],SpecifiedECDomain.prototype,"cofactor",void 0);SpecifiedECDomain=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SpecifiedECDomain);var ECParameters=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],ECParameters.prototype,"namedCurve",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Null})],ECParameters.prototype,"implicitCurve",void 0);__decorate$1([AsnProp({type:SpecifiedECDomain})],ECParameters.prototype,"specifiedCurve",void 0);ECParameters=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],ECParameters);var ECPrivateKey=function(){function e(e){if(e===void 0){e={}}this.version=1;this.privateKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ECPrivateKey.prototype,"version",void 0);__decorate$1([AsnProp({type:OctetString})],ECPrivateKey.prototype,"privateKey",void 0);__decorate$1([AsnProp({type:ECParameters,context:0,optional:true})],ECPrivateKey.prototype,"parameters",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:1,optional:true})],ECPrivateKey.prototype,"publicKey",void 0);var ECDSASigValue=function(){function e(e){if(e===void 0){e={}}this.r=new ArrayBuffer(0);this.s=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],ECDSASigValue.prototype,"r",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],ECDSASigValue.prototype,"s",void 0);var id_pkcs_1="1.2.840.113549.1.1";var id_rsaEncryption="".concat(id_pkcs_1,".1");var id_RSAES_OAEP="".concat(id_pkcs_1,".7");var id_pSpecified="".concat(id_pkcs_1,".9");var id_RSASSA_PSS="".concat(id_pkcs_1,".10");var id_md2WithRSAEncryption="".concat(id_pkcs_1,".2");var id_md5WithRSAEncryption="".concat(id_pkcs_1,".4");var id_sha1WithRSAEncryption="".concat(id_pkcs_1,".5");var id_sha384WithRSAEncryption="".concat(id_pkcs_1,".12");var id_sha512WithRSAEncryption="".concat(id_pkcs_1,".13");var id_sha512_224WithRSAEncryption="".concat(id_pkcs_1,".15");var id_sha512_256WithRSAEncryption="".concat(id_pkcs_1,".16");var id_sha1="1.3.14.3.2.26";var id_sha224="2.16.840.1.101.3.4.2.4";var id_sha256="2.16.840.1.101.3.4.2.1";var id_sha384="2.16.840.1.101.3.4.2.2";var id_sha512="2.16.840.1.101.3.4.2.3";var id_sha512_224="2.16.840.1.101.3.4.2.5";var id_sha512_256="2.16.840.1.101.3.4.2.6";var id_md2="1.2.840.113549.2.2";var id_md5="1.2.840.113549.2.5";var id_mgf1="".concat(id_pkcs_1,".8");function create(e){return new AlgorithmIdentifier({algorithm:e,parameters:null})}create(id_md2);create(id_md5);var sha1=create(id_sha1);create(id_sha224);create(id_sha256);create(id_sha384);create(id_sha512);create(id_sha512_224);create(id_sha512_256);var mgf1SHA1=new AlgorithmIdentifier({algorithm:id_mgf1,parameters:AsnConvert.serialize(sha1)});var pSpecifiedEmpty=new AlgorithmIdentifier({algorithm:id_pSpecified,parameters:AsnConvert.serialize(AsnOctetStringConverter.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});create(id_rsaEncryption);create(id_md2WithRSAEncryption);create(id_md5WithRSAEncryption);create(id_sha1WithRSAEncryption);create(id_sha512_224WithRSAEncryption);create(id_sha512_256WithRSAEncryption);create(id_sha384WithRSAEncryption);create(id_sha512WithRSAEncryption);create(id_sha512_224WithRSAEncryption);create(id_sha512_256WithRSAEncryption);var RsaEsOaepParams=function(){function e(e){if(e===void 0){e={}}this.hashAlgorithm=new AlgorithmIdentifier(sha1);this.maskGenAlgorithm=new AlgorithmIdentifier({algorithm:id_mgf1,parameters:AsnConvert.serialize(sha1)});this.pSourceAlgorithm=new AlgorithmIdentifier(pSpecifiedEmpty);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier,context:0,defaultValue:sha1})],RsaEsOaepParams.prototype,"hashAlgorithm",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier,context:1,defaultValue:mgf1SHA1})],RsaEsOaepParams.prototype,"maskGenAlgorithm",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier,context:2,defaultValue:pSpecifiedEmpty})],RsaEsOaepParams.prototype,"pSourceAlgorithm",void 0);new AlgorithmIdentifier({algorithm:id_RSAES_OAEP,parameters:AsnConvert.serialize(new RsaEsOaepParams)});var RsaSaPssParams=function(){function e(e){if(e===void 0){e={}}this.hashAlgorithm=new AlgorithmIdentifier(sha1);this.maskGenAlgorithm=new AlgorithmIdentifier({algorithm:id_mgf1,parameters:AsnConvert.serialize(sha1)});this.saltLength=20;this.trailerField=1;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier,context:0,defaultValue:sha1})],RsaSaPssParams.prototype,"hashAlgorithm",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier,context:1,defaultValue:mgf1SHA1})],RsaSaPssParams.prototype,"maskGenAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:2,defaultValue:20})],RsaSaPssParams.prototype,"saltLength",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:3,defaultValue:1})],RsaSaPssParams.prototype,"trailerField",void 0);new AlgorithmIdentifier({algorithm:id_RSASSA_PSS,parameters:AsnConvert.serialize(new RsaSaPssParams)});var DigestInfo=function(){function e(e){if(e===void 0){e={}}this.digestAlgorithm=new AlgorithmIdentifier;this.digest=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],DigestInfo.prototype,"digestAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],DigestInfo.prototype,"digest",void 0);var OtherPrimeInfos_1;var OtherPrimeInfo=function(){function e(e){if(e===void 0){e={}}this.prime=new ArrayBuffer(0);this.exponent=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],OtherPrimeInfo.prototype,"prime",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],OtherPrimeInfo.prototype,"exponent",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],OtherPrimeInfo.prototype,"coefficient",void 0);var OtherPrimeInfos=OtherPrimeInfos_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,OtherPrimeInfos_1.prototype);return r}return t}(AsnArray);OtherPrimeInfos=OtherPrimeInfos_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:OtherPrimeInfo})],OtherPrimeInfos);var RSAPrivateKey=function(){function e(e){if(e===void 0){e={}}this.version=0;this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);this.privateExponent=new ArrayBuffer(0);this.prime1=new ArrayBuffer(0);this.prime2=new ArrayBuffer(0);this.exponent1=new ArrayBuffer(0);this.exponent2=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],RSAPrivateKey.prototype,"version",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"modulus",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"publicExponent",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"privateExponent",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"prime1",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"prime2",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"exponent1",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"exponent2",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"coefficient",void 0);__decorate$1([AsnProp({type:OtherPrimeInfos,optional:true})],RSAPrivateKey.prototype,"otherPrimeInfos",void 0);var RSAPublicKey=function(){function e(e){if(e===void 0){e={}}this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPublicKey.prototype,"modulus",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPublicKey.prototype,"publicExponent",void 0);var CompositeParams_1,CompositeSignatureValue_1;var id_alg_composite="1.3.6.1.4.1.18227.2.1";var CompositeParams=CompositeParams_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositeParams_1.prototype);return r}return t}(AsnArray);CompositeParams=CompositeParams_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AlgorithmIdentifier})],CompositeParams);var CompositeSignatureValue=CompositeSignatureValue_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositeSignatureValue_1.prototype);return r}return t}(AsnArray);CompositeSignatureValue=CompositeSignatureValue_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.BitString})],CompositeSignatureValue);var EncryptedData=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var EncryptedPrivateKeyInfo$1=function(){function e(e){if(e===void 0){e={}}this.encryptionAlgorithm=new AlgorithmIdentifier;this.encryptedData=new EncryptedData;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],EncryptedPrivateKeyInfo$1.prototype,"encryptionAlgorithm",void 0);__decorate$1([AsnProp({type:EncryptedData})],EncryptedPrivateKeyInfo$1.prototype,"encryptedData",void 0);var Attributes_1$1;var Version$3;(function(e){e[e["v1"]=0]="v1"})(Version$3||(Version$3={}));var PrivateKey=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var Attributes$1=Attributes_1$1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Attributes_1$1.prototype);return r}return t}(AsnArray);Attributes$1=Attributes_1$1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Attribute$1})],Attributes$1);var PrivateKeyInfo$1=function(){function e(e){if(e===void 0){e={}}this.version=Version$3.v1;this.privateKeyAlgorithm=new AlgorithmIdentifier;this.privateKey=new PrivateKey;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],PrivateKeyInfo$1.prototype,"version",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],PrivateKeyInfo$1.prototype,"privateKeyAlgorithm",void 0);__decorate$1([AsnProp({type:PrivateKey})],PrivateKeyInfo$1.prototype,"privateKey",void 0);__decorate$1([AsnProp({type:Attributes$1,implicit:true,context:0,optional:true})],PrivateKeyInfo$1.prototype,"attributes",void 0);var AsymmetricKeyPackage_1;var Version$2;(function(e){e[e["v1"]=0]="v1";e[e["v2"]=1]="v2"})(Version$2||(Version$2={}));var PrivateKeyAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);PrivateKeyAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],PrivateKeyAlgorithmIdentifier);var OneAsymmetricKey=function(){function e(){this.version=Version$2.v1;this.privateKeyAlgorithm=new AlgorithmIdentifier;this.privateKey=new ArrayBuffer(0)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],OneAsymmetricKey.prototype,"version",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],OneAsymmetricKey.prototype,"privateKeyAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.OctetString})],OneAsymmetricKey.prototype,"privateKey",void 0);__decorate$1([AsnProp({type:Attributes$1,context:0,implicit:true,optional:true})],OneAsymmetricKey.prototype,"attributes",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:1,implicit:true,optional:true})],OneAsymmetricKey.prototype,"publicKey",void 0);OneAsymmetricKey=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],OneAsymmetricKey);var PrivateKeyInfo=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OneAsymmetricKey);PrivateKeyInfo=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],PrivateKeyInfo);var AsymmetricKeyPackage=AsymmetricKeyPackage_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AsymmetricKeyPackage_1.prototype);return r}return t}(AsnArray);AsymmetricKeyPackage=AsymmetricKeyPackage_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:OneAsymmetricKey})],AsymmetricKeyPackage);var CompositePublicKey_1,CompositePrivateKey_1;var id_composite_key="2.16.840.1.114027.80.4.1";var CompositeAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);CompositeAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CompositeAlgorithmIdentifier);var CompositePublicKey=CompositePublicKey_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositePublicKey_1.prototype);return r}return t}(AsnArray);CompositePublicKey=CompositePublicKey_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:SubjectPublicKeyInfo})],CompositePublicKey);var CompositePrivateKey=CompositePrivateKey_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositePrivateKey_1.prototype);return r}return t}(AsnArray);CompositePrivateKey=CompositePrivateKey_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:OneAsymmetricKey})],CompositePrivateKey);var dayjs_min$1={exports:{}};var dayjs_min=dayjs_min$1.exports;var hasRequiredDayjs_min;function requireDayjs_min(){if(hasRequiredDayjs_min)return dayjs_min$1.exports;hasRequiredDayjs_min=1;(function(e,t){!function(t,r){e.exports=r()}(dayjs_min,(function(){var e=1e3,t=6e4,r=36e5,i="millisecond",n="second",o="minute",a="hour",s="day",c="week",u="month",p="quarter",f="year",d="date",l="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|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,h={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(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},A=function(e,t,r){var i=String(e);return!i||i.length>=t?e:""+Array(t+1-i.length).join(r)+e},_={s:A,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),i=Math.floor(r/60),n=r%60;return(t<=0?"+":"-")+A(i,2,"0")+":"+A(n,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var i=12*(r.year()-t.year())+(r.month()-t.month()),n=t.clone().add(i,u),o=r-n<0,a=t.clone().add(i+(o?-1:1),u);return+(-(i+(r-n)/(o?n-a:a-n))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:f,w:c,d:s,D:d,h:a,m:o,s:n,ms:i,Q:p}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},S="en",g={};g[S]=h;var m="$isDayjsObject",C=function(e){return e instanceof I||!(!e||!e[m])},P=function e(t,r,i){var n;if(!t)return S;if("string"==typeof t){var o=t.toLowerCase();g[o]&&(n=o),r&&(g[o]=r,n=o);var a=t.split("-");if(!n&&a.length>1)return e(a[0])}else{var s=t.name;g[s]=t,n=s}return!i&&n&&(S=n),n||!i&&S},T=function(e,t){if(C(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new I(r)},E=_;E.l=P,E.i=C,E.w=function(e,t){return T(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var I=function(){function h(e){this.$L=P(e.locale,null,true),this.parse(e),this.$x=this.$x||e.x||{},this[m]=true}var A=h.prototype;return A.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var i=t.match(y);if(i){var n=i[2]-1||0,o=(i[7]||"0").substring(0,3);return r?new Date(Date.UTC(i[1],n,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)):new Date(i[1],n,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)}}return new Date(t)}(e),this.init()},A.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},A.$utils=function(){return E},A.isValid=function(){return!(this.$d.toString()===l)},A.isSame=function(e,t){var r=T(e);return this.startOf(t)<=r&&r<=this.endOf(t)},A.isAfter=function(e,t){return T(e)<this.startOf(t)},A.isBefore=function(e,t){return this.endOf(t)<T(e)},A.$g=function(e,t,r){return E.u(e)?this[t]:this.set(r,e)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function(e,t){var r=this,i=!!E.u(t)||t,p=E.p(e),l=function(e,t){var n=E.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return i?n:n.endOf(s)},y=function(e,t){return E.w(r.toDate()[e].apply(r.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},v=this.$W,h=this.$M,A=this.$D,_="set"+(this.$u?"UTC":"");switch(p){case f:return i?l(1,0):l(31,11);case u:return i?l(1,h):l(0,h+1);case c:var S=this.$locale().weekStart||0,g=(v<S?v+7:v)-S;return l(i?A-g:A+(6-g),h);case s:case d:return y(_+"Hours",0);case a:return y(_+"Minutes",1);case o:return y(_+"Seconds",2);case n:return y(_+"Milliseconds",3);default:return this.clone()}},A.endOf=function(e){return this.startOf(e,false)},A.$set=function(e,t){var r,c=E.p(e),p="set"+(this.$u?"UTC":""),l=(r={},r[s]=p+"Date",r[d]=p+"Date",r[u]=p+"Month",r[f]=p+"FullYear",r[a]=p+"Hours",r[o]=p+"Minutes",r[n]=p+"Seconds",r[i]=p+"Milliseconds",r)[c],y=c===s?this.$D+(t-this.$W):t;if(c===u||c===f){var v=this.clone().set(d,1);v.$d[l](y),v.init(),this.$d=v.set(d,Math.min(this.$D,v.daysInMonth())).$d}else l&&this.$d[l](y);return this.init(),this},A.set=function(e,t){return this.clone().$set(e,t)},A.get=function(e){return this[E.p(e)]()},A.add=function(i,p){var d,l=this;i=Number(i);var y=E.p(p),v=function(e){var t=T(l);return E.w(t.date(t.date()+Math.round(e*i)),l)};if(y===u)return this.set(u,this.$M+i);if(y===f)return this.set(f,this.$y+i);if(y===s)return v(1);if(y===c)return v(7);var h=(d={},d[o]=t,d[a]=r,d[n]=e,d)[y]||1,A=this.$d.getTime()+i*h;return E.w(A,this)},A.subtract=function(e,t){return this.add(-1*e,t)},A.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||l;var i=e||"YYYY-MM-DDTHH:mm:ssZ",n=E.z(this),o=this.$H,a=this.$m,s=this.$M,c=r.weekdays,u=r.months,p=r.meridiem,f=function(e,r,n,o){return e&&(e[r]||e(t,i))||n[r].slice(0,o)},d=function(e){return E.s(o%12||12,e,"0")},y=p||function(e,t,r){var i=e<12?"AM":"PM";return r?i.toLowerCase():i};return i.replace(v,(function(e,i){return i||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return E.s(t.$y,4,"0");case"M":return s+1;case"MM":return E.s(s+1,2,"0");case"MMM":return f(r.monthsShort,s,u,3);case"MMMM":return f(u,s);case"D":return t.$D;case"DD":return E.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return f(r.weekdaysMin,t.$W,c,2);case"ddd":return f(r.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(o);case"HH":return E.s(o,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return y(o,a,true);case"A":return y(o,a,false);case"m":return String(a);case"mm":return E.s(a,2,"0");case"s":return String(t.$s);case"ss":return E.s(t.$s,2,"0");case"SSS":return E.s(t.$ms,3,"0");case"Z":return n}return null}(e)||n.replace(":","")}))},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function(i,d,l){var y,v=this,h=E.p(d),A=T(i),_=(A.utcOffset()-this.utcOffset())*t,S=this-A,g=function(){return E.m(v,A)};switch(h){case f:y=g()/12;break;case u:y=g();break;case p:y=g()/3;break;case c:y=(S-_)/6048e5;break;case s:y=(S-_)/864e5;break;case a:y=S/r;break;case o:y=S/t;break;case n:y=S/e;break;default:y=S}return l?y:E.a(y)},A.daysInMonth=function(){return this.endOf(u).$D},A.$locale=function(){return g[this.$L]},A.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),i=P(e,t,true);return i&&(r.$L=i),r},A.clone=function(){return E.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},h}(),b=I.prototype;return T.prototype=b,[["$ms",i],["$s",n],["$m",o],["$H",a],["$W",s],["$M",u],["$y",f],["$D",d]].forEach((function(e){b[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),T.extend=function(e,t){return e.$i||(e(t,I,T),e.$i=true),T},T.locale=P,T.isDayjs=C,T.unix=function(e){return T(1e3*e)},T.en=g[S],T.Ls=g,T.p={},T}))})(dayjs_min$1);return dayjs_min$1.exports}var dayjs_minExports=requireDayjs_min();var dayjs=getDefaultExportFromCjs(dayjs_minExports);var relativeTime$2={exports:{}};var relativeTime$1=relativeTime$2.exports;var hasRequiredRelativeTime;function requireRelativeTime(){if(hasRequiredRelativeTime)return relativeTime$2.exports;hasRequiredRelativeTime=1;(function(e,t){!function(t,r){e.exports=r()}(relativeTime$1,(function(){return function(e,t,r){e=e||{};var i=t.prototype,n={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 o(e,t,r,n){return i.fromToBase(e,t,r,n)}r.en.relativeTime=n,i.fromToBase=function(t,i,o,a,s){for(var c,u,p,f=o.$locale().relativeTime||n,d=e.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"}],l=d.length,y=0;y<l;y+=1){var v=d[y];v.d&&(c=a?r(t).diff(o,v.d,true):o.diff(t,v.d,true));var h=(e.rounding||Math.round)(Math.abs(c));if(p=c>0,h<=v.r||!v.r){h<=1&&y>0&&(v=d[y-1]);var A=f[v.l];s&&(h=s(""+h)),u="string"==typeof A?A.replace("%d",h):A(h,i,v.l,p);break}}if(i)return u;var _=p?f.future:f.past;return"function"==typeof _?_(u):_.replace("%s",u)},i.to=function(e,t){return o(e,t,this,true)},i.from=function(e,t){return o(e,t,this)};var a=function(e){return e.$u?r.utc():r()};i.toNow=function(e){return this.to(a(this),e)},i.fromNow=function(e){return this.from(a(this),e)}}}))})(relativeTime$2);return relativeTime$2.exports}var relativeTimeExports=requireRelativeTime();var relativeTime=getDefaultExportFromCjs(relativeTimeExports);
|
|
78
|
+
*/function assertBigInt(){if(typeof BigInt==="undefined"){throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}}function concat(e){var t=0;var r=0;for(var i=0;i<e.length;i++){var n=e[i];t+=n.byteLength}var o=new Uint8Array(t);for(var i=0;i<e.length;i++){var n=e[i];o.set(new Uint8Array(n),r);r+=n.byteLength}return o.buffer}function checkBufferParams(e,t,r,i){if(!(t instanceof Uint8Array)){e.error="Wrong parameter: inputBuffer must be 'Uint8Array'";return false}if(!t.byteLength){e.error="Wrong parameter: inputBuffer has zero length";return false}if(r<0){e.error="Wrong parameter: inputOffset less than zero";return false}if(i<0){e.error="Wrong parameter: inputLength less than zero";return false}if(t.byteLength-r-i<0){e.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return false}return true}var ViewWriter=function(){function e(){this.items=[]}e.prototype.write=function(e){this.items.push(e)};e.prototype.final=function(){return concat(this.items)};return e}();var powers2=[new Uint8Array([1])];var digitsString="0123456789";var NAME="name";var VALUE_HEX_VIEW="valueHexView";var IS_HEX_ONLY="isHexOnly";var ID_BLOCK="idBlock";var TAG_CLASS="tagClass";var TAG_NUMBER="tagNumber";var IS_CONSTRUCTED="isConstructed";var FROM_BER="fromBER";var TO_BER="toBER";var LOCAL="local";var EMPTY_STRING="";var EMPTY_BUFFER=new ArrayBuffer(0);var EMPTY_VIEW=new Uint8Array(0);var END_OF_CONTENT_NAME="EndOfContent";var OCTET_STRING_NAME="OCTET STRING";var BIT_STRING_NAME="BIT STRING";function HexBlock(e){var t;return t=function(e){__extends(t,e);function t(){var t=[];for(var r=0;r<arguments.length;r++){t[r]=arguments[r]}var i;var n=e.apply(this,t)||this;var o=t[0]||{};n.isHexOnly=(i=o.isHexOnly)!==null&&i!==void 0?i:false;n.valueHexView=o.valueHex?buildExports.BufferSourceConverter.toUint8Array(o.valueHex):EMPTY_VIEW;return n}Object.defineProperty(t.prototype,"valueHex",{get:function(){return this.valueHexView.slice().buffer},set:function(e){this.valueHexView=new Uint8Array(e)},enumerable:false,configurable:true});t.prototype.fromBER=function(e,t,r){var i=e instanceof ArrayBuffer?new Uint8Array(e):e;if(!checkBufferParams(this,i,t,r)){return-1}var n=t+r;this.valueHexView=i.subarray(t,n);if(!this.valueHexView.length){this.warnings.push("Zero buffer length");return t}this.blockLength=r;return n};t.prototype.toBER=function(e){if(e===void 0){e=false}if(!this.isHexOnly){this.error="Flag 'isHexOnly' is not set, abort";return EMPTY_BUFFER}if(e){return new ArrayBuffer(this.valueHexView.byteLength)}return this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{isHexOnly:this.isHexOnly,valueHex:buildExports.Convert.ToHex(this.valueHexView)})};return t}(e),t.NAME="hexBlock",t}var LocalBaseBlock=function(){function e(e){var t=e===void 0?{}:e,r=t.blockLength,i=r===void 0?0:r,n=t.error,o=n===void 0?EMPTY_STRING:n,a=t.warnings,s=a===void 0?[]:a,c=t.valueBeforeDecode,u=c===void 0?EMPTY_VIEW:c;this.blockLength=i;this.error=o;this.warnings=s;this.valueBeforeDecodeView=buildExports.BufferSourceConverter.toUint8Array(u)}e.blockName=function(){return this.NAME};Object.defineProperty(e.prototype,"valueBeforeDecode",{get:function(){return this.valueBeforeDecodeView.slice().buffer},set:function(e){this.valueBeforeDecodeView=new Uint8Array(e)},enumerable:false,configurable:true});e.prototype.toJSON=function(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:buildExports.Convert.ToHex(this.valueBeforeDecodeView)}};return e}();LocalBaseBlock.NAME="baseBlock";var ValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBER=function(e,t,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")};t.prototype.toBER=function(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")};return t}(LocalBaseBlock);ValueBlock.NAME="valueBlock";var LocalIdentificationBlock=function(e){__extends(t,e);function t(t){var r=t===void 0?{}:t,i=r.idBlock,n=i===void 0?{}:i;var o,a,s,c;var u=e.call(this)||this;if(n){u.isHexOnly=(o=n.isHexOnly)!==null&&o!==void 0?o:false;u.valueHexView=n.valueHex?buildExports.BufferSourceConverter.toUint8Array(n.valueHex):EMPTY_VIEW;u.tagClass=(a=n.tagClass)!==null&&a!==void 0?a:-1;u.tagNumber=(s=n.tagNumber)!==null&&s!==void 0?s:-1;u.isConstructed=(c=n.isConstructed)!==null&&c!==void 0?c:false}else{u.tagClass=-1;u.tagNumber=-1;u.isConstructed=false}return u}t.prototype.toBER=function(e){if(e===void 0){e=false}var t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:this.error="Unknown tag class";return EMPTY_BUFFER}if(this.isConstructed)t|=32;if(this.tagNumber<31&&!this.isHexOnly){var r=new Uint8Array(1);if(!e){var i=this.tagNumber;i&=31;t|=i;r[0]=t}return r.buffer}if(!this.isHexOnly){var n=utilToBase(this.tagNumber,7);var o=new Uint8Array(n);var a=n.byteLength;var s=new Uint8Array(a+1);s[0]=t|31;if(!e){for(var c=0;c<a-1;c++)s[c+1]=o[c]|128;s[a]=o[a-1]}return s.buffer}var u=new Uint8Array(this.valueHexView.byteLength+1);u[0]=t|31;if(!e){var p=this.valueHexView;for(var c=0;c<p.length-1;c++)u[c+1]=p[c]|128;u[this.valueHexView.byteLength]=p[p.length-1]}return u.buffer};t.prototype.fromBER=function(e,t,r){var i=buildExports.BufferSourceConverter.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}var n=i.subarray(t,t+r);if(n.length===0){this.error="Zero buffer length";return-1}var o=n[0]&192;switch(o){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:this.error="Unknown tag class";return-1}this.isConstructed=(n[0]&32)===32;this.isHexOnly=false;var a=n[0]&31;if(a!==31){this.tagNumber=a;this.blockLength=1}else{var s=1;var c=this.valueHexView=new Uint8Array(255);var u=255;while(n[s]&128){c[s-1]=n[s]&127;s++;if(s>=n.length){this.error="End of input reached before message was fully decoded";return-1}if(s===u){u+=255;var p=new Uint8Array(u);for(var f=0;f<c.length;f++)p[f]=c[f];c=this.valueHexView=new Uint8Array(u)}}this.blockLength=s+1;c[s-1]=n[s]&127;var d=new Uint8Array(s);for(var f=0;f<s;f++)d[f]=c[f];c=this.valueHexView=new Uint8Array(s);c.set(d);if(this.blockLength<=9)this.tagNumber=utilFromBase(c,7);else{this.isHexOnly=true;this.warnings.push("Tag too long, represented as hex-coded")}}if(this.tagClass===1&&this.isConstructed){switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:this.error="Constructed encoding used for primitive type";return-1}}return t+this.blockLength};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed})};return t}(HexBlock(LocalBaseBlock));LocalIdentificationBlock.NAME="identificationBlock";var LocalLengthBlock=function(e){__extends(t,e);function t(t){var r=t===void 0?{}:t,i=r.lenBlock,n=i===void 0?{}:i;var o,a,s;var c=e.call(this)||this;c.isIndefiniteForm=(o=n.isIndefiniteForm)!==null&&o!==void 0?o:false;c.longFormUsed=(a=n.longFormUsed)!==null&&a!==void 0?a:false;c.length=(s=n.length)!==null&&s!==void 0?s:0;return c}t.prototype.fromBER=function(e,t,r){var i=buildExports.BufferSourceConverter.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}var n=i.subarray(t,t+r);if(n.length===0){this.error="Zero buffer length";return-1}if(n[0]===255){this.error="Length block 0xFF is reserved by standard";return-1}this.isIndefiniteForm=n[0]===128;if(this.isIndefiniteForm){this.blockLength=1;return t+this.blockLength}this.longFormUsed=!!(n[0]&128);if(this.longFormUsed===false){this.length=n[0];this.blockLength=1;return t+this.blockLength}var o=n[0]&127;if(o>8){this.error="Too big integer";return-1}if(o+1>n.length){this.error="End of input reached before message was fully decoded";return-1}var a=t+1;var s=i.subarray(a,a+o);if(s[o-1]===0)this.warnings.push("Needlessly long encoded length");this.length=utilFromBase(s,8);if(this.longFormUsed&&this.length<=127)this.warnings.push("Unnecessary usage of long length form");this.blockLength=o+1;return t+this.blockLength};t.prototype.toBER=function(e){if(e===void 0){e=false}var t;var r;if(this.length>127)this.longFormUsed=true;if(this.isIndefiniteForm){t=new ArrayBuffer(1);if(e===false){r=new Uint8Array(t);r[0]=128}return t}if(this.longFormUsed){var i=utilToBase(this.length,8);if(i.byteLength>127){this.error="Too big length";return EMPTY_BUFFER}t=new ArrayBuffer(i.byteLength+1);if(e)return t;var n=new Uint8Array(i);r=new Uint8Array(t);r[0]=i.byteLength|128;for(var o=0;o<i.byteLength;o++)r[o+1]=n[o];return t}t=new ArrayBuffer(1);if(e===false){r=new Uint8Array(t);r[0]=this.length}return t};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length})};return t}(LocalBaseBlock);LocalLengthBlock.NAME="lengthBlock";var typeStore={};var BaseBlock=function(e){__extends(t,e);function t(t,r){if(t===void 0){t={}}var i=this;var n=t.name,o=n===void 0?EMPTY_STRING:n,a=t.optional,s=a===void 0?false:a,c=t.primitiveSchema,u=__rest(t,["name","optional","primitiveSchema"]);i=e.call(this,u)||this;i.name=o;i.optional=s;if(c){i.primitiveSchema=c}i.idBlock=new LocalIdentificationBlock(u);i.lenBlock=new LocalLengthBlock(u);i.valueBlock=r?new r(u):new ValueBlock(u);return i}t.prototype.fromBER=function(e,t,r){var i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);if(i===-1){this.error=this.valueBlock.error;return i}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return i};t.prototype.toBER=function(e,t){var r=t||new ViewWriter;if(!t){prepareIndefiniteForm(this)}var i=this.idBlock.toBER(e);r.write(i);if(this.lenBlock.isIndefiniteForm){r.write(new Uint8Array([128]).buffer);this.valueBlock.toBER(e,r);r.write(new ArrayBuffer(2))}else{var n=this.valueBlock.toBER(e);this.lenBlock.length=n.byteLength;var o=this.lenBlock.toBER(e);r.write(o);r.write(n)}if(!t){return r.final()}return EMPTY_BUFFER};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional});if(this.primitiveSchema)t.primitiveSchema=this.primitiveSchema.toJSON();return t};t.prototype.toString=function(e){if(e===void 0){e="ascii"}if(e==="ascii"){return this.onAsciiEncoding()}return buildExports.Convert.ToHex(this.toBER())};t.prototype.onAsciiEncoding=function(){var e=this.constructor.NAME;var t=buildExports.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);return"".concat(e," : ").concat(t)};t.prototype.isEqual=function(e){if(this===e){return true}if(!(e instanceof this.constructor)){return false}var t=this.toBER();var r=e.toBER();return isEqualBuffer(t,r)};return t}(LocalBaseBlock);BaseBlock.NAME="BaseBlock";function prepareIndefiniteForm(e){var t;if(e instanceof typeStore.Constructed){for(var r=0,i=e.valueBlock.value;r<i.length;r++){var n=i[r];if(prepareIndefiniteForm(n)){e.lenBlock.isIndefiniteForm=true}}}return!!((t=e.lenBlock)===null||t===void 0?void 0:t.isIndefiniteForm)}var BaseStringBlock=function(e){__extends(t,e);function t(t,r){if(t===void 0){t={}}var i=this;var n=t.value,o=n===void 0?EMPTY_STRING:n,a=__rest(t,["value"]);i=e.call(this,a,r)||this;if(o){i.fromString(o)}return i}t.prototype.getValue=function(){return this.valueBlock.value};t.prototype.setValue=function(e){this.valueBlock.value=e};t.prototype.fromBER=function(e,t,r){var i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);if(i===-1){this.error=this.valueBlock.error;return i}this.fromBuffer(this.valueBlock.valueHexView);if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return i};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : '").concat(this.valueBlock.value,"'")};return t}(BaseBlock);BaseStringBlock.NAME="BaseStringBlock";var LocalPrimitiveValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.isHexOnly,n=i===void 0?true:i,o=__rest(t,["isHexOnly"]);r=e.call(this,o)||this;r.isHexOnly=n;return r}return t}(HexBlock(ValueBlock));LocalPrimitiveValueBlock.NAME="PrimitiveValueBlock";var _a$w;var Primitive=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalPrimitiveValueBlock)||this;r.idBlock.isConstructed=false;return r}return t}(BaseBlock);_a$w=Primitive;(function(){typeStore.Primitive=_a$w})();Primitive.NAME="PRIMITIVE";function localChangeType(e,t){if(e instanceof t){return e}var r=new t;r.idBlock=e.idBlock;r.lenBlock=e.lenBlock;r.warnings=e.warnings;r.valueBeforeDecodeView=e.valueBeforeDecodeView;return r}function localFromBER(e,t,r){if(t===void 0){t=0}if(r===void 0){r=e.length}var i=t;var n=new BaseBlock({},ValueBlock);var o=new LocalBaseBlock;if(!checkBufferParams(o,e,t,r)){n.error=o.error;return{offset:-1,result:n}}var a=e.subarray(t,t+r);if(!a.length){n.error="Zero buffer length";return{offset:-1,result:n}}var s=n.idBlock.fromBER(e,t,r);if(n.idBlock.warnings.length){n.warnings.concat(n.idBlock.warnings)}if(s===-1){n.error=n.idBlock.error;return{offset:-1,result:n}}t=s;r-=n.idBlock.blockLength;s=n.lenBlock.fromBER(e,t,r);if(n.lenBlock.warnings.length){n.warnings.concat(n.lenBlock.warnings)}if(s===-1){n.error=n.lenBlock.error;return{offset:-1,result:n}}t=s;r-=n.lenBlock.blockLength;if(!n.idBlock.isConstructed&&n.lenBlock.isIndefiniteForm){n.error="Indefinite length form used for primitive encoding form";return{offset:-1,result:n}}var c=BaseBlock;switch(n.idBlock.tagClass){case 1:if(n.idBlock.tagNumber>=37&&n.idBlock.isHexOnly===false){n.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard";return{offset:-1,result:n}}switch(n.idBlock.tagNumber){case 0:if(n.idBlock.isConstructed&&n.lenBlock.length>0){n.error="Type [UNIVERSAL 0] is reserved";return{offset:-1,result:n}}c=typeStore.EndOfContent;break;case 1:c=typeStore.Boolean;break;case 2:c=typeStore.Integer;break;case 3:c=typeStore.BitString;break;case 4:c=typeStore.OctetString;break;case 5:c=typeStore.Null;break;case 6:c=typeStore.ObjectIdentifier;break;case 10:c=typeStore.Enumerated;break;case 12:c=typeStore.Utf8String;break;case 13:c=typeStore.RelativeObjectIdentifier;break;case 14:c=typeStore.TIME;break;case 15:n.error="[UNIVERSAL 15] is reserved by ASN.1 standard";return{offset:-1,result:n};case 16:c=typeStore.Sequence;break;case 17:c=typeStore.Set;break;case 18:c=typeStore.NumericString;break;case 19:c=typeStore.PrintableString;break;case 20:c=typeStore.TeletexString;break;case 21:c=typeStore.VideotexString;break;case 22:c=typeStore.IA5String;break;case 23:c=typeStore.UTCTime;break;case 24:c=typeStore.GeneralizedTime;break;case 25:c=typeStore.GraphicString;break;case 26:c=typeStore.VisibleString;break;case 27:c=typeStore.GeneralString;break;case 28:c=typeStore.UniversalString;break;case 29:c=typeStore.CharacterString;break;case 30:c=typeStore.BmpString;break;case 31:c=typeStore.DATE;break;case 32:c=typeStore.TimeOfDay;break;case 33:c=typeStore.DateTime;break;case 34:c=typeStore.Duration;break;default:{var u=n.idBlock.isConstructed?new typeStore.Constructed:new typeStore.Primitive;u.idBlock=n.idBlock;u.lenBlock=n.lenBlock;u.warnings=n.warnings;n=u}}break;case 2:case 3:case 4:default:{c=n.idBlock.isConstructed?typeStore.Constructed:typeStore.Primitive}}n=localChangeType(n,c);s=n.fromBER(e,t,n.lenBlock.isIndefiniteForm?r:n.lenBlock.length);n.valueBeforeDecodeView=e.subarray(i,i+n.blockLength);return{offset:s,result:n}}function fromBER(e){if(!e.byteLength){var t=new BaseBlock({},ValueBlock);t.error="Input buffer has zero length";return{offset:-1,result:t}}return localFromBER(buildExports.BufferSourceConverter.toUint8Array(e).slice(),0,e.byteLength)}function checkLen(e,t){if(e){return 1}return t}var LocalConstructedValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?[]:i,o=t.isIndefiniteForm,a=o===void 0?false:o,s=__rest(t,["value","isIndefiniteForm"]);r=e.call(this,s)||this;r.value=n;r.isIndefiniteForm=a;return r}t.prototype.fromBER=function(e,t,r){var i=buildExports.BufferSourceConverter.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}this.valueBeforeDecodeView=i.subarray(t,t+r);if(this.valueBeforeDecodeView.length===0){this.warnings.push("Zero buffer length");return t}var n=t;while(checkLen(this.isIndefiniteForm,r)>0){var o=localFromBER(i,n,r);if(o.offset===-1){this.error=o.result.error;this.warnings.concat(o.result.warnings);return-1}n=o.offset;this.blockLength+=o.result.blockLength;r-=o.result.blockLength;this.value.push(o.result);if(this.isIndefiniteForm&&o.result.constructor.NAME===END_OF_CONTENT_NAME){break}}if(this.isIndefiniteForm){if(this.value[this.value.length-1].constructor.NAME===END_OF_CONTENT_NAME){this.value.pop()}else{this.warnings.push("No EndOfContent block encoded")}}return n};t.prototype.toBER=function(e,t){var r=t||new ViewWriter;for(var i=0;i<this.value.length;i++){this.value[i].toBER(e,r)}if(!t){return r.final()}return EMPTY_BUFFER};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{isIndefiniteForm:this.isIndefiniteForm,value:[]});for(var r=0,i=this.value;r<i.length;r++){var n=i[r];t.value.push(n.toJSON())}return t};return t}(ValueBlock);LocalConstructedValueBlock.NAME="ConstructedValueBlock";var _a$v;var Constructed=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalConstructedValueBlock)||this;r.idBlock.isConstructed=true;return r}t.prototype.fromBER=function(e,t,r){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;var i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);if(i===-1){this.error=this.valueBlock.error;return i}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return i};t.prototype.onAsciiEncoding=function(){var e=[];for(var t=0,r=this.valueBlock.value;t<r.length;t++){var i=r[t];e.push(i.toString("ascii").split("\n").map((function(e){return" ".concat(e)})).join("\n"))}var n=this.idBlock.tagClass===3?"[".concat(this.idBlock.tagNumber,"]"):this.constructor.NAME;return e.length?"".concat(n," :\n").concat(e.join("\n")):"".concat(n," :")};return t}(BaseBlock);_a$v=Constructed;(function(){typeStore.Constructed=_a$v})();Constructed.NAME="CONSTRUCTED";var LocalEndOfContentValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBER=function(e,t,r){return t};t.prototype.toBER=function(e){return EMPTY_BUFFER};return t}(ValueBlock);LocalEndOfContentValueBlock.override="EndOfContentValueBlock";var _a$u;var EndOfContent=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalEndOfContentValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=0;return r}return t}(BaseBlock);_a$u=EndOfContent;(function(){typeStore.EndOfContent=_a$u})();EndOfContent.NAME=END_OF_CONTENT_NAME;var _a$t;var Null=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,ValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=5;return r}t.prototype.fromBER=function(e,t,r){if(this.lenBlock.length>0)this.warnings.push("Non-zero length of value block for Null type");if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;this.blockLength+=r;if(t+r>e.byteLength){this.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return-1}return t+r};t.prototype.toBER=function(e,t){var r=new ArrayBuffer(2);if(!e){var i=new Uint8Array(r);i[0]=5;i[1]=0}if(t){t.write(r)}return r};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME)};return t}(BaseBlock);_a$t=Null;(function(){typeStore.Null=_a$t})();Null.NAME="NULL";var LocalBooleanValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=__rest(t,["value"]);r=e.call(this,n)||this;if(n.valueHex){r.valueHexView=buildExports.BufferSourceConverter.toUint8Array(n.valueHex)}else{r.valueHexView=new Uint8Array(1)}if(i){r.value=i}return r}Object.defineProperty(t.prototype,"value",{get:function(){for(var e=0,t=this.valueHexView;e<t.length;e++){var r=t[e];if(r>0){return true}}return false},set:function(e){this.valueHexView[0]=e?255:0},enumerable:false,configurable:true});t.prototype.fromBER=function(e,t,r){var i=buildExports.BufferSourceConverter.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}this.valueHexView=i.subarray(t,t+r);if(r>1)this.warnings.push("Boolean value encoded in more then 1 octet");this.isHexOnly=true;utilDecodeTC.call(this);this.blockLength=r;return t+r};t.prototype.toBER=function(){return this.valueHexView.slice()};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.value})};return t}(HexBlock(ValueBlock));LocalBooleanValueBlock.NAME="BooleanValueBlock";var _a$s;var Boolean=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalBooleanValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=1;return r}t.prototype.getValue=function(){return this.valueBlock.value};t.prototype.setValue=function(e){this.valueBlock.value=e};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.getValue)};return t}(BaseBlock);_a$s=Boolean;(function(){typeStore.Boolean=_a$s})();Boolean.NAME="BOOLEAN";var LocalOctetStringValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.isConstructed,n=i===void 0?false:i,o=__rest(t,["isConstructed"]);r=e.call(this,o)||this;r.isConstructed=n;return r}t.prototype.fromBER=function(t,r,i){var n=0;if(this.isConstructed){this.isHexOnly=false;n=LocalConstructedValueBlock.prototype.fromBER.call(this,t,r,i);if(n===-1)return n;for(var o=0;o<this.value.length;o++){var a=this.value[o].constructor.NAME;if(a===END_OF_CONTENT_NAME){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only";return-1}}if(a!==OCTET_STRING_NAME){this.error="OCTET STRING may consists of OCTET STRINGs only";return-1}}}else{this.isHexOnly=true;n=e.prototype.fromBER.call(this,t,r,i);this.blockLength=i}return n};t.prototype.toBER=function(e,t){if(this.isConstructed)return LocalConstructedValueBlock.prototype.toBER.call(this,e,t);return e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{isConstructed:this.isConstructed})};return t}(HexBlock(LocalConstructedValueBlock));LocalOctetStringValueBlock.NAME="OctetStringValueBlock";var _a$r;var OctetString$1=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.idBlock,n=i===void 0?{}:i,o=t.lenBlock,a=o===void 0?{}:o,s=__rest(t,["idBlock","lenBlock"]);var c,u;(c=s.isConstructed)!==null&&c!==void 0?c:s.isConstructed=!!((u=s.value)===null||u===void 0?void 0:u.length);r=e.call(this,__assign({idBlock:__assign({isConstructed:s.isConstructed},n),lenBlock:__assign(__assign({},a),{isIndefiniteForm:!!s.isIndefiniteForm})},s),LocalOctetStringValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=4;return r}t.prototype.fromBER=function(t,r,i){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;if(i===0){if(this.idBlock.error.length===0)this.blockLength+=this.idBlock.blockLength;if(this.lenBlock.error.length===0)this.blockLength+=this.lenBlock.blockLength;return r}if(!this.valueBlock.isConstructed){var n=t instanceof ArrayBuffer?new Uint8Array(t):t;var o=n.subarray(r,r+i);try{if(o.byteLength){var a=localFromBER(o,0,o.byteLength);if(a.offset!==-1&&a.offset===i){this.valueBlock.value=[a.result]}}}catch(e){}}return e.prototype.fromBER.call(this,t,r,i)};t.prototype.onAsciiEncoding=function(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return Constructed.prototype.onAsciiEncoding.call(this)}var e=this.constructor.NAME;var t=buildExports.Convert.ToHex(this.valueBlock.valueHexView);return"".concat(e," : ").concat(t)};t.prototype.getValue=function(){if(!this.idBlock.isConstructed){return this.valueBlock.valueHexView.slice().buffer}var e=[];for(var t=0,r=this.valueBlock.value;t<r.length;t++){var i=r[t];if(i instanceof _a$r){e.push(i.valueBlock.valueHexView)}}return buildExports.BufferSourceConverter.concat(e)};return t}(BaseBlock);_a$r=OctetString$1;(function(){typeStore.OctetString=_a$r})();OctetString$1.NAME=OCTET_STRING_NAME;var LocalBitStringValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.unusedBits,n=i===void 0?0:i,o=t.isConstructed,a=o===void 0?false:o,s=__rest(t,["unusedBits","isConstructed"]);r=e.call(this,s)||this;r.unusedBits=n;r.isConstructed=a;r.blockLength=r.valueHexView.byteLength;return r}t.prototype.fromBER=function(e,t,r){if(!r){return t}var i=-1;if(this.isConstructed){i=LocalConstructedValueBlock.prototype.fromBER.call(this,e,t,r);if(i===-1)return i;for(var n=0,o=this.value;n<o.length;n++){var a=o[n];var s=a.constructor.NAME;if(s===END_OF_CONTENT_NAME){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only";return-1}}if(s!==BIT_STRING_NAME){this.error="BIT STRING may consists of BIT STRINGs only";return-1}var c=a.valueBlock;if(this.unusedBits>0&&c.unusedBits>0){this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only';return-1}this.unusedBits=c.unusedBits}return i}var u=buildExports.BufferSourceConverter.toUint8Array(e);if(!checkBufferParams(this,u,t,r)){return-1}var p=u.subarray(t,t+r);this.unusedBits=p[0];if(this.unusedBits>7){this.error="Unused bits for BitString must be in range 0-7";return-1}if(!this.unusedBits){var f=p.subarray(1);try{if(f.byteLength){var d=localFromBER(f,0,f.byteLength);if(d.offset!==-1&&d.offset===r-1){this.value=[d.result]}}}catch(e){}}this.valueHexView=p.subarray(1);this.blockLength=p.length;return t+r};t.prototype.toBER=function(e,t){if(this.isConstructed){return LocalConstructedValueBlock.prototype.toBER.call(this,e,t)}if(e){return new ArrayBuffer(this.valueHexView.byteLength+1)}if(!this.valueHexView.byteLength){return EMPTY_BUFFER}var r=new Uint8Array(this.valueHexView.length+1);r[0]=this.unusedBits;r.set(this.valueHexView,1);return r.buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{unusedBits:this.unusedBits,isConstructed:this.isConstructed})};return t}(HexBlock(LocalConstructedValueBlock));LocalBitStringValueBlock.NAME="BitStringValueBlock";var _a$q;var BitString$1=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.idBlock,n=i===void 0?{}:i,o=t.lenBlock,a=o===void 0?{}:o,s=__rest(t,["idBlock","lenBlock"]);var c,u;(c=s.isConstructed)!==null&&c!==void 0?c:s.isConstructed=!!((u=s.value)===null||u===void 0?void 0:u.length);r=e.call(this,__assign({idBlock:__assign({isConstructed:s.isConstructed},n),lenBlock:__assign(__assign({},a),{isIndefiniteForm:!!s.isIndefiniteForm})},s),LocalBitStringValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=3;return r}t.prototype.fromBER=function(t,r,i){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;return e.prototype.fromBER.call(this,t,r,i)};t.prototype.onAsciiEncoding=function(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return Constructed.prototype.onAsciiEncoding.call(this)}else{var e=[];var t=this.valueBlock.valueHexView;for(var r=0,i=t;r<i.length;r++){var n=i[r];e.push(n.toString(2).padStart(8,"0"))}var o=e.join("");var a=this.constructor.NAME;var s=o.substring(0,o.length-this.valueBlock.unusedBits);return"".concat(a," : ").concat(s)}};return t}(BaseBlock);_a$q=BitString$1;(function(){typeStore.BitString=_a$q})();BitString$1.NAME=BIT_STRING_NAME;var _a$p;function viewAdd(e,t){var r=new Uint8Array([0]);var i=new Uint8Array(e);var n=new Uint8Array(t);var o=i.slice(0);var a=o.length-1;var s=n.slice(0);var c=s.length-1;var u=0;var p=c<a?a:c;var f=0;for(var d=p;d>=0;d--,f++){switch(true){case f<s.length:u=o[a-f]+s[c-f]+r[0];break;default:u=o[a-f]+r[0]}r[0]=u/10;switch(true){case f>=o.length:o=utilConcatView(new Uint8Array([u%10]),o);break;default:o[a-f]=u%10}}if(r[0]>0)o=utilConcatView(r,o);return o}function power2(e){if(e>=powers2.length){for(var t=powers2.length;t<=e;t++){var r=new Uint8Array([0]);var i=powers2[t-1].slice(0);for(var n=i.length-1;n>=0;n--){var o=new Uint8Array([(i[n]<<1)+r[0]]);r[0]=o[0]/10;i[n]=o[0]%10}if(r[0]>0)i=utilConcatView(r,i);powers2.push(i)}}return powers2[e]}function viewSub(e,t){var r=0;var i=new Uint8Array(e);var n=new Uint8Array(t);var o=i.slice(0);var a=o.length-1;var s=n.slice(0);var c=s.length-1;var u;var p=0;for(var f=c;f>=0;f--,p++){u=o[a-p]-s[c-p]-r;switch(true){case u<0:r=1;o[a-p]=u+10;break;default:r=0;o[a-p]=u}}if(r>0){for(var f=a-c+1;f>=0;f--,p++){u=o[a-p]-r;if(u<0){r=1;o[a-p]=u+10}else{r=0;o[a-p]=u;break}}}return o.slice()}var LocalIntegerValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=__rest(t,["value"]);r=e.call(this,n)||this;r._valueDec=0;if(n.valueHex){r.setValueHex()}if(i!==undefined){r.valueDec=i}return r}t.prototype.setValueHex=function(){if(this.valueHexView.length>=4){this.warnings.push("Too big Integer for decoding, hex only");this.isHexOnly=true;this._valueDec=0}else{this.isHexOnly=false;if(this.valueHexView.length>0){this._valueDec=utilDecodeTC.call(this)}}};Object.defineProperty(t.prototype,"valueDec",{get:function(){return this._valueDec},set:function(e){this._valueDec=e;this.isHexOnly=false;this.valueHexView=new Uint8Array(utilEncodeTC(e))},enumerable:false,configurable:true});t.prototype.fromDER=function(e,t,r,i){if(i===void 0){i=0}var n=this.fromBER(e,t,r);if(n===-1)return n;var o=this.valueHexView;if(o[0]===0&&(o[1]&128)!==0){this.valueHexView=o.subarray(1)}else{if(i!==0){if(o.length<i){if(i-o.length>1)i=o.length+1;this.valueHexView=o.subarray(i-o.length)}}}return n};t.prototype.toDER=function(e){if(e===void 0){e=false}var t=this.valueHexView;switch(true){case(t[0]&128)!==0:{var r=new Uint8Array(this.valueHexView.length+1);r[0]=0;r.set(t,1);this.valueHexView=r}break;case t[0]===0&&(t[1]&128)===0:{this.valueHexView=this.valueHexView.subarray(1)}break}return this.toBER(e)};t.prototype.fromBER=function(t,r,i){var n=e.prototype.fromBER.call(this,t,r,i);if(n===-1){return n}this.setValueHex();return n};t.prototype.toBER=function(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{valueDec:this.valueDec})};t.prototype.toString=function(){var e=this.valueHexView.length*8-1;var t=new Uint8Array(this.valueHexView.length*8/3);var r=0;var i;var n=this.valueHexView;var o="";var a=false;for(var s=n.byteLength-1;s>=0;s--){i=n[s];for(var c=0;c<8;c++){if((i&1)===1){switch(r){case e:t=viewSub(power2(r),t);o="-";break;default:t=viewAdd(t,power2(r))}}r++;i>>=1}}for(var c=0;c<t.length;c++){if(t[c])a=true;if(a)o+=digitsString.charAt(t[c])}if(a===false)o+=digitsString.charAt(0);return o};return t}(HexBlock(ValueBlock));_a$p=LocalIntegerValueBlock;LocalIntegerValueBlock.NAME="IntegerValueBlock";(function(){Object.defineProperty(_a$p.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e);this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}})})();var _a$o;var Integer=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalIntegerValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=2;return r}t.prototype.toBigInt=function(){assertBigInt();return BigInt(this.valueBlock.toString())};t.fromBigInt=function(e){assertBigInt();var t=BigInt(e);var r=new ViewWriter;var i=t.toString(16).replace(/^-/,"");var n=new Uint8Array(buildExports.Convert.FromHex(i));if(t<0){var o=new Uint8Array(n.length+(n[0]&128?1:0));o[0]|=128;var a=BigInt("0x".concat(buildExports.Convert.ToHex(o)));var s=a+t;var c=buildExports.BufferSourceConverter.toUint8Array(buildExports.Convert.FromHex(s.toString(16)));c[0]|=128;r.write(c)}else{if(n[0]&128){r.write(new Uint8Array([0]))}r.write(n)}var u=new _a$o({valueHex:r.final()});return u};t.prototype.convertToDER=function(){var e=new _a$o({valueHex:this.valueBlock.valueHexView});e.valueBlock.toDER();return e};t.prototype.convertFromDER=function(){return new _a$o({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString())};return t}(BaseBlock);_a$o=Integer;(function(){typeStore.Integer=_a$o})();Integer.NAME="INTEGER";var _a$n;var Enumerated=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=10;return r}return t}(Integer);_a$n=Enumerated;(function(){typeStore.Enumerated=_a$n})();Enumerated.NAME="ENUMERATED";var LocalSidValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.valueDec,n=i===void 0?-1:i,o=t.isFirstSid,a=o===void 0?false:o,s=__rest(t,["valueDec","isFirstSid"]);r=e.call(this,s)||this;r.valueDec=n;r.isFirstSid=a;return r}t.prototype.fromBER=function(e,t,r){if(!r){return t}var i=buildExports.BufferSourceConverter.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}var n=i.subarray(t,t+r);this.valueHexView=new Uint8Array(r);for(var o=0;o<r;o++){this.valueHexView[o]=n[o]&127;this.blockLength++;if((n[o]&128)===0)break}var a=new Uint8Array(this.blockLength);for(var o=0;o<this.blockLength;o++){a[o]=this.valueHexView[o]}this.valueHexView=a;if((n[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=utilFromBase(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return t+this.blockLength};Object.defineProperty(t.prototype,"valueBigInt",{set:function(e){assertBigInt();var t=BigInt(e).toString(2);while(t.length%7){t="0"+t}var r=new Uint8Array(t.length/7);for(var i=0;i<r.length;i++){r[i]=parseInt(t.slice(i*7,i*7+7),2)+(i+1<r.length?128:0)}this.fromBER(r.buffer,0,r.length)},enumerable:false,configurable:true});t.prototype.toBER=function(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);var t=this.valueHexView;var r=new Uint8Array(this.blockLength);for(var i=0;i<this.blockLength-1;i++)r[i]=t[i]|128;r[this.blockLength-1]=t[this.blockLength-1];return r.buffer}var n=utilToBase(this.valueDec,7);if(n.byteLength===0){this.error="Error during encoding SID value";return EMPTY_BUFFER}var o=new Uint8Array(n.byteLength);if(!e){var a=new Uint8Array(n);var s=n.byteLength-1;for(var i=0;i<s;i++)o[i]=a[i]|128;o[s]=a[s]}return o};t.prototype.toString=function(){var e="";if(this.isHexOnly)e=buildExports.Convert.ToHex(this.valueHexView);else{if(this.isFirstSid){var t=this.valueDec;if(this.valueDec<=39)e="0.";else{if(this.valueDec<=79){e="1.";t-=40}else{e="2.";t-=80}}e+=t.toString()}else e=this.valueDec.toString()}return e};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{valueDec:this.valueDec,isFirstSid:this.isFirstSid})};return t}(HexBlock(ValueBlock));LocalSidValueBlock.NAME="sidBlock";var LocalObjectIdentifierValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?EMPTY_STRING:i,o=__rest(t,["value"]);r=e.call(this,o)||this;r.value=[];if(n){r.fromString(n)}return r}t.prototype.fromBER=function(e,t,r){var i=t;while(r>0){var n=new LocalSidValueBlock;i=n.fromBER(e,i,r);if(i===-1){this.blockLength=0;this.error=n.error;return i}if(this.value.length===0)n.isFirstSid=true;this.blockLength+=n.blockLength;r-=n.blockLength;this.value.push(n)}return i};t.prototype.toBER=function(e){var t=[];for(var r=0;r<this.value.length;r++){var i=this.value[r].toBER(e);if(i.byteLength===0){this.error=this.value[r].error;return EMPTY_BUFFER}t.push(i)}return concat(t)};t.prototype.fromString=function(e){this.value=[];var t=0;var r=0;var i="";var n=false;do{r=e.indexOf(".",t);if(r===-1)i=e.substring(t);else i=e.substring(t,r);t=r+1;if(n){var o=this.value[0];var a=0;switch(o.valueDec){case 0:break;case 1:a=40;break;case 2:a=80;break;default:this.value=[];return}var s=parseInt(i,10);if(isNaN(s))return;o.valueDec=s+a;n=false}else{var o=new LocalSidValueBlock;if(i>Number.MAX_SAFE_INTEGER){assertBigInt();var c=BigInt(i);o.valueBigInt=c}else{o.valueDec=parseInt(i,10);if(isNaN(o.valueDec))return}if(!this.value.length){o.isFirstSid=true;n=true}this.value.push(o)}}while(r!==-1)};t.prototype.toString=function(){var e="";var t=false;for(var r=0;r<this.value.length;r++){t=this.value[r].isHexOnly;var i=this.value[r].toString();if(r!==0)e="".concat(e,".");if(t){i="{".concat(i,"}");if(this.value[r].isFirstSid)e="2.{".concat(i," - 80}");else e+=i}else e+=i}return e};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{value:this.toString(),sidArray:[]});for(var r=0;r<this.value.length;r++){t.sidArray.push(this.value[r].toJSON())}return t};return t}(ValueBlock);LocalObjectIdentifierValueBlock.NAME="ObjectIdentifierValueBlock";var _a$m;var ObjectIdentifier=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalObjectIdentifierValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=6;return r}t.prototype.getValue=function(){return this.valueBlock.toString()};t.prototype.setValue=function(e){this.valueBlock.fromString(e)};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString()||"empty")};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.getValue()})};return t}(BaseBlock);_a$m=ObjectIdentifier;(function(){typeStore.ObjectIdentifier=_a$m})();ObjectIdentifier.NAME="OBJECT IDENTIFIER";var LocalRelativeSidValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.valueDec,n=i===void 0?0:i,o=__rest(t,["valueDec"]);r=e.call(this,o)||this;r.valueDec=n;return r}t.prototype.fromBER=function(e,t,r){if(r===0)return t;var i=buildExports.BufferSourceConverter.toUint8Array(e);if(!checkBufferParams(this,i,t,r))return-1;var n=i.subarray(t,t+r);this.valueHexView=new Uint8Array(r);for(var o=0;o<r;o++){this.valueHexView[o]=n[o]&127;this.blockLength++;if((n[o]&128)===0)break}var a=new Uint8Array(this.blockLength);for(var o=0;o<this.blockLength;o++)a[o]=this.valueHexView[o];this.valueHexView=a;if((n[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=utilFromBase(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return t+this.blockLength};t.prototype.toBER=function(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);var t=this.valueHexView;var r=new Uint8Array(this.blockLength);for(var i=0;i<this.blockLength-1;i++)r[i]=t[i]|128;r[this.blockLength-1]=t[this.blockLength-1];return r.buffer}var n=utilToBase(this.valueDec,7);if(n.byteLength===0){this.error="Error during encoding SID value";return EMPTY_BUFFER}var o=new Uint8Array(n.byteLength);if(!e){var a=new Uint8Array(n);var s=n.byteLength-1;for(var i=0;i<s;i++)o[i]=a[i]|128;o[s]=a[s]}return o.buffer};t.prototype.toString=function(){var e="";if(this.isHexOnly)e=buildExports.Convert.ToHex(this.valueHexView);else{e=this.valueDec.toString()}return e};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{valueDec:this.valueDec})};return t}(HexBlock(LocalBaseBlock));LocalRelativeSidValueBlock.NAME="relativeSidBlock";var LocalRelativeObjectIdentifierValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?EMPTY_STRING:i,o=__rest(t,["value"]);r=e.call(this,o)||this;r.value=[];if(n){r.fromString(n)}return r}t.prototype.fromBER=function(e,t,r){var i=t;while(r>0){var n=new LocalRelativeSidValueBlock;i=n.fromBER(e,i,r);if(i===-1){this.blockLength=0;this.error=n.error;return i}this.blockLength+=n.blockLength;r-=n.blockLength;this.value.push(n)}return i};t.prototype.toBER=function(e,t){var r=[];for(var i=0;i<this.value.length;i++){var n=this.value[i].toBER(e);if(n.byteLength===0){this.error=this.value[i].error;return EMPTY_BUFFER}r.push(n)}return concat(r)};t.prototype.fromString=function(e){this.value=[];var t=0;var r=0;var i="";do{r=e.indexOf(".",t);if(r===-1)i=e.substring(t);else i=e.substring(t,r);t=r+1;var n=new LocalRelativeSidValueBlock;n.valueDec=parseInt(i,10);if(isNaN(n.valueDec))return true;this.value.push(n)}while(r!==-1);return true};t.prototype.toString=function(){var e="";var t=false;for(var r=0;r<this.value.length;r++){t=this.value[r].isHexOnly;var i=this.value[r].toString();if(r!==0)e="".concat(e,".");if(t){i="{".concat(i,"}");e+=i}else e+=i}return e};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{value:this.toString(),sidArray:[]});for(var r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t};return t}(ValueBlock);LocalRelativeObjectIdentifierValueBlock.NAME="RelativeObjectIdentifierValueBlock";var _a$l;var RelativeObjectIdentifier=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalRelativeObjectIdentifierValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=13;return r}t.prototype.getValue=function(){return this.valueBlock.toString()};t.prototype.setValue=function(e){this.valueBlock.fromString(e)};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString()||"empty")};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.getValue()})};return t}(BaseBlock);_a$l=RelativeObjectIdentifier;(function(){typeStore.RelativeObjectIdentifier=_a$l})();RelativeObjectIdentifier.NAME="RelativeObjectIdentifier";var _a$k;var Sequence=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=16;return r}return t}(Constructed);_a$k=Sequence;(function(){typeStore.Sequence=_a$k})();Sequence.NAME="SEQUENCE";var _a$j;var Set=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=17;return r}return t}(Constructed);_a$j=Set;(function(){typeStore.Set=_a$j})();Set.NAME="SET";var LocalStringValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=__rest(t,[]);r=e.call(this,i)||this;r.isHexOnly=true;r.value=EMPTY_STRING;return r}t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.value})};return t}(HexBlock(ValueBlock));LocalStringValueBlock.NAME="StringValueBlock";var LocalSimpleStringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(LocalStringValueBlock);LocalSimpleStringValueBlock.NAME="SimpleStringValueBlock";var LocalSimpleStringBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=__rest(t,[]);return e.call(this,r,LocalSimpleStringValueBlock)||this}t.prototype.fromBuffer=function(e){this.valueBlock.value=String.fromCharCode.apply(null,buildExports.BufferSourceConverter.toUint8Array(e))};t.prototype.fromString=function(e){var t=e.length;var r=this.valueBlock.valueHexView=new Uint8Array(t);for(var i=0;i<t;i++)r[i]=e.charCodeAt(i);this.valueBlock.value=e};return t}(BaseStringBlock);LocalSimpleStringBlock.NAME="SIMPLE STRING";var LocalUtf8StringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBuffer=function(e){this.valueBlock.valueHexView=buildExports.BufferSourceConverter.toUint8Array(e);try{this.valueBlock.value=buildExports.Convert.ToUtf8String(e)}catch(t){this.warnings.push('Error during "decodeURIComponent": '.concat(t,", using raw string"));this.valueBlock.value=buildExports.Convert.ToBinary(e)}};t.prototype.fromString=function(e){this.valueBlock.valueHexView=new Uint8Array(buildExports.Convert.FromUtf8String(e));this.valueBlock.value=e};return t}(LocalSimpleStringBlock);LocalUtf8StringValueBlock.NAME="Utf8StringValueBlock";var _a$i;var Utf8String=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=12;return r}return t}(LocalUtf8StringValueBlock);_a$i=Utf8String;(function(){typeStore.Utf8String=_a$i})();Utf8String.NAME="UTF8String";var LocalBmpStringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBuffer=function(e){this.valueBlock.value=buildExports.Convert.ToUtf16String(e);this.valueBlock.valueHexView=buildExports.BufferSourceConverter.toUint8Array(e)};t.prototype.fromString=function(e){this.valueBlock.value=e;this.valueBlock.valueHexView=new Uint8Array(buildExports.Convert.FromUtf16String(e))};return t}(LocalSimpleStringBlock);LocalBmpStringValueBlock.NAME="BmpStringValueBlock";var _a$h;var BmpString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=__rest(t,[]);r=e.call(this,i)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=30;return r}return t}(LocalBmpStringValueBlock);_a$h=BmpString;(function(){typeStore.BmpString=_a$h})();BmpString.NAME="BMPString";var LocalUniversalStringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBuffer=function(e){var t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0);var r=new Uint8Array(t);for(var i=0;i<r.length;i+=4){r[i]=r[i+3];r[i+1]=r[i+2];r[i+2]=0;r[i+3]=0}this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))};t.prototype.fromString=function(e){var t=e.length;var r=this.valueBlock.valueHexView=new Uint8Array(t*4);for(var i=0;i<t;i++){var n=utilToBase(e.charCodeAt(i),8);var o=new Uint8Array(n);if(o.length>4)continue;var a=4-o.length;for(var s=o.length-1;s>=0;s--)r[i*4+s+a]=o[s]}this.valueBlock.value=e};return t}(LocalSimpleStringBlock);LocalUniversalStringValueBlock.NAME="UniversalStringValueBlock";var _a$g;var UniversalString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=__rest(t,[]);r=e.call(this,i)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=28;return r}return t}(LocalUniversalStringValueBlock);_a$g=UniversalString;(function(){typeStore.UniversalString=_a$g})();UniversalString.NAME="UniversalString";var _a$f;var NumericString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=18;return r}return t}(LocalSimpleStringBlock);_a$f=NumericString;(function(){typeStore.NumericString=_a$f})();NumericString.NAME="NumericString";var _a$e;var PrintableString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=19;return r}return t}(LocalSimpleStringBlock);_a$e=PrintableString;(function(){typeStore.PrintableString=_a$e})();PrintableString.NAME="PrintableString";var _a$d;var TeletexString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=20;return r}return t}(LocalSimpleStringBlock);_a$d=TeletexString;(function(){typeStore.TeletexString=_a$d})();TeletexString.NAME="TeletexString";var _a$c;var VideotexString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=21;return r}return t}(LocalSimpleStringBlock);_a$c=VideotexString;(function(){typeStore.VideotexString=_a$c})();VideotexString.NAME="VideotexString";var _a$b;var IA5String=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=22;return r}return t}(LocalSimpleStringBlock);_a$b=IA5String;(function(){typeStore.IA5String=_a$b})();IA5String.NAME="IA5String";var _a$a;var GraphicString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=25;return r}return t}(LocalSimpleStringBlock);_a$a=GraphicString;(function(){typeStore.GraphicString=_a$a})();GraphicString.NAME="GraphicString";var _a$9;var VisibleString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=26;return r}return t}(LocalSimpleStringBlock);_a$9=VisibleString;(function(){typeStore.VisibleString=_a$9})();VisibleString.NAME="VisibleString";var _a$8;var GeneralString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=27;return r}return t}(LocalSimpleStringBlock);_a$8=GeneralString;(function(){typeStore.GeneralString=_a$8})();GeneralString.NAME="GeneralString";var _a$7;var CharacterString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=29;return r}return t}(LocalSimpleStringBlock);_a$7=CharacterString;(function(){typeStore.CharacterString=_a$7})();CharacterString.NAME="CharacterString";var _a$6;var UTCTime=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=t.valueDate,o=__rest(t,["value","valueDate"]);r=e.call(this,o)||this;r.year=0;r.month=0;r.day=0;r.hour=0;r.minute=0;r.second=0;if(i){r.fromString(i);r.valueBlock.valueHexView=new Uint8Array(i.length);for(var a=0;a<i.length;a++)r.valueBlock.valueHexView[a]=i.charCodeAt(a)}if(n){r.fromDate(n);r.valueBlock.valueHexView=new Uint8Array(r.toBuffer())}r.idBlock.tagClass=1;r.idBlock.tagNumber=23;return r}t.prototype.fromBuffer=function(e){this.fromString(String.fromCharCode.apply(null,buildExports.BufferSourceConverter.toUint8Array(e)))};t.prototype.toBuffer=function(){var e=this.toString();var t=new ArrayBuffer(e.length);var r=new Uint8Array(t);for(var i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return t};t.prototype.fromDate=function(e){this.year=e.getUTCFullYear();this.month=e.getUTCMonth()+1;this.day=e.getUTCDate();this.hour=e.getUTCHours();this.minute=e.getUTCMinutes();this.second=e.getUTCSeconds()};t.prototype.toDate=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))};t.prototype.fromString=function(e){var t=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/gi;var r=t.exec(e);if(r===null){this.error="Wrong input string for conversion";return}var i=parseInt(r[1],10);if(i>=50)this.year=1900+i;else this.year=2e3+i;this.month=parseInt(r[2],10);this.day=parseInt(r[3],10);this.hour=parseInt(r[4],10);this.minute=parseInt(r[5],10);this.second=parseInt(r[6],10)};t.prototype.toString=function(t){if(t===void 0){t="iso"}if(t==="iso"){var r=new Array(7);r[0]=padNumber(this.year<2e3?this.year-1900:this.year-2e3,2);r[1]=padNumber(this.month,2);r[2]=padNumber(this.day,2);r[3]=padNumber(this.hour,2);r[4]=padNumber(this.minute,2);r[5]=padNumber(this.second,2);r[6]="Z";return r.join("")}return e.prototype.toString.call(this,t)};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.toDate().toISOString())};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second})};return t}(VisibleString);_a$6=UTCTime;(function(){typeStore.UTCTime=_a$6})();UTCTime.NAME="UTCTime";var _a$5;var GeneralizedTime=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r;var i=e.call(this,t)||this;(r=i.millisecond)!==null&&r!==void 0?r:i.millisecond=0;i.idBlock.tagClass=1;i.idBlock.tagNumber=24;return i}t.prototype.fromDate=function(t){e.prototype.fromDate.call(this,t);this.millisecond=t.getUTCMilliseconds()};t.prototype.toDate=function(){var e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)};t.prototype.fromString=function(e){var t=false;var r="";var i="";var n=0;var o;var a=0;var s=0;if(e[e.length-1]==="Z"){r=e.substring(0,e.length-1);t=true}else{var c=new Number(e[e.length-1]);if(isNaN(c.valueOf()))throw new Error("Wrong input string for conversion");r=e}if(t){if(r.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(r.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{var u=1;var p=r.indexOf("+");var f="";if(p===-1){p=r.indexOf("-");u=-1}if(p!==-1){f=r.substring(p+1);r=r.substring(0,p);if(f.length!==2&&f.length!==4)throw new Error("Wrong input string for conversion");var c=parseInt(f.substring(0,2),10);if(isNaN(c.valueOf()))throw new Error("Wrong input string for conversion");a=u*c;if(f.length===4){c=parseInt(f.substring(2,4),10);if(isNaN(c.valueOf()))throw new Error("Wrong input string for conversion");s=u*c}}}var d=r.indexOf(".");if(d===-1)d=r.indexOf(",");if(d!==-1){var l=new Number("0".concat(r.substring(d)));if(isNaN(l.valueOf()))throw new Error("Wrong input string for conversion");n=l.valueOf();i=r.substring(0,d)}else i=r;switch(true){case i.length===8:o=/(\d{4})(\d{2})(\d{2})/gi;if(d!==-1)throw new Error("Wrong input string for conversion");break;case i.length===10:o=/(\d{4})(\d{2})(\d{2})(\d{2})/gi;if(d!==-1){var y=60*n;this.minute=Math.floor(y);y=60*(y-this.minute);this.second=Math.floor(y);y=1e3*(y-this.second);this.millisecond=Math.floor(y)}break;case i.length===12:o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(d!==-1){var y=60*n;this.second=Math.floor(y);y=1e3*(y-this.second);this.millisecond=Math.floor(y)}break;case i.length===14:o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(d!==-1){var y=1e3*n;this.millisecond=Math.floor(y)}break;default:throw new Error("Wrong input string for conversion")}var v=o.exec(i);if(v===null)throw new Error("Wrong input string for conversion");for(var h=1;h<v.length;h++){switch(h){case 1:this.year=parseInt(v[h],10);break;case 2:this.month=parseInt(v[h],10);break;case 3:this.day=parseInt(v[h],10);break;case 4:this.hour=parseInt(v[h],10)+a;break;case 5:this.minute=parseInt(v[h],10)+s;break;case 6:this.second=parseInt(v[h],10);break;default:throw new Error("Wrong input string for conversion")}}if(t===false){var A=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=A.getUTCFullYear();this.month=A.getUTCMonth();this.day=A.getUTCDay();this.hour=A.getUTCHours();this.minute=A.getUTCMinutes();this.second=A.getUTCSeconds();this.millisecond=A.getUTCMilliseconds()}};t.prototype.toString=function(t){if(t===void 0){t="iso"}if(t==="iso"){var r=[];r.push(padNumber(this.year,4));r.push(padNumber(this.month,2));r.push(padNumber(this.day,2));r.push(padNumber(this.hour,2));r.push(padNumber(this.minute,2));r.push(padNumber(this.second,2));if(this.millisecond!==0){r.push(".");r.push(padNumber(this.millisecond,3))}r.push("Z");return r.join("")}return e.prototype.toString.call(this,t)};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{millisecond:this.millisecond})};return t}(UTCTime);_a$5=GeneralizedTime;(function(){typeStore.GeneralizedTime=_a$5})();GeneralizedTime.NAME="GeneralizedTime";var _a$4;var DATE=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=31;return r}return t}(Utf8String);_a$4=DATE;(function(){typeStore.DATE=_a$4})();DATE.NAME="DATE";var _a$3;var TimeOfDay=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=32;return r}return t}(Utf8String);_a$3=TimeOfDay;(function(){typeStore.TimeOfDay=_a$3})();TimeOfDay.NAME="TimeOfDay";var _a$2;var DateTime=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=33;return r}return t}(Utf8String);_a$2=DateTime;(function(){typeStore.DateTime=_a$2})();DateTime.NAME="DateTime";var _a$1;var Duration=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=34;return r}return t}(Utf8String);_a$1=Duration;(function(){typeStore.Duration=_a$1})();Duration.NAME="Duration";var _a;var TIME=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=14;return r}return t}(Utf8String);_a=TIME;(function(){typeStore.TIME=_a})();TIME.NAME="TIME";var Any=function(){function e(e){var t=e===void 0?{}:e,r=t.name,i=r===void 0?EMPTY_STRING:r,n=t.optional,o=n===void 0?false:n;this.name=i;this.optional=o}return e}();var Choice=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?[]:i,o=__rest(t,["value"]);r=e.call(this,o)||this;r.value=n;return r}return t}(Any);var Repeated=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?new Any:i,o=t.local,a=o===void 0?false:o,s=__rest(t,["value","local"]);r=e.call(this,s)||this;r.value=n;r.local=a;return r}return t}(Any);var RawData=function(){function e(e){var t=e===void 0?{}:e,r=t.data,i=r===void 0?EMPTY_VIEW:r;this.dataView=buildExports.BufferSourceConverter.toUint8Array(i)}Object.defineProperty(e.prototype,"data",{get:function(){return this.dataView.slice().buffer},set:function(e){this.dataView=buildExports.BufferSourceConverter.toUint8Array(e)},enumerable:false,configurable:true});e.prototype.fromBER=function(e,t,r){var i=t+r;this.dataView=buildExports.BufferSourceConverter.toUint8Array(e).subarray(t,i);return i};e.prototype.toBER=function(e){return this.dataView.slice().buffer};return e}();function compareSchema(e,t,r){if(r instanceof Choice){for(var i=0,n=r.value;i<n.length;i++){var o=n[i];var a=compareSchema(e,t,o);if(a.verified){return{verified:true,result:e}}}{var s={verified:false,result:{error:"Wrong values for Choice type"}};if(r.hasOwnProperty(NAME))s.name=r.name;return s}}if(r instanceof Any){if(r.hasOwnProperty(NAME))e[r.name]=t;return{verified:true,result:e}}if(e instanceof Object===false){return{verified:false,result:{error:"Wrong root object"}}}if(t instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 data"}}}if(r instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(ID_BLOCK in r===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(FROM_BER in r.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(TO_BER in r.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}var c=r.idBlock.toBER(false);if(c.byteLength===0){return{verified:false,result:{error:"Error encoding idBlock for ASN.1 schema"}}}var u=r.idBlock.fromBER(c,0,c.byteLength);if(u===-1){return{verified:false,result:{error:"Error decoding idBlock for ASN.1 schema"}}}if(r.idBlock.hasOwnProperty(TAG_CLASS)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.tagClass!==t.idBlock.tagClass){return{verified:false,result:e}}if(r.idBlock.hasOwnProperty(TAG_NUMBER)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.tagNumber!==t.idBlock.tagNumber){return{verified:false,result:e}}if(r.idBlock.hasOwnProperty(IS_CONSTRUCTED)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.isConstructed!==t.idBlock.isConstructed){return{verified:false,result:e}}if(!(IS_HEX_ONLY in r.idBlock)){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.isHexOnly!==t.idBlock.isHexOnly){return{verified:false,result:e}}if(r.idBlock.isHexOnly){if(VALUE_HEX_VIEW in r.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}var p=r.idBlock.valueHexView;var f=t.idBlock.valueHexView;if(p.length!==f.length){return{verified:false,result:e}}for(var d=0;d<p.length;d++){if(p[d]!==f[1]){return{verified:false,result:e}}}}if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)e[r.name]=t}if(r instanceof typeStore.Constructed){var l=0;var a={verified:false,result:{error:"Unknown error"}};var y=r.valueBlock.value.length;if(y>0){if(r.valueBlock.value[0]instanceof Repeated){y=t.valueBlock.value.length}}if(y===0){return{verified:true,result:e}}if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){var v=true;for(var d=0;d<r.valueBlock.value.length;d++)v=v&&(r.valueBlock.value[d].optional||false);if(v){return{verified:true,result:e}}if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)delete e[r.name]}e.error="Inconsistent object length";return{verified:false,result:e}}for(var d=0;d<y;d++){if(d-l>=t.valueBlock.value.length){if(r.valueBlock.value[d].optional===false){var s={verified:false,result:e};e.error="Inconsistent length between ASN.1 data and schema";if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name){delete e[r.name];s.name=r.name}}return s}}else{if(r.valueBlock.value[0]instanceof Repeated){a=compareSchema(e,t.valueBlock.value[d],r.valueBlock.value[0].value);if(a.verified===false){if(r.valueBlock.value[0].optional)l++;else{if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)delete e[r.name]}return a}}if(NAME in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){var h={};if(LOCAL in r.valueBlock.value[0]&&r.valueBlock.value[0].local)h=t;else h=e;if(typeof h[r.valueBlock.value[0].name]==="undefined")h[r.valueBlock.value[0].name]=[];h[r.valueBlock.value[0].name].push(t.valueBlock.value[d])}}else{a=compareSchema(e,t.valueBlock.value[d-l],r.valueBlock.value[d]);if(a.verified===false){if(r.valueBlock.value[d].optional)l++;else{if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)delete e[r.name]}return a}}}}}if(a.verified===false){var s={verified:false,result:e};if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name){delete e[r.name];s.name=r.name}}return s}return{verified:true,result:e}}if(r.primitiveSchema&&VALUE_HEX_VIEW in t.valueBlock){var A=localFromBER(t.valueBlock.valueHexView);if(A.offset===-1){var s={verified:false,result:A.result};if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name){delete e[r.name];s.name=r.name}}return s}return compareSchema(e,A.result,r.primitiveSchema)}return{verified:true,result:e}}function verifySchema(e,t){if(t instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema type"}}}var r=localFromBER(buildExports.BufferSourceConverter.toUint8Array(e));if(r.offset===-1){return{verified:false,result:r.result}}return compareSchema(r.result,r.result,t)}var asn1js=Object.freeze({__proto__:null,Any:Any,BaseBlock:BaseBlock,BaseStringBlock:BaseStringBlock,BitString:BitString$1,BmpString:BmpString,Boolean:Boolean,CharacterString:CharacterString,Choice:Choice,Constructed:Constructed,DATE:DATE,DateTime:DateTime,Duration:Duration,EndOfContent:EndOfContent,Enumerated:Enumerated,GeneralString:GeneralString,GeneralizedTime:GeneralizedTime,GraphicString:GraphicString,HexBlock:HexBlock,IA5String:IA5String,Integer:Integer,Null:Null,NumericString:NumericString,ObjectIdentifier:ObjectIdentifier,OctetString:OctetString$1,Primitive:Primitive,PrintableString:PrintableString,RawData:RawData,RelativeObjectIdentifier:RelativeObjectIdentifier,Repeated:Repeated,Sequence:Sequence,Set:Set,TIME:TIME,TeletexString:TeletexString,TimeOfDay:TimeOfDay,UTCTime:UTCTime,UniversalString:UniversalString,Utf8String:Utf8String,ValueBlock:ValueBlock,VideotexString:VideotexString,ViewWriter:ViewWriter,VisibleString:VisibleString,compareSchema:compareSchema,fromBER:fromBER,verifySchema:verifySchema});var AsnTypeTypes;(function(e){e[e["Sequence"]=0]="Sequence";e[e["Set"]=1]="Set";e[e["Choice"]=2]="Choice"})(AsnTypeTypes||(AsnTypeTypes={}));var AsnPropTypes;(function(e){e[e["Any"]=1]="Any";e[e["Boolean"]=2]="Boolean";e[e["OctetString"]=3]="OctetString";e[e["BitString"]=4]="BitString";e[e["Integer"]=5]="Integer";e[e["Enumerated"]=6]="Enumerated";e[e["ObjectIdentifier"]=7]="ObjectIdentifier";e[e["Utf8String"]=8]="Utf8String";e[e["BmpString"]=9]="BmpString";e[e["UniversalString"]=10]="UniversalString";e[e["NumericString"]=11]="NumericString";e[e["PrintableString"]=12]="PrintableString";e[e["TeletexString"]=13]="TeletexString";e[e["VideotexString"]=14]="VideotexString";e[e["IA5String"]=15]="IA5String";e[e["GraphicString"]=16]="GraphicString";e[e["VisibleString"]=17]="VisibleString";e[e["GeneralString"]=18]="GeneralString";e[e["CharacterString"]=19]="CharacterString";e[e["UTCTime"]=20]="UTCTime";e[e["GeneralizedTime"]=21]="GeneralizedTime";e[e["DATE"]=22]="DATE";e[e["TimeOfDay"]=23]="TimeOfDay";e[e["DateTime"]=24]="DateTime";e[e["Duration"]=25]="Duration";e[e["TIME"]=26]="TIME";e[e["Null"]=27]="Null"})(AsnPropTypes||(AsnPropTypes={}));var BitString=function(){function e(e,t){if(t===void 0){t=0}this.unusedBits=0;this.value=new ArrayBuffer(0);if(e){if(typeof e==="number"){this.fromNumber(e)}else if(buildExports.BufferSourceConverter.isBufferSource(e)){this.unusedBits=t;this.value=buildExports.BufferSourceConverter.toArrayBuffer(e)}else{throw TypeError("Unsupported type of 'params' argument for BitString")}}}e.prototype.fromASN=function(e){if(!(e instanceof BitString$1)){throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString")}this.unusedBits=e.valueBlock.unusedBits;this.value=e.valueBlock.valueHex;return this};e.prototype.toASN=function(){return new BitString$1({unusedBits:this.unusedBits,valueHex:this.value})};e.prototype.toSchema=function(e){return new BitString$1({name:e})};e.prototype.toNumber=function(){var e="";var t=new Uint8Array(this.value);for(var r=0,i=t;r<i.length;r++){var n=i[r];e+=n.toString(2).padStart(8,"0")}e=e.split("").reverse().join("");if(this.unusedBits){e=e.slice(this.unusedBits).padStart(this.unusedBits,"0")}return parseInt(e,2)};e.prototype.fromNumber=function(e){var t=e.toString(2);var r=t.length+7>>3;this.unusedBits=(r<<3)-t.length;var i=new Uint8Array(r);t=t.padStart(r<<3,"0").split("").reverse().join("");var n=0;while(n<r){i[n]=parseInt(t.slice(n<<3,(n<<3)+8),2);n++}this.value=i.buffer};return e}();var OctetString=function(){function e(e){if(typeof e==="number"){this.buffer=new ArrayBuffer(e)}else{if(buildExports.BufferSourceConverter.isBufferSource(e)){this.buffer=buildExports.BufferSourceConverter.toArrayBuffer(e)}else if(Array.isArray(e)){this.buffer=new Uint8Array(e)}else{this.buffer=new ArrayBuffer(0)}}}Object.defineProperty(e.prototype,"byteLength",{get:function(){return this.buffer.byteLength},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"byteOffset",{get:function(){return 0},enumerable:false,configurable:true});e.prototype.fromASN=function(e){if(!(e instanceof OctetString$1)){throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString")}this.buffer=e.valueBlock.valueHex;return this};e.prototype.toASN=function(){return new OctetString$1({valueHex:this.buffer})};e.prototype.toSchema=function(e){return new OctetString$1({name:e})};return e}();var AsnAnyConverter={fromASN:function(e){return e instanceof Null?null:e.valueBeforeDecodeView},toASN:function(e){if(e===null){return new Null}var t=fromBER(e);if(t.result.error){throw new Error(t.result.error)}return t.result}};var AsnIntegerConverter={fromASN:function(e){return e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec},toASN:function(e){return new Integer({value:+e})}};var AsnEnumeratedConverter={fromASN:function(e){return e.valueBlock.valueDec},toASN:function(e){return new Enumerated({value:e})}};var AsnIntegerArrayBufferConverter={fromASN:function(e){return e.valueBlock.valueHexView},toASN:function(e){return new Integer({valueHex:e})}};var AsnBitStringConverter={fromASN:function(e){return e.valueBlock.valueHexView},toASN:function(e){return new BitString$1({valueHex:e})}};var AsnObjectIdentifierConverter={fromASN:function(e){return e.valueBlock.toString()},toASN:function(e){return new ObjectIdentifier({value:e})}};var AsnBooleanConverter={fromASN:function(e){return e.valueBlock.value},toASN:function(e){return new Boolean({value:e})}};var AsnOctetStringConverter={fromASN:function(e){return e.valueBlock.valueHexView},toASN:function(e){return new OctetString$1({valueHex:e})}};var AsnConstructedOctetStringConverter={fromASN:function(e){return new OctetString(e.getValue())},toASN:function(e){return e.toASN()}};function createStringConverter(e){return{fromASN:function(e){return e.valueBlock.value},toASN:function(t){return new e({value:t})}}}var AsnUtf8StringConverter=createStringConverter(Utf8String);var AsnBmpStringConverter=createStringConverter(BmpString);var AsnUniversalStringConverter=createStringConverter(UniversalString);var AsnNumericStringConverter=createStringConverter(NumericString);var AsnPrintableStringConverter=createStringConverter(PrintableString);var AsnTeletexStringConverter=createStringConverter(TeletexString);var AsnVideotexStringConverter=createStringConverter(VideotexString);var AsnIA5StringConverter=createStringConverter(IA5String);var AsnGraphicStringConverter=createStringConverter(GraphicString);var AsnVisibleStringConverter=createStringConverter(VisibleString);var AsnGeneralStringConverter=createStringConverter(GeneralString);var AsnCharacterStringConverter=createStringConverter(CharacterString);var AsnUTCTimeConverter={fromASN:function(e){return e.toDate()},toASN:function(e){return new UTCTime({valueDate:e})}};var AsnGeneralizedTimeConverter={fromASN:function(e){return e.toDate()},toASN:function(e){return new GeneralizedTime({valueDate:e})}};var AsnNullConverter={fromASN:function(){return null},toASN:function(){return new Null}};function defaultConverter(e){switch(e){case AsnPropTypes.Any:return AsnAnyConverter;case AsnPropTypes.BitString:return AsnBitStringConverter;case AsnPropTypes.BmpString:return AsnBmpStringConverter;case AsnPropTypes.Boolean:return AsnBooleanConverter;case AsnPropTypes.CharacterString:return AsnCharacterStringConverter;case AsnPropTypes.Enumerated:return AsnEnumeratedConverter;case AsnPropTypes.GeneralString:return AsnGeneralStringConverter;case AsnPropTypes.GeneralizedTime:return AsnGeneralizedTimeConverter;case AsnPropTypes.GraphicString:return AsnGraphicStringConverter;case AsnPropTypes.IA5String:return AsnIA5StringConverter;case AsnPropTypes.Integer:return AsnIntegerConverter;case AsnPropTypes.Null:return AsnNullConverter;case AsnPropTypes.NumericString:return AsnNumericStringConverter;case AsnPropTypes.ObjectIdentifier:return AsnObjectIdentifierConverter;case AsnPropTypes.OctetString:return AsnOctetStringConverter;case AsnPropTypes.PrintableString:return AsnPrintableStringConverter;case AsnPropTypes.TeletexString:return AsnTeletexStringConverter;case AsnPropTypes.UTCTime:return AsnUTCTimeConverter;case AsnPropTypes.UniversalString:return AsnUniversalStringConverter;case AsnPropTypes.Utf8String:return AsnUtf8StringConverter;case AsnPropTypes.VideotexString:return AsnVideotexStringConverter;case AsnPropTypes.VisibleString:return AsnVisibleStringConverter;default:return null}}function isConvertible(e){if(typeof e==="function"&&e.prototype){if(e.prototype.toASN&&e.prototype.fromASN){return true}else{return isConvertible(e.prototype)}}else{return!!(e&&typeof e==="object"&&"toASN"in e&&"fromASN"in e)}}function isTypeOfArray(e){var t;if(e){var r=Object.getPrototypeOf(e);if(((t=r===null||r===void 0?void 0:r.prototype)===null||t===void 0?void 0:t.constructor)===Array){return true}return isTypeOfArray(r)}return false}function isArrayEqual(e,t){if(!(e&&t)){return false}if(e.byteLength!==t.byteLength){return false}var r=new Uint8Array(e);var i=new Uint8Array(t);for(var n=0;n<e.byteLength;n++){if(r[n]!==i[n]){return false}}return true}var AsnSchemaStorage=function(){function e(){this.items=new WeakMap}e.prototype.has=function(e){return this.items.has(e)};e.prototype.get=function(e,t){if(t===void 0){t=false}var r=this.items.get(e);if(!r){throw new Error("Cannot get schema for '".concat(e.prototype.constructor.name,"' target"))}if(t&&!r.schema){throw new Error("Schema '".concat(e.prototype.constructor.name,"' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'."))}return r};e.prototype.cache=function(e){var t=this.get(e);if(!t.schema){t.schema=this.create(e,true)}};e.prototype.createDefault=function(e){var t={type:AsnTypeTypes.Sequence,items:{}};var r=this.findParentSchema(e);if(r){Object.assign(t,r);t.items=Object.assign({},t.items,r.items)}return t};e.prototype.create=function(e,t){var r=this.items.get(e)||this.createDefault(e);var i=[];for(var n in r.items){var o=r.items[n];var a=t?n:"";var s=void 0;if(typeof o.type==="number"){var c=AsnPropTypes[o.type];var u=asn1js[c];if(!u){throw new Error("Cannot get ASN1 class by name '".concat(c,"'"))}s=new u({name:a})}else if(isConvertible(o.type)){var p=new o.type;s=p.toSchema(a)}else if(o.optional){var f=this.get(o.type);if(f.type===AsnTypeTypes.Choice){s=new Any({name:a})}else{s=this.create(o.type,false);s.name=a}}else{s=new Any({name:a})}var d=!!o.optional||o.defaultValue!==undefined;if(o.repeated){s.name="";var l=o.repeated==="set"?Set:Sequence;s=new l({name:"",value:[new Repeated({name:a,value:s})]})}if(o.context!==null&&o.context!==undefined){if(o.implicit){if(typeof o.type==="number"||isConvertible(o.type)){var l=o.repeated?Constructed:Primitive;i.push(new l({name:a,optional:d,idBlock:{tagClass:3,tagNumber:o.context}}))}else{this.cache(o.type);var y=!!o.repeated;var v=!y?this.get(o.type,true).schema:s;v="valueBlock"in v?v.valueBlock.value:v.value;i.push(new Constructed({name:!y?a:"",optional:d,idBlock:{tagClass:3,tagNumber:o.context},value:v}))}}else{i.push(new Constructed({optional:d,idBlock:{tagClass:3,tagNumber:o.context},value:[s]}))}}else{s.optional=d;i.push(s)}}switch(r.type){case AsnTypeTypes.Sequence:return new Sequence({value:i,name:""});case AsnTypeTypes.Set:return new Set({value:i,name:""});case AsnTypeTypes.Choice:return new Choice({value:i,name:""});default:throw new Error("Unsupported ASN1 type in use")}};e.prototype.set=function(e,t){this.items.set(e,t);return this};e.prototype.findParentSchema=function(e){var t=Object.getPrototypeOf(e);if(t){var r=this.items.get(t);return r||this.findParentSchema(t)}return null};return e}();var schemaStorage=new AsnSchemaStorage;var AsnType=function(e){return function(t){var r;if(!schemaStorage.has(t)){r=schemaStorage.createDefault(t);schemaStorage.set(t,r)}else{r=schemaStorage.get(t)}Object.assign(r,e)}};var AsnProp=function(e){return function(t,r){var i;if(!schemaStorage.has(t.constructor)){i=schemaStorage.createDefault(t.constructor);schemaStorage.set(t.constructor,i)}else{i=schemaStorage.get(t.constructor)}var n=Object.assign({},e);if(typeof n.type==="number"&&!n.converter){var o=defaultConverter(e.type);if(!o){throw new Error("Cannot get default converter for property '".concat(r,"' of ").concat(t.constructor.name))}n.converter=o}n.raw=e.raw;i.items[r]=n}};var AsnSchemaValidationError=function(e){__extends(t,e);function t(){var t=e.apply(this,arguments)||this;t.schemas=[];return t}return t}(Error);var AsnParser=function(){function e(){}e.parse=function(e,t){var r=fromBER(e);if(r.result.error){throw new Error(r.result.error)}var i=this.fromASN(r.result,t);return i};e.fromASN=function(e,t){try{if(isConvertible(t)){var r=new t;return r.fromASN(e)}var i=schemaStorage.get(t);schemaStorage.cache(t);var n=i.schema;var o=this.handleChoiceTypes(e,i,t,n);if(o===null||o===void 0?void 0:o.result){return o.result}if(o===null||o===void 0?void 0:o.targetSchema){n=o.targetSchema}var a=this.handleSequenceTypes(e,i,t,n);var s=new t;if(isTypeOfArray(t)){return this.handleArrayTypes(e,i,t)}this.processSchemaItems(i,a,s);return s}catch(e){if(e instanceof AsnSchemaValidationError){e.schemas.push(t.name)}throw e}};e.handleChoiceTypes=function(e,t,r,i){if(e.constructor===Constructed&&t.type===AsnTypeTypes.Choice&&e.idBlock.tagClass===3){for(var n in t.items){var o=t.items[n];if(o.context===e.idBlock.tagNumber&&o.implicit){if(typeof o.type==="function"&&schemaStorage.has(o.type)){var a=schemaStorage.get(o.type);if(a&&a.type===AsnTypeTypes.Sequence){var s=new Sequence;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock){s.valueBlock.value=e.valueBlock.value;var c=this.fromASN(s,o.type);var u=new r;u[n]=c;return{result:u}}}}}}}else if(e.constructor===Constructed&&t.type!==AsnTypeTypes.Choice){var p=new Constructed({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:t.schema.valueBlock.value});for(var n in t.items){delete e[n]}return{targetSchema:p}}return null};e.handleSequenceTypes=function(e,t,r,i){if(t.type===AsnTypeTypes.Sequence){var n=compareSchema({},e,i);if(!n.verified){throw new AsnSchemaValidationError("Data does not match to ".concat(r.name," ASN1 schema.").concat(n.result.error?" ".concat(n.result.error):""))}return n}else{var n=compareSchema({},e,i);if(!n.verified){throw new AsnSchemaValidationError("Data does not match to ".concat(r.name," ASN1 schema.").concat(n.result.error?" ".concat(n.result.error):""))}return n}};e.processRepeatedField=function(e,t,r){var i=this;var n=e.slice(t);if(n.length===1&&n[0].constructor.name==="Sequence"){var o=n[0];if(o.valueBlock&&o.valueBlock.value&&Array.isArray(o.valueBlock.value)){n=o.valueBlock.value}}if(typeof r.type==="number"){var a=defaultConverter(r.type);if(!a)throw new Error("No converter for ASN.1 type ".concat(r.type));return n.filter((function(e){return e&&e.valueBlock})).map((function(e){try{return a.fromASN(e)}catch(e){return undefined}})).filter((function(e){return e!==undefined}))}else{return n.filter((function(e){return e&&e.valueBlock})).map((function(e){try{return i.fromASN(e,r.type)}catch(e){return undefined}})).filter((function(e){return e!==undefined}))}};e.processPrimitiveField=function(e,t){var r=defaultConverter(t.type);if(!r)throw new Error("No converter for ASN.1 type ".concat(t.type));return r.fromASN(e)};e.isOptionalChoiceField=function(e){return e.optional&&typeof e.type==="function"&&schemaStorage.has(e.type)&&schemaStorage.get(e.type).type===AsnTypeTypes.Choice};e.processOptionalChoiceField=function(e,t){try{var r=this.fromASN(e,t.type);return{processed:true,value:r}}catch(e){if(e instanceof AsnSchemaValidationError&&/Wrong values for Choice type/.test(e.message)){return{processed:false}}throw e}};e.handleArrayTypes=function(e,t,r){var i=this;if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value))){throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.")}var n=t.itemType;if(typeof n==="number"){var o=defaultConverter(n);if(!o){throw new Error("Cannot get default converter for array item of ".concat(r.name," ASN1 schema"))}return r.from(e.valueBlock.value,(function(e){return o.fromASN(e)}))}else{return r.from(e.valueBlock.value,(function(e){return i.fromASN(e,n)}))}};e.processSchemaItems=function(e,t,r){for(var i in e.items){var n=t.result[i];if(!n){continue}var o=e.items[i];var a=o.type;var s=void 0;if(typeof a==="number"||isConvertible(a)){s=this.processPrimitiveSchemaItem(n,o,a)}else{s=this.processComplexSchemaItem(n,o,a)}if(s&&typeof s==="object"&&"value"in s&&"raw"in s){r[i]=s.value;r["".concat(i,"Raw")]=s.raw}else{r[i]=s}}};e.processPrimitiveSchemaItem=function(e,t,r){var i;var n=(i=t.converter)!==null&&i!==void 0?i:isConvertible(r)?new r:null;if(!n){throw new Error("Converter is empty")}if(t.repeated){return this.processRepeatedPrimitiveItem(e,t,n)}else{return this.processSinglePrimitiveItem(e,t,r,n)}};e.processRepeatedPrimitiveItem=function(e,t,r){if(t.implicit){var i=t.repeated==="sequence"?Sequence:Set;var n=new i;n.valueBlock=e.valueBlock;var o=fromBER(n.toBER(false));if(o.offset===-1){throw new Error("Cannot parse the child item. ".concat(o.result.error))}if(!("value"in o.result.valueBlock&&Array.isArray(o.result.valueBlock.value))){throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.")}var a=o.result.valueBlock.value;return Array.from(a,(function(e){return r.fromASN(e)}))}else{return Array.from(e,(function(e){return r.fromASN(e)}))}};e.processSinglePrimitiveItem=function(e,t,r,i){var n=e;if(t.implicit){var o=void 0;if(isConvertible(r)){o=(new r).toSchema("")}else{var a=AsnPropTypes[r];var s=asn1js[a];if(!s){throw new Error("Cannot get '".concat(a,"' class from asn1js module"))}o=new s}o.valueBlock=n.valueBlock;n=fromBER(o.toBER(false)).result}return i.fromASN(n)};e.processComplexSchemaItem=function(e,t,r){var i=this;if(t.repeated){if(!Array.isArray(e)){throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.")}return Array.from(e,(function(e){return i.fromASN(e,r)}))}else{var n=this.handleImplicitTagging(e,t,r);if(this.isOptionalChoiceField(t)){try{return this.fromASN(n,r)}catch(e){if(e instanceof AsnSchemaValidationError&&/Wrong values for Choice type/.test(e.message)){return undefined}throw e}}else{var o=this.fromASN(n,r);if(t.raw){return{value:o,raw:e.valueBeforeDecodeView}}return o}}};e.handleImplicitTagging=function(e,t,r){if(t.implicit&&typeof t.context==="number"){var i=schemaStorage.get(r);if(i.type===AsnTypeTypes.Sequence){var n=new Sequence;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in n.valueBlock){n.valueBlock.value=e.valueBlock.value;return n}}else if(i.type===AsnTypeTypes.Set){var o=new Set;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in o.valueBlock){o.valueBlock.value=e.valueBlock.value;return o}}}return e};return e}();var AsnSerializer=function(){function e(){}e.serialize=function(e){if(e instanceof BaseBlock){return e.toBER(false)}return this.toASN(e).toBER(false)};e.toASN=function(t){var r=this;if(t&&typeof t==="object"&&isConvertible(t)){return t.toASN()}if(!(t&&typeof t==="object")){throw new TypeError("Parameter 1 should be type of Object.")}var i=t.constructor;var n=schemaStorage.get(i);schemaStorage.cache(i);var o=[];if(n.itemType){if(!Array.isArray(t)){throw new TypeError("Parameter 1 should be type of Array.")}if(typeof n.itemType==="number"){var a=defaultConverter(n.itemType);if(!a){throw new Error("Cannot get default converter for array item of ".concat(i.name," ASN1 schema"))}o=t.map((function(e){return a.toASN(e)}))}else{o=t.map((function(e){return r.toAsnItem({type:n.itemType},"[]",i,e)}))}}else{for(var s in n.items){var c=n.items[s];var u=t[s];if(u===undefined||c.defaultValue===u||typeof c.defaultValue==="object"&&typeof u==="object"&&isArrayEqual(this.serialize(c.defaultValue),this.serialize(u))){continue}var p=e.toAsnItem(c,s,i,u);if(typeof c.context==="number"){if(c.implicit){if(!c.repeated&&(typeof c.type==="number"||isConvertible(c.type))){var f={};f.valueHex=p instanceof Null?p.valueBeforeDecodeView:p.valueBlock.toBER();o.push(new Primitive(__assign({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context}},f)))}else{o.push(new Constructed({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:p.valueBlock.value}))}}else{o.push(new Constructed({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[p]}))}}else if(c.repeated){o=o.concat(p)}else{o.push(p)}}}var d;switch(n.type){case AsnTypeTypes.Sequence:d=new Sequence({value:o});break;case AsnTypeTypes.Set:d=new Set({value:o});break;case AsnTypeTypes.Choice:if(!o[0]){throw new Error("Schema '".concat(i.name,"' has wrong data. Choice cannot be empty."))}d=o[0];break}return d};e.toAsnItem=function(e,t,r,i){var n=this;var o;if(typeof e.type==="number"){var a=e.converter;if(!a){throw new Error("Property '".concat(t,"' doesn't have converter for type ").concat(AsnPropTypes[e.type]," in schema '").concat(r.name,"'"))}if(e.repeated){if(!Array.isArray(i)){throw new TypeError("Parameter 'objProp' should be type of Array.")}var s=Array.from(i,(function(e){return a.toASN(e)}));var c=e.repeated==="sequence"?Sequence:Set;o=new c({value:s})}else{o=a.toASN(i)}}else{if(e.repeated){if(!Array.isArray(i)){throw new TypeError("Parameter 'objProp' should be type of Array.")}var s=Array.from(i,(function(e){return n.toASN(e)}));var c=e.repeated==="sequence"?Sequence:Set;o=new c({value:s})}else{o=this.toASN(i)}}return o};return e}();var AsnArray=function(e){__extends(t,e);function t(t){if(t===void 0){t=[]}var r=this;if(typeof t==="number"){r=e.call(this,t)||this}else{r=e.call(this)||this;for(var i=0,n=t;i<n.length;i++){var o=n[i];r.push(o)}}return r}return t}(Array);var AsnConvert=function(){function e(){}e.serialize=function(e){return AsnSerializer.serialize(e)};e.parse=function(e,t){return AsnParser.parse(e,t)};e.toString=function(t){var r=buildExports.BufferSourceConverter.isBufferSource(t)?buildExports.BufferSourceConverter.toArrayBuffer(t):e.serialize(t);var i=fromBER(r);if(i.offset===-1){throw new Error("Cannot decode ASN.1 data. ".concat(i.result.error))}return i.result.toString()};return e}();function __decorate$1(e,t,r,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(n<3?a(o):n>3?a(t,r,o):a(t,r))||o;return n>3&&o&&Object.defineProperty(t,r,o),o}typeof SuppressedError==="function"?SuppressedError:function(e,t,r){var i=new Error(r);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};var IpConverter=function(){function e(){}e.isIPv4=function(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)};e.parseIPv4=function(e){var t=e.split(".");if(t.length!==4){throw new Error("Invalid IPv4 address")}return t.map((function(e){var t=parseInt(e,10);if(isNaN(t)||t<0||t>255){throw new Error("Invalid IPv4 address part")}return t}))};e.parseIPv6=function(e){var t=this.expandIPv6(e);var r=t.split(":");if(r.length!==8){throw new Error("Invalid IPv6 address")}return r.reduce((function(e,t){var r=parseInt(t,16);if(isNaN(r)||r<0||r>65535){throw new Error("Invalid IPv6 address part")}e.push(r>>8&255);e.push(r&255);return e}),[])};e.expandIPv6=function(e){if(!e.includes("::")){return e}var t=e.split("::");if(t.length>2){throw new Error("Invalid IPv6 address")}var r=t[0]?t[0].split(":"):[];var i=t[1]?t[1].split(":"):[];var n=8-(r.length+i.length);if(n<0){throw new Error("Invalid IPv6 address")}return __spreadArray(__spreadArray(__spreadArray([],r,true),Array(n).fill("0"),true),i,true).join(":")};e.formatIPv6=function(e){var t=[];for(var r=0;r<16;r+=2){t.push((e[r]<<8|e[r+1]).toString(16))}return this.compressIPv6(t.join(":"))};e.compressIPv6=function(e){var t=e.split(":");var r=-1;var i=0;var n=-1;var o=0;for(var a=0;a<t.length;a++){if(t[a]==="0"){if(n===-1){n=a}o++}else{if(o>i){r=n;i=o}n=-1;o=0}}if(o>i){r=n;i=o}if(i>1){var s=t.slice(0,r).join(":");var c=t.slice(r+i).join(":");return"".concat(s,"::").concat(c)}return e};e.parseCIDR=function(e){var t=e.split("/"),r=t[0],i=t[1];var n=parseInt(i,10);if(this.isIPv4(r)){if(n<0||n>32){throw new Error("Invalid IPv4 prefix length")}return[this.parseIPv4(r),n]}else{if(n<0||n>128){throw new Error("Invalid IPv6 prefix length")}return[this.parseIPv6(r),n]}};e.decodeIP=function(e){if(e.length===64&&parseInt(e,16)===0){return"::/0"}if(e.length!==16){return e}var t=parseInt(e.slice(8),16).toString(2).split("").reduce((function(e,t){return e+ +t}),0);var r=e.slice(0,8).replace(/(.{2})/g,(function(e){return"".concat(parseInt(e,16),".")}));r=r.slice(0,-1);return"".concat(r,"/").concat(t)};e.toString=function(e){var t=new Uint8Array(e);if(t.length===4){return Array.from(t).join(".")}if(t.length===16){return this.formatIPv6(t)}if(t.length===8||t.length===32){var r=t.length/2;var i=t.slice(0,r);var n=t.slice(r);var o=t.every((function(e){return e===0}));if(o){return t.length===8?"0.0.0.0/0":"::/0"}var a=n.reduce((function(e,t){return e+(t.toString(2).match(/1/g)||[]).length}),0);if(t.length===8){var s=Array.from(i).join(".");return"".concat(s,"/").concat(a)}else{var s=this.formatIPv6(i);return"".concat(s,"/").concat(a)}}return this.decodeIP(buildExports.Convert.ToHex(e))};e.fromString=function(e){if(e.includes("/")){var t=this.parseCIDR(e),r=t[0],i=t[1];var n=new Uint8Array(r.length);var o=i;for(var a=0;a<n.length;a++){if(o>=8){n[a]=255;o-=8}else if(o>0){n[a]=255<<8-o;o=0}}var s=new Uint8Array(r.length*2);s.set(r,0);s.set(n,r.length);return s.buffer}var c=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(c).buffer};return e}();var RelativeDistinguishedName_1,RDNSequence_1,Name_1;var DirectoryString=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}e.prototype.toString=function(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""};return e}();__decorate$1([AsnProp({type:AsnPropTypes.TeletexString})],DirectoryString.prototype,"teletexString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],DirectoryString.prototype,"printableString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.UniversalString})],DirectoryString.prototype,"universalString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],DirectoryString.prototype,"utf8String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],DirectoryString.prototype,"bmpString",void 0);DirectoryString=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DirectoryString);var AttributeValue=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;Object.assign(r,t);return r}t.prototype.toString=function(){return this.ia5String||(this.anyValue?buildExports.Convert.ToHex(this.anyValue):e.prototype.toString.call(this))};return t}(DirectoryString);__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],AttributeValue.prototype,"ia5String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],AttributeValue.prototype,"anyValue",void 0);AttributeValue=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],AttributeValue);var AttributeTypeAndValue=function(){function e(e){if(e===void 0){e={}}this.type="";this.value=new AttributeValue;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],AttributeTypeAndValue.prototype,"type",void 0);__decorate$1([AsnProp({type:AttributeValue})],AttributeTypeAndValue.prototype,"value",void 0);var RelativeDistinguishedName=RelativeDistinguishedName_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RelativeDistinguishedName_1.prototype);return r}return t}(AsnArray);RelativeDistinguishedName=RelativeDistinguishedName_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:AttributeTypeAndValue})],RelativeDistinguishedName);var RDNSequence=RDNSequence_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RDNSequence_1.prototype);return r}return t}(AsnArray);RDNSequence=RDNSequence_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:RelativeDistinguishedName})],RDNSequence);var Name$1=Name_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name_1.prototype);return r}return t}(RDNSequence);Name$1=Name_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],Name$1);var AsnIpConverter={fromASN:function(e){return IpConverter.toString(AsnOctetStringConverter.fromASN(e))},toASN:function(e){return AsnOctetStringConverter.toASN(IpConverter.fromString(e))}};var OtherName=function(){function e(e){if(e===void 0){e={}}this.typeId="";this.value=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherName.prototype,"typeId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],OtherName.prototype,"value",void 0);var EDIPartyName=function(){function e(e){if(e===void 0){e={}}this.partyName=new DirectoryString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DirectoryString,optional:true,context:0,implicit:true})],EDIPartyName.prototype,"nameAssigner",void 0);__decorate$1([AsnProp({type:DirectoryString,context:1,implicit:true})],EDIPartyName.prototype,"partyName",void 0);var GeneralName=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OtherName,context:0,implicit:true})],GeneralName.prototype,"otherName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:1,implicit:true})],GeneralName.prototype,"rfc822Name",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:2,implicit:true})],GeneralName.prototype,"dNSName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:3,implicit:true})],GeneralName.prototype,"x400Address",void 0);__decorate$1([AsnProp({type:Name$1,context:4,implicit:false})],GeneralName.prototype,"directoryName",void 0);__decorate$1([AsnProp({type:EDIPartyName,context:5})],GeneralName.prototype,"ediPartyName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:6,implicit:true})],GeneralName.prototype,"uniformResourceIdentifier",void 0);__decorate$1([AsnProp({type:AsnPropTypes.OctetString,context:7,implicit:true,converter:AsnIpConverter})],GeneralName.prototype,"iPAddress",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier,context:8,implicit:true})],GeneralName.prototype,"registeredID",void 0);GeneralName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],GeneralName);var id_pkix$1="1.3.6.1.5.5.7";var id_pe$1="".concat(id_pkix$1,".1");var id_ce="2.5.29";var AuthorityInfoAccessSyntax_1;var id_pe_authorityInfoAccess="".concat(id_pe$1,".1");var AccessDescription=function(){function e(e){if(e===void 0){e={}}this.accessMethod="";this.accessLocation=new GeneralName;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],AccessDescription.prototype,"accessMethod",void 0);__decorate$1([AsnProp({type:GeneralName})],AccessDescription.prototype,"accessLocation",void 0);var AuthorityInfoAccessSyntax=AuthorityInfoAccessSyntax_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AuthorityInfoAccessSyntax_1.prototype);return r}return t}(AsnArray);AuthorityInfoAccessSyntax=AuthorityInfoAccessSyntax_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AccessDescription})],AuthorityInfoAccessSyntax);var id_ce_authorityKeyIdentifier="".concat(id_ce,".35");var KeyIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var AuthorityKeyIdentifier=function(){function e(e){if(e===void 0){e={}}if(e){Object.assign(this,e)}}return e}();__decorate$1([AsnProp({type:KeyIdentifier,context:0,optional:true,implicit:true})],AuthorityKeyIdentifier.prototype,"keyIdentifier",void 0);__decorate$1([AsnProp({type:GeneralName,context:1,optional:true,implicit:true,repeated:"sequence"})],AuthorityKeyIdentifier.prototype,"authorityCertIssuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:2,optional:true,implicit:true,converter:AsnIntegerArrayBufferConverter})],AuthorityKeyIdentifier.prototype,"authorityCertSerialNumber",void 0);var id_ce_basicConstraints="".concat(id_ce,".19");var BasicConstraints=function(){function e(e){if(e===void 0){e={}}this.cA=false;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Boolean,defaultValue:false})],BasicConstraints.prototype,"cA",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],BasicConstraints.prototype,"pathLenConstraint",void 0);var GeneralNames_1;var GeneralNames=GeneralNames_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,GeneralNames_1.prototype);return r}return t}(AsnArray);GeneralNames=GeneralNames_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:GeneralName})],GeneralNames);var CertificateIssuer_1;var id_ce_certificateIssuer="".concat(id_ce,".29");var CertificateIssuer=CertificateIssuer_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertificateIssuer_1.prototype);return r}return t}(GeneralNames);CertificateIssuer=CertificateIssuer_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CertificateIssuer);var CertificatePolicies_1;var id_ce_certificatePolicies="".concat(id_ce,".32");var DisplayText=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}e.prototype.toString=function(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""};return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],DisplayText.prototype,"ia5String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.VisibleString})],DisplayText.prototype,"visibleString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],DisplayText.prototype,"bmpString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],DisplayText.prototype,"utf8String",void 0);DisplayText=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DisplayText);var NoticeReference=function(){function e(e){if(e===void 0){e={}}this.organization=new DisplayText;this.noticeNumbers=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DisplayText})],NoticeReference.prototype,"organization",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,repeated:"sequence"})],NoticeReference.prototype,"noticeNumbers",void 0);var UserNotice=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:NoticeReference,optional:true})],UserNotice.prototype,"noticeRef",void 0);__decorate$1([AsnProp({type:DisplayText,optional:true})],UserNotice.prototype,"explicitText",void 0);var Qualifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],Qualifier.prototype,"cPSuri",void 0);__decorate$1([AsnProp({type:UserNotice})],Qualifier.prototype,"userNotice",void 0);Qualifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Qualifier);var PolicyQualifierInfo=function(){function e(e){if(e===void 0){e={}}this.policyQualifierId="";this.qualifier=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyQualifierInfo.prototype,"policyQualifierId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],PolicyQualifierInfo.prototype,"qualifier",void 0);var PolicyInformation=function(){function e(e){if(e===void 0){e={}}this.policyIdentifier="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyInformation.prototype,"policyIdentifier",void 0);__decorate$1([AsnProp({type:PolicyQualifierInfo,repeated:"sequence",optional:true})],PolicyInformation.prototype,"policyQualifiers",void 0);var CertificatePolicies=CertificatePolicies_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertificatePolicies_1.prototype);return r}return t}(AsnArray);CertificatePolicies=CertificatePolicies_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:PolicyInformation})],CertificatePolicies);var id_ce_cRLNumber="".concat(id_ce,".20");var CRLNumber=function(){function e(e){if(e===void 0){e=0}this.value=e}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],CRLNumber.prototype,"value",void 0);CRLNumber=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CRLNumber);var id_ce_deltaCRLIndicator="".concat(id_ce,".27");var BaseCRLNumber=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(CRLNumber);BaseCRLNumber=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],BaseCRLNumber);var CRLDistributionPoints_1;var id_ce_cRLDistributionPoints="".concat(id_ce,".31");var ReasonFlags;(function(e){e[e["unused"]=1]="unused";e[e["keyCompromise"]=2]="keyCompromise";e[e["cACompromise"]=4]="cACompromise";e[e["affiliationChanged"]=8]="affiliationChanged";e[e["superseded"]=16]="superseded";e[e["cessationOfOperation"]=32]="cessationOfOperation";e[e["certificateHold"]=64]="certificateHold";e[e["privilegeWithdrawn"]=128]="privilegeWithdrawn";e[e["aACompromise"]=256]="aACompromise"})(ReasonFlags||(ReasonFlags={}));var Reason=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.toJSON=function(){var e=[];var t=this.toNumber();if(t&ReasonFlags.aACompromise){e.push("aACompromise")}if(t&ReasonFlags.affiliationChanged){e.push("affiliationChanged")}if(t&ReasonFlags.cACompromise){e.push("cACompromise")}if(t&ReasonFlags.certificateHold){e.push("certificateHold")}if(t&ReasonFlags.cessationOfOperation){e.push("cessationOfOperation")}if(t&ReasonFlags.keyCompromise){e.push("keyCompromise")}if(t&ReasonFlags.privilegeWithdrawn){e.push("privilegeWithdrawn")}if(t&ReasonFlags.superseded){e.push("superseded")}if(t&ReasonFlags.unused){e.push("unused")}return e};t.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return t}(BitString);var DistributionPointName=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0,repeated:"sequence",implicit:true})],DistributionPointName.prototype,"fullName",void 0);__decorate$1([AsnProp({type:RelativeDistinguishedName,context:1,implicit:true})],DistributionPointName.prototype,"nameRelativeToCRLIssuer",void 0);DistributionPointName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DistributionPointName);var DistributionPoint=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DistributionPointName,context:0,optional:true})],DistributionPoint.prototype,"distributionPoint",void 0);__decorate$1([AsnProp({type:Reason,context:1,optional:true,implicit:true})],DistributionPoint.prototype,"reasons",void 0);__decorate$1([AsnProp({type:GeneralName,context:2,optional:true,repeated:"sequence",implicit:true})],DistributionPoint.prototype,"cRLIssuer",void 0);var CRLDistributionPoints=CRLDistributionPoints_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CRLDistributionPoints_1.prototype);return r}return t}(AsnArray);CRLDistributionPoints=CRLDistributionPoints_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:DistributionPoint})],CRLDistributionPoints);var FreshestCRL_1;var FreshestCRL=FreshestCRL_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,FreshestCRL_1.prototype);return r}return t}(CRLDistributionPoints);FreshestCRL=FreshestCRL_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:DistributionPoint})],FreshestCRL);var id_ce_issuingDistributionPoint="".concat(id_ce,".28");var IssuingDistributionPoint=function(){function e(t){if(t===void 0){t={}}this.onlyContainsUserCerts=e.ONLY;this.onlyContainsCACerts=e.ONLY;this.indirectCRL=e.ONLY;this.onlyContainsAttributeCerts=e.ONLY;Object.assign(this,t)}return e}();IssuingDistributionPoint.ONLY=false;__decorate$1([AsnProp({type:DistributionPointName,context:0,optional:true})],IssuingDistributionPoint.prototype,"distributionPoint",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:1,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"onlyContainsUserCerts",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:2,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"onlyContainsCACerts",void 0);__decorate$1([AsnProp({type:Reason,context:3,optional:true,implicit:true})],IssuingDistributionPoint.prototype,"onlySomeReasons",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:4,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"indirectCRL",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:5,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"onlyContainsAttributeCerts",void 0);var id_ce_cRLReasons="".concat(id_ce,".21");var CRLReasons;(function(e){e[e["unspecified"]=0]="unspecified";e[e["keyCompromise"]=1]="keyCompromise";e[e["cACompromise"]=2]="cACompromise";e[e["affiliationChanged"]=3]="affiliationChanged";e[e["superseded"]=4]="superseded";e[e["cessationOfOperation"]=5]="cessationOfOperation";e[e["certificateHold"]=6]="certificateHold";e[e["removeFromCRL"]=8]="removeFromCRL";e[e["privilegeWithdrawn"]=9]="privilegeWithdrawn";e[e["aACompromise"]=10]="aACompromise"})(CRLReasons||(CRLReasons={}));var CRLReason=function(){function e(e){if(e===void 0){e=CRLReasons.unspecified}this.reason=CRLReasons.unspecified;this.reason=e}e.prototype.toJSON=function(){return CRLReasons[this.reason]};e.prototype.toString=function(){return this.toJSON()};return e}();__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],CRLReason.prototype,"reason",void 0);CRLReason=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CRLReason);var ExtendedKeyUsage_1;var id_ce_extKeyUsage="".concat(id_ce,".37");var ExtendedKeyUsage=ExtendedKeyUsage_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ExtendedKeyUsage_1.prototype);return r}return t}(AsnArray);ExtendedKeyUsage=ExtendedKeyUsage_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.ObjectIdentifier})],ExtendedKeyUsage);var id_ce_inhibitAnyPolicy="".concat(id_ce,".54");var InhibitAnyPolicy=function(){function e(e){if(e===void 0){e=new ArrayBuffer(0)}this.value=e}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],InhibitAnyPolicy.prototype,"value",void 0);InhibitAnyPolicy=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],InhibitAnyPolicy);var id_ce_invalidityDate="".concat(id_ce,".24");var InvalidityDate=function(){function e(e){this.value=new Date;if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],InvalidityDate.prototype,"value",void 0);InvalidityDate=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],InvalidityDate);var IssueAlternativeName_1;var id_ce_issuerAltName="".concat(id_ce,".18");var IssueAlternativeName=IssueAlternativeName_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,IssueAlternativeName_1.prototype);return r}return t}(GeneralNames);IssueAlternativeName=IssueAlternativeName_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],IssueAlternativeName);var id_ce_keyUsage="".concat(id_ce,".15");var KeyUsageFlags;(function(e){e[e["digitalSignature"]=1]="digitalSignature";e[e["nonRepudiation"]=2]="nonRepudiation";e[e["keyEncipherment"]=4]="keyEncipherment";e[e["dataEncipherment"]=8]="dataEncipherment";e[e["keyAgreement"]=16]="keyAgreement";e[e["keyCertSign"]=32]="keyCertSign";e[e["cRLSign"]=64]="cRLSign";e[e["encipherOnly"]=128]="encipherOnly";e[e["decipherOnly"]=256]="decipherOnly"})(KeyUsageFlags||(KeyUsageFlags={}));var KeyUsage=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.toJSON=function(){var e=this.toNumber();var t=[];if(e&KeyUsageFlags.cRLSign){t.push("crlSign")}if(e&KeyUsageFlags.dataEncipherment){t.push("dataEncipherment")}if(e&KeyUsageFlags.decipherOnly){t.push("decipherOnly")}if(e&KeyUsageFlags.digitalSignature){t.push("digitalSignature")}if(e&KeyUsageFlags.encipherOnly){t.push("encipherOnly")}if(e&KeyUsageFlags.keyAgreement){t.push("keyAgreement")}if(e&KeyUsageFlags.keyCertSign){t.push("keyCertSign")}if(e&KeyUsageFlags.keyEncipherment){t.push("keyEncipherment")}if(e&KeyUsageFlags.nonRepudiation){t.push("nonRepudiation")}return t};t.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return t}(BitString);var GeneralSubtrees_1;var id_ce_nameConstraints="".concat(id_ce,".30");var GeneralSubtree=function(){function e(e){if(e===void 0){e={}}this.base=new GeneralName;this.minimum=0;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName})],GeneralSubtree.prototype,"base",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:0,defaultValue:0,implicit:true})],GeneralSubtree.prototype,"minimum",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:1,optional:true,implicit:true})],GeneralSubtree.prototype,"maximum",void 0);var GeneralSubtrees=GeneralSubtrees_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,GeneralSubtrees_1.prototype);return r}return t}(AsnArray);GeneralSubtrees=GeneralSubtrees_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:GeneralSubtree})],GeneralSubtrees);var NameConstraints=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralSubtrees,context:0,optional:true,implicit:true})],NameConstraints.prototype,"permittedSubtrees",void 0);__decorate$1([AsnProp({type:GeneralSubtrees,context:1,optional:true,implicit:true})],NameConstraints.prototype,"excludedSubtrees",void 0);var id_ce_policyConstraints="".concat(id_ce,".36");var PolicyConstraints=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:0,implicit:true,optional:true,converter:AsnIntegerArrayBufferConverter})],PolicyConstraints.prototype,"requireExplicitPolicy",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:1,implicit:true,optional:true,converter:AsnIntegerArrayBufferConverter})],PolicyConstraints.prototype,"inhibitPolicyMapping",void 0);var PolicyMappings_1;var id_ce_policyMappings="".concat(id_ce,".33");var PolicyMapping=function(){function e(e){if(e===void 0){e={}}this.issuerDomainPolicy="";this.subjectDomainPolicy="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyMapping.prototype,"issuerDomainPolicy",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyMapping.prototype,"subjectDomainPolicy",void 0);var PolicyMappings=PolicyMappings_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,PolicyMappings_1.prototype);return r}return t}(AsnArray);PolicyMappings=PolicyMappings_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:PolicyMapping})],PolicyMappings);var SubjectAlternativeName_1;var id_ce_subjectAltName="".concat(id_ce,".17");var SubjectAlternativeName=SubjectAlternativeName_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SubjectAlternativeName_1.prototype);return r}return t}(GeneralNames);SubjectAlternativeName=SubjectAlternativeName_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SubjectAlternativeName);var Attribute$1=function(){function e(e){if(e===void 0){e={}}this.type="";this.values=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Attribute$1.prototype,"type",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,repeated:"set"})],Attribute$1.prototype,"values",void 0);var SubjectDirectoryAttributes_1;var id_ce_subjectDirectoryAttributes="".concat(id_ce,".9");var SubjectDirectoryAttributes=SubjectDirectoryAttributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SubjectDirectoryAttributes_1.prototype);return r}return t}(AsnArray);SubjectDirectoryAttributes=SubjectDirectoryAttributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Attribute$1})],SubjectDirectoryAttributes);var id_ce_subjectKeyIdentifier="".concat(id_ce,".14");var SubjectKeyIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(KeyIdentifier);var id_ce_privateKeyUsagePeriod="".concat(id_ce,".16");var PrivateKeyUsagePeriod=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,context:0,implicit:true,optional:true})],PrivateKeyUsagePeriod.prototype,"notBefore",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,context:1,implicit:true,optional:true})],PrivateKeyUsagePeriod.prototype,"notAfter",void 0);var id_entrust_entrustVersInfo="1.2.840.113533.7.65.0";var EntrustInfoFlags;(function(e){e[e["keyUpdateAllowed"]=1]="keyUpdateAllowed";e[e["newExtensions"]=2]="newExtensions";e[e["pKIXCertificate"]=4]="pKIXCertificate"})(EntrustInfoFlags||(EntrustInfoFlags={}));var EntrustInfo=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.toJSON=function(){var e=[];var t=this.toNumber();if(t&EntrustInfoFlags.pKIXCertificate){e.push("pKIXCertificate")}if(t&EntrustInfoFlags.newExtensions){e.push("newExtensions")}if(t&EntrustInfoFlags.keyUpdateAllowed){e.push("keyUpdateAllowed")}return e};t.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return t}(BitString);var EntrustVersionInfo=function(){function e(e){if(e===void 0){e={}}this.entrustVers="";this.entrustInfoFlags=new EntrustInfo;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralString})],EntrustVersionInfo.prototype,"entrustVers",void 0);__decorate$1([AsnProp({type:EntrustInfo})],EntrustVersionInfo.prototype,"entrustInfoFlags",void 0);var SubjectInfoAccessSyntax_1;var id_pe_subjectInfoAccess="".concat(id_pe$1,".11");var SubjectInfoAccessSyntax=SubjectInfoAccessSyntax_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SubjectInfoAccessSyntax_1.prototype);return r}return t}(AsnArray);SubjectInfoAccessSyntax=SubjectInfoAccessSyntax_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AccessDescription})],SubjectInfoAccessSyntax);var AlgorithmIdentifier=function(){function e(e){if(e===void 0){e={}}this.algorithm="";Object.assign(this,e)}e.prototype.isEqual=function(t){return t instanceof e&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&buildExports.isEqual(t.parameters,this.parameters)||t.parameters===this.parameters)};return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],AlgorithmIdentifier.prototype,"algorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,optional:true})],AlgorithmIdentifier.prototype,"parameters",void 0);var SubjectPublicKeyInfo=function(){function e(e){if(e===void 0){e={}}this.algorithm=new AlgorithmIdentifier;this.subjectPublicKey=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],SubjectPublicKeyInfo.prototype,"algorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],SubjectPublicKeyInfo.prototype,"subjectPublicKey",void 0);var Time=function(){function e(e){if(e){if(typeof e==="string"||typeof e==="number"||e instanceof Date){var t=new Date(e);if(t.getUTCFullYear()>2049){this.generalTime=t}else{this.utcTime=t}}else{Object.assign(this,e)}}}e.prototype.getTime=function(){var e=this.utcTime||this.generalTime;if(!e){throw new Error("Cannot get time from CHOICE object")}return e};return e}();__decorate$1([AsnProp({type:AsnPropTypes.UTCTime})],Time.prototype,"utcTime",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],Time.prototype,"generalTime",void 0);Time=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Time);var Validity=function(){function e(e){this.notBefore=new Time(new Date);this.notAfter=new Time(new Date);if(e){this.notBefore=new Time(e.notBefore);this.notAfter=new Time(e.notAfter)}}return e}();__decorate$1([AsnProp({type:Time})],Validity.prototype,"notBefore",void 0);__decorate$1([AsnProp({type:Time})],Validity.prototype,"notAfter",void 0);var Extensions_1;var Extension$1=function(){function e(t){if(t===void 0){t={}}this.extnID="";this.critical=e.CRITICAL;this.extnValue=new OctetString;Object.assign(this,t)}return e}();Extension$1.CRITICAL=false;__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Extension$1.prototype,"extnID",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,defaultValue:Extension$1.CRITICAL})],Extension$1.prototype,"critical",void 0);__decorate$1([AsnProp({type:OctetString})],Extension$1.prototype,"extnValue",void 0);var Extensions=Extensions_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Extensions_1.prototype);return r}return t}(AsnArray);Extensions=Extensions_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Extension$1})],Extensions);var Version$4;(function(e){e[e["v1"]=0]="v1";e[e["v2"]=1]="v2";e[e["v3"]=2]="v3"})(Version$4||(Version$4={}));var TBSCertificate=function(){function e(e){if(e===void 0){e={}}this.version=Version$4.v1;this.serialNumber=new ArrayBuffer(0);this.signature=new AlgorithmIdentifier;this.issuer=new Name$1;this.validity=new Validity;this.subject=new Name$1;this.subjectPublicKeyInfo=new SubjectPublicKeyInfo;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:0,defaultValue:Version$4.v1})],TBSCertificate.prototype,"version",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],TBSCertificate.prototype,"serialNumber",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],TBSCertificate.prototype,"signature",void 0);__decorate$1([AsnProp({type:Name$1})],TBSCertificate.prototype,"issuer",void 0);__decorate$1([AsnProp({type:Validity})],TBSCertificate.prototype,"validity",void 0);__decorate$1([AsnProp({type:Name$1})],TBSCertificate.prototype,"subject",void 0);__decorate$1([AsnProp({type:SubjectPublicKeyInfo})],TBSCertificate.prototype,"subjectPublicKeyInfo",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:1,implicit:true,optional:true})],TBSCertificate.prototype,"issuerUniqueID",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:2,implicit:true,optional:true})],TBSCertificate.prototype,"subjectUniqueID",void 0);__decorate$1([AsnProp({type:Extensions,context:3,optional:true})],TBSCertificate.prototype,"extensions",void 0);var Certificate=function(){function e(e){if(e===void 0){e={}}this.tbsCertificate=new TBSCertificate;this.signatureAlgorithm=new AlgorithmIdentifier;this.signatureValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:TBSCertificate,raw:true})],Certificate.prototype,"tbsCertificate",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],Certificate.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],Certificate.prototype,"signatureValue",void 0);var RevokedCertificate=function(){function e(e){if(e===void 0){e={}}this.userCertificate=new ArrayBuffer(0);this.revocationDate=new Time;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RevokedCertificate.prototype,"userCertificate",void 0);__decorate$1([AsnProp({type:Time})],RevokedCertificate.prototype,"revocationDate",void 0);__decorate$1([AsnProp({type:Extension$1,optional:true,repeated:"sequence"})],RevokedCertificate.prototype,"crlEntryExtensions",void 0);var TBSCertList=function(){function e(e){if(e===void 0){e={}}this.signature=new AlgorithmIdentifier;this.issuer=new Name$1;this.thisUpdate=new Time;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],TBSCertList.prototype,"version",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],TBSCertList.prototype,"signature",void 0);__decorate$1([AsnProp({type:Name$1})],TBSCertList.prototype,"issuer",void 0);__decorate$1([AsnProp({type:Time})],TBSCertList.prototype,"thisUpdate",void 0);__decorate$1([AsnProp({type:Time,optional:true})],TBSCertList.prototype,"nextUpdate",void 0);__decorate$1([AsnProp({type:RevokedCertificate,repeated:"sequence",optional:true})],TBSCertList.prototype,"revokedCertificates",void 0);__decorate$1([AsnProp({type:Extension$1,optional:true,context:0,repeated:"sequence"})],TBSCertList.prototype,"crlExtensions",void 0);var CertificateList=function(){function e(e){if(e===void 0){e={}}this.tbsCertList=new TBSCertList;this.signatureAlgorithm=new AlgorithmIdentifier;this.signature=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:TBSCertList,raw:true})],CertificateList.prototype,"tbsCertList",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],CertificateList.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],CertificateList.prototype,"signature",void 0);var id_ecPublicKey="1.2.840.10045.2.1";var id_ecdsaWithSHA1="1.2.840.10045.4.1";var id_ecdsaWithSHA224="1.2.840.10045.4.3.1";var id_ecdsaWithSHA256="1.2.840.10045.4.3.2";var id_ecdsaWithSHA384="1.2.840.10045.4.3.3";var id_ecdsaWithSHA512="1.2.840.10045.4.3.4";function create$1(e){return new AlgorithmIdentifier({algorithm:e})}create$1(id_ecdsaWithSHA1);create$1(id_ecdsaWithSHA224);create$1(id_ecdsaWithSHA256);create$1(id_ecdsaWithSHA384);create$1(id_ecdsaWithSHA512);var FieldID=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],FieldID.prototype,"fieldType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],FieldID.prototype,"parameters",void 0);FieldID=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],FieldID);var ECPoint=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var Curve=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.OctetString})],Curve.prototype,"a",void 0);__decorate$1([AsnProp({type:AsnPropTypes.OctetString})],Curve.prototype,"b",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,optional:true})],Curve.prototype,"seed",void 0);Curve=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],Curve);var ECPVer;(function(e){e[e["ecpVer1"]=1]="ecpVer1"})(ECPVer||(ECPVer={}));var SpecifiedECDomain=function(){function e(e){if(e===void 0){e={}}this.version=ECPVer.ecpVer1;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SpecifiedECDomain.prototype,"version",void 0);__decorate$1([AsnProp({type:FieldID})],SpecifiedECDomain.prototype,"fieldID",void 0);__decorate$1([AsnProp({type:Curve})],SpecifiedECDomain.prototype,"curve",void 0);__decorate$1([AsnProp({type:ECPoint})],SpecifiedECDomain.prototype,"base",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],SpecifiedECDomain.prototype,"order",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],SpecifiedECDomain.prototype,"cofactor",void 0);SpecifiedECDomain=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SpecifiedECDomain);var ECParameters=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],ECParameters.prototype,"namedCurve",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Null})],ECParameters.prototype,"implicitCurve",void 0);__decorate$1([AsnProp({type:SpecifiedECDomain})],ECParameters.prototype,"specifiedCurve",void 0);ECParameters=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],ECParameters);var ECPrivateKey=function(){function e(e){if(e===void 0){e={}}this.version=1;this.privateKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ECPrivateKey.prototype,"version",void 0);__decorate$1([AsnProp({type:OctetString})],ECPrivateKey.prototype,"privateKey",void 0);__decorate$1([AsnProp({type:ECParameters,context:0,optional:true})],ECPrivateKey.prototype,"parameters",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:1,optional:true})],ECPrivateKey.prototype,"publicKey",void 0);var ECDSASigValue=function(){function e(e){if(e===void 0){e={}}this.r=new ArrayBuffer(0);this.s=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],ECDSASigValue.prototype,"r",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],ECDSASigValue.prototype,"s",void 0);var id_pkcs_1="1.2.840.113549.1.1";var id_rsaEncryption="".concat(id_pkcs_1,".1");var id_RSAES_OAEP="".concat(id_pkcs_1,".7");var id_pSpecified="".concat(id_pkcs_1,".9");var id_RSASSA_PSS="".concat(id_pkcs_1,".10");var id_md2WithRSAEncryption="".concat(id_pkcs_1,".2");var id_md5WithRSAEncryption="".concat(id_pkcs_1,".4");var id_sha1WithRSAEncryption="".concat(id_pkcs_1,".5");var id_sha384WithRSAEncryption="".concat(id_pkcs_1,".12");var id_sha512WithRSAEncryption="".concat(id_pkcs_1,".13");var id_sha512_224WithRSAEncryption="".concat(id_pkcs_1,".15");var id_sha512_256WithRSAEncryption="".concat(id_pkcs_1,".16");var id_sha1="1.3.14.3.2.26";var id_sha224="2.16.840.1.101.3.4.2.4";var id_sha256="2.16.840.1.101.3.4.2.1";var id_sha384="2.16.840.1.101.3.4.2.2";var id_sha512="2.16.840.1.101.3.4.2.3";var id_sha512_224="2.16.840.1.101.3.4.2.5";var id_sha512_256="2.16.840.1.101.3.4.2.6";var id_md2="1.2.840.113549.2.2";var id_md5="1.2.840.113549.2.5";var id_mgf1="".concat(id_pkcs_1,".8");function create(e){return new AlgorithmIdentifier({algorithm:e,parameters:null})}create(id_md2);create(id_md5);var sha1=create(id_sha1);create(id_sha224);create(id_sha256);create(id_sha384);create(id_sha512);create(id_sha512_224);create(id_sha512_256);var mgf1SHA1=new AlgorithmIdentifier({algorithm:id_mgf1,parameters:AsnConvert.serialize(sha1)});var pSpecifiedEmpty=new AlgorithmIdentifier({algorithm:id_pSpecified,parameters:AsnConvert.serialize(AsnOctetStringConverter.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});create(id_rsaEncryption);create(id_md2WithRSAEncryption);create(id_md5WithRSAEncryption);create(id_sha1WithRSAEncryption);create(id_sha512_224WithRSAEncryption);create(id_sha512_256WithRSAEncryption);create(id_sha384WithRSAEncryption);create(id_sha512WithRSAEncryption);create(id_sha512_224WithRSAEncryption);create(id_sha512_256WithRSAEncryption);var RsaEsOaepParams=function(){function e(e){if(e===void 0){e={}}this.hashAlgorithm=new AlgorithmIdentifier(sha1);this.maskGenAlgorithm=new AlgorithmIdentifier({algorithm:id_mgf1,parameters:AsnConvert.serialize(sha1)});this.pSourceAlgorithm=new AlgorithmIdentifier(pSpecifiedEmpty);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier,context:0,defaultValue:sha1})],RsaEsOaepParams.prototype,"hashAlgorithm",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier,context:1,defaultValue:mgf1SHA1})],RsaEsOaepParams.prototype,"maskGenAlgorithm",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier,context:2,defaultValue:pSpecifiedEmpty})],RsaEsOaepParams.prototype,"pSourceAlgorithm",void 0);new AlgorithmIdentifier({algorithm:id_RSAES_OAEP,parameters:AsnConvert.serialize(new RsaEsOaepParams)});var RsaSaPssParams=function(){function e(e){if(e===void 0){e={}}this.hashAlgorithm=new AlgorithmIdentifier(sha1);this.maskGenAlgorithm=new AlgorithmIdentifier({algorithm:id_mgf1,parameters:AsnConvert.serialize(sha1)});this.saltLength=20;this.trailerField=1;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier,context:0,defaultValue:sha1})],RsaSaPssParams.prototype,"hashAlgorithm",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier,context:1,defaultValue:mgf1SHA1})],RsaSaPssParams.prototype,"maskGenAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:2,defaultValue:20})],RsaSaPssParams.prototype,"saltLength",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:3,defaultValue:1})],RsaSaPssParams.prototype,"trailerField",void 0);new AlgorithmIdentifier({algorithm:id_RSASSA_PSS,parameters:AsnConvert.serialize(new RsaSaPssParams)});var DigestInfo=function(){function e(e){if(e===void 0){e={}}this.digestAlgorithm=new AlgorithmIdentifier;this.digest=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],DigestInfo.prototype,"digestAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],DigestInfo.prototype,"digest",void 0);var OtherPrimeInfos_1;var OtherPrimeInfo=function(){function e(e){if(e===void 0){e={}}this.prime=new ArrayBuffer(0);this.exponent=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],OtherPrimeInfo.prototype,"prime",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],OtherPrimeInfo.prototype,"exponent",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],OtherPrimeInfo.prototype,"coefficient",void 0);var OtherPrimeInfos=OtherPrimeInfos_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,OtherPrimeInfos_1.prototype);return r}return t}(AsnArray);OtherPrimeInfos=OtherPrimeInfos_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:OtherPrimeInfo})],OtherPrimeInfos);var RSAPrivateKey=function(){function e(e){if(e===void 0){e={}}this.version=0;this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);this.privateExponent=new ArrayBuffer(0);this.prime1=new ArrayBuffer(0);this.prime2=new ArrayBuffer(0);this.exponent1=new ArrayBuffer(0);this.exponent2=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],RSAPrivateKey.prototype,"version",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"modulus",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"publicExponent",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"privateExponent",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"prime1",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"prime2",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"exponent1",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"exponent2",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"coefficient",void 0);__decorate$1([AsnProp({type:OtherPrimeInfos,optional:true})],RSAPrivateKey.prototype,"otherPrimeInfos",void 0);var RSAPublicKey=function(){function e(e){if(e===void 0){e={}}this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPublicKey.prototype,"modulus",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPublicKey.prototype,"publicExponent",void 0);var CompositeParams_1,CompositeSignatureValue_1;var id_alg_composite="1.3.6.1.4.1.18227.2.1";var CompositeParams=CompositeParams_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositeParams_1.prototype);return r}return t}(AsnArray);CompositeParams=CompositeParams_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AlgorithmIdentifier})],CompositeParams);var CompositeSignatureValue=CompositeSignatureValue_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositeSignatureValue_1.prototype);return r}return t}(AsnArray);CompositeSignatureValue=CompositeSignatureValue_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.BitString})],CompositeSignatureValue);var EncryptedData=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var EncryptedPrivateKeyInfo$1=function(){function e(e){if(e===void 0){e={}}this.encryptionAlgorithm=new AlgorithmIdentifier;this.encryptedData=new EncryptedData;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],EncryptedPrivateKeyInfo$1.prototype,"encryptionAlgorithm",void 0);__decorate$1([AsnProp({type:EncryptedData})],EncryptedPrivateKeyInfo$1.prototype,"encryptedData",void 0);var Attributes_1$1;var Version$3;(function(e){e[e["v1"]=0]="v1"})(Version$3||(Version$3={}));var PrivateKey=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var Attributes$1=Attributes_1$1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Attributes_1$1.prototype);return r}return t}(AsnArray);Attributes$1=Attributes_1$1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Attribute$1})],Attributes$1);var PrivateKeyInfo$1=function(){function e(e){if(e===void 0){e={}}this.version=Version$3.v1;this.privateKeyAlgorithm=new AlgorithmIdentifier;this.privateKey=new PrivateKey;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],PrivateKeyInfo$1.prototype,"version",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],PrivateKeyInfo$1.prototype,"privateKeyAlgorithm",void 0);__decorate$1([AsnProp({type:PrivateKey})],PrivateKeyInfo$1.prototype,"privateKey",void 0);__decorate$1([AsnProp({type:Attributes$1,implicit:true,context:0,optional:true})],PrivateKeyInfo$1.prototype,"attributes",void 0);var AsymmetricKeyPackage_1;var Version$2;(function(e){e[e["v1"]=0]="v1";e[e["v2"]=1]="v2"})(Version$2||(Version$2={}));var PrivateKeyAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);PrivateKeyAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],PrivateKeyAlgorithmIdentifier);var OneAsymmetricKey=function(){function e(){this.version=Version$2.v1;this.privateKeyAlgorithm=new AlgorithmIdentifier;this.privateKey=new ArrayBuffer(0)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],OneAsymmetricKey.prototype,"version",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],OneAsymmetricKey.prototype,"privateKeyAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.OctetString})],OneAsymmetricKey.prototype,"privateKey",void 0);__decorate$1([AsnProp({type:Attributes$1,context:0,implicit:true,optional:true})],OneAsymmetricKey.prototype,"attributes",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:1,implicit:true,optional:true})],OneAsymmetricKey.prototype,"publicKey",void 0);OneAsymmetricKey=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],OneAsymmetricKey);var PrivateKeyInfo=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OneAsymmetricKey);PrivateKeyInfo=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],PrivateKeyInfo);var AsymmetricKeyPackage=AsymmetricKeyPackage_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AsymmetricKeyPackage_1.prototype);return r}return t}(AsnArray);AsymmetricKeyPackage=AsymmetricKeyPackage_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:OneAsymmetricKey})],AsymmetricKeyPackage);var CompositePublicKey_1,CompositePrivateKey_1;var id_composite_key="2.16.840.1.114027.80.4.1";var CompositeAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);CompositeAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CompositeAlgorithmIdentifier);var CompositePublicKey=CompositePublicKey_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositePublicKey_1.prototype);return r}return t}(AsnArray);CompositePublicKey=CompositePublicKey_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:SubjectPublicKeyInfo})],CompositePublicKey);var CompositePrivateKey=CompositePrivateKey_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositePrivateKey_1.prototype);return r}return t}(AsnArray);CompositePrivateKey=CompositePrivateKey_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:OneAsymmetricKey})],CompositePrivateKey);var dayjs_min$1={exports:{}};var dayjs_min=dayjs_min$1.exports;var hasRequiredDayjs_min;function requireDayjs_min(){if(hasRequiredDayjs_min)return dayjs_min$1.exports;hasRequiredDayjs_min=1;(function(e,t){!function(t,r){e.exports=r()}(dayjs_min,(function(){var e=1e3,t=6e4,r=36e5,i="millisecond",n="second",o="minute",a="hour",s="day",c="week",u="month",p="quarter",f="year",d="date",l="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|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,h={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(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},A=function(e,t,r){var i=String(e);return!i||i.length>=t?e:""+Array(t+1-i.length).join(r)+e},_={s:A,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),i=Math.floor(r/60),n=r%60;return(t<=0?"+":"-")+A(i,2,"0")+":"+A(n,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var i=12*(r.year()-t.year())+(r.month()-t.month()),n=t.clone().add(i,u),o=r-n<0,a=t.clone().add(i+(o?-1:1),u);return+(-(i+(r-n)/(o?n-a:a-n))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:f,w:c,d:s,D:d,h:a,m:o,s:n,ms:i,Q:p}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},S="en",g={};g[S]=h;var m="$isDayjsObject",C=function(e){return e instanceof I||!(!e||!e[m])},P=function e(t,r,i){var n;if(!t)return S;if("string"==typeof t){var o=t.toLowerCase();g[o]&&(n=o),r&&(g[o]=r,n=o);var a=t.split("-");if(!n&&a.length>1)return e(a[0])}else{var s=t.name;g[s]=t,n=s}return!i&&n&&(S=n),n||!i&&S},T=function(e,t){if(C(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new I(r)},E=_;E.l=P,E.i=C,E.w=function(e,t){return T(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var I=function(){function h(e){this.$L=P(e.locale,null,true),this.parse(e),this.$x=this.$x||e.x||{},this[m]=true}var A=h.prototype;return A.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var i=t.match(y);if(i){var n=i[2]-1||0,o=(i[7]||"0").substring(0,3);return r?new Date(Date.UTC(i[1],n,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)):new Date(i[1],n,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)}}return new Date(t)}(e),this.init()},A.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},A.$utils=function(){return E},A.isValid=function(){return!(this.$d.toString()===l)},A.isSame=function(e,t){var r=T(e);return this.startOf(t)<=r&&r<=this.endOf(t)},A.isAfter=function(e,t){return T(e)<this.startOf(t)},A.isBefore=function(e,t){return this.endOf(t)<T(e)},A.$g=function(e,t,r){return E.u(e)?this[t]:this.set(r,e)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function(e,t){var r=this,i=!!E.u(t)||t,p=E.p(e),l=function(e,t){var n=E.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return i?n:n.endOf(s)},y=function(e,t){return E.w(r.toDate()[e].apply(r.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},v=this.$W,h=this.$M,A=this.$D,_="set"+(this.$u?"UTC":"");switch(p){case f:return i?l(1,0):l(31,11);case u:return i?l(1,h):l(0,h+1);case c:var S=this.$locale().weekStart||0,g=(v<S?v+7:v)-S;return l(i?A-g:A+(6-g),h);case s:case d:return y(_+"Hours",0);case a:return y(_+"Minutes",1);case o:return y(_+"Seconds",2);case n:return y(_+"Milliseconds",3);default:return this.clone()}},A.endOf=function(e){return this.startOf(e,false)},A.$set=function(e,t){var r,c=E.p(e),p="set"+(this.$u?"UTC":""),l=(r={},r[s]=p+"Date",r[d]=p+"Date",r[u]=p+"Month",r[f]=p+"FullYear",r[a]=p+"Hours",r[o]=p+"Minutes",r[n]=p+"Seconds",r[i]=p+"Milliseconds",r)[c],y=c===s?this.$D+(t-this.$W):t;if(c===u||c===f){var v=this.clone().set(d,1);v.$d[l](y),v.init(),this.$d=v.set(d,Math.min(this.$D,v.daysInMonth())).$d}else l&&this.$d[l](y);return this.init(),this},A.set=function(e,t){return this.clone().$set(e,t)},A.get=function(e){return this[E.p(e)]()},A.add=function(i,p){var d,l=this;i=Number(i);var y=E.p(p),v=function(e){var t=T(l);return E.w(t.date(t.date()+Math.round(e*i)),l)};if(y===u)return this.set(u,this.$M+i);if(y===f)return this.set(f,this.$y+i);if(y===s)return v(1);if(y===c)return v(7);var h=(d={},d[o]=t,d[a]=r,d[n]=e,d)[y]||1,A=this.$d.getTime()+i*h;return E.w(A,this)},A.subtract=function(e,t){return this.add(-1*e,t)},A.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||l;var i=e||"YYYY-MM-DDTHH:mm:ssZ",n=E.z(this),o=this.$H,a=this.$m,s=this.$M,c=r.weekdays,u=r.months,p=r.meridiem,f=function(e,r,n,o){return e&&(e[r]||e(t,i))||n[r].slice(0,o)},d=function(e){return E.s(o%12||12,e,"0")},y=p||function(e,t,r){var i=e<12?"AM":"PM";return r?i.toLowerCase():i};return i.replace(v,(function(e,i){return i||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return E.s(t.$y,4,"0");case"M":return s+1;case"MM":return E.s(s+1,2,"0");case"MMM":return f(r.monthsShort,s,u,3);case"MMMM":return f(u,s);case"D":return t.$D;case"DD":return E.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return f(r.weekdaysMin,t.$W,c,2);case"ddd":return f(r.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(o);case"HH":return E.s(o,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return y(o,a,true);case"A":return y(o,a,false);case"m":return String(a);case"mm":return E.s(a,2,"0");case"s":return String(t.$s);case"ss":return E.s(t.$s,2,"0");case"SSS":return E.s(t.$ms,3,"0");case"Z":return n}return null}(e)||n.replace(":","")}))},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function(i,d,l){var y,v=this,h=E.p(d),A=T(i),_=(A.utcOffset()-this.utcOffset())*t,S=this-A,g=function(){return E.m(v,A)};switch(h){case f:y=g()/12;break;case u:y=g();break;case p:y=g()/3;break;case c:y=(S-_)/6048e5;break;case s:y=(S-_)/864e5;break;case a:y=S/r;break;case o:y=S/t;break;case n:y=S/e;break;default:y=S}return l?y:E.a(y)},A.daysInMonth=function(){return this.endOf(u).$D},A.$locale=function(){return g[this.$L]},A.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),i=P(e,t,true);return i&&(r.$L=i),r},A.clone=function(){return E.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},h}(),b=I.prototype;return T.prototype=b,[["$ms",i],["$s",n],["$m",o],["$H",a],["$W",s],["$M",u],["$y",f],["$D",d]].forEach((function(e){b[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),T.extend=function(e,t){return e.$i||(e(t,I,T),e.$i=true),T},T.locale=P,T.isDayjs=C,T.unix=function(e){return T(1e3*e)},T.en=g[S],T.Ls=g,T.p={},T}))})(dayjs_min$1);return dayjs_min$1.exports}var dayjs_minExports=requireDayjs_min();var dayjs=getDefaultExportFromCjs(dayjs_minExports);var relativeTime$2={exports:{}};var relativeTime$1=relativeTime$2.exports;var hasRequiredRelativeTime;function requireRelativeTime(){if(hasRequiredRelativeTime)return relativeTime$2.exports;hasRequiredRelativeTime=1;(function(e,t){!function(t,r){e.exports=r()}(relativeTime$1,(function(){return function(e,t,r){e=e||{};var i=t.prototype,n={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 o(e,t,r,n){return i.fromToBase(e,t,r,n)}r.en.relativeTime=n,i.fromToBase=function(t,i,o,a,s){for(var c,u,p,f=o.$locale().relativeTime||n,d=e.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"}],l=d.length,y=0;y<l;y+=1){var v=d[y];v.d&&(c=a?r(t).diff(o,v.d,true):o.diff(t,v.d,true));var h=(e.rounding||Math.round)(Math.abs(c));if(p=c>0,h<=v.r||!v.r){h<=1&&y>0&&(v=d[y-1]);var A=f[v.l];s&&(h=s(""+h)),u="string"==typeof A?A.replace("%d",h):A(h,i,v.l,p);break}}if(i)return u;var _=p?f.future:f.past;return"function"==typeof _?_(u):_.replace("%s",u)},i.to=function(e,t){return o(e,t,this,true)},i.from=function(e,t){return o(e,t,this)};var a=function(e){return e.$u?r.utc():r()};i.toNow=function(e){return this.to(a(this),e)},i.fromNow=function(e){return this.from(a(this),e)}}}))})(relativeTime$2);return relativeTime$2.exports}var relativeTimeExports=requireRelativeTime();var relativeTime=getDefaultExportFromCjs(relativeTimeExports);
|
|
79
79
|
/**
|
|
80
80
|
* @license
|
|
81
81
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -103,7 +103,7 @@ var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setP
|
|
|
103
103
|
*
|
|
104
104
|
* This source code is licensed under the MIT license found in the
|
|
105
105
|
* LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/var __classPrivateFieldSet$2=undefined&&undefined.__classPrivateFieldSet||function(e,t,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(e,r):n?n.value=r:t.set(e,r),r};var __classPrivateFieldGet$2=undefined&&undefined.__classPrivateFieldGet||function(e,t,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(e):i?i.value:t.get(e)};var _Name_asn;var Name=function(){function e(e){_Name_asn.set(this,new Name$1);if(buildExports.BufferSourceConverter.isBufferSource(e)){__classPrivateFieldSet$2(this,_Name_asn,AsnParser.parse(e,Name$1),"f")}else{__classPrivateFieldSet$2(this,_Name_asn,e,"f")}}e.prototype.toJSON=function(){var e=[];__classPrivateFieldGet$2(this,_Name_asn,"f").forEach((function(t){return t.forEach((function(t){e.push({type:t.type,name:OIDs[t.type],shortName:OIDsShort[t.type],value:t.value.toString()})}))}));return e};return e}();_Name_asn=new WeakMap;var BiometricSyntax_1;var id_pe_biometricInfo="".concat(id_pe$1,".2");var PredefinedBiometricType;(function(e){e[e["picture"]=0]="picture";e[e["handwrittenSignature"]=1]="handwrittenSignature"})(PredefinedBiometricType||(PredefinedBiometricType={}));var TypeOfBiometricData=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],TypeOfBiometricData.prototype,"predefinedBiometricType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],TypeOfBiometricData.prototype,"biometricDataOid",void 0);TypeOfBiometricData=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],TypeOfBiometricData);var BiometricData=function(){function e(e){if(e===void 0){e={}}this.typeOfBiometricData=new TypeOfBiometricData;this.hashAlgorithm=new AlgorithmIdentifier;this.biometricDataHash=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:TypeOfBiometricData})],BiometricData.prototype,"typeOfBiometricData",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],BiometricData.prototype,"hashAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],BiometricData.prototype,"biometricDataHash",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,optional:true})],BiometricData.prototype,"sourceDataUri",void 0);var BiometricSyntax=BiometricSyntax_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,BiometricSyntax_1.prototype);return r}return t}(AsnArray);BiometricSyntax=BiometricSyntax_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:BiometricData})],BiometricSyntax);var id_qcs="".concat(id_pkix$1,".11");var NameRegistrationAuthorities_1,QCStatements_1;var id_pe_qcStatements="".concat(id_pe$1,".3");var QCStatement=function(){function e(){this.statementId="";this.statementInfo=new ArrayBuffer(0)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],QCStatement.prototype,"statementId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,optional:true})],QCStatement.prototype,"statementInfo",void 0);var id_qcs_pkixQCSyntax_v2="".concat(id_qcs,".2");var NameRegistrationAuthorities=NameRegistrationAuthorities_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,NameRegistrationAuthorities_1.prototype);return r}return t}(AsnArray);NameRegistrationAuthorities=NameRegistrationAuthorities_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:GeneralName})],NameRegistrationAuthorities);var SemanticsInformation=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier,optional:true})],SemanticsInformation.prototype,"semanticsIdentifier",void 0);__decorate$1([AsnProp({type:NameRegistrationAuthorities,optional:true})],SemanticsInformation.prototype,"nameRegistrationAuthorities",void 0);var QCStatements=QCStatements_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,QCStatements_1.prototype);return r}return t}(AsnArray);QCStatements=QCStatements_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:QCStatement})],QCStatements);var PlaceOfBirth$1=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);PlaceOfBirth$1=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],PlaceOfBirth$1);var Gender$1;(function(e){e["M"]="M";e["F"]="F";e["m"]="m";e["f"]="f"})(Gender$1||(Gender$1={}));var CertificateApplicationPolicies_1;var CertificateApplicationPolicies=CertificateApplicationPolicies_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertificateApplicationPolicies_1.prototype);return r}return t}(CertificatePolicies);CertificateApplicationPolicies=CertificateApplicationPolicies_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CertificateApplicationPolicies);var id_certificateTemplate="1.3.6.1.4.1.311.21.7";var CertificateTemplate=function(){function e(e){if(e===void 0){e={}}this.templateID="";this.templateMajorVersion=0;this.templateMinorVersion=0;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],CertificateTemplate.prototype,"templateID",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],CertificateTemplate.prototype,"templateMajorVersion",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],CertificateTemplate.prototype,"templateMinorVersion",void 0);var id_enrollCertType="1.3.6.1.4.1.311.20.2";var EnrollCertType=function(){function e(e){if(e===void 0){e={}}this.name="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],EnrollCertType.prototype,"name",void 0);var EnrollCertTypeChoice=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}e.prototype.toString=function(){var e,t;return((e=this.name)===null||e===void 0?void 0:e.toString())||((t=this.spec)===null||t===void 0?void 0:t.name)||""};return e}();__decorate$1([AsnProp({type:DirectoryString})],EnrollCertTypeChoice.prototype,"name",void 0);__decorate$1([AsnProp({type:EnrollCertType})],EnrollCertTypeChoice.prototype,"spec",void 0);EnrollCertTypeChoice=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],EnrollCertTypeChoice);var id_caVersion="1.3.6.1.4.1.311.21.1";var CaVersion=function(){function e(){this.value=new ArrayBuffer(0)}e.prototype.toString=function(){var e=this.getVersion();return"V".concat(e.certificateIndex,".").concat(e.keyIndex)};e.prototype.getVersion=function(){var e=new Uint8Array(this.value);if(this.value.byteLength<4){e=new Uint8Array(4);e.set(new Uint8Array(this.value),4-this.value.byteLength)}return{keyIndex:parseInt(buildExports.Convert.ToHex(e.slice(0,2)),16),certificateIndex:parseInt(buildExports.Convert.ToHex(e.slice(2)),16)}};return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],CaVersion.prototype,"value",void 0);CaVersion=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CaVersion);var AnyString=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.NumericString})],AnyString.prototype,"numericString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],AnyString.prototype,"printableString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.TeletexString})],AnyString.prototype,"teletexString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.VideotexString})],AnyString.prototype,"videotexString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],AnyString.prototype,"ia5String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GraphicString})],AnyString.prototype,"graphicString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.VisibleString})],AnyString.prototype,"visibleString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralString})],AnyString.prototype,"generalString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.UniversalString})],AnyString.prototype,"universalString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],AnyString.prototype,"bmpString",void 0);AnyString=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],AnyString);var ArchivedKey=function(){function e(e){if(e===void 0){e=new ArrayBuffer(0)}this.value=e}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Any})],ArchivedKey.prototype,"value",void 0);ArchivedKey=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],ArchivedKey);var CertExtensions_1;var CertExtensions=CertExtensions_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertExtensions_1.prototype);return r}return t}(Extensions);CertExtensions=CertExtensions_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CertExtensions);var CSPProvider=function(){function e(e){if(e===void 0){e={}}this.keySpec=0;this.cspName="";this.signature=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],CSPProvider.prototype,"keySpec",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],CSPProvider.prototype,"cspName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],CSPProvider.prototype,"signature",void 0);var AttestationIdentityKeyInfo_1;var AttestationIdentityKeyInfo=AttestationIdentityKeyInfo_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AttestationIdentityKeyInfo_1.prototype);return r}return t}(AsnArray);AttestationIdentityKeyInfo=AttestationIdentityKeyInfo_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.Any})],AttestationIdentityKeyInfo);var EndorsementKeyInfo_1;var EndorsementKeyInfo=EndorsementKeyInfo_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,EndorsementKeyInfo_1.prototype);return r}return t}(AsnArray);EndorsementKeyInfo=EndorsementKeyInfo_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.Any})],EndorsementKeyInfo);var EnrollmentNameValuePairs_1;var EnrollmentNameValuePair=function(){function e(e){if(e===void 0){e={}}this.name="";this.value="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],EnrollmentNameValuePair.prototype,"name",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],EnrollmentNameValuePair.prototype,"value",void 0);var EnrollmentNameValuePairs=EnrollmentNameValuePairs_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,EnrollmentNameValuePairs_1.prototype);return r}return t}(AsnArray);EnrollmentNameValuePairs=EnrollmentNameValuePairs_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:EnrollmentNameValuePair})],EnrollmentNameValuePairs);var NTPrincipalName=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OtherName);NTPrincipalName=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],NTPrincipalName);var NTDSReplication=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OtherName);NTDSReplication=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],NTDSReplication);var RenewalCertificate=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Certificate);RenewalCertificate=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],RenewalCertificate);var RequestClientInfo=function(){function e(e){if(e===void 0){e={}}this.clientId=0;this.machineName="";this.userName="";this.processName="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],RequestClientInfo.prototype,"clientId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],RequestClientInfo.prototype,"machineName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],RequestClientInfo.prototype,"userName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],RequestClientInfo.prototype,"processName",void 0);var id_netscape="2.16.840.1.113730";var id_netscapeCertExtension="".concat(id_netscape,".1");var NetscapeBaseUrl=function(){function e(e){this.value="";if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],NetscapeBaseUrl.prototype,"value",void 0);NetscapeBaseUrl=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NetscapeBaseUrl);var NetscapeCaPolicyUrl=function(){function e(e){this.value="";if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],NetscapeCaPolicyUrl.prototype,"value",void 0);NetscapeCaPolicyUrl=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NetscapeCaPolicyUrl);var NetscapeCaRevocationUrl=function(){function e(e){this.value="";if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],NetscapeCaRevocationUrl.prototype,"value",void 0);NetscapeCaRevocationUrl=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NetscapeCaRevocationUrl);var NetscapeCertRenewUrl=function(){function e(e){this.value="";if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],NetscapeCertRenewUrl.prototype,"value",void 0);NetscapeCertRenewUrl=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NetscapeCertRenewUrl);var id_netscapeCertType="".concat(id_netscapeCertExtension,".1");var NetscapeCertTypeFlags;(function(e){e[e["sslClient"]=1]="sslClient";e[e["sslServer"]=2]="sslServer";e[e["sMime"]=4]="sMime";e[e["objectSigning"]=8]="objectSigning";e[e["sslCa"]=32]="sslCa";e[e["sMimeCa"]=64]="sMimeCa";e[e["objectSigningCa"]=128]="objectSigningCa"})(NetscapeCertTypeFlags||(NetscapeCertTypeFlags={}));var NetscapeCertType=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.toJSON=function(){var e=this.toNumber();var t=[];if(e&NetscapeCertTypeFlags.objectSigning){t.push("objectSigning")}if(e&NetscapeCertTypeFlags.objectSigningCa){t.push("objectSigningCa")}if(e&NetscapeCertTypeFlags.sMime){t.push("sMime")}if(e&NetscapeCertTypeFlags.sMimeCa){t.push("sMimeCa")}if(e&NetscapeCertTypeFlags.sslCa){t.push("sslCa")}if(e&NetscapeCertTypeFlags.sslClient){t.push("sslClient")}if(e&NetscapeCertTypeFlags.sslServer){t.push("sslServer")}return t};t.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return t}(BitString);var id_netscapeComment="".concat(id_netscapeCertExtension,".13");var NetscapeComment=function(){function e(e){this.value="";if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],NetscapeComment.prototype,"value",void 0);NetscapeComment=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NetscapeComment);var NetscapeRevocationUrl=function(){function e(e){this.value="";if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],NetscapeRevocationUrl.prototype,"value",void 0);NetscapeRevocationUrl=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NetscapeRevocationUrl);var NetscapeSSLServerName=function(){function e(e){this.value="";if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],NetscapeSSLServerName.prototype,"value",void 0);NetscapeSSLServerName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NetscapeSSLServerName);var id_lei="1.3.6.1.4.1.52266.1";var Lei=function(){function e(e){if(e===void 0){e={}}this.leiCode="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:PrintableString})],Lei.prototype,"leiCode",void 0);__decorate$1([AsnProp({type:PrintableString,context:0,optional:true})],Lei.prototype,"leiRole",void 0);Lei=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],Lei);var BaseLeiChoice=function(){function e(e){if(e){this.text=e}}Object.defineProperty(e.prototype,"text",{get:function(){if(this.bmpString!==undefined){return this.bmpString}if(this.ia5String!==undefined){return this.ia5String}if(this.printableString!==undefined){return this.printableString}if(this.utf8String!==undefined){return this.utf8String}if(this.visibleString!==undefined){return this.visibleString}return undefined},set:function(e){this.printableString=e},enumerable:false,configurable:true});return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],BaseLeiChoice.prototype,"ia5String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.VisibleString})],BaseLeiChoice.prototype,"visibleString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],BaseLeiChoice.prototype,"bmpString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],BaseLeiChoice.prototype,"utf8String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],BaseLeiChoice.prototype,"printableString",void 0);BaseLeiChoice=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],BaseLeiChoice);var LeiChoice=function(e){__extends(t,e);function t(t){var r=e.call(this)||this;if(typeof t==="string"){r.text=t}else if(t instanceof Lei){r.struct=t}return r}return t}(BaseLeiChoice);__decorate$1([AsnProp({type:Lei})],LeiChoice.prototype,"struct",void 0);LeiChoice=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],LeiChoice);var id_role="1.3.6.1.4.1.52266.2";var LeiRole=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(BaseLeiChoice);LeiRole=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],LeiRole);var ByteStream=function(){function e(e){this.offset=0;this.view=buildExports.BufferSourceConverter.toUint8Array(e)}Object.defineProperty(e.prototype,"position",{get:function(){return this.offset},enumerable:false,configurable:true});e.prototype.read=function(e){if(e===void 0){e=1}var t=this.view.slice(this.offset,this.offset+e);this.offset=this.offset+t.length;return t};e.prototype.readByte=function(){var e=this.read();if(!e.length){throw new Error("End of stream")}return e[0]};e.prototype.readNumber=function(e){var t=this.read(e);var r=buildExports.Convert.ToHex(t);return parseInt(r,16)};e.prototype.readEnd=function(){return this.read(this.view.length-this.offset)};e.prototype.reset=function(){this.offset=0};return e}();var Structure=function(){function e(){}e.createStream=function(e){var t=buildExports.BufferSourceConverter.toUint8Array(e);return new ByteStream(t)};return e}();var SignatureType;(function(e){e[e["certificateTimestamp"]=0]="certificateTimestamp";e[e["treeHash"]=1]="treeHash"})(SignatureType||(SignatureType={}));var HashAlgorithm;(function(e){e[e["none"]=0]="none";e[e["md5"]=1]="md5";e[e["sha1"]=2]="sha1";e[e["sha224"]=3]="sha224";e[e["sha256"]=4]="sha256";e[e["sha384"]=5]="sha384";e[e["sha512"]=6]="sha512"})(HashAlgorithm||(HashAlgorithm={}));var SignatureAlgorithm;(function(e){e[e["anonymous"]=0]="anonymous";e[e["rsa"]=1]="rsa";e[e["dsa"]=2]="dsa";e[e["ecdsa"]=3]="ecdsa"})(SignatureAlgorithm||(SignatureAlgorithm={}));var SignedCertificateTimestamp=function(e){__extends(t,e);function t(t){var r=e.call(this)||this;r.version=0;r.logId=new ArrayBuffer(32);r.timestamp=new Date;r.extensions=new ArrayBuffer(0);r.hashAlgorithm=0;r.signatureAlgorithm=0;r.signature=new ArrayBuffer(0);if(t){r.parse(t)}return r}t.prototype.parse=function(e){this.version=e.readByte();e.read(2);this.logId=buildExports.BufferSourceConverter.toArrayBuffer(e.read(32));this.timestamp=new Date(e.readNumber(8));var t=e.readNumber(2);this.extensions=e.read(t).buffer;this.hashAlgorithm=e.readByte();this.signatureAlgorithm=e.readByte();this.signature=e.read(e.readNumber(2)).buffer};t.prototype.toJSON=function(){return{version:this.version,logId:buildExports.Convert.ToHex(this.logId),timestamp:this.timestamp,extensions:buildExports.Convert.ToBase64(this.extensions),hashAlgorithm:HashAlgorithm[this.hashAlgorithm]||"undefined",signatureAlgorithm:SignatureAlgorithm[this.signatureAlgorithm]||"undefined",signature:buildExports.Convert.ToBase64(this.signature)}};return t}(Structure);var Version$1;(function(e){e[e["v1"]=1]="v1"})(Version$1||(Version$1={}));var id_adbe_archiveRevInfo="1.2.840.113583.1.1.9.2";var ArchiveRevInfo=function(){function e(e){if(e===void 0){e={}}this.version=Version$1.v1;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ArchiveRevInfo.prototype,"version",void 0);var id_adbe_timestamp="1.2.840.113583.1.1.9.1";var Timestamp=function(){function e(e){if(e===void 0){e={}}this.version=Version$1.v1;this.location=new GeneralName;this.requiresAuth=false;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],Timestamp.prototype,"version",void 0);__decorate$1([AsnProp({type:GeneralName})],Timestamp.prototype,"location",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,defaultValue:false,optional:true})],Timestamp.prototype,"requiresAuth",void 0);var HashAlgAndValue=function(){function e(e){if(e===void 0){e={}}this.hashAlg=new AlgorithmIdentifier;this.hashValue=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],HashAlgAndValue.prototype,"hashAlg",void 0);__decorate$1([AsnProp({type:OctetString})],HashAlgAndValue.prototype,"hashValue",void 0);var LogotypeDetails=function(){function e(e){if(e===void 0){e={}}this.mediaType="";this.logotypeHash=[];this.logotypeURI=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],LogotypeDetails.prototype,"mediaType",void 0);__decorate$1([AsnProp({type:HashAlgAndValue,repeated:"sequence"})],LogotypeDetails.prototype,"logotypeHash",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,repeated:"sequence"})],LogotypeDetails.prototype,"logotypeURI",void 0);var LogotypeAudioChannels;(function(e){e[e["mono"]=1]="mono";e[e["stereo"]=2]="stereo";e[e["quad"]=4]="quad"})(LogotypeAudioChannels||(LogotypeAudioChannels={}));var LogotypeAudioInfo=function(){function e(e){if(e===void 0){e={}}this.fileSize=0;this.playTime=0;this.channels=LogotypeAudioChannels.mono;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],LogotypeAudioInfo.prototype,"fileSize",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],LogotypeAudioInfo.prototype,"playTime",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],LogotypeAudioInfo.prototype,"channels",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,implicit:true,context:3,optional:true})],LogotypeAudioInfo.prototype,"sampleRate",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,implicit:true,context:4,optional:true})],LogotypeAudioInfo.prototype,"language",void 0);var LogotypeAudio=function(){function e(e){if(e===void 0){e={}}this.audioDetails=new LogotypeDetails;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:LogotypeDetails})],LogotypeAudio.prototype,"audioDetails",void 0);__decorate$1([AsnProp({type:LogotypeAudioInfo,optional:true})],LogotypeAudio.prototype,"audioInfo",void 0);var LogotypeImageResolution=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:1,implicit:true})],LogotypeImageResolution.prototype,"numBits",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:2,implicit:true})],LogotypeImageResolution.prototype,"tableSize",void 0);LogotypeImageResolution=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],LogotypeImageResolution);var LogotypeImageType;(function(e){e[e["grayScale"]=0]="grayScale";e[e["color"]=1]="color"})(LogotypeImageType||(LogotypeImageType={}));var LogotypeImageInfo=function(){function e(e){if(e===void 0){e={}}this.type=LogotypeImageType.color;this.fileSize=0;this.xSize=0;this.ySize=0;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:0,implicit:true,defaultValue:LogotypeImageType.color})],LogotypeImageInfo.prototype,"type",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],LogotypeImageInfo.prototype,"fileSize",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],LogotypeImageInfo.prototype,"xSize",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],LogotypeImageInfo.prototype,"ySize",void 0);__decorate$1([AsnProp({type:LogotypeImageResolution})],LogotypeImageInfo.prototype,"resolution",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:4,implicit:true,optional:true})],LogotypeImageInfo.prototype,"language",void 0);var LogotypeImage=function(){function e(e){if(e===void 0){e={}}this.imageDetails=new LogotypeDetails;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:LogotypeDetails})],LogotypeImage.prototype,"imageDetails",void 0);__decorate$1([AsnProp({type:LogotypeImageInfo,optional:true})],LogotypeImage.prototype,"imageInfo",void 0);var LogotypeData=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:LogotypeImage,repeated:"sequence",optional:true})],LogotypeData.prototype,"image",void 0);__decorate$1([AsnProp({type:LogotypeAudio,repeated:"sequence",context:1,optional:true})],LogotypeData.prototype,"audio",void 0);var LogotypeReference=function(){function e(e){if(e===void 0){e={}}this.refStructHash=[];this.refStructURI=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:HashAlgAndValue,repeated:"sequence"})],LogotypeReference.prototype,"refStructHash",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,repeated:"sequence"})],LogotypeReference.prototype,"refStructURI",void 0);var LogotypeInfo=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:LogotypeData,implicit:true,context:0})],LogotypeInfo.prototype,"direct",void 0);__decorate$1([AsnProp({type:LogotypeReference,implicit:true,context:1})],LogotypeInfo.prototype,"indirect",void 0);LogotypeInfo=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],LogotypeInfo);var OtherLogotypeInfo=function(){function e(e){if(e===void 0){e={}}this.logotypeType="";this.info=new LogotypeInfo;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherLogotypeInfo.prototype,"logotypeType",void 0);__decorate$1([AsnProp({type:LogotypeInfo})],OtherLogotypeInfo.prototype,"info",void 0);var LogotypeExtn=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:LogotypeInfo,context:0,repeated:"sequence",optional:true})],LogotypeExtn.prototype,"communityLogos",void 0);__decorate$1([AsnProp({type:LogotypeInfo,context:1,optional:true})],LogotypeExtn.prototype,"issuerLogo",void 0);__decorate$1([AsnProp({type:LogotypeInfo,context:2,optional:true})],LogotypeExtn.prototype,"subjectLogo",void 0);__decorate$1([AsnProp({type:OtherLogotypeInfo,context:3,repeated:"sequence",optional:true})],LogotypeExtn.prototype,"otherLogos",void 0);var JWTClaimNames_1,JWTClaimPermittedValuesList_1,TNAuthorizationList_1;var id_pkix="1.3.6.1.5.5.7";var id_pe="".concat(id_pkix,".1");var JWTClaimNames=JWTClaimNames_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,JWTClaimNames_1.prototype);return r}return t}(AsnArray);JWTClaimNames=JWTClaimNames_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.IA5String})],JWTClaimNames);var JWTClaimPermittedValues=function(){function e(e){if(e===void 0){e={}}this.claim="";this.permitted=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],JWTClaimPermittedValues.prototype,"claim",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String,repeated:"sequence"})],JWTClaimPermittedValues.prototype,"permitted",void 0);var JWTClaimPermittedValuesList=JWTClaimPermittedValuesList_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,JWTClaimPermittedValuesList_1.prototype);return r}return t}(AsnArray);JWTClaimPermittedValuesList=JWTClaimPermittedValuesList_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:JWTClaimPermittedValues})],JWTClaimPermittedValuesList);var JWTClaimConstraints=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:JWTClaimNames,optional:true,context:0})],JWTClaimConstraints.prototype,"mustInclude",void 0);__decorate$1([AsnProp({type:JWTClaimPermittedValuesList,optional:true,context:1})],JWTClaimConstraints.prototype,"permittedValues",void 0);var id_pe_TNAuthList="".concat(id_pe,".26");var TelephoneNumberRange=function(){function e(){this.start="";this.count=2}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],TelephoneNumberRange.prototype,"start",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],TelephoneNumberRange.prototype,"count",void 0);var TNEntry=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:0})],TNEntry.prototype,"spc",void 0);__decorate$1([AsnProp({type:TelephoneNumberRange,context:1})],TNEntry.prototype,"range",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:2})],TNEntry.prototype,"one",void 0);TNEntry=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],TNEntry);var TNAuthorizationList=TNAuthorizationList_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,TNAuthorizationList_1.prototype);return r}return t}(AsnArray);TNAuthorizationList=TNAuthorizationList_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:TNEntry})],TNAuthorizationList);var IntegerSet_1;var id_ce_keyDescription="1.3.6.1.4.1.11129.2.1.17";var VerifiedBootState;(function(e){e[e["verified"]=0]="verified";e[e["selfSigned"]=1]="selfSigned";e[e["unverified"]=2]="unverified";e[e["failed"]=3]="failed"})(VerifiedBootState||(VerifiedBootState={}));var RootOfTrust=function(){function e(e){if(e===void 0){e={}}this.verifiedBootKey=new OctetString;this.deviceLocked=false;this.verifiedBootState=VerifiedBootState.verified;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString})],RootOfTrust.prototype,"verifiedBootKey",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean})],RootOfTrust.prototype,"deviceLocked",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],RootOfTrust.prototype,"verifiedBootState",void 0);__decorate$1([AsnProp({type:OctetString,optional:true})],RootOfTrust.prototype,"verifiedBootHash",void 0);var IntegerSet=IntegerSet_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,IntegerSet_1.prototype);return r}return t}(AsnArray);IntegerSet=IntegerSet_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:AsnPropTypes.Integer})],IntegerSet);var AuthorizationList=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({context:1,type:IntegerSet,optional:true})],AuthorizationList.prototype,"purpose",void 0);__decorate$1([AsnProp({context:2,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"algorithm",void 0);__decorate$1([AsnProp({context:3,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"keySize",void 0);__decorate$1([AsnProp({context:5,type:IntegerSet,optional:true})],AuthorizationList.prototype,"digest",void 0);__decorate$1([AsnProp({context:6,type:IntegerSet,optional:true})],AuthorizationList.prototype,"padding",void 0);__decorate$1([AsnProp({context:10,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"ecCurve",void 0);__decorate$1([AsnProp({context:200,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"rsaPublicExponent",void 0);__decorate$1([AsnProp({context:203,type:IntegerSet,optional:true})],AuthorizationList.prototype,"mgfDigest",void 0);__decorate$1([AsnProp({context:303,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"rollbackResistance",void 0);__decorate$1([AsnProp({context:305,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"earlyBootOnly",void 0);__decorate$1([AsnProp({context:400,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"activeDateTime",void 0);__decorate$1([AsnProp({context:401,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"originationExpireDateTime",void 0);__decorate$1([AsnProp({context:402,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"usageExpireDateTime",void 0);__decorate$1([AsnProp({context:405,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"usageCountLimit",void 0);__decorate$1([AsnProp({context:503,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"noAuthRequired",void 0);__decorate$1([AsnProp({context:504,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"userAuthType",void 0);__decorate$1([AsnProp({context:505,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"authTimeout",void 0);__decorate$1([AsnProp({context:506,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"allowWhileOnBody",void 0);__decorate$1([AsnProp({context:507,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"trustedUserPresenceRequired",void 0);__decorate$1([AsnProp({context:508,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"trustedConfirmationRequired",void 0);__decorate$1([AsnProp({context:509,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"unlockedDeviceRequired",void 0);__decorate$1([AsnProp({context:600,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"allApplications",void 0);__decorate$1([AsnProp({context:601,type:OctetString,optional:true})],AuthorizationList.prototype,"applicationId",void 0);__decorate$1([AsnProp({context:701,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"creationDateTime",void 0);__decorate$1([AsnProp({context:702,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"origin",void 0);__decorate$1([AsnProp({context:703,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"rollbackResistant",void 0);__decorate$1([AsnProp({context:704,type:RootOfTrust,optional:true})],AuthorizationList.prototype,"rootOfTrust",void 0);__decorate$1([AsnProp({context:705,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"osVersion",void 0);__decorate$1([AsnProp({context:706,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"osPatchLevel",void 0);__decorate$1([AsnProp({context:709,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationApplicationId",void 0);__decorate$1([AsnProp({context:710,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdBrand",void 0);__decorate$1([AsnProp({context:711,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdDevice",void 0);__decorate$1([AsnProp({context:712,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdProduct",void 0);__decorate$1([AsnProp({context:713,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdSerial",void 0);__decorate$1([AsnProp({context:714,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdImei",void 0);__decorate$1([AsnProp({context:715,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdMeid",void 0);__decorate$1([AsnProp({context:716,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdManufacturer",void 0);__decorate$1([AsnProp({context:717,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdModel",void 0);__decorate$1([AsnProp({context:718,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"vendorPatchLevel",void 0);__decorate$1([AsnProp({context:719,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"bootPatchLevel",void 0);__decorate$1([AsnProp({context:720,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"deviceUniqueAttestation",void 0);__decorate$1([AsnProp({context:723,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdSecondImei",void 0);__decorate$1([AsnProp({context:724,type:OctetString,optional:true})],AuthorizationList.prototype,"moduleHash",void 0);var SecurityLevel;(function(e){e[e["software"]=0]="software";e[e["trustedEnvironment"]=1]="trustedEnvironment";e[e["strongBox"]=2]="strongBox"})(SecurityLevel||(SecurityLevel={}));var Version;(function(e){e[e["KM2"]=1]="KM2";e[e["KM3"]=2]="KM3";e[e["KM4"]=3]="KM4";e[e["KM4_1"]=4]="KM4_1";e[e["keyMint1"]=100]="keyMint1";e[e["keyMint2"]=200]="keyMint2";e[e["keyMint3"]=300]="keyMint3";e[e["keyMint4"]=400]="keyMint4"})(Version||(Version={}));var KeyDescription=function(){function e(e){if(e===void 0){e={}}this.attestationVersion=Version.KM4;this.attestationSecurityLevel=SecurityLevel.software;this.keymasterVersion=0;this.keymasterSecurityLevel=SecurityLevel.software;this.attestationChallenge=new OctetString;this.uniqueId=new OctetString;this.softwareEnforced=new AuthorizationList;this.teeEnforced=new AuthorizationList;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyDescription.prototype,"attestationVersion",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],KeyDescription.prototype,"attestationSecurityLevel",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyDescription.prototype,"keymasterVersion",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],KeyDescription.prototype,"keymasterSecurityLevel",void 0);__decorate$1([AsnProp({type:OctetString})],KeyDescription.prototype,"attestationChallenge",void 0);__decorate$1([AsnProp({type:OctetString})],KeyDescription.prototype,"uniqueId",void 0);__decorate$1([AsnProp({type:AuthorizationList})],KeyDescription.prototype,"softwareEnforced",void 0);__decorate$1([AsnProp({type:AuthorizationList})],KeyDescription.prototype,"teeEnforced",void 0);var KeyMintKeyDescription=function(){function e(e){if(e===void 0){e={}}this.attestationVersion=Version.keyMint4;this.attestationSecurityLevel=SecurityLevel.software;this.keyMintVersion=0;this.keyMintSecurityLevel=SecurityLevel.software;this.attestationChallenge=new OctetString;this.uniqueId=new OctetString;this.softwareEnforced=new AuthorizationList;this.hardwareEnforced=new AuthorizationList;Object.assign(this,e)}e.prototype.toLegacyKeyDescription=function(){return new KeyDescription({attestationVersion:this.attestationVersion,attestationSecurityLevel:this.attestationSecurityLevel,keymasterVersion:this.keyMintVersion,keymasterSecurityLevel:this.keyMintSecurityLevel,attestationChallenge:this.attestationChallenge,uniqueId:this.uniqueId,softwareEnforced:this.softwareEnforced,teeEnforced:this.hardwareEnforced})};e.fromLegacyKeyDescription=function(t){return new e({attestationVersion:t.attestationVersion,attestationSecurityLevel:t.attestationSecurityLevel,keyMintVersion:t.keymasterVersion,keyMintSecurityLevel:t.keymasterSecurityLevel,attestationChallenge:t.attestationChallenge,uniqueId:t.uniqueId,softwareEnforced:t.softwareEnforced,hardwareEnforced:t.teeEnforced})};return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyMintKeyDescription.prototype,"attestationVersion",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],KeyMintKeyDescription.prototype,"attestationSecurityLevel",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyMintKeyDescription.prototype,"keyMintVersion",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],KeyMintKeyDescription.prototype,"keyMintSecurityLevel",void 0);__decorate$1([AsnProp({type:OctetString})],KeyMintKeyDescription.prototype,"attestationChallenge",void 0);__decorate$1([AsnProp({type:OctetString})],KeyMintKeyDescription.prototype,"uniqueId",void 0);__decorate$1([AsnProp({type:AuthorizationList})],KeyMintKeyDescription.prototype,"softwareEnforced",void 0);__decorate$1([AsnProp({type:AuthorizationList})],KeyMintKeyDescription.prototype,"hardwareEnforced",void 0);var NonStandardAuthorizationList_1;var NonStandardAuthorization=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AuthorizationList);NonStandardAuthorization=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NonStandardAuthorization);var NonStandardAuthorizationList=NonStandardAuthorizationList_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,NonStandardAuthorizationList_1.prototype);return r}t.prototype.findProperty=function(e){var t=this.find((function(t){return e in t}));if(t){return t[e]}return undefined};return t}(AsnArray);NonStandardAuthorizationList=NonStandardAuthorizationList_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:NonStandardAuthorization})],NonStandardAuthorizationList);var NonStandardKeyDescription=function(){function e(e){if(e===void 0){e={}}this.attestationVersion=Version.KM4;this.attestationSecurityLevel=SecurityLevel.software;this.keymasterVersion=0;this.keymasterSecurityLevel=SecurityLevel.software;this.attestationChallenge=new OctetString;this.uniqueId=new OctetString;this.softwareEnforced=new NonStandardAuthorizationList;this.teeEnforced=new NonStandardAuthorizationList;Object.assign(this,e)}Object.defineProperty(e.prototype,"keyMintVersion",{get:function(){return this.keymasterVersion},set:function(e){this.keymasterVersion=e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"keyMintSecurityLevel",{get:function(){return this.keymasterSecurityLevel},set:function(e){this.keymasterSecurityLevel=e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"hardwareEnforced",{get:function(){return this.teeEnforced},set:function(e){this.teeEnforced=e},enumerable:false,configurable:true});return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],NonStandardKeyDescription.prototype,"attestationVersion",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],NonStandardKeyDescription.prototype,"attestationSecurityLevel",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],NonStandardKeyDescription.prototype,"keymasterVersion",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],NonStandardKeyDescription.prototype,"keymasterSecurityLevel",void 0);__decorate$1([AsnProp({type:OctetString})],NonStandardKeyDescription.prototype,"attestationChallenge",void 0);__decorate$1([AsnProp({type:OctetString})],NonStandardKeyDescription.prototype,"uniqueId",void 0);__decorate$1([AsnProp({type:NonStandardAuthorizationList})],NonStandardKeyDescription.prototype,"softwareEnforced",void 0);__decorate$1([AsnProp({type:NonStandardAuthorizationList})],NonStandardKeyDescription.prototype,"teeEnforced",void 0);var NonStandardKeyMintKeyDescription=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}if("keymasterVersion"in t&&!("keyMintVersion"in t)){t.keyMintVersion=t.keymasterVersion}if("keymasterSecurityLevel"in t&&!("keyMintSecurityLevel"in t)){t.keyMintSecurityLevel=t.keymasterSecurityLevel}if("teeEnforced"in t&&!("hardwareEnforced"in t)){t.hardwareEnforced=t.teeEnforced}return e.call(this,t)||this}return t}(NonStandardKeyDescription);NonStandardKeyMintKeyDescription=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],NonStandardKeyMintKeyDescription);var AttestationPackageInfo=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.OctetString})],AttestationPackageInfo.prototype,"packageName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],AttestationPackageInfo.prototype,"version",void 0);var AttestationApplicationId=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AttestationPackageInfo,repeated:"set"})],AttestationApplicationId.prototype,"packageInfos",void 0);__decorate$1([AsnProp({type:AsnPropTypes.OctetString,repeated:"set"})],AttestationApplicationId.prototype,"signatureDigests",void 0);var __decorate=undefined&&undefined.__decorate||function(e,t,r,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(n<3?a(o):n>3?a(t,r,o):a(t,r))||o;return n>3&&o&&Object.defineProperty(t,r,o),o};var id_cabforganizationIdentifier="2.23.140.3.1";var CabforganizationIdentifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate([AsnProp({type:AsnPropTypes.PrintableString})],CabforganizationIdentifier.prototype,"registrationSchemeIdentifier",void 0);__decorate([AsnProp({type:AsnPropTypes.PrintableString})],CabforganizationIdentifier.prototype,"registrationCountry",void 0);__decorate([AsnProp({type:AsnPropTypes.PrintableString,optional:true,context:0,implicit:true})],CabforganizationIdentifier.prototype,"registrationStateOrProvince",void 0);__decorate([AsnProp({type:AsnPropTypes.Utf8String})],CabforganizationIdentifier.prototype,"registrationReference",void 0);
|
|
106
|
+
*/var __classPrivateFieldSet$2=undefined&&undefined.__classPrivateFieldSet||function(e,t,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(e,r):n?n.value=r:t.set(e,r),r};var __classPrivateFieldGet$2=undefined&&undefined.__classPrivateFieldGet||function(e,t,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(e):i?i.value:t.get(e)};var _Name_asn;var Name=function(){function e(e){_Name_asn.set(this,new Name$1);if(buildExports.BufferSourceConverter.isBufferSource(e)){__classPrivateFieldSet$2(this,_Name_asn,AsnParser.parse(e,Name$1),"f")}else{__classPrivateFieldSet$2(this,_Name_asn,e,"f")}}e.prototype.toJSON=function(){var e=[];__classPrivateFieldGet$2(this,_Name_asn,"f").forEach((function(t){return t.forEach((function(t){e.push({type:t.type,name:OIDs[t.type],shortName:OIDsShort[t.type],value:t.value.toString()})}))}));return e};return e}();_Name_asn=new WeakMap;var BiometricSyntax_1;var id_pe_biometricInfo="".concat(id_pe$1,".2");var PredefinedBiometricType;(function(e){e[e["picture"]=0]="picture";e[e["handwrittenSignature"]=1]="handwrittenSignature"})(PredefinedBiometricType||(PredefinedBiometricType={}));var TypeOfBiometricData=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],TypeOfBiometricData.prototype,"predefinedBiometricType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],TypeOfBiometricData.prototype,"biometricDataOid",void 0);TypeOfBiometricData=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],TypeOfBiometricData);var BiometricData=function(){function e(e){if(e===void 0){e={}}this.typeOfBiometricData=new TypeOfBiometricData;this.hashAlgorithm=new AlgorithmIdentifier;this.biometricDataHash=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:TypeOfBiometricData})],BiometricData.prototype,"typeOfBiometricData",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],BiometricData.prototype,"hashAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],BiometricData.prototype,"biometricDataHash",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,optional:true})],BiometricData.prototype,"sourceDataUri",void 0);var BiometricSyntax=BiometricSyntax_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,BiometricSyntax_1.prototype);return r}return t}(AsnArray);BiometricSyntax=BiometricSyntax_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:BiometricData})],BiometricSyntax);var id_qcs="".concat(id_pkix$1,".11");var NameRegistrationAuthorities_1,QCStatements_1;var id_pe_qcStatements="".concat(id_pe$1,".3");var QCStatement=function(){function e(){this.statementId=""}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],QCStatement.prototype,"statementId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,optional:true})],QCStatement.prototype,"statementInfo",void 0);var id_qcs_pkixQCSyntax_v2="".concat(id_qcs,".2");var NameRegistrationAuthorities=NameRegistrationAuthorities_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,NameRegistrationAuthorities_1.prototype);return r}return t}(AsnArray);NameRegistrationAuthorities=NameRegistrationAuthorities_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:GeneralName})],NameRegistrationAuthorities);var SemanticsInformation=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier,optional:true})],SemanticsInformation.prototype,"semanticsIdentifier",void 0);__decorate$1([AsnProp({type:NameRegistrationAuthorities,optional:true})],SemanticsInformation.prototype,"nameRegistrationAuthorities",void 0);var QCStatements=QCStatements_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,QCStatements_1.prototype);return r}return t}(AsnArray);QCStatements=QCStatements_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:QCStatement})],QCStatements);var PlaceOfBirth$1=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);PlaceOfBirth$1=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],PlaceOfBirth$1);var Gender$1;(function(e){e["M"]="M";e["F"]="F";e["m"]="m";e["f"]="f"})(Gender$1||(Gender$1={}));var CertificateApplicationPolicies_1;var CertificateApplicationPolicies=CertificateApplicationPolicies_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertificateApplicationPolicies_1.prototype);return r}return t}(CertificatePolicies);CertificateApplicationPolicies=CertificateApplicationPolicies_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CertificateApplicationPolicies);var id_certificateTemplate="1.3.6.1.4.1.311.21.7";var CertificateTemplate=function(){function e(e){if(e===void 0){e={}}this.templateID="";this.templateMajorVersion=0;this.templateMinorVersion=0;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],CertificateTemplate.prototype,"templateID",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],CertificateTemplate.prototype,"templateMajorVersion",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],CertificateTemplate.prototype,"templateMinorVersion",void 0);var id_enrollCertType="1.3.6.1.4.1.311.20.2";var EnrollCertType=function(){function e(e){if(e===void 0){e={}}this.name="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],EnrollCertType.prototype,"name",void 0);var EnrollCertTypeChoice=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}e.prototype.toString=function(){var e,t;return((e=this.name)===null||e===void 0?void 0:e.toString())||((t=this.spec)===null||t===void 0?void 0:t.name)||""};return e}();__decorate$1([AsnProp({type:DirectoryString})],EnrollCertTypeChoice.prototype,"name",void 0);__decorate$1([AsnProp({type:EnrollCertType})],EnrollCertTypeChoice.prototype,"spec",void 0);EnrollCertTypeChoice=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],EnrollCertTypeChoice);var id_caVersion="1.3.6.1.4.1.311.21.1";var CaVersion=function(){function e(){this.value=new ArrayBuffer(0)}e.prototype.toString=function(){var e=this.getVersion();return"V".concat(e.certificateIndex,".").concat(e.keyIndex)};e.prototype.getVersion=function(){var e=new Uint8Array(this.value);if(this.value.byteLength<4){e=new Uint8Array(4);e.set(new Uint8Array(this.value),4-this.value.byteLength)}return{keyIndex:parseInt(buildExports.Convert.ToHex(e.slice(0,2)),16),certificateIndex:parseInt(buildExports.Convert.ToHex(e.slice(2)),16)}};return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],CaVersion.prototype,"value",void 0);CaVersion=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CaVersion);var AnyString=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.NumericString})],AnyString.prototype,"numericString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],AnyString.prototype,"printableString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.TeletexString})],AnyString.prototype,"teletexString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.VideotexString})],AnyString.prototype,"videotexString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],AnyString.prototype,"ia5String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GraphicString})],AnyString.prototype,"graphicString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.VisibleString})],AnyString.prototype,"visibleString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralString})],AnyString.prototype,"generalString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.UniversalString})],AnyString.prototype,"universalString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],AnyString.prototype,"bmpString",void 0);AnyString=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],AnyString);var ArchivedKey=function(){function e(e){if(e===void 0){e=new ArrayBuffer(0)}this.value=e}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Any})],ArchivedKey.prototype,"value",void 0);ArchivedKey=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],ArchivedKey);var CertExtensions_1;var CertExtensions=CertExtensions_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertExtensions_1.prototype);return r}return t}(Extensions);CertExtensions=CertExtensions_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CertExtensions);var CSPProvider=function(){function e(e){if(e===void 0){e={}}this.keySpec=0;this.cspName="";this.signature=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],CSPProvider.prototype,"keySpec",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],CSPProvider.prototype,"cspName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],CSPProvider.prototype,"signature",void 0);var AttestationIdentityKeyInfo_1;var AttestationIdentityKeyInfo=AttestationIdentityKeyInfo_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AttestationIdentityKeyInfo_1.prototype);return r}return t}(AsnArray);AttestationIdentityKeyInfo=AttestationIdentityKeyInfo_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.Any})],AttestationIdentityKeyInfo);var EndorsementKeyInfo_1;var EndorsementKeyInfo=EndorsementKeyInfo_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,EndorsementKeyInfo_1.prototype);return r}return t}(AsnArray);EndorsementKeyInfo=EndorsementKeyInfo_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.Any})],EndorsementKeyInfo);var EnrollmentNameValuePairs_1;var EnrollmentNameValuePair=function(){function e(e){if(e===void 0){e={}}this.name="";this.value="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],EnrollmentNameValuePair.prototype,"name",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],EnrollmentNameValuePair.prototype,"value",void 0);var EnrollmentNameValuePairs=EnrollmentNameValuePairs_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,EnrollmentNameValuePairs_1.prototype);return r}return t}(AsnArray);EnrollmentNameValuePairs=EnrollmentNameValuePairs_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:EnrollmentNameValuePair})],EnrollmentNameValuePairs);var NTPrincipalName=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OtherName);NTPrincipalName=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],NTPrincipalName);var NTDSReplication=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OtherName);NTDSReplication=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],NTDSReplication);var RenewalCertificate=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Certificate);RenewalCertificate=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],RenewalCertificate);var RequestClientInfo=function(){function e(e){if(e===void 0){e={}}this.clientId=0;this.machineName="";this.userName="";this.processName="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],RequestClientInfo.prototype,"clientId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],RequestClientInfo.prototype,"machineName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],RequestClientInfo.prototype,"userName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],RequestClientInfo.prototype,"processName",void 0);var id_netscape="2.16.840.1.113730";var id_netscapeCertExtension="".concat(id_netscape,".1");var NetscapeBaseUrl=function(){function e(e){this.value="";if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],NetscapeBaseUrl.prototype,"value",void 0);NetscapeBaseUrl=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NetscapeBaseUrl);var NetscapeCaPolicyUrl=function(){function e(e){this.value="";if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],NetscapeCaPolicyUrl.prototype,"value",void 0);NetscapeCaPolicyUrl=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NetscapeCaPolicyUrl);var NetscapeCaRevocationUrl=function(){function e(e){this.value="";if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],NetscapeCaRevocationUrl.prototype,"value",void 0);NetscapeCaRevocationUrl=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NetscapeCaRevocationUrl);var NetscapeCertRenewUrl=function(){function e(e){this.value="";if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],NetscapeCertRenewUrl.prototype,"value",void 0);NetscapeCertRenewUrl=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NetscapeCertRenewUrl);var id_netscapeCertType="".concat(id_netscapeCertExtension,".1");var NetscapeCertTypeFlags;(function(e){e[e["sslClient"]=1]="sslClient";e[e["sslServer"]=2]="sslServer";e[e["sMime"]=4]="sMime";e[e["objectSigning"]=8]="objectSigning";e[e["sslCa"]=32]="sslCa";e[e["sMimeCa"]=64]="sMimeCa";e[e["objectSigningCa"]=128]="objectSigningCa"})(NetscapeCertTypeFlags||(NetscapeCertTypeFlags={}));var NetscapeCertType=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.toJSON=function(){var e=this.toNumber();var t=[];if(e&NetscapeCertTypeFlags.objectSigning){t.push("objectSigning")}if(e&NetscapeCertTypeFlags.objectSigningCa){t.push("objectSigningCa")}if(e&NetscapeCertTypeFlags.sMime){t.push("sMime")}if(e&NetscapeCertTypeFlags.sMimeCa){t.push("sMimeCa")}if(e&NetscapeCertTypeFlags.sslCa){t.push("sslCa")}if(e&NetscapeCertTypeFlags.sslClient){t.push("sslClient")}if(e&NetscapeCertTypeFlags.sslServer){t.push("sslServer")}return t};t.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return t}(BitString);var id_netscapeComment="".concat(id_netscapeCertExtension,".13");var NetscapeComment=function(){function e(e){this.value="";if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],NetscapeComment.prototype,"value",void 0);NetscapeComment=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NetscapeComment);var NetscapeRevocationUrl=function(){function e(e){this.value="";if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],NetscapeRevocationUrl.prototype,"value",void 0);NetscapeRevocationUrl=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NetscapeRevocationUrl);var NetscapeSSLServerName=function(){function e(e){this.value="";if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],NetscapeSSLServerName.prototype,"value",void 0);NetscapeSSLServerName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NetscapeSSLServerName);var id_lei="1.3.6.1.4.1.52266.1";var Lei=function(){function e(e){if(e===void 0){e={}}this.leiCode="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:PrintableString})],Lei.prototype,"leiCode",void 0);__decorate$1([AsnProp({type:PrintableString,context:0,optional:true})],Lei.prototype,"leiRole",void 0);Lei=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],Lei);var BaseLeiChoice=function(){function e(e){if(e){this.text=e}}Object.defineProperty(e.prototype,"text",{get:function(){if(this.bmpString!==undefined){return this.bmpString}if(this.ia5String!==undefined){return this.ia5String}if(this.printableString!==undefined){return this.printableString}if(this.utf8String!==undefined){return this.utf8String}if(this.visibleString!==undefined){return this.visibleString}return undefined},set:function(e){this.printableString=e},enumerable:false,configurable:true});return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],BaseLeiChoice.prototype,"ia5String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.VisibleString})],BaseLeiChoice.prototype,"visibleString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],BaseLeiChoice.prototype,"bmpString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],BaseLeiChoice.prototype,"utf8String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],BaseLeiChoice.prototype,"printableString",void 0);BaseLeiChoice=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],BaseLeiChoice);var LeiChoice=function(e){__extends(t,e);function t(t){var r=e.call(this)||this;if(typeof t==="string"){r.text=t}else if(t instanceof Lei){r.struct=t}return r}return t}(BaseLeiChoice);__decorate$1([AsnProp({type:Lei})],LeiChoice.prototype,"struct",void 0);LeiChoice=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],LeiChoice);var id_role="1.3.6.1.4.1.52266.2";var LeiRole=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(BaseLeiChoice);LeiRole=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],LeiRole);var ByteStream=function(){function e(e){this.offset=0;this.view=buildExports.BufferSourceConverter.toUint8Array(e)}Object.defineProperty(e.prototype,"position",{get:function(){return this.offset},enumerable:false,configurable:true});e.prototype.read=function(e){if(e===void 0){e=1}var t=this.view.slice(this.offset,this.offset+e);this.offset=this.offset+t.length;return t};e.prototype.readByte=function(){var e=this.read();if(!e.length){throw new Error("End of stream")}return e[0]};e.prototype.readNumber=function(e){var t=this.read(e);var r=buildExports.Convert.ToHex(t);return parseInt(r,16)};e.prototype.readEnd=function(){return this.read(this.view.length-this.offset)};e.prototype.reset=function(){this.offset=0};return e}();var Structure=function(){function e(){}e.createStream=function(e){var t=buildExports.BufferSourceConverter.toUint8Array(e);return new ByteStream(t)};return e}();var SignatureType;(function(e){e[e["certificateTimestamp"]=0]="certificateTimestamp";e[e["treeHash"]=1]="treeHash"})(SignatureType||(SignatureType={}));var HashAlgorithm;(function(e){e[e["none"]=0]="none";e[e["md5"]=1]="md5";e[e["sha1"]=2]="sha1";e[e["sha224"]=3]="sha224";e[e["sha256"]=4]="sha256";e[e["sha384"]=5]="sha384";e[e["sha512"]=6]="sha512"})(HashAlgorithm||(HashAlgorithm={}));var SignatureAlgorithm;(function(e){e[e["anonymous"]=0]="anonymous";e[e["rsa"]=1]="rsa";e[e["dsa"]=2]="dsa";e[e["ecdsa"]=3]="ecdsa"})(SignatureAlgorithm||(SignatureAlgorithm={}));var SignedCertificateTimestamp=function(e){__extends(t,e);function t(t){var r=e.call(this)||this;r.version=0;r.logId=new ArrayBuffer(32);r.timestamp=new Date;r.extensions=new ArrayBuffer(0);r.hashAlgorithm=0;r.signatureAlgorithm=0;r.signature=new ArrayBuffer(0);if(t){r.parse(t)}return r}t.prototype.parse=function(e){this.version=e.readByte();e.read(2);this.logId=buildExports.BufferSourceConverter.toArrayBuffer(e.read(32));this.timestamp=new Date(e.readNumber(8));var t=e.readNumber(2);this.extensions=e.read(t).buffer;this.hashAlgorithm=e.readByte();this.signatureAlgorithm=e.readByte();this.signature=e.read(e.readNumber(2)).buffer};t.prototype.toJSON=function(){return{version:this.version,logId:buildExports.Convert.ToHex(this.logId),timestamp:this.timestamp,extensions:buildExports.Convert.ToBase64(this.extensions),hashAlgorithm:HashAlgorithm[this.hashAlgorithm]||"undefined",signatureAlgorithm:SignatureAlgorithm[this.signatureAlgorithm]||"undefined",signature:buildExports.Convert.ToBase64(this.signature)}};return t}(Structure);var Version$1;(function(e){e[e["v1"]=1]="v1"})(Version$1||(Version$1={}));var id_adbe_archiveRevInfo="1.2.840.113583.1.1.9.2";var ArchiveRevInfo=function(){function e(e){if(e===void 0){e={}}this.version=Version$1.v1;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ArchiveRevInfo.prototype,"version",void 0);var id_adbe_timestamp="1.2.840.113583.1.1.9.1";var Timestamp=function(){function e(e){if(e===void 0){e={}}this.version=Version$1.v1;this.location=new GeneralName;this.requiresAuth=false;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],Timestamp.prototype,"version",void 0);__decorate$1([AsnProp({type:GeneralName})],Timestamp.prototype,"location",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,defaultValue:false,optional:true})],Timestamp.prototype,"requiresAuth",void 0);var HashAlgAndValue=function(){function e(e){if(e===void 0){e={}}this.hashAlg=new AlgorithmIdentifier;this.hashValue=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],HashAlgAndValue.prototype,"hashAlg",void 0);__decorate$1([AsnProp({type:OctetString})],HashAlgAndValue.prototype,"hashValue",void 0);var LogotypeDetails=function(){function e(e){if(e===void 0){e={}}this.mediaType="";this.logotypeHash=[];this.logotypeURI=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],LogotypeDetails.prototype,"mediaType",void 0);__decorate$1([AsnProp({type:HashAlgAndValue,repeated:"sequence"})],LogotypeDetails.prototype,"logotypeHash",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,repeated:"sequence"})],LogotypeDetails.prototype,"logotypeURI",void 0);var LogotypeAudioChannels;(function(e){e[e["mono"]=1]="mono";e[e["stereo"]=2]="stereo";e[e["quad"]=4]="quad"})(LogotypeAudioChannels||(LogotypeAudioChannels={}));var LogotypeAudioInfo=function(){function e(e){if(e===void 0){e={}}this.fileSize=0;this.playTime=0;this.channels=LogotypeAudioChannels.mono;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],LogotypeAudioInfo.prototype,"fileSize",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],LogotypeAudioInfo.prototype,"playTime",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],LogotypeAudioInfo.prototype,"channels",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,implicit:true,context:3,optional:true})],LogotypeAudioInfo.prototype,"sampleRate",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,implicit:true,context:4,optional:true})],LogotypeAudioInfo.prototype,"language",void 0);var LogotypeAudio=function(){function e(e){if(e===void 0){e={}}this.audioDetails=new LogotypeDetails;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:LogotypeDetails})],LogotypeAudio.prototype,"audioDetails",void 0);__decorate$1([AsnProp({type:LogotypeAudioInfo,optional:true})],LogotypeAudio.prototype,"audioInfo",void 0);var LogotypeImageResolution=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:1,implicit:true})],LogotypeImageResolution.prototype,"numBits",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:2,implicit:true})],LogotypeImageResolution.prototype,"tableSize",void 0);LogotypeImageResolution=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],LogotypeImageResolution);var LogotypeImageType;(function(e){e[e["grayScale"]=0]="grayScale";e[e["color"]=1]="color"})(LogotypeImageType||(LogotypeImageType={}));var LogotypeImageInfo=function(){function e(e){if(e===void 0){e={}}this.type=LogotypeImageType.color;this.fileSize=0;this.xSize=0;this.ySize=0;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:0,implicit:true,defaultValue:LogotypeImageType.color})],LogotypeImageInfo.prototype,"type",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],LogotypeImageInfo.prototype,"fileSize",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],LogotypeImageInfo.prototype,"xSize",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],LogotypeImageInfo.prototype,"ySize",void 0);__decorate$1([AsnProp({type:LogotypeImageResolution})],LogotypeImageInfo.prototype,"resolution",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:4,implicit:true,optional:true})],LogotypeImageInfo.prototype,"language",void 0);var LogotypeImage=function(){function e(e){if(e===void 0){e={}}this.imageDetails=new LogotypeDetails;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:LogotypeDetails})],LogotypeImage.prototype,"imageDetails",void 0);__decorate$1([AsnProp({type:LogotypeImageInfo,optional:true})],LogotypeImage.prototype,"imageInfo",void 0);var LogotypeData=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:LogotypeImage,repeated:"sequence",optional:true})],LogotypeData.prototype,"image",void 0);__decorate$1([AsnProp({type:LogotypeAudio,repeated:"sequence",context:1,optional:true})],LogotypeData.prototype,"audio",void 0);var LogotypeReference=function(){function e(e){if(e===void 0){e={}}this.refStructHash=[];this.refStructURI=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:HashAlgAndValue,repeated:"sequence"})],LogotypeReference.prototype,"refStructHash",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,repeated:"sequence"})],LogotypeReference.prototype,"refStructURI",void 0);var LogotypeInfo=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:LogotypeData,implicit:true,context:0})],LogotypeInfo.prototype,"direct",void 0);__decorate$1([AsnProp({type:LogotypeReference,implicit:true,context:1})],LogotypeInfo.prototype,"indirect",void 0);LogotypeInfo=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],LogotypeInfo);var OtherLogotypeInfo=function(){function e(e){if(e===void 0){e={}}this.logotypeType="";this.info=new LogotypeInfo;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherLogotypeInfo.prototype,"logotypeType",void 0);__decorate$1([AsnProp({type:LogotypeInfo})],OtherLogotypeInfo.prototype,"info",void 0);var LogotypeExtn=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:LogotypeInfo,context:0,repeated:"sequence",optional:true})],LogotypeExtn.prototype,"communityLogos",void 0);__decorate$1([AsnProp({type:LogotypeInfo,context:1,optional:true})],LogotypeExtn.prototype,"issuerLogo",void 0);__decorate$1([AsnProp({type:LogotypeInfo,context:2,optional:true})],LogotypeExtn.prototype,"subjectLogo",void 0);__decorate$1([AsnProp({type:OtherLogotypeInfo,context:3,repeated:"sequence",optional:true})],LogotypeExtn.prototype,"otherLogos",void 0);var JWTClaimNames_1,JWTClaimPermittedValuesList_1,TNAuthorizationList_1;var id_pkix="1.3.6.1.5.5.7";var id_pe="".concat(id_pkix,".1");var JWTClaimNames=JWTClaimNames_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,JWTClaimNames_1.prototype);return r}return t}(AsnArray);JWTClaimNames=JWTClaimNames_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.IA5String})],JWTClaimNames);var JWTClaimPermittedValues=function(){function e(e){if(e===void 0){e={}}this.claim="";this.permitted=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],JWTClaimPermittedValues.prototype,"claim",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String,repeated:"sequence"})],JWTClaimPermittedValues.prototype,"permitted",void 0);var JWTClaimPermittedValuesList=JWTClaimPermittedValuesList_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,JWTClaimPermittedValuesList_1.prototype);return r}return t}(AsnArray);JWTClaimPermittedValuesList=JWTClaimPermittedValuesList_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:JWTClaimPermittedValues})],JWTClaimPermittedValuesList);var JWTClaimConstraints=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:JWTClaimNames,optional:true,context:0})],JWTClaimConstraints.prototype,"mustInclude",void 0);__decorate$1([AsnProp({type:JWTClaimPermittedValuesList,optional:true,context:1})],JWTClaimConstraints.prototype,"permittedValues",void 0);var id_pe_TNAuthList="".concat(id_pe,".26");var TelephoneNumberRange=function(){function e(){this.start="";this.count=2}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],TelephoneNumberRange.prototype,"start",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],TelephoneNumberRange.prototype,"count",void 0);var TNEntry=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:0})],TNEntry.prototype,"spc",void 0);__decorate$1([AsnProp({type:TelephoneNumberRange,context:1})],TNEntry.prototype,"range",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:2})],TNEntry.prototype,"one",void 0);TNEntry=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],TNEntry);var TNAuthorizationList=TNAuthorizationList_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,TNAuthorizationList_1.prototype);return r}return t}(AsnArray);TNAuthorizationList=TNAuthorizationList_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:TNEntry})],TNAuthorizationList);var IntegerSet_1;var id_ce_keyDescription="1.3.6.1.4.1.11129.2.1.17";var VerifiedBootState;(function(e){e[e["verified"]=0]="verified";e[e["selfSigned"]=1]="selfSigned";e[e["unverified"]=2]="unverified";e[e["failed"]=3]="failed"})(VerifiedBootState||(VerifiedBootState={}));var RootOfTrust=function(){function e(e){if(e===void 0){e={}}this.verifiedBootKey=new OctetString;this.deviceLocked=false;this.verifiedBootState=VerifiedBootState.verified;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString})],RootOfTrust.prototype,"verifiedBootKey",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean})],RootOfTrust.prototype,"deviceLocked",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],RootOfTrust.prototype,"verifiedBootState",void 0);__decorate$1([AsnProp({type:OctetString,optional:true})],RootOfTrust.prototype,"verifiedBootHash",void 0);var IntegerSet=IntegerSet_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,IntegerSet_1.prototype);return r}return t}(AsnArray);IntegerSet=IntegerSet_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:AsnPropTypes.Integer})],IntegerSet);var AuthorizationList=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({context:1,type:IntegerSet,optional:true})],AuthorizationList.prototype,"purpose",void 0);__decorate$1([AsnProp({context:2,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"algorithm",void 0);__decorate$1([AsnProp({context:3,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"keySize",void 0);__decorate$1([AsnProp({context:5,type:IntegerSet,optional:true})],AuthorizationList.prototype,"digest",void 0);__decorate$1([AsnProp({context:6,type:IntegerSet,optional:true})],AuthorizationList.prototype,"padding",void 0);__decorate$1([AsnProp({context:10,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"ecCurve",void 0);__decorate$1([AsnProp({context:200,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"rsaPublicExponent",void 0);__decorate$1([AsnProp({context:203,type:IntegerSet,optional:true})],AuthorizationList.prototype,"mgfDigest",void 0);__decorate$1([AsnProp({context:303,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"rollbackResistance",void 0);__decorate$1([AsnProp({context:305,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"earlyBootOnly",void 0);__decorate$1([AsnProp({context:400,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"activeDateTime",void 0);__decorate$1([AsnProp({context:401,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"originationExpireDateTime",void 0);__decorate$1([AsnProp({context:402,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"usageExpireDateTime",void 0);__decorate$1([AsnProp({context:405,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"usageCountLimit",void 0);__decorate$1([AsnProp({context:503,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"noAuthRequired",void 0);__decorate$1([AsnProp({context:504,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"userAuthType",void 0);__decorate$1([AsnProp({context:505,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"authTimeout",void 0);__decorate$1([AsnProp({context:506,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"allowWhileOnBody",void 0);__decorate$1([AsnProp({context:507,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"trustedUserPresenceRequired",void 0);__decorate$1([AsnProp({context:508,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"trustedConfirmationRequired",void 0);__decorate$1([AsnProp({context:509,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"unlockedDeviceRequired",void 0);__decorate$1([AsnProp({context:600,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"allApplications",void 0);__decorate$1([AsnProp({context:601,type:OctetString,optional:true})],AuthorizationList.prototype,"applicationId",void 0);__decorate$1([AsnProp({context:701,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"creationDateTime",void 0);__decorate$1([AsnProp({context:702,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"origin",void 0);__decorate$1([AsnProp({context:703,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"rollbackResistant",void 0);__decorate$1([AsnProp({context:704,type:RootOfTrust,optional:true})],AuthorizationList.prototype,"rootOfTrust",void 0);__decorate$1([AsnProp({context:705,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"osVersion",void 0);__decorate$1([AsnProp({context:706,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"osPatchLevel",void 0);__decorate$1([AsnProp({context:709,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationApplicationId",void 0);__decorate$1([AsnProp({context:710,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdBrand",void 0);__decorate$1([AsnProp({context:711,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdDevice",void 0);__decorate$1([AsnProp({context:712,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdProduct",void 0);__decorate$1([AsnProp({context:713,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdSerial",void 0);__decorate$1([AsnProp({context:714,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdImei",void 0);__decorate$1([AsnProp({context:715,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdMeid",void 0);__decorate$1([AsnProp({context:716,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdManufacturer",void 0);__decorate$1([AsnProp({context:717,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdModel",void 0);__decorate$1([AsnProp({context:718,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"vendorPatchLevel",void 0);__decorate$1([AsnProp({context:719,type:AsnPropTypes.Integer,optional:true})],AuthorizationList.prototype,"bootPatchLevel",void 0);__decorate$1([AsnProp({context:720,type:AsnPropTypes.Null,optional:true})],AuthorizationList.prototype,"deviceUniqueAttestation",void 0);__decorate$1([AsnProp({context:723,type:OctetString,optional:true})],AuthorizationList.prototype,"attestationIdSecondImei",void 0);__decorate$1([AsnProp({context:724,type:OctetString,optional:true})],AuthorizationList.prototype,"moduleHash",void 0);var SecurityLevel;(function(e){e[e["software"]=0]="software";e[e["trustedEnvironment"]=1]="trustedEnvironment";e[e["strongBox"]=2]="strongBox"})(SecurityLevel||(SecurityLevel={}));var Version;(function(e){e[e["KM2"]=1]="KM2";e[e["KM3"]=2]="KM3";e[e["KM4"]=3]="KM4";e[e["KM4_1"]=4]="KM4_1";e[e["keyMint1"]=100]="keyMint1";e[e["keyMint2"]=200]="keyMint2";e[e["keyMint3"]=300]="keyMint3";e[e["keyMint4"]=400]="keyMint4"})(Version||(Version={}));var KeyDescription=function(){function e(e){if(e===void 0){e={}}this.attestationVersion=Version.KM4;this.attestationSecurityLevel=SecurityLevel.software;this.keymasterVersion=0;this.keymasterSecurityLevel=SecurityLevel.software;this.attestationChallenge=new OctetString;this.uniqueId=new OctetString;this.softwareEnforced=new AuthorizationList;this.teeEnforced=new AuthorizationList;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyDescription.prototype,"attestationVersion",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],KeyDescription.prototype,"attestationSecurityLevel",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyDescription.prototype,"keymasterVersion",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],KeyDescription.prototype,"keymasterSecurityLevel",void 0);__decorate$1([AsnProp({type:OctetString})],KeyDescription.prototype,"attestationChallenge",void 0);__decorate$1([AsnProp({type:OctetString})],KeyDescription.prototype,"uniqueId",void 0);__decorate$1([AsnProp({type:AuthorizationList})],KeyDescription.prototype,"softwareEnforced",void 0);__decorate$1([AsnProp({type:AuthorizationList})],KeyDescription.prototype,"teeEnforced",void 0);var KeyMintKeyDescription=function(){function e(e){if(e===void 0){e={}}this.attestationVersion=Version.keyMint4;this.attestationSecurityLevel=SecurityLevel.software;this.keyMintVersion=0;this.keyMintSecurityLevel=SecurityLevel.software;this.attestationChallenge=new OctetString;this.uniqueId=new OctetString;this.softwareEnforced=new AuthorizationList;this.hardwareEnforced=new AuthorizationList;Object.assign(this,e)}e.prototype.toLegacyKeyDescription=function(){return new KeyDescription({attestationVersion:this.attestationVersion,attestationSecurityLevel:this.attestationSecurityLevel,keymasterVersion:this.keyMintVersion,keymasterSecurityLevel:this.keyMintSecurityLevel,attestationChallenge:this.attestationChallenge,uniqueId:this.uniqueId,softwareEnforced:this.softwareEnforced,teeEnforced:this.hardwareEnforced})};e.fromLegacyKeyDescription=function(t){return new e({attestationVersion:t.attestationVersion,attestationSecurityLevel:t.attestationSecurityLevel,keyMintVersion:t.keymasterVersion,keyMintSecurityLevel:t.keymasterSecurityLevel,attestationChallenge:t.attestationChallenge,uniqueId:t.uniqueId,softwareEnforced:t.softwareEnforced,hardwareEnforced:t.teeEnforced})};return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyMintKeyDescription.prototype,"attestationVersion",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],KeyMintKeyDescription.prototype,"attestationSecurityLevel",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyMintKeyDescription.prototype,"keyMintVersion",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],KeyMintKeyDescription.prototype,"keyMintSecurityLevel",void 0);__decorate$1([AsnProp({type:OctetString})],KeyMintKeyDescription.prototype,"attestationChallenge",void 0);__decorate$1([AsnProp({type:OctetString})],KeyMintKeyDescription.prototype,"uniqueId",void 0);__decorate$1([AsnProp({type:AuthorizationList})],KeyMintKeyDescription.prototype,"softwareEnforced",void 0);__decorate$1([AsnProp({type:AuthorizationList})],KeyMintKeyDescription.prototype,"hardwareEnforced",void 0);var NonStandardAuthorizationList_1;var NonStandardAuthorization=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AuthorizationList);NonStandardAuthorization=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],NonStandardAuthorization);var NonStandardAuthorizationList=NonStandardAuthorizationList_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,NonStandardAuthorizationList_1.prototype);return r}t.prototype.findProperty=function(e){var t=this.find((function(t){return e in t}));if(t){return t[e]}return undefined};return t}(AsnArray);NonStandardAuthorizationList=NonStandardAuthorizationList_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:NonStandardAuthorization})],NonStandardAuthorizationList);var NonStandardKeyDescription=function(){function e(e){if(e===void 0){e={}}this.attestationVersion=Version.KM4;this.attestationSecurityLevel=SecurityLevel.software;this.keymasterVersion=0;this.keymasterSecurityLevel=SecurityLevel.software;this.attestationChallenge=new OctetString;this.uniqueId=new OctetString;this.softwareEnforced=new NonStandardAuthorizationList;this.teeEnforced=new NonStandardAuthorizationList;Object.assign(this,e)}Object.defineProperty(e.prototype,"keyMintVersion",{get:function(){return this.keymasterVersion},set:function(e){this.keymasterVersion=e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"keyMintSecurityLevel",{get:function(){return this.keymasterSecurityLevel},set:function(e){this.keymasterSecurityLevel=e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"hardwareEnforced",{get:function(){return this.teeEnforced},set:function(e){this.teeEnforced=e},enumerable:false,configurable:true});return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],NonStandardKeyDescription.prototype,"attestationVersion",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],NonStandardKeyDescription.prototype,"attestationSecurityLevel",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],NonStandardKeyDescription.prototype,"keymasterVersion",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],NonStandardKeyDescription.prototype,"keymasterSecurityLevel",void 0);__decorate$1([AsnProp({type:OctetString})],NonStandardKeyDescription.prototype,"attestationChallenge",void 0);__decorate$1([AsnProp({type:OctetString})],NonStandardKeyDescription.prototype,"uniqueId",void 0);__decorate$1([AsnProp({type:NonStandardAuthorizationList})],NonStandardKeyDescription.prototype,"softwareEnforced",void 0);__decorate$1([AsnProp({type:NonStandardAuthorizationList})],NonStandardKeyDescription.prototype,"teeEnforced",void 0);var NonStandardKeyMintKeyDescription=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}if("keymasterVersion"in t&&!("keyMintVersion"in t)){t.keyMintVersion=t.keymasterVersion}if("keymasterSecurityLevel"in t&&!("keyMintSecurityLevel"in t)){t.keyMintSecurityLevel=t.keymasterSecurityLevel}if("teeEnforced"in t&&!("hardwareEnforced"in t)){t.hardwareEnforced=t.teeEnforced}return e.call(this,t)||this}return t}(NonStandardKeyDescription);NonStandardKeyMintKeyDescription=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],NonStandardKeyMintKeyDescription);var AttestationPackageInfo=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.OctetString})],AttestationPackageInfo.prototype,"packageName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],AttestationPackageInfo.prototype,"version",void 0);var AttestationApplicationId=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AttestationPackageInfo,repeated:"set"})],AttestationApplicationId.prototype,"packageInfos",void 0);__decorate$1([AsnProp({type:AsnPropTypes.OctetString,repeated:"set"})],AttestationApplicationId.prototype,"signatureDigests",void 0);var __decorate=undefined&&undefined.__decorate||function(e,t,r,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(n<3?a(o):n>3?a(t,r,o):a(t,r))||o;return n>3&&o&&Object.defineProperty(t,r,o),o};var id_cabforganizationIdentifier="2.23.140.3.1";var CabforganizationIdentifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate([AsnProp({type:AsnPropTypes.PrintableString})],CabforganizationIdentifier.prototype,"registrationSchemeIdentifier",void 0);__decorate([AsnProp({type:AsnPropTypes.PrintableString})],CabforganizationIdentifier.prototype,"registrationCountry",void 0);__decorate([AsnProp({type:AsnPropTypes.PrintableString,optional:true,context:0,implicit:true})],CabforganizationIdentifier.prototype,"registrationStateOrProvince",void 0);__decorate([AsnProp({type:AsnPropTypes.Utf8String})],CabforganizationIdentifier.prototype,"registrationReference",void 0);
|
|
107
107
|
/**
|
|
108
108
|
* @license
|
|
109
109
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -131,5 +131,5 @@ var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setP
|
|
|
131
131
|
*
|
|
132
132
|
* This source code is licensed under the MIT license found in the
|
|
133
133
|
* LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/var certificateRawToBuffer=function(e){if(PemConverter.isPem(e)){return PemConverter.decode(e)[0]}if(buildExports.Convert.isHex(e)){return buildExports.Convert.FromHex(e)}if(buildExports.Convert.isBase64(e)){return buildExports.Convert.FromBase64(e)}if(buildExports.Convert.isBase64Url(e)){return buildExports.Convert.FromBase64Url(e)}return buildExports.Convert.FromBinary(e)};var getCertificateThumbprint=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(i){r=cryptoProvider.get();if(r.subtle){return[2,r.subtle.digest(e,t)]}return[2,undefined]}))}))};var ACClearAttrs=function(){function e(e){if(e===void 0){e={}}this.acIssuer=new GeneralName;this.acSerial=0;this.attrs=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName})],ACClearAttrs.prototype,"acIssuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ACClearAttrs.prototype,"acSerial",void 0);__decorate$1([AsnProp({type:Attribute$1,repeated:"sequence"})],ACClearAttrs.prototype,"attrs",void 0);var AttrSpec_1;var AttrSpec=AttrSpec_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AttrSpec_1.prototype);return r}return t}(AsnArray);AttrSpec=AttrSpec_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.ObjectIdentifier})],AttrSpec);var AAControls=function(){function e(e){if(e===void 0){e={}}this.permitUnSpecified=true;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],AAControls.prototype,"pathLenConstraint",void 0);__decorate$1([AsnProp({type:AttrSpec,implicit:true,context:0,optional:true})],AAControls.prototype,"permittedAttrs",void 0);__decorate$1([AsnProp({type:AttrSpec,implicit:true,context:1,optional:true})],AAControls.prototype,"excludedAttrs",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,defaultValue:true})],AAControls.prototype,"permitUnSpecified",void 0);var IssuerSerial=function(){function e(e){if(e===void 0){e={}}this.issuer=new GeneralNames;this.serial=new ArrayBuffer(0);this.issuerUID=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames})],IssuerSerial.prototype,"issuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],IssuerSerial.prototype,"serial",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,optional:true})],IssuerSerial.prototype,"issuerUID",void 0);var DigestedObjectType;(function(e){e[e["publicKey"]=0]="publicKey";e[e["publicKeyCert"]=1]="publicKeyCert";e[e["otherObjectTypes"]=2]="otherObjectTypes"})(DigestedObjectType||(DigestedObjectType={}));var ObjectDigestInfo=function(){function e(e){if(e===void 0){e={}}this.digestedObjectType=DigestedObjectType.publicKey;this.digestAlgorithm=new AlgorithmIdentifier;this.objectDigest=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],ObjectDigestInfo.prototype,"digestedObjectType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier,optional:true})],ObjectDigestInfo.prototype,"otherObjectTypeID",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],ObjectDigestInfo.prototype,"digestAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],ObjectDigestInfo.prototype,"objectDigest",void 0);var V2Form=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames,optional:true})],V2Form.prototype,"issuerName",void 0);__decorate$1([AsnProp({type:IssuerSerial,context:0,implicit:true,optional:true})],V2Form.prototype,"baseCertificateID",void 0);__decorate$1([AsnProp({type:ObjectDigestInfo,context:1,implicit:true,optional:true})],V2Form.prototype,"objectDigestInfo",void 0);var AttCertIssuer=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,repeated:"sequence"})],AttCertIssuer.prototype,"v1Form",void 0);__decorate$1([AsnProp({type:V2Form,context:0,implicit:true})],AttCertIssuer.prototype,"v2Form",void 0);AttCertIssuer=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],AttCertIssuer);var AttCertValidityPeriod=function(){function e(e){if(e===void 0){e={}}this.notBeforeTime=new Date;this.notAfterTime=new Date;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],AttCertValidityPeriod.prototype,"notBeforeTime",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],AttCertValidityPeriod.prototype,"notAfterTime",void 0);var Holder=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:IssuerSerial,implicit:true,context:0,optional:true})],Holder.prototype,"baseCertificateID",void 0);__decorate$1([AsnProp({type:GeneralNames,implicit:true,context:1,optional:true})],Holder.prototype,"entityName",void 0);__decorate$1([AsnProp({type:ObjectDigestInfo,implicit:true,context:2,optional:true})],Holder.prototype,"objectDigestInfo",void 0);var AttCertVersion;(function(e){e[e["v2"]=1]="v2"})(AttCertVersion||(AttCertVersion={}));var AttributeCertificateInfo=function(){function e(e){if(e===void 0){e={}}this.version=AttCertVersion.v2;this.holder=new Holder;this.issuer=new AttCertIssuer;this.signature=new AlgorithmIdentifier;this.serialNumber=new ArrayBuffer(0);this.attrCertValidityPeriod=new AttCertValidityPeriod;this.attributes=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],AttributeCertificateInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:Holder})],AttributeCertificateInfo.prototype,"holder",void 0);__decorate$1([AsnProp({type:AttCertIssuer})],AttributeCertificateInfo.prototype,"issuer",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],AttributeCertificateInfo.prototype,"signature",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],AttributeCertificateInfo.prototype,"serialNumber",void 0);__decorate$1([AsnProp({type:AttCertValidityPeriod})],AttributeCertificateInfo.prototype,"attrCertValidityPeriod",void 0);__decorate$1([AsnProp({type:Attribute$1,repeated:"sequence"})],AttributeCertificateInfo.prototype,"attributes",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,optional:true})],AttributeCertificateInfo.prototype,"issuerUniqueID",void 0);__decorate$1([AsnProp({type:Extensions,optional:true})],AttributeCertificateInfo.prototype,"extensions",void 0);var AttributeCertificate=function(){function e(e){if(e===void 0){e={}}this.acinfo=new AttributeCertificateInfo;this.signatureAlgorithm=new AlgorithmIdentifier;this.signatureValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AttributeCertificateInfo})],AttributeCertificate.prototype,"acinfo",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],AttributeCertificate.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],AttributeCertificate.prototype,"signatureValue",void 0);var ClassListFlags;(function(e){e[e["unmarked"]=1]="unmarked";e[e["unclassified"]=2]="unclassified";e[e["restricted"]=4]="restricted";e[e["confidential"]=8]="confidential";e[e["secret"]=16]="secret";e[e["topSecret"]=32]="topSecret"})(ClassListFlags||(ClassListFlags={}));var ClassList=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(BitString);var SecurityCategory=function(){function e(e){if(e===void 0){e={}}this.type="";this.value=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier,implicit:true,context:0})],SecurityCategory.prototype,"type",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,implicit:true,context:1})],SecurityCategory.prototype,"value",void 0);var Clearance=function(){function e(e){if(e===void 0){e={}}this.policyId="";this.classList=new ClassList(ClassListFlags.unclassified);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Clearance.prototype,"policyId",void 0);__decorate$1([AsnProp({type:ClassList,defaultValue:new ClassList(ClassListFlags.unclassified)})],Clearance.prototype,"classList",void 0);__decorate$1([AsnProp({type:SecurityCategory,repeated:"set"})],Clearance.prototype,"securityCategories",void 0);var IetfAttrSyntaxValueChoices=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString})],IetfAttrSyntaxValueChoices.prototype,"cotets",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],IetfAttrSyntaxValueChoices.prototype,"oid",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],IetfAttrSyntaxValueChoices.prototype,"string",void 0);var IetfAttrSyntax=function(){function e(e){if(e===void 0){e={}}this.values=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames,implicit:true,context:0,optional:true})],IetfAttrSyntax.prototype,"policyAuthority",void 0);__decorate$1([AsnProp({type:IetfAttrSyntaxValueChoices,repeated:"sequence"})],IetfAttrSyntax.prototype,"values",void 0);var Targets_1;var TargetCert=function(){function e(e){if(e===void 0){e={}}this.targetCertificate=new IssuerSerial;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:IssuerSerial})],TargetCert.prototype,"targetCertificate",void 0);__decorate$1([AsnProp({type:GeneralName,optional:true})],TargetCert.prototype,"targetName",void 0);__decorate$1([AsnProp({type:ObjectDigestInfo,optional:true})],TargetCert.prototype,"certDigestInfo",void 0);var Target=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0,implicit:true})],Target.prototype,"targetName",void 0);__decorate$1([AsnProp({type:GeneralName,context:1,implicit:true})],Target.prototype,"targetGroup",void 0);__decorate$1([AsnProp({type:TargetCert,context:2,implicit:true})],Target.prototype,"targetCert",void 0);Target=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Target);var Targets=Targets_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Targets_1.prototype);return r}return t}(AsnArray);Targets=Targets_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Target})],Targets);var ProxyInfo_1;var ProxyInfo=ProxyInfo_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ProxyInfo_1.prototype);return r}return t}(AsnArray);ProxyInfo=ProxyInfo_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Targets})],ProxyInfo);var RoleSyntax=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames,implicit:true,context:0,optional:true})],RoleSyntax.prototype,"roleAuthority",void 0);__decorate$1([AsnProp({type:GeneralName,implicit:true,context:1})],RoleSyntax.prototype,"roleName",void 0);var SvceAuthInfo=function(){function e(e){if(e===void 0){e={}}this.service=new GeneralName;this.ident=new GeneralName;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName})],SvceAuthInfo.prototype,"service",void 0);__decorate$1([AsnProp({type:GeneralName})],SvceAuthInfo.prototype,"ident",void 0);__decorate$1([AsnProp({type:OctetString,optional:true})],SvceAuthInfo.prototype,"authInfo",void 0);var id_ntQWAC="0.4.0.9496";var id_ActivityDescription="".concat(id_ntQWAC,".6");var ActivityDescription=function(){function e(e){if(e===void 0){e={}}this.codeAuthority=new GeneralName;this.codeId=new GeneralName;this.shortName="";this.shortDescription="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0})],ActivityDescription.prototype,"codeAuthority",void 0);__decorate$1([AsnProp({type:GeneralName,context:1})],ActivityDescription.prototype,"codeId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String,context:2})],ActivityDescription.prototype,"shortName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String,context:3})],ActivityDescription.prototype,"shortDescription",void 0);ActivityDescription=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ActivityDescription);var DomainName=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(Name$1);DomainName=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainName);var id_DomainNameBeneficiary="".concat(id_ntQWAC,".1");var DomainNameBeneficiary=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameBeneficiary=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameBeneficiary);var id_DomainNameLegalRepresentative="".concat(id_ntQWAC,".2");var DomainNameLegalRepresentative=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameLegalRepresentative=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameLegalRepresentative);var id_DomainNameOwner="".concat(id_ntQWAC,".3");var DomainNameOwner=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameOwner=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameOwner);var id_DomainNameTechnicalOperator="".concat(id_ntQWAC,".4");var DomainNameTechnicalOperator=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameTechnicalOperator=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameTechnicalOperator);var id_InsuranceValue="".concat(id_ntQWAC,".8");var InsuranceValue=function(){function e(e){if(e===void 0){e={}}this.location="";this.base=0;this.degree=0;Object.assign(this,e)}e.prototype.toString=function(){return"".concat(this.base," x 10^").concat(this.degree," ").concat(this.location)};return e}();__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],InsuranceValue.prototype,"location",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],InsuranceValue.prototype,"base",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],InsuranceValue.prototype,"degree",void 0);InsuranceValue=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],InsuranceValue);var id_ValuationRanking="".concat(id_ntQWAC,".9");var ValuationRanking=function(){function e(e){if(e===void 0){e={}}this.stars5=0;this.stars4=0;this.stars3=0;this.stars2=0;this.stars1=0;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars5",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars4",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars3",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars2",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars1",void 0);ValuationRanking=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ValuationRanking);var id_TypeRelationship="".concat(id_ntQWAC,".5");var TypeRelationship=function(){function e(e){if(e===void 0){e={}}this.DNBvsDNO=new BitString(0);this.DNBvsDNT=new BitString(0);this.DNOvsDNT=new BitString(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:BitString,context:0})],TypeRelationship.prototype,"DNBvsDNO",void 0);__decorate$1([AsnProp({type:BitString,context:1})],TypeRelationship.prototype,"DNBvsDNT",void 0);__decorate$1([AsnProp({type:BitString,context:2})],TypeRelationship.prototype,"DNOvsDNT",void 0);TypeRelationship=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],TypeRelationship);var id_WebGDPR="".concat(id_ntQWAC,".7");var WebGDPR=function(){function e(e){if(e===void 0){e={}}this.assessmentAuthority=new GeneralName;this.assessmentRef=new GeneralName;this.assessmentLocation=new GeneralName;this.dataStorageTerritory="";this.description="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0})],WebGDPR.prototype,"assessmentAuthority",void 0);__decorate$1([AsnProp({type:GeneralName,context:1})],WebGDPR.prototype,"assessmentRef",void 0);__decorate$1([AsnProp({type:GeneralName,context:2})],WebGDPR.prototype,"assessmentLocation",void 0);__decorate$1([AsnProp({type:AsnPropTypes.PrintableString,context:3})],WebGDPR.prototype,"dataStorageTerritory",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String,context:4})],WebGDPR.prototype,"description",void 0);WebGDPR=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],WebGDPR);var IssuerAndSerialNumber=function(){function e(e){if(e===void 0){e={}}this.issuer=new Name$1;this.serialNumber=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:Name$1})],IssuerAndSerialNumber.prototype,"issuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],IssuerAndSerialNumber.prototype,"serialNumber",void 0);var SignerIdentifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier,context:0,implicit:true})],SignerIdentifier.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber})],SignerIdentifier.prototype,"issuerAndSerialNumber",void 0);SignerIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SignerIdentifier);var CMSVersion;(function(e){e[e["v0"]=0]="v0";e[e["v1"]=1]="v1";e[e["v2"]=2]="v2";e[e["v3"]=3]="v3";e[e["v4"]=4]="v4";e[e["v5"]=5]="v5"})(CMSVersion||(CMSVersion={}));var DigestAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);DigestAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DigestAlgorithmIdentifier);var SignatureAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);SignatureAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SignatureAlgorithmIdentifier);var KeyEncryptionAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);KeyEncryptionAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],KeyEncryptionAlgorithmIdentifier);var ContentEncryptionAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);ContentEncryptionAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ContentEncryptionAlgorithmIdentifier);var MessageAuthenticationCodeAlgorithm=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);MessageAuthenticationCodeAlgorithm=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],MessageAuthenticationCodeAlgorithm);var KeyDerivationAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);KeyDerivationAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],KeyDerivationAlgorithmIdentifier);var Attribute=function(){function e(e){if(e===void 0){e={}}this.attrType="";this.attrValues=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Attribute.prototype,"attrType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,repeated:"set"})],Attribute.prototype,"attrValues",void 0);var SignerInfos_1;var SignerInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.sid=new SignerIdentifier;this.digestAlgorithm=new DigestAlgorithmIdentifier;this.signatureAlgorithm=new SignatureAlgorithmIdentifier;this.signature=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SignerInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:SignerIdentifier})],SignerInfo.prototype,"sid",void 0);__decorate$1([AsnProp({type:DigestAlgorithmIdentifier})],SignerInfo.prototype,"digestAlgorithm",void 0);__decorate$1([AsnProp({type:Attribute,repeated:"set",context:0,implicit:true,optional:true})],SignerInfo.prototype,"signedAttrs",void 0);__decorate$1([AsnProp({type:SignatureAlgorithmIdentifier})],SignerInfo.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],SignerInfo.prototype,"signature",void 0);__decorate$1([AsnProp({type:Attribute,repeated:"set",context:1,implicit:true,optional:true})],SignerInfo.prototype,"unsignedAttrs",void 0);var SignerInfos=SignerInfos_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SignerInfos_1.prototype);return r}return t}(AsnArray);SignerInfos=SignerInfos_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:SignerInfo})],SignerInfos);var SigningTime$1=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Time);SigningTime$1=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SigningTime$1);var CounterSignature$1=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(SignerInfo);CounterSignature$1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CounterSignature$1);var CertificateSet_1;var OtherCertificateFormat=function(){function e(e){if(e===void 0){e={}}this.otherCertFormat="";this.otherCert=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherCertificateFormat.prototype,"otherCertFormat",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],OtherCertificateFormat.prototype,"otherCert",void 0);var CertificateChoices=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:Certificate})],CertificateChoices.prototype,"certificate",void 0);__decorate$1([AsnProp({type:AttributeCertificate,context:2,implicit:true})],CertificateChoices.prototype,"v2AttrCert",void 0);__decorate$1([AsnProp({type:OtherCertificateFormat,context:3,implicit:true})],CertificateChoices.prototype,"other",void 0);CertificateChoices=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CertificateChoices);var CertificateSet=CertificateSet_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertificateSet_1.prototype);return r}return t}(AsnArray);CertificateSet=CertificateSet_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:CertificateChoices})],CertificateSet);var ContentInfo=function(){function e(e){if(e===void 0){e={}}this.contentType="";this.content=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],ContentInfo.prototype,"contentType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],ContentInfo.prototype,"content",void 0);var EncapsulatedContent=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString})],EncapsulatedContent.prototype,"single",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],EncapsulatedContent.prototype,"any",void 0);EncapsulatedContent=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],EncapsulatedContent);var EncapsulatedContentInfo=function(){function e(e){if(e===void 0){e={}}this.eContentType="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],EncapsulatedContentInfo.prototype,"eContentType",void 0);__decorate$1([AsnProp({type:EncapsulatedContent,context:0,optional:true})],EncapsulatedContentInfo.prototype,"eContent",void 0);var EncryptedContent=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString,context:0,implicit:true,optional:true})],EncryptedContent.prototype,"value",void 0);__decorate$1([AsnProp({type:OctetString,converter:AsnConstructedOctetStringConverter,context:0,implicit:true,optional:true,repeated:"sequence"})],EncryptedContent.prototype,"constructedValue",void 0);EncryptedContent=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],EncryptedContent);var EncryptedContentInfo=function(){function e(e){if(e===void 0){e={}}this.contentType="";this.contentEncryptionAlgorithm=new ContentEncryptionAlgorithmIdentifier;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],EncryptedContentInfo.prototype,"contentType",void 0);__decorate$1([AsnProp({type:ContentEncryptionAlgorithmIdentifier})],EncryptedContentInfo.prototype,"contentEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:EncryptedContent,optional:true})],EncryptedContentInfo.prototype,"encryptedContent",void 0);var OtherKeyAttribute=function(){function e(e){if(e===void 0){e={}}this.keyAttrId="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherKeyAttribute.prototype,"keyAttrId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,optional:true})],OtherKeyAttribute.prototype,"keyAttr",void 0);var RecipientEncryptedKeys_1;var RecipientKeyIdentifier=function(){function e(e){if(e===void 0){e={}}this.subjectKeyIdentifier=new SubjectKeyIdentifier;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier})],RecipientKeyIdentifier.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,optional:true})],RecipientKeyIdentifier.prototype,"date",void 0);__decorate$1([AsnProp({type:OtherKeyAttribute,optional:true})],RecipientKeyIdentifier.prototype,"other",void 0);var KeyAgreeRecipientIdentifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:RecipientKeyIdentifier,context:0,implicit:true,optional:true})],KeyAgreeRecipientIdentifier.prototype,"rKeyId",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber,optional:true})],KeyAgreeRecipientIdentifier.prototype,"issuerAndSerialNumber",void 0);KeyAgreeRecipientIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],KeyAgreeRecipientIdentifier);var RecipientEncryptedKey=function(){function e(e){if(e===void 0){e={}}this.rid=new KeyAgreeRecipientIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:KeyAgreeRecipientIdentifier})],RecipientEncryptedKey.prototype,"rid",void 0);__decorate$1([AsnProp({type:OctetString})],RecipientEncryptedKey.prototype,"encryptedKey",void 0);var RecipientEncryptedKeys=RecipientEncryptedKeys_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RecipientEncryptedKeys_1.prototype);return r}return t}(AsnArray);RecipientEncryptedKeys=RecipientEncryptedKeys_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:RecipientEncryptedKey})],RecipientEncryptedKeys);var OriginatorPublicKey=function(){function e(e){if(e===void 0){e={}}this.algorithm=new AlgorithmIdentifier;this.publicKey=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],OriginatorPublicKey.prototype,"algorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],OriginatorPublicKey.prototype,"publicKey",void 0);var OriginatorIdentifierOrKey=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier,context:0,implicit:true,optional:true})],OriginatorIdentifierOrKey.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:OriginatorPublicKey,context:1,implicit:true,optional:true})],OriginatorIdentifierOrKey.prototype,"originatorKey",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber,optional:true})],OriginatorIdentifierOrKey.prototype,"issuerAndSerialNumber",void 0);OriginatorIdentifierOrKey=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],OriginatorIdentifierOrKey);var KeyAgreeRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v3;this.originator=new OriginatorIdentifierOrKey;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.recipientEncryptedKeys=new RecipientEncryptedKeys;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyAgreeRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:OriginatorIdentifierOrKey,context:0})],KeyAgreeRecipientInfo.prototype,"originator",void 0);__decorate$1([AsnProp({type:OctetString,context:1,optional:true})],KeyAgreeRecipientInfo.prototype,"ukm",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],KeyAgreeRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:RecipientEncryptedKeys})],KeyAgreeRecipientInfo.prototype,"recipientEncryptedKeys",void 0);var RecipientIdentifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier,context:0,implicit:true})],RecipientIdentifier.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber})],RecipientIdentifier.prototype,"issuerAndSerialNumber",void 0);RecipientIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],RecipientIdentifier);var KeyTransRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.rid=new RecipientIdentifier;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyTransRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:RecipientIdentifier})],KeyTransRecipientInfo.prototype,"rid",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],KeyTransRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],KeyTransRecipientInfo.prototype,"encryptedKey",void 0);var KEKIdentifier=function(){function e(e){if(e===void 0){e={}}this.keyIdentifier=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString})],KEKIdentifier.prototype,"keyIdentifier",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,optional:true})],KEKIdentifier.prototype,"date",void 0);__decorate$1([AsnProp({type:OtherKeyAttribute,optional:true})],KEKIdentifier.prototype,"other",void 0);var KEKRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v4;this.kekid=new KEKIdentifier;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KEKRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:KEKIdentifier})],KEKRecipientInfo.prototype,"kekid",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],KEKRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],KEKRecipientInfo.prototype,"encryptedKey",void 0);var PasswordRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],PasswordRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:KeyDerivationAlgorithmIdentifier,context:0,optional:true})],PasswordRecipientInfo.prototype,"keyDerivationAlgorithm",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],PasswordRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],PasswordRecipientInfo.prototype,"encryptedKey",void 0);var OtherRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.oriType="";this.oriValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherRecipientInfo.prototype,"oriType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],OtherRecipientInfo.prototype,"oriValue",void 0);var RecipientInfo=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:KeyTransRecipientInfo,optional:true})],RecipientInfo.prototype,"ktri",void 0);__decorate$1([AsnProp({type:KeyAgreeRecipientInfo,context:1,implicit:true,optional:true})],RecipientInfo.prototype,"kari",void 0);__decorate$1([AsnProp({type:KEKRecipientInfo,context:2,implicit:true,optional:true})],RecipientInfo.prototype,"kekri",void 0);__decorate$1([AsnProp({type:PasswordRecipientInfo,context:3,implicit:true,optional:true})],RecipientInfo.prototype,"pwri",void 0);__decorate$1([AsnProp({type:OtherRecipientInfo,context:4,implicit:true,optional:true})],RecipientInfo.prototype,"ori",void 0);RecipientInfo=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],RecipientInfo);var RecipientInfos_1;var RecipientInfos=RecipientInfos_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RecipientInfos_1.prototype);return r}return t}(AsnArray);RecipientInfos=RecipientInfos_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:RecipientInfo})],RecipientInfos);var RevocationInfoChoices_1;var OtherRevocationInfoFormat=function(){function e(e){if(e===void 0){e={}}this.otherRevInfoFormat="";this.otherRevInfo=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherRevocationInfoFormat.prototype,"otherRevInfoFormat",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],OtherRevocationInfoFormat.prototype,"otherRevInfo",void 0);var RevocationInfoChoice=function(){function e(e){if(e===void 0){e={}}this.other=new OtherRevocationInfoFormat;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OtherRevocationInfoFormat,context:1,implicit:true})],RevocationInfoChoice.prototype,"other",void 0);RevocationInfoChoice=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],RevocationInfoChoice);var RevocationInfoChoices=RevocationInfoChoices_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RevocationInfoChoices_1.prototype);return r}return t}(AsnArray);RevocationInfoChoices=RevocationInfoChoices_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:RevocationInfoChoice})],RevocationInfoChoices);var OriginatorInfo=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:CertificateSet,context:0,implicit:true,optional:true})],OriginatorInfo.prototype,"certs",void 0);__decorate$1([AsnProp({type:RevocationInfoChoices,context:1,implicit:true,optional:true})],OriginatorInfo.prototype,"crls",void 0);var UnprotectedAttributes_1;var UnprotectedAttributes=UnprotectedAttributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,UnprotectedAttributes_1.prototype);return r}return t}(AsnArray);UnprotectedAttributes=UnprotectedAttributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:Attribute})],UnprotectedAttributes);var EnvelopedData=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.recipientInfos=new RecipientInfos;this.encryptedContentInfo=new EncryptedContentInfo;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],EnvelopedData.prototype,"version",void 0);__decorate$1([AsnProp({type:OriginatorInfo,context:0,implicit:true,optional:true})],EnvelopedData.prototype,"originatorInfo",void 0);__decorate$1([AsnProp({type:RecipientInfos})],EnvelopedData.prototype,"recipientInfos",void 0);__decorate$1([AsnProp({type:EncryptedContentInfo})],EnvelopedData.prototype,"encryptedContentInfo",void 0);__decorate$1([AsnProp({type:UnprotectedAttributes,context:1,implicit:true,optional:true})],EnvelopedData.prototype,"unprotectedAttrs",void 0);var DigestAlgorithmIdentifiers_1;var DigestAlgorithmIdentifiers=DigestAlgorithmIdentifiers_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,DigestAlgorithmIdentifiers_1.prototype);return r}return t}(AsnArray);DigestAlgorithmIdentifiers=DigestAlgorithmIdentifiers_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:DigestAlgorithmIdentifier})],DigestAlgorithmIdentifiers);var SignedData=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.digestAlgorithms=new DigestAlgorithmIdentifiers;this.encapContentInfo=new EncapsulatedContentInfo;this.signerInfos=new SignerInfos;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SignedData.prototype,"version",void 0);__decorate$1([AsnProp({type:DigestAlgorithmIdentifiers})],SignedData.prototype,"digestAlgorithms",void 0);__decorate$1([AsnProp({type:EncapsulatedContentInfo})],SignedData.prototype,"encapContentInfo",void 0);__decorate$1([AsnProp({type:CertificateSet,context:0,implicit:true,optional:true})],SignedData.prototype,"certificates",void 0);__decorate$1([AsnProp({type:RevocationInfoChoices,context:1,implicit:true,optional:true})],SignedData.prototype,"crls",void 0);__decorate$1([AsnProp({type:SignerInfos})],SignedData.prototype,"signerInfos",void 0);var PKCS12AttrSet_1;var PKCS12Attribute=function(){function e(e){if(e===void 0){e={}}this.attrId="";this.attrValues=[];Object.assign(e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PKCS12Attribute.prototype,"attrId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,repeated:"set"})],PKCS12Attribute.prototype,"attrValues",void 0);var PKCS12AttrSet=PKCS12AttrSet_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,PKCS12AttrSet_1.prototype);return r}return t}(AsnArray);PKCS12AttrSet=PKCS12AttrSet_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:PKCS12Attribute})],PKCS12AttrSet);var AuthenticatedSafe_1;var AuthenticatedSafe=AuthenticatedSafe_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AuthenticatedSafe_1.prototype);return r}return t}(AsnArray);AuthenticatedSafe=AuthenticatedSafe_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:ContentInfo})],AuthenticatedSafe);var CertBag=function(){function e(e){if(e===void 0){e={}}this.certId="";this.certValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],CertBag.prototype,"certId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],CertBag.prototype,"certValue",void 0);var CRLBag=function(){function e(e){if(e===void 0){e={}}this.crlId="";this.crltValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],CRLBag.prototype,"crlId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],CRLBag.prototype,"crltValue",void 0);var KeyBag=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(PrivateKeyInfo$1);KeyBag=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],KeyBag);var PKCS8ShroudedKeyBag=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(EncryptedPrivateKeyInfo$1);PKCS8ShroudedKeyBag=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],PKCS8ShroudedKeyBag);var SecretBag=function(){function e(e){if(e===void 0){e={}}this.secretTypeId="";this.secretValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],SecretBag.prototype,"secretTypeId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],SecretBag.prototype,"secretValue",void 0);var MacData=function(){function e(e){if(e===void 0){e={}}this.mac=new DigestInfo;this.macSalt=new OctetString;this.iterations=1;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DigestInfo})],MacData.prototype,"mac",void 0);__decorate$1([AsnProp({type:OctetString})],MacData.prototype,"macSalt",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,defaultValue:1})],MacData.prototype,"iterations",void 0);var PFX=function(){function e(e){if(e===void 0){e={}}this.version=3;this.authSafe=new ContentInfo;this.macData=new MacData;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],PFX.prototype,"version",void 0);__decorate$1([AsnProp({type:ContentInfo})],PFX.prototype,"authSafe",void 0);__decorate$1([AsnProp({type:MacData,optional:true})],PFX.prototype,"macData",void 0);var SafeContents_1;var SafeBag=function(){function e(e){if(e===void 0){e={}}this.bagId="";this.bagValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],SafeBag.prototype,"bagId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],SafeBag.prototype,"bagValue",void 0);__decorate$1([AsnProp({type:PKCS12Attribute,repeated:"set",optional:true})],SafeBag.prototype,"bagAttributes",void 0);var SafeContents=SafeContents_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SafeContents_1.prototype);return r}return t}(AsnArray);SafeContents=SafeContents_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:SafeBag})],SafeContents);var ExtensionRequest_1,ExtendedCertificateAttributes_1,SMIMECapabilities_1;var id_pkcs9="1.2.840.113549.1.9";var id_pkcs9_at_unstructuredName="".concat(id_pkcs9,".2");var id_pkcs9_at_challengePassword="".concat(id_pkcs9,".7");var id_pkcs9_at_extensionRequest="".concat(id_pkcs9,".14");var PKCS9String=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}return e.call(this,t)||this}t.prototype.toString=function(){return this.ia5String||e.prototype.toString.call(this)};return t}(DirectoryString);__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],PKCS9String.prototype,"ia5String",void 0);PKCS9String=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],PKCS9String);var Pkcs7PDU=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(ContentInfo);Pkcs7PDU=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],Pkcs7PDU);var UserPKCS12=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(PFX);UserPKCS12=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],UserPKCS12);var EncryptedPrivateKeyInfo=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(EncryptedPrivateKeyInfo$1);EncryptedPrivateKeyInfo=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],EncryptedPrivateKeyInfo);var EmailAddress=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],EmailAddress.prototype,"value",void 0);EmailAddress=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],EmailAddress);var UnstructuredName=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(PKCS9String);UnstructuredName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],UnstructuredName);var UnstructuredAddress=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);UnstructuredAddress=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],UnstructuredAddress);var DateOfBirth=function(){function e(e){if(e===void 0){e=new Date}this.value=e}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],DateOfBirth.prototype,"value",void 0);DateOfBirth=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DateOfBirth);var PlaceOfBirth=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);PlaceOfBirth=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],PlaceOfBirth);var Gender=function(){function e(e){if(e===void 0){e="M"}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],Gender.prototype,"value",void 0);Gender=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Gender);var CountryOfCitizenship=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],CountryOfCitizenship.prototype,"value",void 0);CountryOfCitizenship=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CountryOfCitizenship);var CountryOfResidence=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(CountryOfCitizenship);CountryOfResidence=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CountryOfResidence);var Pseudonym=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);Pseudonym=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Pseudonym);var ContentType=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],ContentType.prototype,"value",void 0);ContentType=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],ContentType);var SigningTime=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Time);SigningTime=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SigningTime);var SequenceNumber=function(){function e(e){if(e===void 0){e=0}this.value=e}e.prototype.toString=function(){return this.value.toString()};return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SequenceNumber.prototype,"value",void 0);SequenceNumber=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SequenceNumber);var CounterSignature=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(SignerInfo);CounterSignature=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CounterSignature);var ChallengePassword=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);ChallengePassword=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],ChallengePassword);var ExtensionRequest=ExtensionRequest_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ExtensionRequest_1.prototype);return r}return t}(Extensions);ExtensionRequest=ExtensionRequest_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ExtensionRequest);var ExtendedCertificateAttributes=ExtendedCertificateAttributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ExtendedCertificateAttributes_1.prototype);return r}return t}(AsnArray);ExtendedCertificateAttributes=ExtendedCertificateAttributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:Attribute})],ExtendedCertificateAttributes);var FriendlyName=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],FriendlyName.prototype,"value",void 0);FriendlyName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],FriendlyName);var SMIMECapability=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);SMIMECapability=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SMIMECapability);var SMIMECapabilities=SMIMECapabilities_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SMIMECapabilities_1.prototype);return r}return t}(AsnArray);SMIMECapabilities=SMIMECapabilities_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:SMIMECapability})],SMIMECapabilities);var id_at_statementOfPossession="1.3.6.1.4.1.22112.2.1";var PrivateKeyPossessionStatement=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:IssuerAndSerialNumber})],PrivateKeyPossessionStatement.prototype,"signer",void 0);__decorate$1([AsnProp({type:Certificate,optional:true})],PrivateKeyPossessionStatement.prototype,"cert",void 0);PrivateKeyPossessionStatement=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],PrivateKeyPossessionStatement);var Attributes_1;var Attributes=Attributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Attributes_1.prototype);return r}return t}(AsnArray);Attributes=Attributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Attribute$1})],Attributes);var CertificationRequestInfo=function(){function e(e){if(e===void 0){e={}}this.version=0;this.subject=new Name$1;this.subjectPKInfo=new SubjectPublicKeyInfo;this.attributes=new Attributes;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],CertificationRequestInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:Name$1})],CertificationRequestInfo.prototype,"subject",void 0);__decorate$1([AsnProp({type:SubjectPublicKeyInfo})],CertificationRequestInfo.prototype,"subjectPKInfo",void 0);__decorate$1([AsnProp({type:Attributes,implicit:true,context:0})],CertificationRequestInfo.prototype,"attributes",void 0);var CertificationRequest=function(){function e(e){if(e===void 0){e={}}this.certificationRequestInfo=new CertificationRequestInfo;this.signatureAlgorithm=new AlgorithmIdentifier;this.signature=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:CertificationRequestInfo})],CertificationRequest.prototype,"certificationRequestInfo",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],CertificationRequest.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],CertificationRequest.prototype,"signature",void 0);var globalCrypto=globalThis.crypto;function getCrypto(){return globalCrypto}var SshError=function(e){__extends(t,e);function t(t,r){var i=e.call(this,t)||this;i.code=r;i.name=i.constructor.name;if(Error.captureStackTrace){Error.captureStackTrace(i,i.constructor)}return i}return t}(Error);var UnsupportedAlgorithmError=function(e){__extends(t,e);function t(t,r){var i=r?" Supported: ".concat(r.join(", ")):"";return e.call(this,"Unsupported algorithm: ".concat(t,".").concat(i),"UNSUPPORTED_ALGORITHM")||this}return t}(SshError);var InvalidFormatError=function(e){__extends(t,e);function t(t,r){var i=r?" Expected: ".concat(r):"";return e.call(this,"Invalid format: ".concat(t,".").concat(i),"INVALID_FORMAT")||this}return t}(SshError);var UnsupportedKeyTypeError=function(e){__extends(t,e);function t(t,r){var i=r?" Supported: ".concat(r.join(", ")):"";return e.call(this,"Unsupported key type: ".concat(t,".").concat(i),"UNSUPPORTED_KEY_TYPE")||this}return t}(SshError);var InvalidPrivateKeyFormatError=function(e){__extends(t,e);function t(t){var r=t?"Invalid SSH private key format: ".concat(t):"Invalid SSH private key format";return e.call(this,r,"INVALID_PRIVATE_KEY_FORMAT")||this}return t}(SshError);var EncryptedKeyNotSupportedError=function(e){__extends(t,e);function t(t){var r=t?"Encrypted SSH private keys are not supported (cipher: ".concat(t,")"):"Encrypted SSH private keys are not supported";return e.call(this,r,"ENCRYPTED_KEY_NOT_SUPPORTED")||this}return t}(SshError);var InvalidKeyDataError=function(e){__extends(t,e);function t(t){var r=t?"Invalid key data: ".concat(t):"Invalid key data";return e.call(this,r,"INVALID_KEY_DATA")||this}return t}(SshError);var UnexpectedEOFError=function(e){__extends(t,e);function t(t,r){var i=t!==undefined&&r!==undefined?" Expected ".concat(t," bytes, got ").concat(r):"";return e.call(this,"Unexpected end of data".concat(i),"UNEXPECTED_EOF")||this}return t}(SshError);var encoder=new TextEncoder;var decoder=new TextDecoder;var SshReader=function(){function e(e){this.buffer=e;this.offset=0}e.prototype.readUint8=function(){if(this.offset>=this.buffer.length){throw new UnexpectedEOFError(1,0)}return this.buffer[this.offset++]};e.prototype.readUint32=function(){var e=this.readUint8()<<24|this.readUint8()<<16|this.readUint8()<<8|this.readUint8();return e>>>0};e.prototype.readUint64=function(){var e=this.readUint32();var t=this.readUint32();return BigInt(e)<<32n|BigInt(t)};e.prototype.readBytes=function(e){if(e<0){throw new InvalidFormatError("Invalid length: ".concat(e))}if(this.offset+e>this.buffer.length){throw new UnexpectedEOFError(e,this.buffer.length-this.offset)}var t=this.buffer.subarray(this.offset,this.offset+e);this.offset+=e;return t};e.prototype.readString=function(){var e=this.readUint32();var t=this.readBytes(e);return decoder.decode(t)};e.prototype.peekString=function(e){if(this.offset+e>this.buffer.length){throw new UnexpectedEOFError(e,this.buffer.length-this.offset)}var t=this.buffer.subarray(this.offset,this.offset+e);return decoder.decode(t)};e.prototype.readMpInt=function(e){if(e===void 0){e=false}var t=this.readUint32();var r=this.readBytes(t);if(e&&r.length>1&&r[0]===0){return r.subarray(1)}return r};e.prototype.readMpIntSsh=function(){return this.readMpInt(true)};e.prototype.remaining=function(){return this.buffer.length-this.offset};e.prototype.getOffset=function(){return this.offset};e.prototype.seek=function(e){if(e<0||e>this.buffer.length){throw new InvalidFormatError("Invalid offset: ".concat(e,". Buffer length: ").concat(this.buffer.length))}this.offset=e};return e}();var SshWriter=function(){function e(e){if(e===void 0){e=1024}this.buffer=new Uint8Array(e);this.offset=0}e.prototype.ensureCapacity=function(e){var t=this.offset+e;if(t>this.buffer.length){var r=Math.max(t,this.buffer.length*2);var i=new Uint8Array(r);i.set(this.buffer.subarray(0,this.offset));this.buffer=i}};e.prototype.reserve=function(e){if(e>this.buffer.length){var t=new Uint8Array(e);t.set(this.buffer.subarray(0,this.offset));this.buffer=t}};e.prototype.writeUint8=function(e){this.ensureCapacity(1);this.buffer[this.offset++]=e&255};e.prototype.writeUint32=function(e){this.ensureCapacity(4);this.buffer[this.offset++]=e>>>24&255;this.buffer[this.offset++]=e>>>16&255;this.buffer[this.offset++]=e>>>8&255;this.buffer[this.offset++]=e&255};e.prototype.writeUint64=function(e){this.ensureCapacity(8);var t=Number(e>>32n);var r=Number(e&0xffffffffn);this.writeUint32(t);this.writeUint32(r)};e.prototype.writeBytes=function(e){this.ensureCapacity(e.length);this.buffer.set(e,this.offset);this.offset+=e.length};e.prototype.writeString=function(e){var t=encoder.encode(e);this.writeUint32(t.length);this.writeBytes(t)};e.prototype.writeMpInt=function(e,t){if(t===void 0){t=false}if(t&&e.length>0&&(e[0]&128)!==0){var r=new Uint8Array(e.length+1);r[0]=0;r.set(e,1);this.writeUint32(r.length);this.writeBytes(r)}else{this.writeUint32(e.length);this.writeBytes(e)}};e.prototype.writeMpIntSsh=function(e){this.writeMpInt(e,true)};e.prototype.toUint8Array=function(){return this.buffer.subarray(0,this.offset)};e.prototype.getOffset=function(){return this.offset};e.prototype.seek=function(e){if(e<0||e>this.buffer.length){throw new InvalidFormatError("Invalid offset")}this.offset=e};return e}();var RsaBinding=function(){function e(e){if(e===void 0){e="SHA-256"}this.hash="SHA-256";this.hash=e}e.prototype.importPublicSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a;return __generator(this,(function(s){t=e.blob,r=e.crypto;i=new SshReader(t);i.readString();n=i.readMpInt(true);o=i.readMpInt(true);a={kty:"RSA",n:buildExports.Convert.ToBase64Url(o),e:buildExports.Convert.ToBase64Url(n)};return[2,r.subtle.importKey("jwk",a,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])]}))}))};e.prototype.exportPublicSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a;return __generator(this,(function(s){switch(s.label){case 0:t=e.publicKey,r=e.crypto;return[4,r.subtle.exportKey("jwk",t)];case 1:i=s.sent();if(!i.n||!i.e){throw new InvalidKeyDataError("RSA JWK missing required parameters (n, e)")}n=buildExports.BufferSourceConverter.toUint8Array(buildExports.Convert.FromBase64Url(i.n));o=buildExports.BufferSourceConverter.toUint8Array(buildExports.Convert.FromBase64Url(i.e));a=new SshWriter;a.writeString("ssh-rsa");a.writeMpInt(o,true);a.writeMpInt(n,true);return[2,a.toUint8Array()]}}))}))};e.prototype.importPublicSpki=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(i){t=e.spki,r=e.crypto;return[2,r.subtle.importKey("spki",t,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])]}))}))};e.prototype.exportPublicSpki=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i;return __generator(this,(function(n){switch(n.label){case 0:t=e.publicKey,r=e.crypto;return[4,r.subtle.exportKey("spki",t)];case 1:i=n.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(i)]}}))}))};e.prototype.importPrivatePkcs8=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(i){t=e.pkcs8,r=e.crypto;return[2,r.subtle.importKey("pkcs8",t,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])]}))}))};e.prototype.exportPrivatePkcs8=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i;return __generator(this,(function(n){switch(n.label){case 0:t=e.privateKey,r=e.crypto;return[4,r.subtle.exportKey("pkcs8",t)];case 1:i=n.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(i)]}}))}))};e.prototype.importPrivateSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s,c,u,p,f,d,l,y,v,h,A,_,S,g,m,C,P,T,E,I,b,w;return __generator(this,(function(D){t=e.sshKey,r=e.crypto;i=t.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=buildExports.Convert.FromBase64(i);o=new SshReader(buildExports.BufferSourceConverter.toUint8Array(n));a=o.readBytes(15);if(buildExports.Convert.ToHex(a)!=="6f70656e7373682d6b65792d763100"){throw new InvalidPrivateKeyFormatError("invalid magic string")}s=o.readString();o.readString();o.readString();if(s!=="none"){throw new EncryptedKeyNotSupportedError(s)}c=o.readUint32();if(c!==1){throw new InvalidPrivateKeyFormatError("multiple keys not supported")}u=o.readUint32();o.readBytes(u);p=o.readUint32();f=o.readBytes(p);d=new SshReader(f);l=d.readUint32();y=d.readUint32();if(l!==y){throw new InvalidPrivateKeyFormatError("invalid checkints")}d.readString();v=d.readMpInt(true);h=d.readMpInt(true);A=d.readMpInt(true);_=d.readMpInt(true);S=d.readMpInt(true);g=d.readMpInt(true);d.readString();m=BigInt("0x"+buildExports.Convert.ToHex(A));C=BigInt("0x"+buildExports.Convert.ToHex(S));P=BigInt("0x"+buildExports.Convert.ToHex(g));T=m%(C-1n);E=m%(P-1n);I=buildExports.Convert.FromHex(T.toString(16).padStart(S.length*2,"0"));b=buildExports.Convert.FromHex(E.toString(16).padStart(g.length*2,"0"));w={kty:"RSA",n:buildExports.Convert.ToBase64Url(v),e:buildExports.Convert.ToBase64Url(h),d:buildExports.Convert.ToBase64Url(A),p:buildExports.Convert.ToBase64Url(S),q:buildExports.Convert.ToBase64Url(g),dp:buildExports.Convert.ToBase64Url(I),dq:buildExports.Convert.ToBase64Url(b),qi:buildExports.Convert.ToBase64Url(_)};return[2,r.subtle.importKey("jwk",w,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])]}))}))};e.prototype.exportPrivateSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s,c,u,p,f,d;return __generator(this,(function(l){switch(l.label){case 0:t=e.privateKey,r=e.crypto,i=e.jwk;o=i;if(o)return[3,2];return[4,r.subtle.exportKey("jwk",t)];case 1:o=l.sent();l.label=2;case 2:n=o;if(!n.n||!n.e||!n.d||!n.p||!n.q){throw new InvalidKeyDataError("RSA JWK missing required parameters")}a=new Uint8Array(buildExports.Convert.FromBase64Url(n.n));s=new Uint8Array(buildExports.Convert.FromBase64Url(n.e));c=new Uint8Array(buildExports.Convert.FromBase64Url(n.d));u=new Uint8Array(buildExports.Convert.FromBase64Url(n.p));p=new Uint8Array(buildExports.Convert.FromBase64Url(n.q));f=n.qi?new Uint8Array(buildExports.Convert.FromBase64Url(n.qi)):new Uint8Array;d=new SshWriter;d.writeString("ssh-rsa");d.writeMpInt(a,true);d.writeMpInt(s,true);d.writeMpInt(c,true);d.writeMpInt(f,true);d.writeMpInt(u,true);d.writeMpInt(p,true);return[2,d.toUint8Array()]}}))}))};e.prototype.sign=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:t=e.privateKey,r=e.data,i=e.crypto,n=e.hash;if(n&&n!==this.hash){throw new InvalidKeyDataError("Hash ".concat(n," not supported for this RSA algorithm"))}if(!t.extractable){throw new InvalidKeyDataError("Private key is not extractable")}return[4,this.exportPrivatePkcs8({privateKey:t,crypto:i})];case 1:o=c.sent();return[4,this.importPrivatePkcs8({pkcs8:new Uint8Array(o),crypto:i})];case 2:a=c.sent();return[4,i.subtle.sign("RSASSA-PKCS1-v1_5",a,r)];case 3:s=c.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(s)]}}))}))};e.prototype.verify=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:t=e.publicKey,r=e.signature,i=e.data,n=e.crypto,o=e.hash;if(o&&o!==this.hash){return[2,false]}if(!t.extractable){throw new InvalidKeyDataError("Public key is not extractable")}return[4,this.exportPublicSpki({publicKey:t,crypto:n})];case 1:a=c.sent();return[4,this.importPublicSpki({spki:new Uint8Array(a),crypto:n})];case 2:s=c.sent();return[2,n.subtle.verify("RSASSA-PKCS1-v1_5",s,r,i)]}}))}))};e.prototype.encodeSignature=function(e){var t=e.signature,r=e.algo;var i=new SshWriter;i.writeString(r);i.writeUint32(t.byteLength);i.writeBytes(t);return i.toUint8Array()};e.prototype.decodeSignature=function(e){var t=e.signature;var r=new SshReader(t);var i=r.readString();var n=r.readUint32();var o=r.readBytes(n);return{signature:o,algo:i}};e.prototype.supportsCryptoKey=function(e){return e.algorithm.name==="RSASSA-PKCS1-v1_5"};e.prototype.parsePublicKey=function(e){var t=e.readBytes(e.readUint32());var r=e.readBytes(e.readUint32());var i=new SshWriter;i.writeString("ssh-rsa");i.writeMpInt(t);i.writeMpInt(r);return{type:"ssh-rsa",keyData:i.toUint8Array()}};e.prototype.writePublicKey=function(e,t){var r=new SshReader(t.keyData);r.readString();var i=r.readMpInt();var n=r.readMpInt();e.writeUint32(i.length);e.writeBytes(i);e.writeUint32(n.length);e.writeBytes(n)};e.prototype.getCertificateType=function(){return"ssh-rsa-cert-v01@openssh.com"};e.prototype.getSignatureAlgo=function(){return this.hash==="SHA-256"?"rsa-sha2-256":"rsa-sha2-512"};return e}();var EcdsaBinding=function(){function e(e,t,r){this.curveName=e;this.sshType=t;this.namedCurve=r}e.prototype.getHashAlgorithm=function(){switch(this.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:return"SHA-256"}};e.prototype.getExpectedLength=function(){switch(this.namedCurve){case"P-256":return 32;case"P-384":return 48;case"P-521":return 66;default:return 32}};e.prototype.getSignatureCoordLength=function(){return this.getExpectedLength()};e.prototype.importPublicSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s;return __generator(this,(function(c){t=e.blob,r=e.crypto;i=new SshReader(t);i.readString();n=i.readString();if(n!==this.curveName){throw new InvalidKeyDataError("ECDSA curve name ".concat(n,", expected ").concat(this.curveName))}o=i.readMpInt();a=Math.floor((o.length-1)/2);s={kty:"EC",crv:this.namedCurve,x:buildExports.Convert.ToBase64Url(o.slice(1,1+a)),y:buildExports.Convert.ToBase64Url(o.slice(1+a))};return[2,r.subtle.importKey("jwk",s,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])]}))}))};e.prototype.exportPublicSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:t=e.publicKey,r=e.crypto;return[4,r.subtle.exportKey("jwk",t)];case 1:i=c.sent();if(!i.x||!i.y){throw new InvalidKeyDataError("ECDSA JWK missing x or y parameters")}n=new Uint8Array(buildExports.Convert.FromBase64Url(i.x));o=new Uint8Array(buildExports.Convert.FromBase64Url(i.y));a=new Uint8Array(1+n.length+o.length);a[0]=4;a.set(n,1);a.set(o,1+n.length);s=new SshWriter;s.writeString(this.sshType);s.writeString(this.curveName);s.writeMpInt(a);return[2,s.toUint8Array()]}}))}))};e.prototype.importPublicSpki=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(i){t=e.spki,r=e.crypto;return[2,r.subtle.importKey("spki",t,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])]}))}))};e.prototype.exportPublicSpki=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i;return __generator(this,(function(n){switch(n.label){case 0:t=e.publicKey,r=e.crypto;return[4,r.subtle.exportKey("spki",t)];case 1:i=n.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(i)]}}))}))};e.prototype.importPrivatePkcs8=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(i){t=e.pkcs8,r=e.crypto;return[2,r.subtle.importKey("pkcs8",t,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])]}))}))};e.prototype.exportPrivatePkcs8=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i;return __generator(this,(function(n){switch(n.label){case 0:t=e.privateKey,r=e.crypto;return[4,r.subtle.exportKey("pkcs8",t)];case 1:i=n.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(i)]}}))}))};e.prototype.exportPrivateSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s,c,u,p;return __generator(this,(function(f){switch(f.label){case 0:t=e.privateKey,r=e.crypto,i=e.jwk;o=i;if(o)return[3,2];return[4,r.subtle.exportKey("jwk",t)];case 1:o=f.sent();f.label=2;case 2:n=o;if(!n.d||!n.x||!n.y){throw new InvalidKeyDataError("ECDSA private key JWK missing required parameters")}a=new Uint8Array(buildExports.Convert.FromBase64Url(n.x));s=new Uint8Array(buildExports.Convert.FromBase64Url(n.y));c=new Uint8Array(buildExports.Convert.FromBase64Url(n.d));u=new Uint8Array(1+a.length+s.length);u[0]=4;u.set(a,1);u.set(s,1+a.length);p=new SshWriter;p.writeString(this.sshType);p.writeString(this.curveName);p.writeMpInt(u);p.writeMpInt(c);return[2,p.toUint8Array()]}}))}))};e.prototype.importPrivateSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s,c,u,p,f,d,l,y,v,h,A,_,S,g;return __generator(this,(function(m){t=e.sshKey,r=e.crypto;i=t.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=buildExports.Convert.FromBase64(i);o=new SshReader(buildExports.BufferSourceConverter.toUint8Array(n));a=o.readBytes(15);if(buildExports.Convert.ToHex(a)!=="6f70656e7373682d6b65792d763100"){throw new InvalidPrivateKeyFormatError("invalid magic string")}s=o.readString();o.readString();o.readString();if(s!=="none"){throw new EncryptedKeyNotSupportedError(s)}c=o.readUint32();if(c!==1){throw new InvalidPrivateKeyFormatError("multiple keys not supported")}u=o.readUint32();o.readBytes(u);p=o.readUint32();f=o.readBytes(p);d=new SshReader(f);l=d.readUint32();y=d.readUint32();if(l!==y){throw new InvalidPrivateKeyFormatError("invalid checkints")}d.readString();d.readString();v=d.readMpInt();h=d.readMpInt();d.readString();if(v[0]!==4){throw new InvalidKeyDataError("invalid ECDSA public key point format")}A=Math.floor((v.length-1)/2);_=v.slice(1,1+A);S=v.slice(1+A);g={kty:"EC",crv:this.namedCurve,x:buildExports.Convert.ToBase64Url(_),y:buildExports.Convert.ToBase64Url(S),d:buildExports.Convert.ToBase64Url(h)};return[2,r.subtle.importKey("jwk",g,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])]}))}))};e.prototype.sign=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a;return __generator(this,(function(s){switch(s.label){case 0:t=e.privateKey,r=e.data,i=e.crypto,n=e.hash;o=this.getHashAlgorithm();if(n&&n!==o){throw new InvalidKeyDataError("ECDSA ".concat(this.namedCurve," requires ").concat(o,", got ").concat(n))}return[4,i.subtle.sign({name:"ECDSA",hash:o},t,r)];case 1:a=s.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(a)]}}))}))};e.prototype.verify=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a;return __generator(this,(function(s){t=e.publicKey,r=e.signature,i=e.data,n=e.crypto,o=e.hash;a=this.getHashAlgorithm();if(o&&o!==a){throw new InvalidKeyDataError("ECDSA ".concat(this.namedCurve," requires ").concat(a,", got ").concat(o))}return[2,n.subtle.verify({name:"ECDSA",hash:a},t,r,i)]}))}))};e.prototype.encodeSignature=function(e){var t=e.signature,r=e.algo;if(r.startsWith("ecdsa-sha2-")){var i=this.getSignatureCoordLength();var n=t.subarray(0,i);var o=t.subarray(i);var a=new SshWriter;a.writeString(r);var s=new SshWriter;s.writeMpInt(n,true);s.writeMpInt(o,true);var c=s.toUint8Array();a.writeUint32(c.length);a.writeBytes(c);return a.toUint8Array()}var u=new SshWriter;u.writeString(r);u.writeUint32(t.byteLength);u.writeBytes(t);return u.toUint8Array()};e.prototype.decodeSignature=function(e){var t=e.signature;var r=new SshReader(t);var i=r.readString();var n=r.readUint32();var o=r.readBytes(n);if(i.startsWith("ecdsa-sha2-")){var a=new SshReader(o);var s=a.readMpInt();var c=a.readMpInt();if(s[0]===0&&s.length>1&&(s[1]&128)===0){s=s.slice(1)}if(c[0]===0&&c.length>1&&(c[1]&128)===0){c=c.slice(1)}var u=this.getExpectedLength();var p=new Uint8Array(u);var f=new Uint8Array(u);if(s.length<=u){p.set(s,u-s.length)}else{p.set(s.slice(s.length-u),0)}if(c.length<=u){f.set(c,u-c.length)}else{f.set(c.slice(c.length-u),0)}var d=new Uint8Array(__spreadArray(__spreadArray([],p,true),f,true));return{signature:d,algo:i}}return{signature:o,algo:i}};e.prototype.supportsCryptoKey=function(e){return e.algorithm.name==="ECDSA"&&e.algorithm.namedCurve===this.namedCurve};e.prototype.parsePublicKey=function(e){var t=e.readString();if(t!==this.curveName){throw new InvalidKeyDataError("ECDSA certificate curve name ".concat(t,", expected ").concat(this.curveName))}var r=e.readBytes(e.readUint32());var i=new SshWriter;i.writeString(this.sshType);i.writeString(t);i.writeMpInt(r);return{type:this.sshType,keyData:i.toUint8Array()}};e.prototype.writePublicKey=function(e,t){var r=new SshReader(t.keyData);r.readString();var i=r.readString();var n=r.readMpInt();e.writeString(i);e.writeUint32(n.length);e.writeBytes(n)};e.prototype.getCertificateType=function(){return"".concat(this.sshType,"-cert-v01@openssh.com")};e.prototype.getSignatureAlgo=function(){return this.sshType};return e}();var EcdsaP256Binding=new EcdsaBinding("nistp256","ecdsa-sha2-nistp256","P-256");var EcdsaP384Binding=new EcdsaBinding("nistp384","ecdsa-sha2-nistp384","P-384");var EcdsaP521Binding=new EcdsaBinding("nistp521","ecdsa-sha2-nistp521","P-521");var Ed25519Binding=function(){function e(){}e.prototype.importPublicSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o;return __generator(this,(function(a){t=e.blob,r=e.crypto;i=new SshReader(t);i.readString();n=i.readUint32();if(n!==32){throw new InvalidKeyDataError("Ed25519 key length ".concat(n,", expected 32"))}o=i.readBytes(n);return[2,r.subtle.importKey("raw",o,"Ed25519",true,["verify"])]}))}))};e.prototype.exportPublicSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o;return __generator(this,(function(a){switch(a.label){case 0:t=e.publicKey,r=e.crypto;return[4,r.subtle.exportKey("jwk",t)];case 1:i=a.sent();if(!i.x){throw new InvalidKeyDataError("Ed25519 JWK missing x parameter")}n=new Uint8Array(buildExports.Convert.FromBase64Url(i.x));o=new SshWriter;o.writeString("ssh-ed25519");o.writeUint32(n.length);o.writeBytes(n);return[2,o.toUint8Array()]}}))}))};e.prototype.importPublicSpki=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(i){t=e.spki,r=e.crypto;return[2,r.subtle.importKey("spki",t,"Ed25519",true,["verify"])]}))}))};e.prototype.exportPublicSpki=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i;return __generator(this,(function(n){switch(n.label){case 0:t=e.publicKey,r=e.crypto;return[4,r.subtle.exportKey("spki",t)];case 1:i=n.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(i)]}}))}))};e.prototype.importPrivatePkcs8=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(i){t=e.pkcs8,r=e.crypto;return[2,r.subtle.importKey("pkcs8",t,"Ed25519",true,["sign"])]}))}))};e.prototype.exportPrivatePkcs8=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i;return __generator(this,(function(n){switch(n.label){case 0:t=e.privateKey,r=e.crypto;return[4,r.subtle.exportKey("pkcs8",t)];case 1:i=n.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(i)]}}))}))};e.prototype.exportPrivateSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s,c,u;return __generator(this,(function(p){switch(p.label){case 0:t=e.privateKey,r=e.crypto,i=e.jwk;o=i;if(o)return[3,2];return[4,r.subtle.exportKey("jwk",t)];case 1:o=p.sent();p.label=2;case 2:n=o;if(!n.d||!n.x){throw new InvalidKeyDataError("Ed25519 private key JWK missing required parameters")}a=new Uint8Array(buildExports.Convert.FromBase64Url(n.d));s=new Uint8Array(buildExports.Convert.FromBase64Url(n.x));c=new SshWriter;c.writeString("ssh-ed25519");c.writeUint32(s.length);c.writeBytes(s);u=new Uint8Array(64);u.set(a,0);u.set(s,32);c.writeUint32(u.length);c.writeBytes(u);return[2,c.toUint8Array()]}}))}))};e.prototype.importPrivateSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s,c,u,p,f,d,l,y,v,h,A,_,S,g;return __generator(this,(function(m){t=e.sshKey,r=e.crypto;i=t.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=buildExports.Convert.FromBase64(i);o=new SshReader(buildExports.BufferSourceConverter.toUint8Array(n));a=o.readBytes(15);if(buildExports.Convert.ToHex(a)!=="6f70656e7373682d6b65792d763100"){throw new InvalidPrivateKeyFormatError("invalid magic string")}s=o.readString();o.readString();o.readString();if(s!=="none"){throw new EncryptedKeyNotSupportedError(s)}c=o.readUint32();if(c!==1){throw new InvalidPrivateKeyFormatError("multiple keys not supported")}u=o.readUint32();o.readBytes(u);p=o.readUint32();f=o.readBytes(p);d=new SshReader(f);l=d.readUint32();y=d.readUint32();if(l!==y){throw new InvalidPrivateKeyFormatError("invalid checkints")}d.readString();v=d.readUint32();h=d.readBytes(v);A=d.readUint32();_=d.readBytes(A);d.readString();S=_.slice(0,32);g={kty:"OKP",crv:"Ed25519",d:buildExports.Convert.ToBase64Url(S),x:buildExports.Convert.ToBase64Url(h)};return[2,r.subtle.importKey("jwk",g,"Ed25519",true,["sign"])]}))}))};e.prototype.sign=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n;return __generator(this,(function(o){switch(o.label){case 0:t=e.privateKey,r=e.data,i=e.crypto;return[4,i.subtle.sign("Ed25519",t,r)];case 1:n=o.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(n)]}}))}))};e.prototype.verify=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n;return __generator(this,(function(o){t=e.publicKey,r=e.signature,i=e.data,n=e.crypto;return[2,n.subtle.verify("Ed25519",t,r,i)]}))}))};e.prototype.encodeSignature=function(e){var t=e.signature,r=e.algo;var i=new Uint8Array(t);var n=new SshWriter;n.writeString(r);n.writeUint32(i.length);n.writeBytes(i);return n.toUint8Array()};e.prototype.decodeSignature=function(e){var t=e.signature;var r=new SshReader(t);var i=r.readString();var n=r.readUint32();var o=r.readBytes(n);return{signature:o,algo:i}};e.prototype.supportsCryptoKey=function(e){return e.algorithm.name==="Ed25519"};e.prototype.parsePublicKey=function(e){var t=e.readBytes(e.readUint32());var r=new SshWriter;r.writeString("ssh-ed25519");r.writeUint32(t.length);r.writeBytes(t);return{type:"ssh-ed25519",keyData:r.toUint8Array()}};e.prototype.writePublicKey=function(e,t){var r=new SshReader(t.keyData);r.readString();var i=r.readUint32();var n=r.readBytes(i);e.writeUint32(n.length);e.writeBytes(n)};e.prototype.getCertificateType=function(){return"ssh-ed25519-cert-v01@openssh.com"};e.prototype.getSignatureAlgo=function(){return"ssh-ed25519"};return e}();var registry=new Map;var AlgorithmRegistry=function(){function e(){}e.get=function(e){var t=registry.get(e);if(!t){throw new UnsupportedKeyTypeError(e,Array.from(registry.keys()))}return t};e.register=function(e,t){registry.set(e,t)};e.getSshTypeFromCryptoKey=function(e){for(var t=0,r=registry.entries();t<r.length;t++){var i=r[t],n=i[0],o=i[1];if(o.supportsCryptoKey(e)){return n}}throw new UnsupportedKeyTypeError(e.algorithm.name,Array.from(registry.keys()))};e.certTypeToKeyType=function(e){var t={"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"};return t[e]};e.getSupportedCertTypes=function(){return Object.keys({"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"})};return e}();AlgorithmRegistry.register("ssh-ed25519",new Ed25519Binding);AlgorithmRegistry.register("ssh-rsa",new RsaBinding("SHA-256"));AlgorithmRegistry.register("rsa-sha2-256",new RsaBinding("SHA-256"));AlgorithmRegistry.register("rsa-sha2-512",new RsaBinding("SHA-512"));AlgorithmRegistry.register("ecdsa-sha2-nistp256",EcdsaP256Binding);AlgorithmRegistry.register("ecdsa-sha2-nistp384",EcdsaP384Binding);AlgorithmRegistry.register("ecdsa-sha2-nistp521",EcdsaP521Binding);function parsePublicKey(e){var t=typeof e==="string"?e.trim().split(/\s+/):null;if(!t||t.length<2){throw new InvalidFormatError("Invalid SSH public key format")}var r=t[0];var i=new Uint8Array(buildExports.Convert.FromBase64(t[1]));var n=t.length>2?t.slice(2).join(" "):undefined;var o=new SshReader(i);var a=o.readString();if(a!==r){throw new InvalidFormatError("Key type mismatch")}return{type:r,keyData:i,comment:n}}function serializePublicKey(e){var t=buildExports.Convert.ToBase64(e.keyData);var r=[e.type,t];if(e.comment){r.push(e.comment)}return r.join(" ")}function parse(e){if(typeof e==="string"){var t=e.trim().split(/\s+/);if(t.length<2){throw new InvalidFormatError("SSH certificate string","type base64 [comment]")}var r=t[0];var i=new Uint8Array(buildExports.Convert.FromBase64(t[1]));var n=t.length>2?t.slice(2).join(" "):undefined;var o=new SshReader(i);var a=o.readString();if(a!==r){throw new InvalidFormatError("certificate blob type ".concat(a),"expected ".concat(r))}return{type:r,keyData:i,comment:n}}else{var o=new SshReader(e);var s=o.readString();var c=e.slice(o.getOffset());return{type:s,keyData:c}}}function parseCertificateData(e){var t=new SshReader(e);var r=t.readString();var i=t.readBytes(t.readUint32());var n=AlgorithmRegistry.certTypeToKeyType(r);if(!n){throw new UnsupportedAlgorithmError(r,AlgorithmRegistry.getSupportedCertTypes())}var o=AlgorithmRegistry.get(n);var a=o.parsePublicKey(t);var s=n;var c=t.readUint64();var u=t.readUint32();var p=u===1?"user":"host";var f=t.readString();var d=t.readUint32();var l=t.readBytes(d);var y=[];if(l.length>0){var v=new SshReader(l);while(v.getOffset()<l.length){try{var h=v.readString();y.push(h)}catch(e){break}}}var A=t.readUint64();var _=t.readUint64();var S={};var g=t.readUint32();var m=t.readBytes(g);if(m.length>0){var C=new SshReader(m);while(C.getOffset()<m.length){try{var P=C.readString();var T=C.readBytes(C.readUint32());var E=T.length===0?"":decoder.decode(T);S[P]=E}catch(e){break}}}var I={};var b=t.readUint32();var w=t.readBytes(b);if(w.length>0){var D=new SshReader(w);while(D.getOffset()<w.length){try{var B=D.readString();var T=D.readBytes(D.readUint32());var R=T.length===0?"":decoder.decode(T);I[B]=R}catch(e){break}}}var $=t.readUint32();var x=t.readBytes($);var N=t.readUint32();var O=t.readBytes(N);var K=new SshReader(O);var k=K.readString();var L={type:k,keyData:O};var M=t.readUint32();var V=t.readBytes(M);return{nonce:i,keyType:s,publicKey:a,serial:c,type:p,keyId:f,validPrincipals:y,validAfter:A,validBefore:_,criticalOptions:S,extensions:I,reserved:x,signatureKey:L,signature:V}}function serialize(e){var t=buildExports.Convert.ToBase64(e.keyData);var r=[e.type,t];if(e.comment){r.push(e.comment)}return r.join(" ")}function parseSignature(e){var t=new SshReader(e);if(e.length>=6&&(new TextDecoder).decode(e.subarray(0,6))==="SSHSIG"){return parseSshSignatureFormat(t)}else{return parseLegacyFormat(t)}}function parseSshSignatureFormat(e){var t=e.readBytes(6);var r=(new TextDecoder).decode(t);if(r!=="SSHSIG"){throw new InvalidFormatError(r,"SSHSIG")}var i=e.readUint32();var n=e.readUint32();var o=e.readBytes(n);var a=e.readString();var s=e.readString();var c=e.readString();var u=e.readUint32();var p=e.readBytes(u);var f=new SshReader(p);var d=f.readString();var l=f.readUint32();var y=f.readBytes(l);return{format:"ssh-signature",algorithm:d,signature:y,version:i,publicKey:o,namespace:a,reserved:s,hashAlgorithm:c}}function parseLegacyFormat(e){var t=e.readString();var r=e.readUint32();var i=e.readBytes(r);return{format:"legacy",algorithm:t,signature:i}}function serializeSignature(e){if(e.format==="ssh-signature"){return serializeSshSignatureFormat(e)}else{return serializeLegacyFormat(e)}}function serializeSshSignatureFormat(e){var t=new SshWriter;t.writeBytes((new TextEncoder).encode("SSHSIG"));t.writeUint32(e.version||1);if(e.publicKey){t.writeUint32(e.publicKey.length);t.writeBytes(e.publicKey)}else{t.writeUint32(0)}t.writeString(e.namespace||"file");t.writeString(e.reserved||"");t.writeString(e.hashAlgorithm||"sha512");var r=new SshWriter;r.writeString(e.algorithm);r.writeUint32(e.signature.length);r.writeBytes(e.signature);var i=r.toUint8Array();t.writeUint32(i.length);t.writeBytes(i);return t.toUint8Array()}function serializeLegacyFormat(e){var t=new SshWriter;t.writeString(e.algorithm);t.writeUint32(e.signature.length);t.writeBytes(e.signature);return t.toUint8Array()}var SshObject=function(){function e(){}return e}();var SshPublicKey=function(e){__extends(t,e);function t(r){var i=e.call(this)||this;i.type=t.TYPE;i.blob=r;return i}t.prototype.getCryptoKey=function(){return __awaiter(this,arguments,void 0,(function(e){var t,r;if(e===void 0){e=getCrypto()}return __generator(this,(function(i){switch(i.label){case 0:if(!!this.cachedCryptoKey)return[3,2];t=AlgorithmRegistry.get(this.blob.type);r=this;return[4,t.importPublicSsh({blob:this.blob.keyData,crypto:e})];case 1:r.cachedCryptoKey=i.sent();i.label=2;case 2:return[2,this.cachedCryptoKey]}}))}))};t.fromSSH=function(e){return __awaiter(this,arguments,void 0,(function(e,r){var i,n;if(r===void 0){r=getCrypto()}return __generator(this,(function(o){switch(o.label){case 0:i=parsePublicKey(e);n=AlgorithmRegistry.get(i.type);return[4,n.importPublicSsh({blob:i.keyData,crypto:r})];case 1:o.sent();return[2,new t(i)]}}))}))};t.fromSPKI=function(e,r){return __awaiter(this,arguments,void 0,(function(e,r,i){var n,o,a,s;if(i===void 0){i=getCrypto()}return __generator(this,(function(c){switch(c.label){case 0:n=AlgorithmRegistry.get(r);return[4,n.importPublicSpki({spki:e,crypto:i})];case 1:o=c.sent();return[4,n.exportPublicSsh({publicKey:o,crypto:i})];case 2:a=c.sent();s={type:r,keyData:a};return[2,new t(s)]}}))}))};t.fromWebCrypto=function(e,r){return __awaiter(this,arguments,void 0,(function(e,r,i){var n,o,a,s;if(i===void 0){i=getCrypto()}return __generator(this,(function(c){switch(c.label){case 0:n=r||AlgorithmRegistry.getSshTypeFromCryptoKey(e);o=AlgorithmRegistry.get(n);return[4,o.exportPublicSsh({publicKey:e,crypto:i})];case 1:a=c.sent();s={type:n,keyData:a};return[2,new t(s)]}}))}))};t.prototype.export=function(){return __awaiter(this,arguments,void 0,(function(e,t){var r,i,n;if(e===void 0){e="ssh"}if(t===void 0){t=getCrypto()}return __generator(this,(function(o){switch(o.label){case 0:if(!(e==="ssh"))return[3,1];return[2,serializePublicKey(this.blob)];case 1:if(!(e==="spki"))return[3,4];return[4,this.getCryptoKey(t)];case 2:r=o.sent();i=AlgorithmRegistry.get(this.blob.type);return[4,i.exportPublicSpki({publicKey:r,crypto:t})];case 3:n=o.sent();return[2,new Uint8Array(n)];case 4:throw new UnsupportedKeyTypeError("Unsupported export format: ".concat(e))}}))}))};t.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.export("ssh")];case 1:e=t.sent();return[2,e]}}))}))};t.prototype.toSPKI=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.export("spki")];case 1:e=t.sent();return[2,e]}}))}))};t.prototype.toWebCrypto=function(){return __awaiter(this,arguments,void 0,(function(e){if(e===void 0){e=getCrypto()}return __generator(this,(function(t){return[2,this.getCryptoKey(e)]}))}))};t.prototype.verify=function(e,t,r){return __awaiter(this,arguments,void 0,(function(e,t,r,i){var n,o;if(i===void 0){i=getCrypto()}return __generator(this,(function(a){switch(a.label){case 0:n=AlgorithmRegistry.get(e);return[4,this.toWebCrypto(i)];case 1:o=a.sent();return[2,n.verify({publicKey:o,signature:t,data:r,crypto:i})]}}))}))};Object.defineProperty(t.prototype,"keyType",{get:function(){return this.blob.type},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"comment",{get:function(){return this.blob.comment},enumerable:false,configurable:true});t.prototype.getBlob=function(){return __assign({},this.blob)};t.prototype.thumbprint=function(){return __awaiter(this,arguments,void 0,(function(e,t){var r,i,n;if(e===void 0){e="sha256"}if(t===void 0){t=getCrypto()}return __generator(this,(function(o){switch(o.label){case 0:r=e==="sha256"?"SHA-256":"SHA-512";i=this.blob.keyData;return[4,t.subtle.digest(r,i)];case 1:n=o.sent();return[2,new Uint8Array(n)]}}))}))};t.TYPE="public-key";return t}(SshObject);var SshSignature=function(e){__extends(t,e);function t(r){var i=e.call(this)||this;i.type=t.TYPE;i.blob=r;i.format=r.format;i.algorithm=r.algorithm;i.signature=r.signature;i.version=r.version;i.namespace=r.namespace;i.reserved=r.reserved;i.hashAlgorithm=r.hashAlgorithm;if(r.publicKey){var n=new SshReader(r.publicKey);var o=n.readString();i.publicKey=new SshPublicKey({type:o,keyData:r.publicKey})}return i}t.parse=function(e){var r=parseSignature(e);return new t(r)};t.fromBlob=function(e){return new t(e)};t.fromBase64=function(e){var r=new Uint8Array(buildExports.Convert.FromBase64(e));return t.parse(r)};t.fromText=function(e){var r=e.replace(/-----BEGIN SSH SIGNATURE-----/,"").replace(/-----END SSH SIGNATURE-----/,"").replace(/[\r\n\s]/g,"");return t.fromBase64(r)};t.prototype.serialize=function(){return serializeSignature(this.blob)};t.prototype.toBase64=function(){return buildExports.Convert.ToBase64(this.serialize())};t.prototype.toText=function(){var e=this.toBase64();var t=[];for(var r=0;r<e.length;r+=70){t.push(e.substring(r,r+70))}return __spreadArray(__spreadArray(["-----BEGIN SSH SIGNATURE-----"],t,true),["-----END SSH SIGNATURE-----"],false).join("\n")};t.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.toText()]}))}))};t.prototype.verify=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,i,n,o,a,s,c,u,p,f,d,l,y,v,h,A;return __generator(this,(function(_){switch(_.label){case 0:r=AlgorithmRegistry.get(this.algorithm);return[4,t["getCryptoKey"]()];case 1:i=_.sent();n=getCrypto();o=e;if(!(this.format==="ssh-signature"))return[3,3];a=this.hashAlgorithm||"sha512";s=this.namespace||"file";c=this.reserved||"";u=a==="sha256"?"SHA-256":"SHA-512";return[4,n.subtle.digest(u,e)];case 2:p=_.sent();f=new Uint8Array(p);d=new SshWriter;d.writeBytes((new TextEncoder).encode("SSHSIG"));d.writeString(s);d.writeString(c);d.writeString(a);d.writeUint32(f.length);d.writeBytes(f);o=d.toUint8Array();_.label=3;case 3:if(this.algorithm==="rsa-sha2-256"){l="SHA-256"}else if(this.algorithm==="rsa-sha2-512"){l="SHA-512"}if(this.format==="legacy"||this.format==="ssh-signature"){v=new SshWriter;v.writeString(this.algorithm);v.writeUint32(this.signature.length);v.writeBytes(this.signature);h=v.toUint8Array();A=r.decodeSignature({signature:h});y=A.signature}else{y=this.signature}return[2,r.verify({publicKey:i,signature:y,data:o,crypto:n,hash:l})]}}))}))};t.fromLegacy=function(e,r){var i=AlgorithmRegistry.get(e);var n=i.encodeSignature({signature:r,algo:e});var o=new SshReader(n);o.readString();var a=o.readUint32();var s=o.readBytes(a);return new t({format:"legacy",algorithm:e,signature:s})};t.fromSshSignature=function(e,r,i){if(i===void 0){i={}}var n={format:"ssh-signature",algorithm:e,signature:r,version:i.version||1,publicKey:i.publicKey?i.publicKey.getBlob().keyData:undefined,namespace:i.namespace||"file",reserved:i.reserved||"",hashAlgorithm:i.hashAlgorithm||"sha512"};return new t(n)};t.sign=function(e,r,i){return __awaiter(this,arguments,void 0,(function(e,r,i,n){var o,a,s,c,u,p,f,d,l,y,v,h,A,_,S,g,u,m,C,P,T;if(n===void 0){n={}}return __generator(this,(function(E){switch(E.label){case 0:o=n.format,a=o===void 0?"legacy":o,s=n.namespace,c=s===void 0?"file":s;if(!(a==="legacy"))return[3,2];return[4,r.sign(e,i)];case 1:u=E.sent();p=e||r.keyType;return[2,t.fromLegacy(p,u)];case 2:f=e;d=AlgorithmRegistry.get(f);l=e==="rsa-sha2-256"?"sha256":"sha512";return[4,r.getPublicKey()];case 3:y=E.sent();v=getCrypto();h=l==="sha256"?"SHA-256":"SHA-512";return[4,v.subtle.digest(h,i)];case 4:A=E.sent();_=new Uint8Array(A);S=new SshWriter;S.writeBytes((new TextEncoder).encode("SSHSIG"));S.writeString(c);S.writeString("");S.writeString(l);S.writeUint32(_.length);S.writeBytes(_);g=S.toUint8Array();return[4,r.sign(f,g)];case 5:u=E.sent();m=d.encodeSignature({signature:u,algo:f});C=new SshReader(m);C.readString();P=C.readUint32();T=C.readBytes(P);return[2,t.fromSshSignature(f,T,{namespace:c,hashAlgorithm:l,publicKey:y})]}}))}))};t.TYPE="signature";return t}(SshObject);var SshCertificate$1=(_e=function(e){__extends(t,e);function t(t){var r=e.call(this)||this;r.type=_e.TYPE;r._blob=t;r.data=parseCertificateData(t.keyData);r._validAfter=r.data.validAfter;r._validBefore=r.data.validBefore;r.keyId=r.data.keyId;r.principals=r.data.validPrincipals;r.certType=r.data.type;r.serial=r.data.serial;r.validAfter=new Date(Number(r.data.validAfter)*1e3);r.validBefore=new Date(Number(r.data.validBefore)*1e3);r.publicKey=new SshPublicKey(r.data.publicKey);r.signatureKey=new SshPublicKey(r.data.signatureKey);r.criticalOptions=__assign({},r.data.criticalOptions);r.extensions=__assign({},r.data.extensions);return r}t.fromSSH=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=parse(e);return[2,new _e(t)]}))}))};t.fromBlob=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,new _e(e)]}))}))};t.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,serialize(this._blob)]}))}))};t.prototype.toBlob=function(){return __assign({},this._blob)};Object.defineProperty(t.prototype,"blob",{get:function(){return this.toBlob()},enumerable:false,configurable:true});t.prototype.validate=function(e){if(e===void 0){e=new Date}var t=BigInt(Math.floor(e.getTime()/1e3));var r=this._validAfter;var i=this._validBefore;var n=0xffffffffffffffffn;var o=i===n?t:i;return t>=r&&t<=o};t.prototype.verify=function(e){return __awaiter(this,arguments,void 0,(function(e,t){var r,i,n,o,a;if(t===void 0){t=getCrypto()}return __generator(this,(function(s){switch(s.label){case 0:r=e||this.signatureKey;i=this.getSignedData();n=SshSignature.parse(this.data.signature);o=AlgorithmRegistry.get(n.algorithm);return[4,r.toWebCrypto(t)];case 1:a=s.sent();return[2,o.verify({publicKey:a,signature:n.signature,data:i,crypto:t})]}}))}))};t.prototype.getSignedData=function(){var e=new SshReader(this._blob.keyData);e.readString();e.readBytes(e.readUint32());if(this.data.keyType==="ssh-ed25519"){e.readBytes(e.readUint32())}else if(this.data.keyType==="ssh-rsa"){e.readBytes(e.readUint32());e.readBytes(e.readUint32())}else if(this.data.keyType.startsWith("ecdsa-sha2-")){e.readString();e.readBytes(e.readUint32())}e.readUint64();e.readUint32();e.readBytes(e.readUint32());e.readBytes(e.readUint32());e.readUint64();e.readUint64();e.readBytes(e.readUint32());e.readBytes(e.readUint32());e.readBytes(e.readUint32());e.readBytes(e.readUint32());var t=e.getOffset();return this._blob.keyData.slice(0,t)};return t}(SshObject),_e.TYPE="certificate",_e);var __classPrivateFieldSet=undefined&&undefined.__classPrivateFieldSet||function(e,t,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(e,r):n?n.value=r:t.set(e,r),r};var __classPrivateFieldGet=undefined&&undefined.__classPrivateFieldGet||function(e,t,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(e):i?i.value:t.get(e)};var _SshCertificate_cert;var SshCertificate=function(){function e(e){_SshCertificate_cert.set(this,void 0);var t=parse(e.trim());__classPrivateFieldSet(this,_SshCertificate_cert,new SshCertificate$1(t),"f");this.notBefore=__classPrivateFieldGet(this,_SshCertificate_cert,"f").validAfter;this.notAfter=__classPrivateFieldGet(this,_SshCertificate_cert,"f").validBefore;this.validity=dateDiff(this.notBefore,this.notAfter);this.type=[__classPrivateFieldGet(this,_SshCertificate_cert,"f").blob.type,__classPrivateFieldGet(this,_SshCertificate_cert,"f").certType,__classPrivateFieldGet(this,_SshCertificate_cert,"f").type].join(" ");this.serialNumber=__classPrivateFieldGet(this,_SshCertificate_cert,"f").serial.toString();this.keyId=__classPrivateFieldGet(this,_SshCertificate_cert,"f").keyId;this.principals=__classPrivateFieldGet(this,_SshCertificate_cert,"f").principals;this.extensions=__classPrivateFieldGet(this,_SshCertificate_cert,"f").extensions;this.criticalOptions=__classPrivateFieldGet(this,_SshCertificate_cert,"f").criticalOptions}e.prototype.parseSignatureKey=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,i;var n;return __generator(this,(function(o){switch(o.label){case 0:return[4,__classPrivateFieldGet(this,_SshCertificate_cert,"f").signatureKey.toWebCrypto()];case 1:e=o.sent();t=__classPrivateFieldGet(this,_SshCertificate_cert,"f").signatureKey.getBlob();return[4,__classPrivateFieldGet(this,_SshCertificate_cert,"f").signatureKey.thumbprint("sha256")];case 2:r=o.sent();i=this;n={algorithm:e.algorithm.name,type:t.type};return[4,__classPrivateFieldGet(this,_SshCertificate_cert,"f").signatureKey.toSSH()];case 3:i.signatureKey=(n.value=o.sent(),n.thumbprint=buildExports.Convert.ToBase64(r),n);return[2]}}))}))};e.prototype.parsePublicKey=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,i;var n;return __generator(this,(function(o){switch(o.label){case 0:return[4,__classPrivateFieldGet(this,_SshCertificate_cert,"f").publicKey.toWebCrypto()];case 1:e=o.sent();t=__classPrivateFieldGet(this,_SshCertificate_cert,"f").publicKey.getBlob();return[4,__classPrivateFieldGet(this,_SshCertificate_cert,"f").publicKey.thumbprint("sha256")];case 2:r=o.sent();i=this;n={algorithm:e.algorithm.name,type:t.type};return[4,__classPrivateFieldGet(this,_SshCertificate_cert,"f").publicKey.toSSH()];case 3:i.publicKey=(n.value=o.sent(),n.thumbprint=buildExports.Convert.ToBase64(r),n);return[2]}}))}))};e.prototype.toString=function(){return __awaiter(this,arguments,void 0,(function(e){if(e===void 0){e="pem"}return __generator(this,(function(e){return[2,__classPrivateFieldGet(this,_SshCertificate_cert,"f").toSSH()]}))}))};Object.defineProperty(e.prototype,"commonName",{get:function(){return __classPrivateFieldGet(this,_SshCertificate_cert,"f").principals.join("_")||__classPrivateFieldGet(this,_SshCertificate_cert,"f").keyId||__classPrivateFieldGet(this,_SshCertificate_cert,"f").certType},enumerable:false,configurable:true});e.prototype.downloadAsPub=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(i){switch(i.label){case 0:r=(t=Download.certSSH).asPub;return[4,this.toString()];case 1:r.apply(t,[i.sent(),e||[this.commonName,"cert"].join("-")]);return[2]}}))}))};return e}();_SshCertificate_cert=new WeakMap;export{OIDs as $,AsnData as A,id_pkcs9_at_extensionRequest as B,Certificate as C,Download as D,ECParameters as E,id_pkcs9_at_unstructuredName as F,id_pkcs9_at_challengePassword as G,id_ValuationRanking as H,InsuranceValue as I,id_InsuranceValue as J,id_WebGDPR as K,id_ActivityDescription as L,id_TypeRelationship as M,Name as N,id_DomainNameTechnicalOperator as O,PemConverter as P,id_DomainNameOwner as Q,RSAPublicKey as R,id_DomainNameLegalRepresentative as S,TypeRelationship as T,UnstructuredName as U,ValuationRanking as V,WebGDPR as W,id_DomainNameBeneficiary as X,CertificationRequest as Y,l10n as Z,dateShort as _,dateDiff as a,id_ce_subjectDirectoryAttributes as a$,OctetString as a0,ByteStream as a1,SignedCertificateTimestamp as a2,Extension$1 as a3,CabforganizationIdentifier as a4,NonStandardKeyDescription as a5,BaseCRLNumber as a6,CRLNumber as a7,SubjectInfoAccessSyntax as a8,TNAuthorizationList as a9,IssuingDistributionPoint as aA,CRLDistributionPoints as aB,CertificatePolicies as aC,CertificateIssuer as aD,BasicConstraints as aE,AuthorityKeyIdentifier as aF,AuthorityInfoAccessSyntax as aG,id_cabforganizationIdentifier as aH,id_ce_keyDescription as aI,id_ce_deltaCRLIndicator as aJ,id_ce_cRLNumber as aK,id_pe_subjectInfoAccess as aL,id_pe_TNAuthList as aM,id_pe_biometricInfo as aN,id_entrust_entrustVersInfo as aO,id_ce_privateKeyUsagePeriod as aP,id_adbe_archiveRevInfo as aQ,id_adbe_timestamp as aR,id_role as aS,id_lei as aT,id_caVersion as aU,id_netscapeCertType as aV,id_netscapeComment as aW,id_enrollCertType as aX,id_certificateTemplate as aY,id_pe_qcStatements as aZ,id_ce_subjectKeyIdentifier as a_,LogotypeExtn as aa,BiometricSyntax as ab,EntrustVersionInfo as ac,PrivateKeyUsagePeriod as ad,ArchiveRevInfo as ae,Timestamp as af,LeiRole as ag,LeiChoice as ah,CaVersion as ai,NetscapeCertType as aj,NetscapeComment as ak,EnrollCertTypeChoice as al,CertificateTemplate as am,QCStatements as an,SubjectKeyIdentifier as ao,SubjectDirectoryAttributes as ap,SubjectAlternativeName as aq,PolicyMappings as ar,PolicyConstraints as as,NameConstraints as at,KeyUsage as au,IssueAlternativeName as av,InvalidityDate as aw,InhibitAnyPolicy as ax,ExtendedKeyUsage as ay,CRLReason as az,buildExports as b,id_ce_subjectAltName as b0,id_ce_policyMappings as b1,id_ce_policyConstraints as b2,id_ce_nameConstraints as b3,id_ce_keyUsage as b4,id_ce_issuerAltName as b5,id_ce_invalidityDate as b6,id_ce_inhibitAnyPolicy as b7,id_ce_extKeyUsage as b8,id_ce_cRLReasons as b9,AsnIntegerArrayBufferConverter as bA,AttestationApplicationId as bB,RootOfTrust as bC,IntegerSet as bD,id_ce_issuingDistributionPoint as ba,id_ce_cRLDistributionPoints as bb,id_ce_certificatePolicies as bc,id_ce_certificateIssuer as bd,id_ce_basicConstraints as be,id_ce_authorityKeyIdentifier as bf,id_pe_authorityInfoAccess as bg,SignedData as bh,EncapsulatedContent as bi,CertificateSet as bj,CertificateChoices as bk,ContentInfo as bl,SshCertificate as bm,Name$1 as bn,OtherName as bo,DisplayText as bp,UserNotice as bq,EDIPartyName as br,__decorate$1 as bs,AsnProp as bt,AsnPropTypes as bu,AsnType as bv,AsnTypeTypes as bw,AsnArray as bx,id_qcs_pkixQCSyntax_v2 as by,SemanticsInformation as bz,certificateRawToBuffer as c,downloadFromBuffer as d,AsnConvert as e,id_rsaEncryption as f,id_composite_key as g,CompositePublicKey as h,id_ecPublicKey as i,id_alg_composite as j,CompositeSignatureValue as k,CompositeParams as l,getCertificateThumbprint as m,AttributeCertificate as n,CertificateList as o,Attribute$1 as p,AsnParser as q,PrivateKeyPossessionStatement as r,ExtensionRequest as s,ChallengePassword as t,ActivityDescription as u,DomainNameTechnicalOperator as v,DomainNameOwner as w,DomainNameLegalRepresentative as x,DomainNameBeneficiary as y,id_at_statementOfPossession as z};
|
|
135
|
-
//# sourceMappingURL=ssh_certificate-
|
|
134
|
+
*/var certificateRawToBuffer=function(e){if(PemConverter.isPem(e)){return PemConverter.decode(e)[0]}if(buildExports.Convert.isHex(e)){return buildExports.Convert.FromHex(e)}if(buildExports.Convert.isBase64(e)){return buildExports.Convert.FromBase64(e)}if(buildExports.Convert.isBase64Url(e)){return buildExports.Convert.FromBase64Url(e)}return buildExports.Convert.FromBinary(e)};var getCertificateThumbprint=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(i){r=cryptoProvider.get();if(r.subtle){return[2,r.subtle.digest(e,t)]}return[2,undefined]}))}))};var ACClearAttrs=function(){function e(e){if(e===void 0){e={}}this.acIssuer=new GeneralName;this.acSerial=0;this.attrs=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName})],ACClearAttrs.prototype,"acIssuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ACClearAttrs.prototype,"acSerial",void 0);__decorate$1([AsnProp({type:Attribute$1,repeated:"sequence"})],ACClearAttrs.prototype,"attrs",void 0);var AttrSpec_1;var AttrSpec=AttrSpec_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AttrSpec_1.prototype);return r}return t}(AsnArray);AttrSpec=AttrSpec_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.ObjectIdentifier})],AttrSpec);var AAControls=function(){function e(e){if(e===void 0){e={}}this.permitUnSpecified=true;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],AAControls.prototype,"pathLenConstraint",void 0);__decorate$1([AsnProp({type:AttrSpec,implicit:true,context:0,optional:true})],AAControls.prototype,"permittedAttrs",void 0);__decorate$1([AsnProp({type:AttrSpec,implicit:true,context:1,optional:true})],AAControls.prototype,"excludedAttrs",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,defaultValue:true})],AAControls.prototype,"permitUnSpecified",void 0);var IssuerSerial=function(){function e(e){if(e===void 0){e={}}this.issuer=new GeneralNames;this.serial=new ArrayBuffer(0);this.issuerUID=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames})],IssuerSerial.prototype,"issuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],IssuerSerial.prototype,"serial",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,optional:true})],IssuerSerial.prototype,"issuerUID",void 0);var DigestedObjectType;(function(e){e[e["publicKey"]=0]="publicKey";e[e["publicKeyCert"]=1]="publicKeyCert";e[e["otherObjectTypes"]=2]="otherObjectTypes"})(DigestedObjectType||(DigestedObjectType={}));var ObjectDigestInfo=function(){function e(e){if(e===void 0){e={}}this.digestedObjectType=DigestedObjectType.publicKey;this.digestAlgorithm=new AlgorithmIdentifier;this.objectDigest=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],ObjectDigestInfo.prototype,"digestedObjectType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier,optional:true})],ObjectDigestInfo.prototype,"otherObjectTypeID",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],ObjectDigestInfo.prototype,"digestAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],ObjectDigestInfo.prototype,"objectDigest",void 0);var V2Form=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames,optional:true})],V2Form.prototype,"issuerName",void 0);__decorate$1([AsnProp({type:IssuerSerial,context:0,implicit:true,optional:true})],V2Form.prototype,"baseCertificateID",void 0);__decorate$1([AsnProp({type:ObjectDigestInfo,context:1,implicit:true,optional:true})],V2Form.prototype,"objectDigestInfo",void 0);var AttCertIssuer=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,repeated:"sequence"})],AttCertIssuer.prototype,"v1Form",void 0);__decorate$1([AsnProp({type:V2Form,context:0,implicit:true})],AttCertIssuer.prototype,"v2Form",void 0);AttCertIssuer=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],AttCertIssuer);var AttCertValidityPeriod=function(){function e(e){if(e===void 0){e={}}this.notBeforeTime=new Date;this.notAfterTime=new Date;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],AttCertValidityPeriod.prototype,"notBeforeTime",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],AttCertValidityPeriod.prototype,"notAfterTime",void 0);var Holder=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:IssuerSerial,implicit:true,context:0,optional:true})],Holder.prototype,"baseCertificateID",void 0);__decorate$1([AsnProp({type:GeneralNames,implicit:true,context:1,optional:true})],Holder.prototype,"entityName",void 0);__decorate$1([AsnProp({type:ObjectDigestInfo,implicit:true,context:2,optional:true})],Holder.prototype,"objectDigestInfo",void 0);var AttCertVersion;(function(e){e[e["v2"]=1]="v2"})(AttCertVersion||(AttCertVersion={}));var AttributeCertificateInfo=function(){function e(e){if(e===void 0){e={}}this.version=AttCertVersion.v2;this.holder=new Holder;this.issuer=new AttCertIssuer;this.signature=new AlgorithmIdentifier;this.serialNumber=new ArrayBuffer(0);this.attrCertValidityPeriod=new AttCertValidityPeriod;this.attributes=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],AttributeCertificateInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:Holder})],AttributeCertificateInfo.prototype,"holder",void 0);__decorate$1([AsnProp({type:AttCertIssuer})],AttributeCertificateInfo.prototype,"issuer",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],AttributeCertificateInfo.prototype,"signature",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],AttributeCertificateInfo.prototype,"serialNumber",void 0);__decorate$1([AsnProp({type:AttCertValidityPeriod})],AttributeCertificateInfo.prototype,"attrCertValidityPeriod",void 0);__decorate$1([AsnProp({type:Attribute$1,repeated:"sequence"})],AttributeCertificateInfo.prototype,"attributes",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,optional:true})],AttributeCertificateInfo.prototype,"issuerUniqueID",void 0);__decorate$1([AsnProp({type:Extensions,optional:true})],AttributeCertificateInfo.prototype,"extensions",void 0);var AttributeCertificate=function(){function e(e){if(e===void 0){e={}}this.acinfo=new AttributeCertificateInfo;this.signatureAlgorithm=new AlgorithmIdentifier;this.signatureValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AttributeCertificateInfo})],AttributeCertificate.prototype,"acinfo",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],AttributeCertificate.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],AttributeCertificate.prototype,"signatureValue",void 0);var ClassListFlags;(function(e){e[e["unmarked"]=1]="unmarked";e[e["unclassified"]=2]="unclassified";e[e["restricted"]=4]="restricted";e[e["confidential"]=8]="confidential";e[e["secret"]=16]="secret";e[e["topSecret"]=32]="topSecret"})(ClassListFlags||(ClassListFlags={}));var ClassList=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(BitString);var SecurityCategory=function(){function e(e){if(e===void 0){e={}}this.type="";this.value=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier,implicit:true,context:0})],SecurityCategory.prototype,"type",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,implicit:true,context:1})],SecurityCategory.prototype,"value",void 0);var Clearance=function(){function e(e){if(e===void 0){e={}}this.policyId="";this.classList=new ClassList(ClassListFlags.unclassified);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Clearance.prototype,"policyId",void 0);__decorate$1([AsnProp({type:ClassList,defaultValue:new ClassList(ClassListFlags.unclassified)})],Clearance.prototype,"classList",void 0);__decorate$1([AsnProp({type:SecurityCategory,repeated:"set"})],Clearance.prototype,"securityCategories",void 0);var IetfAttrSyntaxValueChoices=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString})],IetfAttrSyntaxValueChoices.prototype,"cotets",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],IetfAttrSyntaxValueChoices.prototype,"oid",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],IetfAttrSyntaxValueChoices.prototype,"string",void 0);var IetfAttrSyntax=function(){function e(e){if(e===void 0){e={}}this.values=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames,implicit:true,context:0,optional:true})],IetfAttrSyntax.prototype,"policyAuthority",void 0);__decorate$1([AsnProp({type:IetfAttrSyntaxValueChoices,repeated:"sequence"})],IetfAttrSyntax.prototype,"values",void 0);var Targets_1;var TargetCert=function(){function e(e){if(e===void 0){e={}}this.targetCertificate=new IssuerSerial;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:IssuerSerial})],TargetCert.prototype,"targetCertificate",void 0);__decorate$1([AsnProp({type:GeneralName,optional:true})],TargetCert.prototype,"targetName",void 0);__decorate$1([AsnProp({type:ObjectDigestInfo,optional:true})],TargetCert.prototype,"certDigestInfo",void 0);var Target=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0,implicit:true})],Target.prototype,"targetName",void 0);__decorate$1([AsnProp({type:GeneralName,context:1,implicit:true})],Target.prototype,"targetGroup",void 0);__decorate$1([AsnProp({type:TargetCert,context:2,implicit:true})],Target.prototype,"targetCert",void 0);Target=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Target);var Targets=Targets_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Targets_1.prototype);return r}return t}(AsnArray);Targets=Targets_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Target})],Targets);var ProxyInfo_1;var ProxyInfo=ProxyInfo_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ProxyInfo_1.prototype);return r}return t}(AsnArray);ProxyInfo=ProxyInfo_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Targets})],ProxyInfo);var RoleSyntax=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames,implicit:true,context:0,optional:true})],RoleSyntax.prototype,"roleAuthority",void 0);__decorate$1([AsnProp({type:GeneralName,implicit:true,context:1})],RoleSyntax.prototype,"roleName",void 0);var SvceAuthInfo=function(){function e(e){if(e===void 0){e={}}this.service=new GeneralName;this.ident=new GeneralName;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName})],SvceAuthInfo.prototype,"service",void 0);__decorate$1([AsnProp({type:GeneralName})],SvceAuthInfo.prototype,"ident",void 0);__decorate$1([AsnProp({type:OctetString,optional:true})],SvceAuthInfo.prototype,"authInfo",void 0);var id_ntQWAC="0.4.0.9496";var id_ActivityDescription="".concat(id_ntQWAC,".6");var ActivityDescription=function(){function e(e){if(e===void 0){e={}}this.codeAuthority=new GeneralName;this.codeId=new GeneralName;this.shortName="";this.shortDescription="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0})],ActivityDescription.prototype,"codeAuthority",void 0);__decorate$1([AsnProp({type:GeneralName,context:1})],ActivityDescription.prototype,"codeId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String,context:2})],ActivityDescription.prototype,"shortName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String,context:3})],ActivityDescription.prototype,"shortDescription",void 0);ActivityDescription=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ActivityDescription);var DomainName=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(Name$1);DomainName=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainName);var id_DomainNameBeneficiary="".concat(id_ntQWAC,".1");var DomainNameBeneficiary=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameBeneficiary=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameBeneficiary);var id_DomainNameLegalRepresentative="".concat(id_ntQWAC,".2");var DomainNameLegalRepresentative=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameLegalRepresentative=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameLegalRepresentative);var id_DomainNameOwner="".concat(id_ntQWAC,".3");var DomainNameOwner=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameOwner=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameOwner);var id_DomainNameTechnicalOperator="".concat(id_ntQWAC,".4");var DomainNameTechnicalOperator=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameTechnicalOperator=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameTechnicalOperator);var id_InsuranceValue="".concat(id_ntQWAC,".8");var InsuranceValue=function(){function e(e){if(e===void 0){e={}}this.location="";this.base=0;this.degree=0;Object.assign(this,e)}e.prototype.toString=function(){return"".concat(this.base," x 10^").concat(this.degree," ").concat(this.location)};return e}();__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],InsuranceValue.prototype,"location",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],InsuranceValue.prototype,"base",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],InsuranceValue.prototype,"degree",void 0);InsuranceValue=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],InsuranceValue);var id_ValuationRanking="".concat(id_ntQWAC,".9");var ValuationRanking=function(){function e(e){if(e===void 0){e={}}this.stars5=0;this.stars4=0;this.stars3=0;this.stars2=0;this.stars1=0;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars5",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars4",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars3",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars2",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars1",void 0);ValuationRanking=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ValuationRanking);var id_TypeRelationship="".concat(id_ntQWAC,".5");var TypeRelationship=function(){function e(e){if(e===void 0){e={}}this.DNBvsDNO=new BitString(0);this.DNBvsDNT=new BitString(0);this.DNOvsDNT=new BitString(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:BitString,context:0})],TypeRelationship.prototype,"DNBvsDNO",void 0);__decorate$1([AsnProp({type:BitString,context:1})],TypeRelationship.prototype,"DNBvsDNT",void 0);__decorate$1([AsnProp({type:BitString,context:2})],TypeRelationship.prototype,"DNOvsDNT",void 0);TypeRelationship=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],TypeRelationship);var id_WebGDPR="".concat(id_ntQWAC,".7");var WebGDPR=function(){function e(e){if(e===void 0){e={}}this.assessmentAuthority=new GeneralName;this.assessmentRef=new GeneralName;this.assessmentLocation=new GeneralName;this.dataStorageTerritory="";this.description="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0})],WebGDPR.prototype,"assessmentAuthority",void 0);__decorate$1([AsnProp({type:GeneralName,context:1})],WebGDPR.prototype,"assessmentRef",void 0);__decorate$1([AsnProp({type:GeneralName,context:2})],WebGDPR.prototype,"assessmentLocation",void 0);__decorate$1([AsnProp({type:AsnPropTypes.PrintableString,context:3})],WebGDPR.prototype,"dataStorageTerritory",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String,context:4})],WebGDPR.prototype,"description",void 0);WebGDPR=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],WebGDPR);var IssuerAndSerialNumber=function(){function e(e){if(e===void 0){e={}}this.issuer=new Name$1;this.serialNumber=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:Name$1})],IssuerAndSerialNumber.prototype,"issuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],IssuerAndSerialNumber.prototype,"serialNumber",void 0);var SignerIdentifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier,context:0,implicit:true})],SignerIdentifier.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber})],SignerIdentifier.prototype,"issuerAndSerialNumber",void 0);SignerIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SignerIdentifier);var CMSVersion;(function(e){e[e["v0"]=0]="v0";e[e["v1"]=1]="v1";e[e["v2"]=2]="v2";e[e["v3"]=3]="v3";e[e["v4"]=4]="v4";e[e["v5"]=5]="v5"})(CMSVersion||(CMSVersion={}));var DigestAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);DigestAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DigestAlgorithmIdentifier);var SignatureAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);SignatureAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SignatureAlgorithmIdentifier);var KeyEncryptionAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);KeyEncryptionAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],KeyEncryptionAlgorithmIdentifier);var ContentEncryptionAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);ContentEncryptionAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ContentEncryptionAlgorithmIdentifier);var MessageAuthenticationCodeAlgorithm=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);MessageAuthenticationCodeAlgorithm=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],MessageAuthenticationCodeAlgorithm);var KeyDerivationAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);KeyDerivationAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],KeyDerivationAlgorithmIdentifier);var Attribute=function(){function e(e){if(e===void 0){e={}}this.attrType="";this.attrValues=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Attribute.prototype,"attrType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,repeated:"set"})],Attribute.prototype,"attrValues",void 0);var SignerInfos_1;var SignerInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.sid=new SignerIdentifier;this.digestAlgorithm=new DigestAlgorithmIdentifier;this.signatureAlgorithm=new SignatureAlgorithmIdentifier;this.signature=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SignerInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:SignerIdentifier})],SignerInfo.prototype,"sid",void 0);__decorate$1([AsnProp({type:DigestAlgorithmIdentifier})],SignerInfo.prototype,"digestAlgorithm",void 0);__decorate$1([AsnProp({type:Attribute,repeated:"set",context:0,implicit:true,optional:true,raw:true})],SignerInfo.prototype,"signedAttrs",void 0);__decorate$1([AsnProp({type:SignatureAlgorithmIdentifier})],SignerInfo.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],SignerInfo.prototype,"signature",void 0);__decorate$1([AsnProp({type:Attribute,repeated:"set",context:1,implicit:true,optional:true})],SignerInfo.prototype,"unsignedAttrs",void 0);var SignerInfos=SignerInfos_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SignerInfos_1.prototype);return r}return t}(AsnArray);SignerInfos=SignerInfos_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:SignerInfo})],SignerInfos);var CounterSignature$1=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(SignerInfo);CounterSignature$1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CounterSignature$1);var SigningTime$1=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Time);SigningTime$1=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SigningTime$1);var CertificateSet_1;var OtherCertificateFormat=function(){function e(e){if(e===void 0){e={}}this.otherCertFormat="";this.otherCert=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherCertificateFormat.prototype,"otherCertFormat",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],OtherCertificateFormat.prototype,"otherCert",void 0);var CertificateChoices=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:Certificate})],CertificateChoices.prototype,"certificate",void 0);__decorate$1([AsnProp({type:AttributeCertificate,context:2,implicit:true})],CertificateChoices.prototype,"v2AttrCert",void 0);__decorate$1([AsnProp({type:OtherCertificateFormat,context:3,implicit:true})],CertificateChoices.prototype,"other",void 0);CertificateChoices=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CertificateChoices);var CertificateSet=CertificateSet_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertificateSet_1.prototype);return r}return t}(AsnArray);CertificateSet=CertificateSet_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:CertificateChoices})],CertificateSet);var ContentInfo=function(){function e(e){if(e===void 0){e={}}this.contentType="";this.content=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],ContentInfo.prototype,"contentType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],ContentInfo.prototype,"content",void 0);var EncapsulatedContent=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString})],EncapsulatedContent.prototype,"single",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],EncapsulatedContent.prototype,"any",void 0);EncapsulatedContent=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],EncapsulatedContent);var EncapsulatedContentInfo=function(){function e(e){if(e===void 0){e={}}this.eContentType="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],EncapsulatedContentInfo.prototype,"eContentType",void 0);__decorate$1([AsnProp({type:EncapsulatedContent,context:0,optional:true})],EncapsulatedContentInfo.prototype,"eContent",void 0);var EncryptedContent=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString,context:0,implicit:true,optional:true})],EncryptedContent.prototype,"value",void 0);__decorate$1([AsnProp({type:OctetString,converter:AsnConstructedOctetStringConverter,context:0,implicit:true,optional:true,repeated:"sequence"})],EncryptedContent.prototype,"constructedValue",void 0);EncryptedContent=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],EncryptedContent);var EncryptedContentInfo=function(){function e(e){if(e===void 0){e={}}this.contentType="";this.contentEncryptionAlgorithm=new ContentEncryptionAlgorithmIdentifier;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],EncryptedContentInfo.prototype,"contentType",void 0);__decorate$1([AsnProp({type:ContentEncryptionAlgorithmIdentifier})],EncryptedContentInfo.prototype,"contentEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:EncryptedContent,optional:true})],EncryptedContentInfo.prototype,"encryptedContent",void 0);var OtherKeyAttribute=function(){function e(e){if(e===void 0){e={}}this.keyAttrId="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherKeyAttribute.prototype,"keyAttrId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,optional:true})],OtherKeyAttribute.prototype,"keyAttr",void 0);var RecipientEncryptedKeys_1;var RecipientKeyIdentifier=function(){function e(e){if(e===void 0){e={}}this.subjectKeyIdentifier=new SubjectKeyIdentifier;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier})],RecipientKeyIdentifier.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,optional:true})],RecipientKeyIdentifier.prototype,"date",void 0);__decorate$1([AsnProp({type:OtherKeyAttribute,optional:true})],RecipientKeyIdentifier.prototype,"other",void 0);var KeyAgreeRecipientIdentifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:RecipientKeyIdentifier,context:0,implicit:true,optional:true})],KeyAgreeRecipientIdentifier.prototype,"rKeyId",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber,optional:true})],KeyAgreeRecipientIdentifier.prototype,"issuerAndSerialNumber",void 0);KeyAgreeRecipientIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],KeyAgreeRecipientIdentifier);var RecipientEncryptedKey=function(){function e(e){if(e===void 0){e={}}this.rid=new KeyAgreeRecipientIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:KeyAgreeRecipientIdentifier})],RecipientEncryptedKey.prototype,"rid",void 0);__decorate$1([AsnProp({type:OctetString})],RecipientEncryptedKey.prototype,"encryptedKey",void 0);var RecipientEncryptedKeys=RecipientEncryptedKeys_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RecipientEncryptedKeys_1.prototype);return r}return t}(AsnArray);RecipientEncryptedKeys=RecipientEncryptedKeys_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:RecipientEncryptedKey})],RecipientEncryptedKeys);var OriginatorPublicKey=function(){function e(e){if(e===void 0){e={}}this.algorithm=new AlgorithmIdentifier;this.publicKey=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],OriginatorPublicKey.prototype,"algorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],OriginatorPublicKey.prototype,"publicKey",void 0);var OriginatorIdentifierOrKey=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier,context:0,implicit:true,optional:true})],OriginatorIdentifierOrKey.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:OriginatorPublicKey,context:1,implicit:true,optional:true})],OriginatorIdentifierOrKey.prototype,"originatorKey",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber,optional:true})],OriginatorIdentifierOrKey.prototype,"issuerAndSerialNumber",void 0);OriginatorIdentifierOrKey=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],OriginatorIdentifierOrKey);var KeyAgreeRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v3;this.originator=new OriginatorIdentifierOrKey;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.recipientEncryptedKeys=new RecipientEncryptedKeys;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyAgreeRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:OriginatorIdentifierOrKey,context:0})],KeyAgreeRecipientInfo.prototype,"originator",void 0);__decorate$1([AsnProp({type:OctetString,context:1,optional:true})],KeyAgreeRecipientInfo.prototype,"ukm",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],KeyAgreeRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:RecipientEncryptedKeys})],KeyAgreeRecipientInfo.prototype,"recipientEncryptedKeys",void 0);var RecipientIdentifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier,context:0,implicit:true})],RecipientIdentifier.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber})],RecipientIdentifier.prototype,"issuerAndSerialNumber",void 0);RecipientIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],RecipientIdentifier);var KeyTransRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.rid=new RecipientIdentifier;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyTransRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:RecipientIdentifier})],KeyTransRecipientInfo.prototype,"rid",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],KeyTransRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],KeyTransRecipientInfo.prototype,"encryptedKey",void 0);var KEKIdentifier=function(){function e(e){if(e===void 0){e={}}this.keyIdentifier=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString})],KEKIdentifier.prototype,"keyIdentifier",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,optional:true})],KEKIdentifier.prototype,"date",void 0);__decorate$1([AsnProp({type:OtherKeyAttribute,optional:true})],KEKIdentifier.prototype,"other",void 0);var KEKRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v4;this.kekid=new KEKIdentifier;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KEKRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:KEKIdentifier})],KEKRecipientInfo.prototype,"kekid",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],KEKRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],KEKRecipientInfo.prototype,"encryptedKey",void 0);var PasswordRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],PasswordRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:KeyDerivationAlgorithmIdentifier,context:0,optional:true})],PasswordRecipientInfo.prototype,"keyDerivationAlgorithm",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],PasswordRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],PasswordRecipientInfo.prototype,"encryptedKey",void 0);var OtherRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.oriType="";this.oriValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherRecipientInfo.prototype,"oriType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],OtherRecipientInfo.prototype,"oriValue",void 0);var RecipientInfo=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:KeyTransRecipientInfo,optional:true})],RecipientInfo.prototype,"ktri",void 0);__decorate$1([AsnProp({type:KeyAgreeRecipientInfo,context:1,implicit:true,optional:true})],RecipientInfo.prototype,"kari",void 0);__decorate$1([AsnProp({type:KEKRecipientInfo,context:2,implicit:true,optional:true})],RecipientInfo.prototype,"kekri",void 0);__decorate$1([AsnProp({type:PasswordRecipientInfo,context:3,implicit:true,optional:true})],RecipientInfo.prototype,"pwri",void 0);__decorate$1([AsnProp({type:OtherRecipientInfo,context:4,implicit:true,optional:true})],RecipientInfo.prototype,"ori",void 0);RecipientInfo=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],RecipientInfo);var RecipientInfos_1;var RecipientInfos=RecipientInfos_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RecipientInfos_1.prototype);return r}return t}(AsnArray);RecipientInfos=RecipientInfos_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:RecipientInfo})],RecipientInfos);var RevocationInfoChoices_1;var OtherRevocationInfoFormat=function(){function e(e){if(e===void 0){e={}}this.otherRevInfoFormat="";this.otherRevInfo=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherRevocationInfoFormat.prototype,"otherRevInfoFormat",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],OtherRevocationInfoFormat.prototype,"otherRevInfo",void 0);var RevocationInfoChoice=function(){function e(e){if(e===void 0){e={}}this.other=new OtherRevocationInfoFormat;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OtherRevocationInfoFormat,context:1,implicit:true})],RevocationInfoChoice.prototype,"other",void 0);RevocationInfoChoice=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],RevocationInfoChoice);var RevocationInfoChoices=RevocationInfoChoices_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RevocationInfoChoices_1.prototype);return r}return t}(AsnArray);RevocationInfoChoices=RevocationInfoChoices_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:RevocationInfoChoice})],RevocationInfoChoices);var OriginatorInfo=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:CertificateSet,context:0,implicit:true,optional:true})],OriginatorInfo.prototype,"certs",void 0);__decorate$1([AsnProp({type:RevocationInfoChoices,context:1,implicit:true,optional:true})],OriginatorInfo.prototype,"crls",void 0);var UnprotectedAttributes_1;var UnprotectedAttributes=UnprotectedAttributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,UnprotectedAttributes_1.prototype);return r}return t}(AsnArray);UnprotectedAttributes=UnprotectedAttributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:Attribute})],UnprotectedAttributes);var EnvelopedData=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.recipientInfos=new RecipientInfos;this.encryptedContentInfo=new EncryptedContentInfo;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],EnvelopedData.prototype,"version",void 0);__decorate$1([AsnProp({type:OriginatorInfo,context:0,implicit:true,optional:true})],EnvelopedData.prototype,"originatorInfo",void 0);__decorate$1([AsnProp({type:RecipientInfos})],EnvelopedData.prototype,"recipientInfos",void 0);__decorate$1([AsnProp({type:EncryptedContentInfo})],EnvelopedData.prototype,"encryptedContentInfo",void 0);__decorate$1([AsnProp({type:UnprotectedAttributes,context:1,implicit:true,optional:true})],EnvelopedData.prototype,"unprotectedAttrs",void 0);var DigestAlgorithmIdentifiers_1;var DigestAlgorithmIdentifiers=DigestAlgorithmIdentifiers_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,DigestAlgorithmIdentifiers_1.prototype);return r}return t}(AsnArray);DigestAlgorithmIdentifiers=DigestAlgorithmIdentifiers_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:DigestAlgorithmIdentifier})],DigestAlgorithmIdentifiers);var SignedData=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.digestAlgorithms=new DigestAlgorithmIdentifiers;this.encapContentInfo=new EncapsulatedContentInfo;this.signerInfos=new SignerInfos;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SignedData.prototype,"version",void 0);__decorate$1([AsnProp({type:DigestAlgorithmIdentifiers})],SignedData.prototype,"digestAlgorithms",void 0);__decorate$1([AsnProp({type:EncapsulatedContentInfo})],SignedData.prototype,"encapContentInfo",void 0);__decorate$1([AsnProp({type:CertificateSet,context:0,implicit:true,optional:true})],SignedData.prototype,"certificates",void 0);__decorate$1([AsnProp({type:RevocationInfoChoices,context:1,implicit:true,optional:true})],SignedData.prototype,"crls",void 0);__decorate$1([AsnProp({type:SignerInfos})],SignedData.prototype,"signerInfos",void 0);var PKCS12AttrSet_1;var PKCS12Attribute=function(){function e(e){if(e===void 0){e={}}this.attrId="";this.attrValues=[];Object.assign(e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PKCS12Attribute.prototype,"attrId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,repeated:"set"})],PKCS12Attribute.prototype,"attrValues",void 0);var PKCS12AttrSet=PKCS12AttrSet_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,PKCS12AttrSet_1.prototype);return r}return t}(AsnArray);PKCS12AttrSet=PKCS12AttrSet_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:PKCS12Attribute})],PKCS12AttrSet);var AuthenticatedSafe_1;var AuthenticatedSafe=AuthenticatedSafe_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AuthenticatedSafe_1.prototype);return r}return t}(AsnArray);AuthenticatedSafe=AuthenticatedSafe_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:ContentInfo})],AuthenticatedSafe);var CertBag=function(){function e(e){if(e===void 0){e={}}this.certId="";this.certValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],CertBag.prototype,"certId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],CertBag.prototype,"certValue",void 0);var CRLBag=function(){function e(e){if(e===void 0){e={}}this.crlId="";this.crltValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],CRLBag.prototype,"crlId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],CRLBag.prototype,"crltValue",void 0);var KeyBag=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(PrivateKeyInfo$1);KeyBag=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],KeyBag);var PKCS8ShroudedKeyBag=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(EncryptedPrivateKeyInfo$1);PKCS8ShroudedKeyBag=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],PKCS8ShroudedKeyBag);var SecretBag=function(){function e(e){if(e===void 0){e={}}this.secretTypeId="";this.secretValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],SecretBag.prototype,"secretTypeId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],SecretBag.prototype,"secretValue",void 0);var MacData=function(){function e(e){if(e===void 0){e={}}this.mac=new DigestInfo;this.macSalt=new OctetString;this.iterations=1;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DigestInfo})],MacData.prototype,"mac",void 0);__decorate$1([AsnProp({type:OctetString})],MacData.prototype,"macSalt",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,defaultValue:1})],MacData.prototype,"iterations",void 0);var PFX=function(){function e(e){if(e===void 0){e={}}this.version=3;this.authSafe=new ContentInfo;this.macData=new MacData;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],PFX.prototype,"version",void 0);__decorate$1([AsnProp({type:ContentInfo})],PFX.prototype,"authSafe",void 0);__decorate$1([AsnProp({type:MacData,optional:true})],PFX.prototype,"macData",void 0);var SafeContents_1;var SafeBag=function(){function e(e){if(e===void 0){e={}}this.bagId="";this.bagValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],SafeBag.prototype,"bagId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],SafeBag.prototype,"bagValue",void 0);__decorate$1([AsnProp({type:PKCS12Attribute,repeated:"set",optional:true})],SafeBag.prototype,"bagAttributes",void 0);var SafeContents=SafeContents_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SafeContents_1.prototype);return r}return t}(AsnArray);SafeContents=SafeContents_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:SafeBag})],SafeContents);var ExtensionRequest_1,ExtendedCertificateAttributes_1,SMIMECapabilities_1;var id_pkcs9="1.2.840.113549.1.9";var id_pkcs9_at_unstructuredName="".concat(id_pkcs9,".2");var id_pkcs9_at_challengePassword="".concat(id_pkcs9,".7");var id_pkcs9_at_extensionRequest="".concat(id_pkcs9,".14");var PKCS9String=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}return e.call(this,t)||this}t.prototype.toString=function(){return this.ia5String||e.prototype.toString.call(this)};return t}(DirectoryString);__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],PKCS9String.prototype,"ia5String",void 0);PKCS9String=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],PKCS9String);var Pkcs7PDU=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(ContentInfo);Pkcs7PDU=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],Pkcs7PDU);var UserPKCS12=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(PFX);UserPKCS12=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],UserPKCS12);var EncryptedPrivateKeyInfo=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(EncryptedPrivateKeyInfo$1);EncryptedPrivateKeyInfo=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],EncryptedPrivateKeyInfo);var EmailAddress=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],EmailAddress.prototype,"value",void 0);EmailAddress=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],EmailAddress);var UnstructuredName=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(PKCS9String);UnstructuredName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],UnstructuredName);var UnstructuredAddress=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);UnstructuredAddress=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],UnstructuredAddress);var DateOfBirth=function(){function e(e){if(e===void 0){e=new Date}this.value=e}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],DateOfBirth.prototype,"value",void 0);DateOfBirth=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DateOfBirth);var PlaceOfBirth=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);PlaceOfBirth=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],PlaceOfBirth);var Gender=function(){function e(e){if(e===void 0){e="M"}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],Gender.prototype,"value",void 0);Gender=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Gender);var CountryOfCitizenship=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],CountryOfCitizenship.prototype,"value",void 0);CountryOfCitizenship=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CountryOfCitizenship);var CountryOfResidence=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(CountryOfCitizenship);CountryOfResidence=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CountryOfResidence);var Pseudonym=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);Pseudonym=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Pseudonym);var ContentType=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],ContentType.prototype,"value",void 0);ContentType=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],ContentType);var SigningTime=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Time);SigningTime=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SigningTime);var SequenceNumber=function(){function e(e){if(e===void 0){e=0}this.value=e}e.prototype.toString=function(){return this.value.toString()};return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SequenceNumber.prototype,"value",void 0);SequenceNumber=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SequenceNumber);var CounterSignature=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(SignerInfo);CounterSignature=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CounterSignature);var ChallengePassword=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);ChallengePassword=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],ChallengePassword);var ExtensionRequest=ExtensionRequest_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ExtensionRequest_1.prototype);return r}return t}(Extensions);ExtensionRequest=ExtensionRequest_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ExtensionRequest);var ExtendedCertificateAttributes=ExtendedCertificateAttributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ExtendedCertificateAttributes_1.prototype);return r}return t}(AsnArray);ExtendedCertificateAttributes=ExtendedCertificateAttributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:Attribute})],ExtendedCertificateAttributes);var FriendlyName=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],FriendlyName.prototype,"value",void 0);FriendlyName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],FriendlyName);var SMIMECapability=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);SMIMECapability=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SMIMECapability);var SMIMECapabilities=SMIMECapabilities_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SMIMECapabilities_1.prototype);return r}return t}(AsnArray);SMIMECapabilities=SMIMECapabilities_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:SMIMECapability})],SMIMECapabilities);var id_at_statementOfPossession="1.3.6.1.4.1.22112.2.1";var PrivateKeyPossessionStatement=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:IssuerAndSerialNumber})],PrivateKeyPossessionStatement.prototype,"signer",void 0);__decorate$1([AsnProp({type:Certificate,optional:true})],PrivateKeyPossessionStatement.prototype,"cert",void 0);PrivateKeyPossessionStatement=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],PrivateKeyPossessionStatement);var Attributes_1;var Attributes=Attributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Attributes_1.prototype);return r}return t}(AsnArray);Attributes=Attributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Attribute$1})],Attributes);var CertificationRequestInfo=function(){function e(e){if(e===void 0){e={}}this.version=0;this.subject=new Name$1;this.subjectPKInfo=new SubjectPublicKeyInfo;this.attributes=new Attributes;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],CertificationRequestInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:Name$1})],CertificationRequestInfo.prototype,"subject",void 0);__decorate$1([AsnProp({type:SubjectPublicKeyInfo})],CertificationRequestInfo.prototype,"subjectPKInfo",void 0);__decorate$1([AsnProp({type:Attributes,implicit:true,context:0,optional:true})],CertificationRequestInfo.prototype,"attributes",void 0);var CertificationRequest=function(){function e(e){if(e===void 0){e={}}this.certificationRequestInfo=new CertificationRequestInfo;this.signatureAlgorithm=new AlgorithmIdentifier;this.signature=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:CertificationRequestInfo,raw:true})],CertificationRequest.prototype,"certificationRequestInfo",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],CertificationRequest.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],CertificationRequest.prototype,"signature",void 0);var globalCrypto=globalThis.crypto;function getCrypto(){return globalCrypto}var SshError=function(e){__extends(t,e);function t(t,r){var i=e.call(this,t)||this;i.code=r;i.name=i.constructor.name;if(Error.captureStackTrace){Error.captureStackTrace(i,i.constructor)}return i}return t}(Error);var UnsupportedAlgorithmError=function(e){__extends(t,e);function t(t,r){var i=r?" Supported: ".concat(r.join(", ")):"";return e.call(this,"Unsupported algorithm: ".concat(t,".").concat(i),"UNSUPPORTED_ALGORITHM")||this}return t}(SshError);var InvalidFormatError=function(e){__extends(t,e);function t(t,r){var i=r?" Expected: ".concat(r):"";return e.call(this,"Invalid format: ".concat(t,".").concat(i),"INVALID_FORMAT")||this}return t}(SshError);var UnsupportedKeyTypeError=function(e){__extends(t,e);function t(t,r){var i=r?" Supported: ".concat(r.join(", ")):"";return e.call(this,"Unsupported key type: ".concat(t,".").concat(i),"UNSUPPORTED_KEY_TYPE")||this}return t}(SshError);var InvalidPrivateKeyFormatError=function(e){__extends(t,e);function t(t){var r=t?"Invalid SSH private key format: ".concat(t):"Invalid SSH private key format";return e.call(this,r,"INVALID_PRIVATE_KEY_FORMAT")||this}return t}(SshError);var EncryptedKeyNotSupportedError=function(e){__extends(t,e);function t(t){var r=t?"Encrypted SSH private keys are not supported (cipher: ".concat(t,")"):"Encrypted SSH private keys are not supported";return e.call(this,r,"ENCRYPTED_KEY_NOT_SUPPORTED")||this}return t}(SshError);var InvalidKeyDataError=function(e){__extends(t,e);function t(t){var r=t?"Invalid key data: ".concat(t):"Invalid key data";return e.call(this,r,"INVALID_KEY_DATA")||this}return t}(SshError);var UnexpectedEOFError=function(e){__extends(t,e);function t(t,r){var i=t!==undefined&&r!==undefined?" Expected ".concat(t," bytes, got ").concat(r):"";return e.call(this,"Unexpected end of data".concat(i),"UNEXPECTED_EOF")||this}return t}(SshError);var encoder=new TextEncoder;var decoder=new TextDecoder;var SshReader=function(){function e(e){this.buffer=e;this.offset=0}e.prototype.readUint8=function(){if(this.offset>=this.buffer.length){throw new UnexpectedEOFError(1,0)}return this.buffer[this.offset++]};e.prototype.readUint32=function(){var e=this.readUint8()<<24|this.readUint8()<<16|this.readUint8()<<8|this.readUint8();return e>>>0};e.prototype.readUint64=function(){var e=this.readUint32();var t=this.readUint32();return BigInt(e)<<32n|BigInt(t)};e.prototype.readBytes=function(e){if(e<0){throw new InvalidFormatError("Invalid length: ".concat(e))}if(this.offset+e>this.buffer.length){throw new UnexpectedEOFError(e,this.buffer.length-this.offset)}var t=this.buffer.subarray(this.offset,this.offset+e);this.offset+=e;return t};e.prototype.readString=function(){var e=this.readUint32();var t=this.readBytes(e);return decoder.decode(t)};e.prototype.peekString=function(e){if(this.offset+e>this.buffer.length){throw new UnexpectedEOFError(e,this.buffer.length-this.offset)}var t=this.buffer.subarray(this.offset,this.offset+e);return decoder.decode(t)};e.prototype.readMpInt=function(e){if(e===void 0){e=false}var t=this.readUint32();var r=this.readBytes(t);if(e&&r.length>1&&r[0]===0){return r.subarray(1)}return r};e.prototype.readMpIntSsh=function(){return this.readMpInt(true)};e.prototype.remaining=function(){return this.buffer.length-this.offset};e.prototype.getOffset=function(){return this.offset};e.prototype.seek=function(e){if(e<0||e>this.buffer.length){throw new InvalidFormatError("Invalid offset: ".concat(e,". Buffer length: ").concat(this.buffer.length))}this.offset=e};return e}();var SshWriter=function(){function e(e){if(e===void 0){e=1024}this.buffer=new Uint8Array(e);this.offset=0}e.prototype.ensureCapacity=function(e){var t=this.offset+e;if(t>this.buffer.length){var r=Math.max(t,this.buffer.length*2);var i=new Uint8Array(r);i.set(this.buffer.subarray(0,this.offset));this.buffer=i}};e.prototype.reserve=function(e){if(e>this.buffer.length){var t=new Uint8Array(e);t.set(this.buffer.subarray(0,this.offset));this.buffer=t}};e.prototype.writeUint8=function(e){this.ensureCapacity(1);this.buffer[this.offset++]=e&255};e.prototype.writeUint32=function(e){this.ensureCapacity(4);this.buffer[this.offset++]=e>>>24&255;this.buffer[this.offset++]=e>>>16&255;this.buffer[this.offset++]=e>>>8&255;this.buffer[this.offset++]=e&255};e.prototype.writeUint64=function(e){this.ensureCapacity(8);var t=Number(e>>32n);var r=Number(e&0xffffffffn);this.writeUint32(t);this.writeUint32(r)};e.prototype.writeBytes=function(e){this.ensureCapacity(e.length);this.buffer.set(e,this.offset);this.offset+=e.length};e.prototype.writeString=function(e){var t=encoder.encode(e);this.writeUint32(t.length);this.writeBytes(t)};e.prototype.writeMpInt=function(e,t){if(t===void 0){t=false}if(t&&e.length>0&&(e[0]&128)!==0){var r=new Uint8Array(e.length+1);r[0]=0;r.set(e,1);this.writeUint32(r.length);this.writeBytes(r)}else{this.writeUint32(e.length);this.writeBytes(e)}};e.prototype.writeMpIntSsh=function(e){this.writeMpInt(e,true)};e.prototype.toUint8Array=function(){return this.buffer.subarray(0,this.offset)};e.prototype.getOffset=function(){return this.offset};e.prototype.seek=function(e){if(e<0||e>this.buffer.length){throw new InvalidFormatError("Invalid offset")}this.offset=e};return e}();var RsaBinding=function(){function e(e){if(e===void 0){e="SHA-256"}this.hash="SHA-256";this.hash=e}e.prototype.importPublicSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a;return __generator(this,(function(s){t=e.blob,r=e.crypto;i=new SshReader(t);i.readString();n=i.readMpInt(true);o=i.readMpInt(true);a={kty:"RSA",n:buildExports.Convert.ToBase64Url(o),e:buildExports.Convert.ToBase64Url(n)};return[2,r.subtle.importKey("jwk",a,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])]}))}))};e.prototype.exportPublicSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a;return __generator(this,(function(s){switch(s.label){case 0:t=e.publicKey,r=e.crypto;return[4,r.subtle.exportKey("jwk",t)];case 1:i=s.sent();if(!i.n||!i.e){throw new InvalidKeyDataError("RSA JWK missing required parameters (n, e)")}n=buildExports.BufferSourceConverter.toUint8Array(buildExports.Convert.FromBase64Url(i.n));o=buildExports.BufferSourceConverter.toUint8Array(buildExports.Convert.FromBase64Url(i.e));a=new SshWriter;a.writeString("ssh-rsa");a.writeMpInt(o,true);a.writeMpInt(n,true);return[2,a.toUint8Array()]}}))}))};e.prototype.importPublicSpki=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(i){t=e.spki,r=e.crypto;return[2,r.subtle.importKey("spki",t,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])]}))}))};e.prototype.exportPublicSpki=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i;return __generator(this,(function(n){switch(n.label){case 0:t=e.publicKey,r=e.crypto;return[4,r.subtle.exportKey("spki",t)];case 1:i=n.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(i)]}}))}))};e.prototype.importPrivatePkcs8=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(i){t=e.pkcs8,r=e.crypto;return[2,r.subtle.importKey("pkcs8",t,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])]}))}))};e.prototype.exportPrivatePkcs8=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i;return __generator(this,(function(n){switch(n.label){case 0:t=e.privateKey,r=e.crypto;return[4,r.subtle.exportKey("pkcs8",t)];case 1:i=n.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(i)]}}))}))};e.prototype.importPrivateSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s,c,u,p,f,d,l,y,v,h,A,_,S,g,m,C,P,T,E,I,b,w;return __generator(this,(function(D){t=e.sshKey,r=e.crypto;i=t.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=buildExports.Convert.FromBase64(i);o=new SshReader(buildExports.BufferSourceConverter.toUint8Array(n));a=o.readBytes(15);if(buildExports.Convert.ToHex(a)!=="6f70656e7373682d6b65792d763100"){throw new InvalidPrivateKeyFormatError("invalid magic string")}s=o.readString();o.readString();o.readString();if(s!=="none"){throw new EncryptedKeyNotSupportedError(s)}c=o.readUint32();if(c!==1){throw new InvalidPrivateKeyFormatError("multiple keys not supported")}u=o.readUint32();o.readBytes(u);p=o.readUint32();f=o.readBytes(p);d=new SshReader(f);l=d.readUint32();y=d.readUint32();if(l!==y){throw new InvalidPrivateKeyFormatError("invalid checkints")}d.readString();v=d.readMpInt(true);h=d.readMpInt(true);A=d.readMpInt(true);_=d.readMpInt(true);S=d.readMpInt(true);g=d.readMpInt(true);d.readString();m=BigInt("0x"+buildExports.Convert.ToHex(A));C=BigInt("0x"+buildExports.Convert.ToHex(S));P=BigInt("0x"+buildExports.Convert.ToHex(g));T=m%(C-1n);E=m%(P-1n);I=buildExports.Convert.FromHex(T.toString(16).padStart(S.length*2,"0"));b=buildExports.Convert.FromHex(E.toString(16).padStart(g.length*2,"0"));w={kty:"RSA",n:buildExports.Convert.ToBase64Url(v),e:buildExports.Convert.ToBase64Url(h),d:buildExports.Convert.ToBase64Url(A),p:buildExports.Convert.ToBase64Url(S),q:buildExports.Convert.ToBase64Url(g),dp:buildExports.Convert.ToBase64Url(I),dq:buildExports.Convert.ToBase64Url(b),qi:buildExports.Convert.ToBase64Url(_)};return[2,r.subtle.importKey("jwk",w,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])]}))}))};e.prototype.exportPrivateSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s,c,u,p,f,d;return __generator(this,(function(l){switch(l.label){case 0:t=e.privateKey,r=e.crypto,i=e.jwk;o=i;if(o)return[3,2];return[4,r.subtle.exportKey("jwk",t)];case 1:o=l.sent();l.label=2;case 2:n=o;if(!n.n||!n.e||!n.d||!n.p||!n.q){throw new InvalidKeyDataError("RSA JWK missing required parameters")}a=new Uint8Array(buildExports.Convert.FromBase64Url(n.n));s=new Uint8Array(buildExports.Convert.FromBase64Url(n.e));c=new Uint8Array(buildExports.Convert.FromBase64Url(n.d));u=new Uint8Array(buildExports.Convert.FromBase64Url(n.p));p=new Uint8Array(buildExports.Convert.FromBase64Url(n.q));f=n.qi?new Uint8Array(buildExports.Convert.FromBase64Url(n.qi)):new Uint8Array;d=new SshWriter;d.writeString("ssh-rsa");d.writeMpInt(a,true);d.writeMpInt(s,true);d.writeMpInt(c,true);d.writeMpInt(f,true);d.writeMpInt(u,true);d.writeMpInt(p,true);return[2,d.toUint8Array()]}}))}))};e.prototype.sign=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:t=e.privateKey,r=e.data,i=e.crypto,n=e.hash;if(n&&n!==this.hash){throw new InvalidKeyDataError("Hash ".concat(n," not supported for this RSA algorithm"))}if(!t.extractable){throw new InvalidKeyDataError("Private key is not extractable")}return[4,this.exportPrivatePkcs8({privateKey:t,crypto:i})];case 1:o=c.sent();return[4,this.importPrivatePkcs8({pkcs8:new Uint8Array(o),crypto:i})];case 2:a=c.sent();return[4,i.subtle.sign("RSASSA-PKCS1-v1_5",a,r)];case 3:s=c.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(s)]}}))}))};e.prototype.verify=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:t=e.publicKey,r=e.signature,i=e.data,n=e.crypto,o=e.hash;if(o&&o!==this.hash){return[2,false]}if(!t.extractable){throw new InvalidKeyDataError("Public key is not extractable")}return[4,this.exportPublicSpki({publicKey:t,crypto:n})];case 1:a=c.sent();return[4,this.importPublicSpki({spki:new Uint8Array(a),crypto:n})];case 2:s=c.sent();return[2,n.subtle.verify("RSASSA-PKCS1-v1_5",s,r,i)]}}))}))};e.prototype.encodeSignature=function(e){var t=e.signature,r=e.algo;var i=new SshWriter;i.writeString(r);i.writeUint32(t.byteLength);i.writeBytes(t);return i.toUint8Array()};e.prototype.decodeSignature=function(e){var t=e.signature;var r=new SshReader(t);var i=r.readString();var n=r.readUint32();var o=r.readBytes(n);return{signature:o,algo:i}};e.prototype.supportsCryptoKey=function(e){return e.algorithm.name==="RSASSA-PKCS1-v1_5"};e.prototype.parsePublicKey=function(e){var t=e.readBytes(e.readUint32());var r=e.readBytes(e.readUint32());var i=new SshWriter;i.writeString("ssh-rsa");i.writeMpInt(t);i.writeMpInt(r);return{type:"ssh-rsa",keyData:i.toUint8Array()}};e.prototype.writePublicKey=function(e,t){var r=new SshReader(t.keyData);r.readString();var i=r.readMpInt();var n=r.readMpInt();e.writeUint32(i.length);e.writeBytes(i);e.writeUint32(n.length);e.writeBytes(n)};e.prototype.getCertificateType=function(){return"ssh-rsa-cert-v01@openssh.com"};e.prototype.getSignatureAlgo=function(){return this.hash==="SHA-256"?"rsa-sha2-256":"rsa-sha2-512"};return e}();var EcdsaBinding=function(){function e(e,t,r){this.curveName=e;this.sshType=t;this.namedCurve=r}e.prototype.getHashAlgorithm=function(){switch(this.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:return"SHA-256"}};e.prototype.getExpectedLength=function(){switch(this.namedCurve){case"P-256":return 32;case"P-384":return 48;case"P-521":return 66;default:return 32}};e.prototype.getSignatureCoordLength=function(){return this.getExpectedLength()};e.prototype.importPublicSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s;return __generator(this,(function(c){t=e.blob,r=e.crypto;i=new SshReader(t);i.readString();n=i.readString();if(n!==this.curveName){throw new InvalidKeyDataError("ECDSA curve name ".concat(n,", expected ").concat(this.curveName))}o=i.readMpInt();a=Math.floor((o.length-1)/2);s={kty:"EC",crv:this.namedCurve,x:buildExports.Convert.ToBase64Url(o.slice(1,1+a)),y:buildExports.Convert.ToBase64Url(o.slice(1+a))};return[2,r.subtle.importKey("jwk",s,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])]}))}))};e.prototype.exportPublicSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:t=e.publicKey,r=e.crypto;return[4,r.subtle.exportKey("jwk",t)];case 1:i=c.sent();if(!i.x||!i.y){throw new InvalidKeyDataError("ECDSA JWK missing x or y parameters")}n=new Uint8Array(buildExports.Convert.FromBase64Url(i.x));o=new Uint8Array(buildExports.Convert.FromBase64Url(i.y));a=new Uint8Array(1+n.length+o.length);a[0]=4;a.set(n,1);a.set(o,1+n.length);s=new SshWriter;s.writeString(this.sshType);s.writeString(this.curveName);s.writeMpInt(a);return[2,s.toUint8Array()]}}))}))};e.prototype.importPublicSpki=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(i){t=e.spki,r=e.crypto;return[2,r.subtle.importKey("spki",t,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])]}))}))};e.prototype.exportPublicSpki=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i;return __generator(this,(function(n){switch(n.label){case 0:t=e.publicKey,r=e.crypto;return[4,r.subtle.exportKey("spki",t)];case 1:i=n.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(i)]}}))}))};e.prototype.importPrivatePkcs8=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(i){t=e.pkcs8,r=e.crypto;return[2,r.subtle.importKey("pkcs8",t,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])]}))}))};e.prototype.exportPrivatePkcs8=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i;return __generator(this,(function(n){switch(n.label){case 0:t=e.privateKey,r=e.crypto;return[4,r.subtle.exportKey("pkcs8",t)];case 1:i=n.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(i)]}}))}))};e.prototype.exportPrivateSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s,c,u,p;return __generator(this,(function(f){switch(f.label){case 0:t=e.privateKey,r=e.crypto,i=e.jwk;o=i;if(o)return[3,2];return[4,r.subtle.exportKey("jwk",t)];case 1:o=f.sent();f.label=2;case 2:n=o;if(!n.d||!n.x||!n.y){throw new InvalidKeyDataError("ECDSA private key JWK missing required parameters")}a=new Uint8Array(buildExports.Convert.FromBase64Url(n.x));s=new Uint8Array(buildExports.Convert.FromBase64Url(n.y));c=new Uint8Array(buildExports.Convert.FromBase64Url(n.d));u=new Uint8Array(1+a.length+s.length);u[0]=4;u.set(a,1);u.set(s,1+a.length);p=new SshWriter;p.writeString(this.sshType);p.writeString(this.curveName);p.writeMpInt(u);p.writeMpInt(c);return[2,p.toUint8Array()]}}))}))};e.prototype.importPrivateSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s,c,u,p,f,d,l,y,v,h,A,_,S,g;return __generator(this,(function(m){t=e.sshKey,r=e.crypto;i=t.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=buildExports.Convert.FromBase64(i);o=new SshReader(buildExports.BufferSourceConverter.toUint8Array(n));a=o.readBytes(15);if(buildExports.Convert.ToHex(a)!=="6f70656e7373682d6b65792d763100"){throw new InvalidPrivateKeyFormatError("invalid magic string")}s=o.readString();o.readString();o.readString();if(s!=="none"){throw new EncryptedKeyNotSupportedError(s)}c=o.readUint32();if(c!==1){throw new InvalidPrivateKeyFormatError("multiple keys not supported")}u=o.readUint32();o.readBytes(u);p=o.readUint32();f=o.readBytes(p);d=new SshReader(f);l=d.readUint32();y=d.readUint32();if(l!==y){throw new InvalidPrivateKeyFormatError("invalid checkints")}d.readString();d.readString();v=d.readMpInt();h=d.readMpInt();d.readString();if(v[0]!==4){throw new InvalidKeyDataError("invalid ECDSA public key point format")}A=Math.floor((v.length-1)/2);_=v.slice(1,1+A);S=v.slice(1+A);g={kty:"EC",crv:this.namedCurve,x:buildExports.Convert.ToBase64Url(_),y:buildExports.Convert.ToBase64Url(S),d:buildExports.Convert.ToBase64Url(h)};return[2,r.subtle.importKey("jwk",g,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])]}))}))};e.prototype.sign=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a;return __generator(this,(function(s){switch(s.label){case 0:t=e.privateKey,r=e.data,i=e.crypto,n=e.hash;o=this.getHashAlgorithm();if(n&&n!==o){throw new InvalidKeyDataError("ECDSA ".concat(this.namedCurve," requires ").concat(o,", got ").concat(n))}return[4,i.subtle.sign({name:"ECDSA",hash:o},t,r)];case 1:a=s.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(a)]}}))}))};e.prototype.verify=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a;return __generator(this,(function(s){t=e.publicKey,r=e.signature,i=e.data,n=e.crypto,o=e.hash;a=this.getHashAlgorithm();if(o&&o!==a){throw new InvalidKeyDataError("ECDSA ".concat(this.namedCurve," requires ").concat(a,", got ").concat(o))}return[2,n.subtle.verify({name:"ECDSA",hash:a},t,r,i)]}))}))};e.prototype.encodeSignature=function(e){var t=e.signature,r=e.algo;if(r.startsWith("ecdsa-sha2-")){var i=this.getSignatureCoordLength();var n=t.subarray(0,i);var o=t.subarray(i);var a=new SshWriter;a.writeString(r);var s=new SshWriter;s.writeMpInt(n,true);s.writeMpInt(o,true);var c=s.toUint8Array();a.writeUint32(c.length);a.writeBytes(c);return a.toUint8Array()}var u=new SshWriter;u.writeString(r);u.writeUint32(t.byteLength);u.writeBytes(t);return u.toUint8Array()};e.prototype.decodeSignature=function(e){var t=e.signature;var r=new SshReader(t);var i=r.readString();var n=r.readUint32();var o=r.readBytes(n);if(i.startsWith("ecdsa-sha2-")){var a=new SshReader(o);var s=a.readMpInt();var c=a.readMpInt();if(s[0]===0&&s.length>1&&(s[1]&128)===0){s=s.slice(1)}if(c[0]===0&&c.length>1&&(c[1]&128)===0){c=c.slice(1)}var u=this.getExpectedLength();var p=new Uint8Array(u);var f=new Uint8Array(u);if(s.length<=u){p.set(s,u-s.length)}else{p.set(s.slice(s.length-u),0)}if(c.length<=u){f.set(c,u-c.length)}else{f.set(c.slice(c.length-u),0)}var d=new Uint8Array(__spreadArray(__spreadArray([],p,true),f,true));return{signature:d,algo:i}}return{signature:o,algo:i}};e.prototype.supportsCryptoKey=function(e){return e.algorithm.name==="ECDSA"&&e.algorithm.namedCurve===this.namedCurve};e.prototype.parsePublicKey=function(e){var t=e.readString();if(t!==this.curveName){throw new InvalidKeyDataError("ECDSA certificate curve name ".concat(t,", expected ").concat(this.curveName))}var r=e.readBytes(e.readUint32());var i=new SshWriter;i.writeString(this.sshType);i.writeString(t);i.writeMpInt(r);return{type:this.sshType,keyData:i.toUint8Array()}};e.prototype.writePublicKey=function(e,t){var r=new SshReader(t.keyData);r.readString();var i=r.readString();var n=r.readMpInt();e.writeString(i);e.writeUint32(n.length);e.writeBytes(n)};e.prototype.getCertificateType=function(){return"".concat(this.sshType,"-cert-v01@openssh.com")};e.prototype.getSignatureAlgo=function(){return this.sshType};return e}();var EcdsaP256Binding=new EcdsaBinding("nistp256","ecdsa-sha2-nistp256","P-256");var EcdsaP384Binding=new EcdsaBinding("nistp384","ecdsa-sha2-nistp384","P-384");var EcdsaP521Binding=new EcdsaBinding("nistp521","ecdsa-sha2-nistp521","P-521");var Ed25519Binding=function(){function e(){}e.prototype.importPublicSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o;return __generator(this,(function(a){t=e.blob,r=e.crypto;i=new SshReader(t);i.readString();n=i.readUint32();if(n!==32){throw new InvalidKeyDataError("Ed25519 key length ".concat(n,", expected 32"))}o=i.readBytes(n);return[2,r.subtle.importKey("raw",o,"Ed25519",true,["verify"])]}))}))};e.prototype.exportPublicSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o;return __generator(this,(function(a){switch(a.label){case 0:t=e.publicKey,r=e.crypto;return[4,r.subtle.exportKey("jwk",t)];case 1:i=a.sent();if(!i.x){throw new InvalidKeyDataError("Ed25519 JWK missing x parameter")}n=new Uint8Array(buildExports.Convert.FromBase64Url(i.x));o=new SshWriter;o.writeString("ssh-ed25519");o.writeUint32(n.length);o.writeBytes(n);return[2,o.toUint8Array()]}}))}))};e.prototype.importPublicSpki=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(i){t=e.spki,r=e.crypto;return[2,r.subtle.importKey("spki",t,"Ed25519",true,["verify"])]}))}))};e.prototype.exportPublicSpki=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i;return __generator(this,(function(n){switch(n.label){case 0:t=e.publicKey,r=e.crypto;return[4,r.subtle.exportKey("spki",t)];case 1:i=n.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(i)]}}))}))};e.prototype.importPrivatePkcs8=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(i){t=e.pkcs8,r=e.crypto;return[2,r.subtle.importKey("pkcs8",t,"Ed25519",true,["sign"])]}))}))};e.prototype.exportPrivatePkcs8=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i;return __generator(this,(function(n){switch(n.label){case 0:t=e.privateKey,r=e.crypto;return[4,r.subtle.exportKey("pkcs8",t)];case 1:i=n.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(i)]}}))}))};e.prototype.exportPrivateSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s,c,u;return __generator(this,(function(p){switch(p.label){case 0:t=e.privateKey,r=e.crypto,i=e.jwk;o=i;if(o)return[3,2];return[4,r.subtle.exportKey("jwk",t)];case 1:o=p.sent();p.label=2;case 2:n=o;if(!n.d||!n.x){throw new InvalidKeyDataError("Ed25519 private key JWK missing required parameters")}a=new Uint8Array(buildExports.Convert.FromBase64Url(n.d));s=new Uint8Array(buildExports.Convert.FromBase64Url(n.x));c=new SshWriter;c.writeString("ssh-ed25519");c.writeUint32(s.length);c.writeBytes(s);u=new Uint8Array(64);u.set(a,0);u.set(s,32);c.writeUint32(u.length);c.writeBytes(u);return[2,c.toUint8Array()]}}))}))};e.prototype.importPrivateSsh=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n,o,a,s,c,u,p,f,d,l,y,v,h,A,_,S,g;return __generator(this,(function(m){t=e.sshKey,r=e.crypto;i=t.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=buildExports.Convert.FromBase64(i);o=new SshReader(buildExports.BufferSourceConverter.toUint8Array(n));a=o.readBytes(15);if(buildExports.Convert.ToHex(a)!=="6f70656e7373682d6b65792d763100"){throw new InvalidPrivateKeyFormatError("invalid magic string")}s=o.readString();o.readString();o.readString();if(s!=="none"){throw new EncryptedKeyNotSupportedError(s)}c=o.readUint32();if(c!==1){throw new InvalidPrivateKeyFormatError("multiple keys not supported")}u=o.readUint32();o.readBytes(u);p=o.readUint32();f=o.readBytes(p);d=new SshReader(f);l=d.readUint32();y=d.readUint32();if(l!==y){throw new InvalidPrivateKeyFormatError("invalid checkints")}d.readString();v=d.readUint32();h=d.readBytes(v);A=d.readUint32();_=d.readBytes(A);d.readString();S=_.slice(0,32);g={kty:"OKP",crv:"Ed25519",d:buildExports.Convert.ToBase64Url(S),x:buildExports.Convert.ToBase64Url(h)};return[2,r.subtle.importKey("jwk",g,"Ed25519",true,["sign"])]}))}))};e.prototype.sign=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n;return __generator(this,(function(o){switch(o.label){case 0:t=e.privateKey,r=e.data,i=e.crypto;return[4,i.subtle.sign("Ed25519",t,r)];case 1:n=o.sent();return[2,buildExports.BufferSourceConverter.toUint8Array(n)]}}))}))};e.prototype.verify=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,n;return __generator(this,(function(o){t=e.publicKey,r=e.signature,i=e.data,n=e.crypto;return[2,n.subtle.verify("Ed25519",t,r,i)]}))}))};e.prototype.encodeSignature=function(e){var t=e.signature,r=e.algo;var i=new Uint8Array(t);var n=new SshWriter;n.writeString(r);n.writeUint32(i.length);n.writeBytes(i);return n.toUint8Array()};e.prototype.decodeSignature=function(e){var t=e.signature;var r=new SshReader(t);var i=r.readString();var n=r.readUint32();var o=r.readBytes(n);return{signature:o,algo:i}};e.prototype.supportsCryptoKey=function(e){return e.algorithm.name==="Ed25519"};e.prototype.parsePublicKey=function(e){var t=e.readBytes(e.readUint32());var r=new SshWriter;r.writeString("ssh-ed25519");r.writeUint32(t.length);r.writeBytes(t);return{type:"ssh-ed25519",keyData:r.toUint8Array()}};e.prototype.writePublicKey=function(e,t){var r=new SshReader(t.keyData);r.readString();var i=r.readUint32();var n=r.readBytes(i);e.writeUint32(n.length);e.writeBytes(n)};e.prototype.getCertificateType=function(){return"ssh-ed25519-cert-v01@openssh.com"};e.prototype.getSignatureAlgo=function(){return"ssh-ed25519"};return e}();var registry=new Map;var AlgorithmRegistry=function(){function e(){}e.get=function(e){var t=registry.get(e);if(!t){throw new UnsupportedKeyTypeError(e,Array.from(registry.keys()))}return t};e.register=function(e,t){registry.set(e,t)};e.getSshTypeFromCryptoKey=function(e){for(var t=0,r=registry.entries();t<r.length;t++){var i=r[t],n=i[0],o=i[1];if(o.supportsCryptoKey(e)){return n}}throw new UnsupportedKeyTypeError(e.algorithm.name,Array.from(registry.keys()))};e.certTypeToKeyType=function(e){var t={"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"};return t[e]};e.getSupportedCertTypes=function(){return Object.keys({"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"})};return e}();AlgorithmRegistry.register("ssh-ed25519",new Ed25519Binding);AlgorithmRegistry.register("ssh-rsa",new RsaBinding("SHA-256"));AlgorithmRegistry.register("rsa-sha2-256",new RsaBinding("SHA-256"));AlgorithmRegistry.register("rsa-sha2-512",new RsaBinding("SHA-512"));AlgorithmRegistry.register("ecdsa-sha2-nistp256",EcdsaP256Binding);AlgorithmRegistry.register("ecdsa-sha2-nistp384",EcdsaP384Binding);AlgorithmRegistry.register("ecdsa-sha2-nistp521",EcdsaP521Binding);function parsePublicKey(e){var t=typeof e==="string"?e.trim().split(/\s+/):null;if(!t||t.length<2){throw new InvalidFormatError("Invalid SSH public key format")}var r=t[0];var i=new Uint8Array(buildExports.Convert.FromBase64(t[1]));var n=t.length>2?t.slice(2).join(" "):undefined;var o=new SshReader(i);var a=o.readString();if(a!==r){throw new InvalidFormatError("Key type mismatch")}return{type:r,keyData:i,comment:n}}function serializePublicKey(e){var t=buildExports.Convert.ToBase64(e.keyData);var r=[e.type,t];if(e.comment){r.push(e.comment)}return r.join(" ")}function parse(e){if(typeof e==="string"){var t=e.trim().split(/\s+/);if(t.length<2){throw new InvalidFormatError("SSH certificate string","type base64 [comment]")}var r=t[0];var i=new Uint8Array(buildExports.Convert.FromBase64(t[1]));var n=t.length>2?t.slice(2).join(" "):undefined;var o=new SshReader(i);var a=o.readString();if(a!==r){throw new InvalidFormatError("certificate blob type ".concat(a),"expected ".concat(r))}return{type:r,keyData:i,comment:n}}else{var o=new SshReader(e);var s=o.readString();var c=e.slice(o.getOffset());return{type:s,keyData:c}}}function parseCertificateData(e){var t=new SshReader(e);var r=t.readString();var i=t.readBytes(t.readUint32());var n=AlgorithmRegistry.certTypeToKeyType(r);if(!n){throw new UnsupportedAlgorithmError(r,AlgorithmRegistry.getSupportedCertTypes())}var o=AlgorithmRegistry.get(n);var a=o.parsePublicKey(t);var s=n;var c=t.readUint64();var u=t.readUint32();var p=u===1?"user":"host";var f=t.readString();var d=t.readUint32();var l=t.readBytes(d);var y=[];if(l.length>0){var v=new SshReader(l);while(v.getOffset()<l.length){try{var h=v.readString();y.push(h)}catch(e){break}}}var A=t.readUint64();var _=t.readUint64();var S={};var g=t.readUint32();var m=t.readBytes(g);if(m.length>0){var C=new SshReader(m);while(C.getOffset()<m.length){try{var P=C.readString();var T=C.readBytes(C.readUint32());var E=T.length===0?"":decoder.decode(T);S[P]=E}catch(e){break}}}var I={};var b=t.readUint32();var w=t.readBytes(b);if(w.length>0){var D=new SshReader(w);while(D.getOffset()<w.length){try{var B=D.readString();var T=D.readBytes(D.readUint32());var R=T.length===0?"":decoder.decode(T);I[B]=R}catch(e){break}}}var $=t.readUint32();var x=t.readBytes($);var N=t.readUint32();var O=t.readBytes(N);var K=new SshReader(O);var k=K.readString();var L={type:k,keyData:O};var M=t.readUint32();var V=t.readBytes(M);return{nonce:i,keyType:s,publicKey:a,serial:c,type:p,keyId:f,validPrincipals:y,validAfter:A,validBefore:_,criticalOptions:S,extensions:I,reserved:x,signatureKey:L,signature:V}}function serialize(e){var t=buildExports.Convert.ToBase64(e.keyData);var r=[e.type,t];if(e.comment){r.push(e.comment)}return r.join(" ")}function parseSignature(e){var t=new SshReader(e);if(e.length>=6&&(new TextDecoder).decode(e.subarray(0,6))==="SSHSIG"){return parseSshSignatureFormat(t)}else{return parseLegacyFormat(t)}}function parseSshSignatureFormat(e){var t=e.readBytes(6);var r=(new TextDecoder).decode(t);if(r!=="SSHSIG"){throw new InvalidFormatError(r,"SSHSIG")}var i=e.readUint32();var n=e.readUint32();var o=e.readBytes(n);var a=e.readString();var s=e.readString();var c=e.readString();var u=e.readUint32();var p=e.readBytes(u);var f=new SshReader(p);var d=f.readString();var l=f.readUint32();var y=f.readBytes(l);return{format:"ssh-signature",algorithm:d,signature:y,version:i,publicKey:o,namespace:a,reserved:s,hashAlgorithm:c}}function parseLegacyFormat(e){var t=e.readString();var r=e.readUint32();var i=e.readBytes(r);return{format:"legacy",algorithm:t,signature:i}}function serializeSignature(e){if(e.format==="ssh-signature"){return serializeSshSignatureFormat(e)}else{return serializeLegacyFormat(e)}}function serializeSshSignatureFormat(e){var t=new SshWriter;t.writeBytes((new TextEncoder).encode("SSHSIG"));t.writeUint32(e.version||1);if(e.publicKey){t.writeUint32(e.publicKey.length);t.writeBytes(e.publicKey)}else{t.writeUint32(0)}t.writeString(e.namespace||"file");t.writeString(e.reserved||"");t.writeString(e.hashAlgorithm||"sha512");var r=new SshWriter;r.writeString(e.algorithm);r.writeUint32(e.signature.length);r.writeBytes(e.signature);var i=r.toUint8Array();t.writeUint32(i.length);t.writeBytes(i);return t.toUint8Array()}function serializeLegacyFormat(e){var t=new SshWriter;t.writeString(e.algorithm);t.writeUint32(e.signature.length);t.writeBytes(e.signature);return t.toUint8Array()}var SshObject=function(){function e(){}return e}();var SshPublicKey=function(e){__extends(t,e);function t(r){var i=e.call(this)||this;i.type=t.TYPE;i.blob=r;return i}t.prototype.getCryptoKey=function(){return __awaiter(this,arguments,void 0,(function(e){var t,r;if(e===void 0){e=getCrypto()}return __generator(this,(function(i){switch(i.label){case 0:if(!!this.cachedCryptoKey)return[3,2];t=AlgorithmRegistry.get(this.blob.type);r=this;return[4,t.importPublicSsh({blob:this.blob.keyData,crypto:e})];case 1:r.cachedCryptoKey=i.sent();i.label=2;case 2:return[2,this.cachedCryptoKey]}}))}))};t.fromSSH=function(e){return __awaiter(this,arguments,void 0,(function(e,r){var i,n;if(r===void 0){r=getCrypto()}return __generator(this,(function(o){switch(o.label){case 0:i=parsePublicKey(e);n=AlgorithmRegistry.get(i.type);return[4,n.importPublicSsh({blob:i.keyData,crypto:r})];case 1:o.sent();return[2,new t(i)]}}))}))};t.fromSPKI=function(e,r){return __awaiter(this,arguments,void 0,(function(e,r,i){var n,o,a,s;if(i===void 0){i=getCrypto()}return __generator(this,(function(c){switch(c.label){case 0:n=AlgorithmRegistry.get(r);return[4,n.importPublicSpki({spki:e,crypto:i})];case 1:o=c.sent();return[4,n.exportPublicSsh({publicKey:o,crypto:i})];case 2:a=c.sent();s={type:r,keyData:a};return[2,new t(s)]}}))}))};t.fromWebCrypto=function(e,r){return __awaiter(this,arguments,void 0,(function(e,r,i){var n,o,a,s;if(i===void 0){i=getCrypto()}return __generator(this,(function(c){switch(c.label){case 0:n=r||AlgorithmRegistry.getSshTypeFromCryptoKey(e);o=AlgorithmRegistry.get(n);return[4,o.exportPublicSsh({publicKey:e,crypto:i})];case 1:a=c.sent();s={type:n,keyData:a};return[2,new t(s)]}}))}))};t.prototype.export=function(){return __awaiter(this,arguments,void 0,(function(e,t){var r,i,n;if(e===void 0){e="ssh"}if(t===void 0){t=getCrypto()}return __generator(this,(function(o){switch(o.label){case 0:if(!(e==="ssh"))return[3,1];return[2,serializePublicKey(this.blob)];case 1:if(!(e==="spki"))return[3,4];return[4,this.getCryptoKey(t)];case 2:r=o.sent();i=AlgorithmRegistry.get(this.blob.type);return[4,i.exportPublicSpki({publicKey:r,crypto:t})];case 3:n=o.sent();return[2,new Uint8Array(n)];case 4:throw new UnsupportedKeyTypeError("Unsupported export format: ".concat(e))}}))}))};t.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.export("ssh")];case 1:e=t.sent();return[2,e]}}))}))};t.prototype.toSPKI=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.export("spki")];case 1:e=t.sent();return[2,e]}}))}))};t.prototype.toWebCrypto=function(){return __awaiter(this,arguments,void 0,(function(e){if(e===void 0){e=getCrypto()}return __generator(this,(function(t){return[2,this.getCryptoKey(e)]}))}))};t.prototype.verify=function(e,t,r){return __awaiter(this,arguments,void 0,(function(e,t,r,i){var n,o;if(i===void 0){i=getCrypto()}return __generator(this,(function(a){switch(a.label){case 0:n=AlgorithmRegistry.get(e);return[4,this.toWebCrypto(i)];case 1:o=a.sent();return[2,n.verify({publicKey:o,signature:t,data:r,crypto:i})]}}))}))};Object.defineProperty(t.prototype,"keyType",{get:function(){return this.blob.type},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"comment",{get:function(){return this.blob.comment},enumerable:false,configurable:true});t.prototype.getBlob=function(){return __assign({},this.blob)};t.prototype.thumbprint=function(){return __awaiter(this,arguments,void 0,(function(e,t){var r,i,n;if(e===void 0){e="sha256"}if(t===void 0){t=getCrypto()}return __generator(this,(function(o){switch(o.label){case 0:r=e==="sha256"?"SHA-256":"SHA-512";i=this.blob.keyData;return[4,t.subtle.digest(r,i)];case 1:n=o.sent();return[2,new Uint8Array(n)]}}))}))};t.TYPE="public-key";return t}(SshObject);var SshSignature=function(e){__extends(t,e);function t(r){var i=e.call(this)||this;i.type=t.TYPE;i.blob=r;i.format=r.format;i.algorithm=r.algorithm;i.signature=r.signature;i.version=r.version;i.namespace=r.namespace;i.reserved=r.reserved;i.hashAlgorithm=r.hashAlgorithm;if(r.publicKey){var n=new SshReader(r.publicKey);var o=n.readString();i.publicKey=new SshPublicKey({type:o,keyData:r.publicKey})}return i}t.parse=function(e){var r=parseSignature(e);return new t(r)};t.fromBlob=function(e){return new t(e)};t.fromBase64=function(e){var r=new Uint8Array(buildExports.Convert.FromBase64(e));return t.parse(r)};t.fromText=function(e){var r=e.replace(/-----BEGIN SSH SIGNATURE-----/,"").replace(/-----END SSH SIGNATURE-----/,"").replace(/[\r\n\s]/g,"");return t.fromBase64(r)};t.prototype.serialize=function(){return serializeSignature(this.blob)};t.prototype.toBase64=function(){return buildExports.Convert.ToBase64(this.serialize())};t.prototype.toText=function(){var e=this.toBase64();var t=[];for(var r=0;r<e.length;r+=70){t.push(e.substring(r,r+70))}return __spreadArray(__spreadArray(["-----BEGIN SSH SIGNATURE-----"],t,true),["-----END SSH SIGNATURE-----"],false).join("\n")};t.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.toText()]}))}))};t.prototype.verify=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,i,n,o,a,s,c,u,p,f,d,l,y,v,h,A;return __generator(this,(function(_){switch(_.label){case 0:r=AlgorithmRegistry.get(this.algorithm);return[4,t["getCryptoKey"]()];case 1:i=_.sent();n=getCrypto();o=e;if(!(this.format==="ssh-signature"))return[3,3];a=this.hashAlgorithm||"sha512";s=this.namespace||"file";c=this.reserved||"";u=a==="sha256"?"SHA-256":"SHA-512";return[4,n.subtle.digest(u,e)];case 2:p=_.sent();f=new Uint8Array(p);d=new SshWriter;d.writeBytes((new TextEncoder).encode("SSHSIG"));d.writeString(s);d.writeString(c);d.writeString(a);d.writeUint32(f.length);d.writeBytes(f);o=d.toUint8Array();_.label=3;case 3:if(this.algorithm==="rsa-sha2-256"){l="SHA-256"}else if(this.algorithm==="rsa-sha2-512"){l="SHA-512"}if(this.format==="legacy"||this.format==="ssh-signature"){v=new SshWriter;v.writeString(this.algorithm);v.writeUint32(this.signature.length);v.writeBytes(this.signature);h=v.toUint8Array();A=r.decodeSignature({signature:h});y=A.signature}else{y=this.signature}return[2,r.verify({publicKey:i,signature:y,data:o,crypto:n,hash:l})]}}))}))};t.fromLegacy=function(e,r){var i=AlgorithmRegistry.get(e);var n=i.encodeSignature({signature:r,algo:e});var o=new SshReader(n);o.readString();var a=o.readUint32();var s=o.readBytes(a);return new t({format:"legacy",algorithm:e,signature:s})};t.fromSshSignature=function(e,r,i){if(i===void 0){i={}}var n={format:"ssh-signature",algorithm:e,signature:r,version:i.version||1,publicKey:i.publicKey?i.publicKey.getBlob().keyData:undefined,namespace:i.namespace||"file",reserved:i.reserved||"",hashAlgorithm:i.hashAlgorithm||"sha512"};return new t(n)};t.sign=function(e,r,i){return __awaiter(this,arguments,void 0,(function(e,r,i,n){var o,a,s,c,u,p,f,d,l,y,v,h,A,_,S,g,u,m,C,P,T;if(n===void 0){n={}}return __generator(this,(function(E){switch(E.label){case 0:o=n.format,a=o===void 0?"legacy":o,s=n.namespace,c=s===void 0?"file":s;if(!(a==="legacy"))return[3,2];return[4,r.sign(e,i)];case 1:u=E.sent();p=e||r.keyType;return[2,t.fromLegacy(p,u)];case 2:f=e;d=AlgorithmRegistry.get(f);l=e==="rsa-sha2-256"?"sha256":"sha512";return[4,r.getPublicKey()];case 3:y=E.sent();v=getCrypto();h=l==="sha256"?"SHA-256":"SHA-512";return[4,v.subtle.digest(h,i)];case 4:A=E.sent();_=new Uint8Array(A);S=new SshWriter;S.writeBytes((new TextEncoder).encode("SSHSIG"));S.writeString(c);S.writeString("");S.writeString(l);S.writeUint32(_.length);S.writeBytes(_);g=S.toUint8Array();return[4,r.sign(f,g)];case 5:u=E.sent();m=d.encodeSignature({signature:u,algo:f});C=new SshReader(m);C.readString();P=C.readUint32();T=C.readBytes(P);return[2,t.fromSshSignature(f,T,{namespace:c,hashAlgorithm:l,publicKey:y})]}}))}))};t.TYPE="signature";return t}(SshObject);var SshCertificate$1=(_e=function(e){__extends(t,e);function t(t){var r=e.call(this)||this;r.type=_e.TYPE;r._blob=t;r.data=parseCertificateData(t.keyData);r._validAfter=r.data.validAfter;r._validBefore=r.data.validBefore;r.keyId=r.data.keyId;r.principals=r.data.validPrincipals;r.certType=r.data.type;r.serial=r.data.serial;r.validAfter=new Date(Number(r.data.validAfter)*1e3);r.validBefore=new Date(Number(r.data.validBefore)*1e3);r.publicKey=new SshPublicKey(r.data.publicKey);r.signatureKey=new SshPublicKey(r.data.signatureKey);r.criticalOptions=__assign({},r.data.criticalOptions);r.extensions=__assign({},r.data.extensions);return r}t.fromSSH=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=parse(e);return[2,new _e(t)]}))}))};t.fromBlob=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,new _e(e)]}))}))};t.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,serialize(this._blob)]}))}))};t.prototype.toBlob=function(){return __assign({},this._blob)};Object.defineProperty(t.prototype,"blob",{get:function(){return this.toBlob()},enumerable:false,configurable:true});t.prototype.validate=function(e){if(e===void 0){e=new Date}var t=BigInt(Math.floor(e.getTime()/1e3));var r=this._validAfter;var i=this._validBefore;var n=0xffffffffffffffffn;var o=i===n?t:i;return t>=r&&t<=o};t.prototype.verify=function(e){return __awaiter(this,arguments,void 0,(function(e,t){var r,i,n,o,a;if(t===void 0){t=getCrypto()}return __generator(this,(function(s){switch(s.label){case 0:r=e||this.signatureKey;i=this.getSignedData();n=SshSignature.parse(this.data.signature);o=AlgorithmRegistry.get(n.algorithm);return[4,r.toWebCrypto(t)];case 1:a=s.sent();return[2,o.verify({publicKey:a,signature:n.signature,data:i,crypto:t})]}}))}))};t.prototype.getSignedData=function(){var e=new SshReader(this._blob.keyData);e.readString();e.readBytes(e.readUint32());if(this.data.keyType==="ssh-ed25519"){e.readBytes(e.readUint32())}else if(this.data.keyType==="ssh-rsa"){e.readBytes(e.readUint32());e.readBytes(e.readUint32())}else if(this.data.keyType.startsWith("ecdsa-sha2-")){e.readString();e.readBytes(e.readUint32())}e.readUint64();e.readUint32();e.readBytes(e.readUint32());e.readBytes(e.readUint32());e.readUint64();e.readUint64();e.readBytes(e.readUint32());e.readBytes(e.readUint32());e.readBytes(e.readUint32());e.readBytes(e.readUint32());var t=e.getOffset();return this._blob.keyData.slice(0,t)};return t}(SshObject),_e.TYPE="certificate",_e);var __classPrivateFieldSet=undefined&&undefined.__classPrivateFieldSet||function(e,t,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(e,r):n?n.value=r:t.set(e,r),r};var __classPrivateFieldGet=undefined&&undefined.__classPrivateFieldGet||function(e,t,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(e):i?i.value:t.get(e)};var _SshCertificate_cert;var SshCertificate=function(){function e(e){_SshCertificate_cert.set(this,void 0);var t=parse(buildExports.Convert.isBase64Url(e.trim())?buildExports.Convert.ToString(buildExports.Convert.FromBase64Url(e.trim())):e.trim());__classPrivateFieldSet(this,_SshCertificate_cert,new SshCertificate$1(t),"f");this.notBefore=__classPrivateFieldGet(this,_SshCertificate_cert,"f").validAfter;this.notAfter=__classPrivateFieldGet(this,_SshCertificate_cert,"f").validBefore;this.validity=dateDiff(this.notBefore,this.notAfter);this.type=[__classPrivateFieldGet(this,_SshCertificate_cert,"f").blob.type,__classPrivateFieldGet(this,_SshCertificate_cert,"f").certType,__classPrivateFieldGet(this,_SshCertificate_cert,"f").type].join(" ");this.serialNumber=__classPrivateFieldGet(this,_SshCertificate_cert,"f").serial.toString();this.keyId=__classPrivateFieldGet(this,_SshCertificate_cert,"f").keyId;this.principals=__classPrivateFieldGet(this,_SshCertificate_cert,"f").principals;this.extensions=__classPrivateFieldGet(this,_SshCertificate_cert,"f").extensions;this.criticalOptions=__classPrivateFieldGet(this,_SshCertificate_cert,"f").criticalOptions}e.prototype.parseSignatureKey=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,i;var n;return __generator(this,(function(o){switch(o.label){case 0:return[4,__classPrivateFieldGet(this,_SshCertificate_cert,"f").signatureKey.toWebCrypto()];case 1:e=o.sent();t=__classPrivateFieldGet(this,_SshCertificate_cert,"f").signatureKey.getBlob();return[4,__classPrivateFieldGet(this,_SshCertificate_cert,"f").signatureKey.thumbprint("sha256")];case 2:r=o.sent();i=this;n={algorithm:e.algorithm.name,type:t.type};return[4,__classPrivateFieldGet(this,_SshCertificate_cert,"f").signatureKey.toSSH()];case 3:i.signatureKey=(n.value=o.sent(),n.thumbprint=buildExports.Convert.ToBase64(r),n);return[2]}}))}))};e.prototype.parsePublicKey=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,i;var n;return __generator(this,(function(o){switch(o.label){case 0:return[4,__classPrivateFieldGet(this,_SshCertificate_cert,"f").publicKey.toWebCrypto()];case 1:e=o.sent();t=__classPrivateFieldGet(this,_SshCertificate_cert,"f").publicKey.getBlob();return[4,__classPrivateFieldGet(this,_SshCertificate_cert,"f").publicKey.thumbprint("sha256")];case 2:r=o.sent();i=this;n={algorithm:e.algorithm.name,type:t.type};return[4,__classPrivateFieldGet(this,_SshCertificate_cert,"f").publicKey.toSSH()];case 3:i.publicKey=(n.value=o.sent(),n.thumbprint=buildExports.Convert.ToBase64(r),n);return[2]}}))}))};e.prototype.toString=function(){return __awaiter(this,arguments,void 0,(function(e){var t;if(e===void 0){e="pem"}return __generator(this,(function(r){switch(r.label){case 0:if(!(e==="base64url"))return[3,2];return[4,__classPrivateFieldGet(this,_SshCertificate_cert,"f").toSSH()];case 1:t=r.sent();return[2,buildExports.Convert.ToBase64Url(buildExports.Convert.FromString(t))];case 2:return[2,__classPrivateFieldGet(this,_SshCertificate_cert,"f").toSSH()]}}))}))};Object.defineProperty(e.prototype,"commonName",{get:function(){return __classPrivateFieldGet(this,_SshCertificate_cert,"f").principals.join("_")||__classPrivateFieldGet(this,_SshCertificate_cert,"f").keyId||__classPrivateFieldGet(this,_SshCertificate_cert,"f").certType},enumerable:false,configurable:true});e.prototype.downloadAsPub=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(i){switch(i.label){case 0:r=(t=Download.certSSH).asPub;return[4,this.toString()];case 1:r.apply(t,[i.sent(),e||[this.commonName,"cert"].join("-")]);return[2]}}))}))};return e}();_SshCertificate_cert=new WeakMap;export{OIDs as $,AsnData as A,id_pkcs9_at_extensionRequest as B,Certificate as C,Download as D,ECParameters as E,id_pkcs9_at_unstructuredName as F,id_pkcs9_at_challengePassword as G,id_ValuationRanking as H,InsuranceValue as I,id_InsuranceValue as J,id_WebGDPR as K,id_ActivityDescription as L,id_TypeRelationship as M,Name as N,id_DomainNameTechnicalOperator as O,PemConverter as P,id_DomainNameOwner as Q,RSAPublicKey as R,id_DomainNameLegalRepresentative as S,TypeRelationship as T,UnstructuredName as U,ValuationRanking as V,WebGDPR as W,id_DomainNameBeneficiary as X,CertificationRequest as Y,l10n as Z,dateShort as _,dateDiff as a,id_ce_subjectDirectoryAttributes as a$,OctetString as a0,ByteStream as a1,SignedCertificateTimestamp as a2,Extension$1 as a3,CabforganizationIdentifier as a4,NonStandardKeyDescription as a5,BaseCRLNumber as a6,CRLNumber as a7,SubjectInfoAccessSyntax as a8,TNAuthorizationList as a9,IssuingDistributionPoint as aA,CRLDistributionPoints as aB,CertificatePolicies as aC,CertificateIssuer as aD,BasicConstraints as aE,AuthorityKeyIdentifier as aF,AuthorityInfoAccessSyntax as aG,id_cabforganizationIdentifier as aH,id_ce_keyDescription as aI,id_ce_deltaCRLIndicator as aJ,id_ce_cRLNumber as aK,id_pe_subjectInfoAccess as aL,id_pe_TNAuthList as aM,id_pe_biometricInfo as aN,id_entrust_entrustVersInfo as aO,id_ce_privateKeyUsagePeriod as aP,id_adbe_archiveRevInfo as aQ,id_adbe_timestamp as aR,id_role as aS,id_lei as aT,id_caVersion as aU,id_netscapeCertType as aV,id_netscapeComment as aW,id_enrollCertType as aX,id_certificateTemplate as aY,id_pe_qcStatements as aZ,id_ce_subjectKeyIdentifier as a_,LogotypeExtn as aa,BiometricSyntax as ab,EntrustVersionInfo as ac,PrivateKeyUsagePeriod as ad,ArchiveRevInfo as ae,Timestamp as af,LeiRole as ag,LeiChoice as ah,CaVersion as ai,NetscapeCertType as aj,NetscapeComment as ak,EnrollCertTypeChoice as al,CertificateTemplate as am,QCStatements as an,SubjectKeyIdentifier as ao,SubjectDirectoryAttributes as ap,SubjectAlternativeName as aq,PolicyMappings as ar,PolicyConstraints as as,NameConstraints as at,KeyUsage as au,IssueAlternativeName as av,InvalidityDate as aw,InhibitAnyPolicy as ax,ExtendedKeyUsage as ay,CRLReason as az,buildExports as b,id_ce_subjectAltName as b0,id_ce_policyMappings as b1,id_ce_policyConstraints as b2,id_ce_nameConstraints as b3,id_ce_keyUsage as b4,id_ce_issuerAltName as b5,id_ce_invalidityDate as b6,id_ce_inhibitAnyPolicy as b7,id_ce_extKeyUsage as b8,id_ce_cRLReasons as b9,AsnIntegerArrayBufferConverter as bA,AttestationApplicationId as bB,RootOfTrust as bC,IntegerSet as bD,id_ce_issuingDistributionPoint as ba,id_ce_cRLDistributionPoints as bb,id_ce_certificatePolicies as bc,id_ce_certificateIssuer as bd,id_ce_basicConstraints as be,id_ce_authorityKeyIdentifier as bf,id_pe_authorityInfoAccess as bg,SignedData as bh,EncapsulatedContent as bi,CertificateSet as bj,CertificateChoices as bk,ContentInfo as bl,SshCertificate as bm,Name$1 as bn,OtherName as bo,DisplayText as bp,UserNotice as bq,EDIPartyName as br,__decorate$1 as bs,AsnProp as bt,AsnPropTypes as bu,AsnType as bv,AsnTypeTypes as bw,AsnArray as bx,id_qcs_pkixQCSyntax_v2 as by,SemanticsInformation as bz,certificateRawToBuffer as c,downloadFromBuffer as d,AsnConvert as e,id_rsaEncryption as f,id_composite_key as g,CompositePublicKey as h,id_ecPublicKey as i,id_alg_composite as j,CompositeSignatureValue as k,CompositeParams as l,getCertificateThumbprint as m,AttributeCertificate as n,CertificateList as o,Attribute$1 as p,AsnParser as q,PrivateKeyPossessionStatement as r,ExtensionRequest as s,ChallengePassword as t,ActivityDescription as u,DomainNameTechnicalOperator as v,DomainNameOwner as w,DomainNameLegalRepresentative as x,DomainNameBeneficiary as y,id_at_statementOfPossession as z};
|
|
135
|
+
//# sourceMappingURL=ssh_certificate-CmOVFH_Z.js.map
|