@peculiar/certificates-viewer 4.3.2 → 4.5.0

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