@peculiar/certificates-viewer 4.3.1 → 4.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (362) hide show
  1. package/components/attribute-certificate-viewer.js +5 -5
  2. package/components/attribute-certificate-viewer.js.map +1 -1
  3. package/components/attribute.js +1 -1
  4. package/components/certificate-chain-viewer.js +66 -0
  5. package/components/certificate-chain-viewer.js.map +1 -0
  6. package/components/certificate-viewer.js +5 -5
  7. package/components/certificate-viewer.js.map +1 -1
  8. package/components/circular-progress.js +3 -3
  9. package/components/crl-viewer.js +5 -5
  10. package/components/crl-viewer.js.map +1 -1
  11. package/components/download.js +185 -45
  12. package/components/download.js.map +1 -1
  13. package/components/highlight-words.js +1 -1
  14. package/components/index2.js +1 -1
  15. package/components/issuer_name.js +1 -1
  16. package/components/miscellaneous.js +1 -1
  17. package/components/miscellaneous.js.map +1 -1
  18. package/components/peculiar-certificate-chain-viewer.d.ts +11 -0
  19. package/components/peculiar-certificate-chain-viewer.js +11 -0
  20. package/components/peculiar-certificate-chain-viewer.js.map +1 -0
  21. package/components/peculiar-certificate-decoder.js +105 -19
  22. package/components/peculiar-certificate-decoder.js.map +1 -1
  23. package/components/peculiar-certificates-viewer.js +2 -2
  24. package/components/peculiar-certificates-viewer.js.map +1 -1
  25. package/components/peculiar-text-hider.js +1 -1
  26. package/components/pkcs10_certificate_request.js +5 -5
  27. package/components/pkcs10_certificate_request.js.map +1 -1
  28. package/components/subject_name.js +1 -1
  29. package/dist/cjs/{actions-789906f5.js → actions-64ce3326.js} +2 -2
  30. package/dist/cjs/{actions-789906f5.js.map → actions-64ce3326.js.map} +1 -1
  31. package/dist/cjs/{arrow_top-76e4261e.js → arrow_top-b9b9f280.js} +2 -2
  32. package/dist/cjs/{arrow_top-76e4261e.js.map → arrow_top-b9b9f280.js.map} +1 -1
  33. package/dist/cjs/{button-87086210.js → button-61bb8305.js} +2 -2
  34. package/dist/cjs/{button-87086210.js.map → button-61bb8305.js.map} +1 -1
  35. package/dist/cjs/{certification_request-ad267278.js → certification_request-393a843d.js} +207 -65
  36. package/dist/cjs/certification_request-393a843d.js.map +1 -0
  37. package/dist/cjs/{cross-bd099933.js → cross-3aeffd04.js} +2 -2
  38. package/dist/cjs/{cross-bd099933.js.map → cross-3aeffd04.js.map} +1 -1
  39. package/dist/cjs/{download-820d66ba.js → download-c2836546.js} +2 -2
  40. package/dist/cjs/{download-820d66ba.js.map → download-c2836546.js.map} +1 -1
  41. package/dist/cjs/index-484a84a0.js +2113 -0
  42. package/dist/cjs/index-484a84a0.js.map +1 -0
  43. package/dist/cjs/index.cjs.js +9 -9
  44. package/dist/cjs/{link-a3d3799d.js → link-dad7195a.js} +3 -3
  45. package/dist/cjs/{link-a3d3799d.js.map → link-dad7195a.js.map} +1 -1
  46. package/dist/cjs/loader.cjs.js +2 -2
  47. package/dist/cjs/{miscellaneous-67439e59.js → miscellaneous-ca06fb81.js} +6 -6
  48. package/dist/cjs/{miscellaneous-67439e59.js.map → miscellaneous-ca06fb81.js.map} +1 -1
  49. package/dist/cjs/{peculiar-attribute-certificate-viewer_3.cjs.entry.js → peculiar-attribute-certificate-viewer_4.cjs.entry.js} +40 -9
  50. package/dist/cjs/peculiar-attribute-certificate-viewer_4.cjs.entry.js.map +1 -0
  51. package/dist/cjs/peculiar-button-menu_3.cjs.entry.js +7 -7
  52. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +101 -21
  53. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -1
  54. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +7 -7
  55. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +8 -8
  56. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +1 -1
  57. package/dist/cjs/peculiar-text-hider.cjs.entry.js +4 -4
  58. package/dist/cjs/peculiar.cjs.js +10 -10
  59. package/dist/cjs/peculiar.cjs.js.map +1 -1
  60. package/dist/cjs/{pkcs10_certificate_request-64898c88.js → pkcs10_certificate_request-56990e4f.js} +6 -6
  61. package/dist/cjs/pkcs10_certificate_request-56990e4f.js.map +1 -0
  62. package/dist/cjs/{x509_certificate-4b0894c2.js → x509_certificate-d162984c.js} +6 -6
  63. package/dist/cjs/x509_certificate-d162984c.js.map +1 -0
  64. package/dist/cjs/{x509_crl-fc8d41a1.js → x509_crl-13322e13.js} +11 -11
  65. package/dist/cjs/x509_crl-13322e13.js.map +1 -0
  66. package/dist/collection/collection-manifest.json +3 -2
  67. package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +14 -0
  68. package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js.map +1 -1
  69. package/dist/collection/components/button-menu/button-menu.js +2 -0
  70. package/dist/collection/components/button-menu/button-menu.js.map +1 -1
  71. package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.css +1019 -0
  72. package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js +101 -0
  73. package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js.map +1 -0
  74. package/dist/collection/components/certificate-decoder/certificate-decoder.css +1 -4
  75. package/dist/collection/components/certificate-decoder/certificate-decoder.js +40 -18
  76. package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
  77. package/dist/collection/components/certificate-details-parts/miscellaneous.js.map +1 -1
  78. package/dist/collection/components/certificate-viewer/certificate-viewer.js +16 -0
  79. package/dist/collection/components/certificate-viewer/certificate-viewer.js.map +1 -1
  80. package/dist/collection/components/certificates-viewer/certificates-viewer.js +9 -1
  81. package/dist/collection/components/certificates-viewer/certificates-viewer.js.map +1 -1
  82. package/dist/collection/components/circular-progress/circular-progress.js +7 -3
  83. package/dist/collection/components/circular-progress/circular-progress.js.map +1 -1
  84. package/dist/collection/components/crl-viewer/crl-viewer.js +12 -0
  85. package/dist/collection/components/crl-viewer/crl-viewer.js.map +1 -1
  86. package/dist/collection/components/csr-viewer/csr-viewer.js +10 -0
  87. package/dist/collection/components/csr-viewer/csr-viewer.js.map +1 -1
  88. package/dist/collection/components/highlight-words/highlight-words.js +3 -1
  89. package/dist/collection/components/highlight-words/highlight-words.js.map +1 -1
  90. package/dist/collection/components/text-hider/text-hider.js +1 -1
  91. package/dist/collection/crypto/index.js +1 -0
  92. package/dist/collection/crypto/index.js.map +1 -1
  93. package/dist/collection/crypto/pem_converter.js +169 -0
  94. package/dist/collection/crypto/pem_converter.js.map +1 -0
  95. package/dist/collection/crypto/pkcs10_certificate_request.js +6 -5
  96. package/dist/collection/crypto/pkcs10_certificate_request.js.map +1 -1
  97. package/dist/collection/crypto/utils.js +18 -21
  98. package/dist/collection/crypto/utils.js.map +1 -1
  99. package/dist/collection/crypto/x509_attribute_certificate.js +6 -5
  100. package/dist/collection/crypto/x509_attribute_certificate.js.map +1 -1
  101. package/dist/collection/crypto/x509_certificate.js +6 -5
  102. package/dist/collection/crypto/x509_certificate.js.map +1 -1
  103. package/dist/collection/crypto/x509_certificates.js +69 -0
  104. package/dist/collection/crypto/x509_certificates.js.map +1 -0
  105. package/dist/collection/crypto/x509_crl.js +6 -5
  106. package/dist/collection/crypto/x509_crl.js.map +1 -1
  107. package/dist/collection/utils/index.js +0 -2
  108. package/dist/collection/utils/index.js.map +1 -1
  109. package/dist/collection/www-copy/index.js +123 -121
  110. package/dist/esm/{actions-aebcbc9d.js → actions-2e39a3b9.js} +2 -2
  111. package/dist/esm/{actions-aebcbc9d.js.map → actions-2e39a3b9.js.map} +1 -1
  112. package/dist/esm/{arrow_top-aee1ee02.js → arrow_top-72c7543a.js} +2 -2
  113. package/dist/esm/{arrow_top-aee1ee02.js.map → arrow_top-72c7543a.js.map} +1 -1
  114. package/dist/esm/{button-a2fabf9a.js → button-e0909687.js} +2 -2
  115. package/dist/esm/{button-a2fabf9a.js.map → button-e0909687.js.map} +1 -1
  116. package/dist/esm/{certification_request-a4699dcf.js → certification_request-714bd438.js} +186 -46
  117. package/dist/esm/certification_request-714bd438.js.map +1 -0
  118. package/dist/esm/{cross-1377606f.js → cross-0c62835f.js} +2 -2
  119. package/dist/esm/{cross-1377606f.js.map → cross-0c62835f.js.map} +1 -1
  120. package/dist/esm/{download-14dc1047.js → download-5686d86f.js} +2 -2
  121. package/dist/esm/{download-14dc1047.js.map → download-5686d86f.js.map} +1 -1
  122. package/dist/esm/index-38365508.js +2084 -0
  123. package/dist/esm/index-38365508.js.map +1 -0
  124. package/dist/esm/index.js +9 -9
  125. package/dist/esm/{link-7e4e9060.js → link-09718951.js} +3 -3
  126. package/dist/esm/{link-7e4e9060.js.map → link-09718951.js.map} +1 -1
  127. package/dist/esm/loader.js +3 -3
  128. package/dist/esm/{miscellaneous-ba1fd2bd.js → miscellaneous-0657d00e.js} +6 -6
  129. package/dist/esm/{miscellaneous-ba1fd2bd.js.map → miscellaneous-0657d00e.js.map} +1 -1
  130. package/dist/esm/{peculiar-attribute-certificate-viewer_3.entry.js → peculiar-attribute-certificate-viewer_4.entry.js} +40 -10
  131. package/dist/esm/peculiar-attribute-certificate-viewer_4.entry.js.map +1 -0
  132. package/dist/esm/peculiar-button-menu_3.entry.js +7 -7
  133. package/dist/esm/peculiar-certificate-decoder.entry.js +101 -21
  134. package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
  135. package/dist/esm/peculiar-certificate-viewer.entry.js +7 -7
  136. package/dist/esm/peculiar-certificates-viewer.entry.js +8 -8
  137. package/dist/esm/peculiar-certificates-viewer.entry.js.map +1 -1
  138. package/dist/esm/peculiar-text-hider.entry.js +4 -4
  139. package/dist/esm/peculiar.js +11 -11
  140. package/dist/esm/peculiar.js.map +1 -1
  141. package/dist/esm/{pkcs10_certificate_request-785a4794.js → pkcs10_certificate_request-d3871050.js} +6 -6
  142. package/dist/esm/pkcs10_certificate_request-d3871050.js.map +1 -0
  143. package/dist/esm/{x509_certificate-05a23c0e.js → x509_certificate-d0d0c5c1.js} +6 -6
  144. package/dist/esm/x509_certificate-d0d0c5c1.js.map +1 -0
  145. package/dist/esm/{x509_crl-26081461.js → x509_crl-e837f4c3.js} +11 -11
  146. package/dist/esm/x509_crl-e837f4c3.js.map +1 -0
  147. package/dist/esm-es5/{actions-aebcbc9d.js → actions-2e39a3b9.js} +2 -2
  148. package/dist/esm-es5/{actions-aebcbc9d.js.map → actions-2e39a3b9.js.map} +1 -1
  149. package/dist/esm-es5/app-globals-5e9b67e0.js.map +1 -1
  150. package/dist/esm-es5/{arrow_top-aee1ee02.js → arrow_top-72c7543a.js} +2 -2
  151. package/dist/esm-es5/{arrow_top-aee1ee02.js.map → arrow_top-72c7543a.js.map} +1 -1
  152. package/dist/esm-es5/{button-a2fabf9a.js → button-e0909687.js} +2 -2
  153. package/dist/esm-es5/{button-a2fabf9a.js.map → button-e0909687.js.map} +1 -1
  154. package/dist/esm-es5/{certification_request-a4699dcf.js → certification_request-714bd438.js} +19 -12
  155. package/dist/esm-es5/certification_request-714bd438.js.map +1 -0
  156. package/dist/esm-es5/{cross-1377606f.js → cross-0c62835f.js} +2 -2
  157. package/dist/esm-es5/{cross-1377606f.js.map → cross-0c62835f.js.map} +1 -1
  158. package/dist/esm-es5/{download-14dc1047.js → download-5686d86f.js} +2 -2
  159. package/dist/esm-es5/{download-14dc1047.js.map → download-5686d86f.js.map} +1 -1
  160. package/dist/esm-es5/index-38365508.js +6 -0
  161. package/dist/esm-es5/index-38365508.js.map +1 -0
  162. package/dist/esm-es5/index.js +1 -1
  163. package/dist/esm-es5/index.js.map +1 -1
  164. package/dist/esm-es5/{link-7e4e9060.js → link-09718951.js} +3 -3
  165. package/dist/esm-es5/{link-7e4e9060.js.map → link-09718951.js.map} +1 -1
  166. package/dist/esm-es5/loader.js +2 -2
  167. package/dist/esm-es5/loader.js.map +1 -1
  168. package/dist/esm-es5/{miscellaneous-ba1fd2bd.js → miscellaneous-0657d00e.js} +2 -2
  169. package/dist/esm-es5/{miscellaneous-ba1fd2bd.js.map → miscellaneous-0657d00e.js.map} +1 -1
  170. package/dist/esm-es5/peculiar-attribute-certificate-viewer_4.entry.js +110 -0
  171. package/dist/esm-es5/peculiar-attribute-certificate-viewer_4.entry.js.map +1 -0
  172. package/dist/esm-es5/peculiar-button-menu_3.entry.js +1 -1
  173. package/dist/esm-es5/peculiar-button-menu_3.entry.js.map +1 -1
  174. package/dist/esm-es5/peculiar-certificate-decoder.entry.js +2 -2
  175. package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -1
  176. package/dist/esm-es5/peculiar-certificate-viewer.entry.js +1 -1
  177. package/dist/esm-es5/peculiar-certificate-viewer.entry.js.map +1 -1
  178. package/dist/esm-es5/peculiar-certificates-viewer.entry.js +2 -2
  179. package/dist/esm-es5/peculiar-certificates-viewer.entry.js.map +1 -1
  180. package/dist/esm-es5/peculiar-text-hider.entry.js +1 -1
  181. package/dist/esm-es5/peculiar-text-hider.entry.js.map +1 -1
  182. package/dist/esm-es5/peculiar.js +2 -2
  183. package/dist/esm-es5/peculiar.js.map +1 -1
  184. package/dist/esm-es5/{pkcs10_certificate_request-785a4794.js → pkcs10_certificate_request-d3871050.js} +3 -3
  185. package/dist/esm-es5/pkcs10_certificate_request-d3871050.js.map +1 -0
  186. package/dist/esm-es5/read_file-bb0b1450.js.map +1 -1
  187. package/dist/esm-es5/x509_certificate-d0d0c5c1.js +12 -0
  188. package/dist/esm-es5/x509_certificate-d0d0c5c1.js.map +1 -0
  189. package/dist/esm-es5/x509_crl-e837f4c3.js +19 -0
  190. package/dist/esm-es5/x509_crl-e837f4c3.js.map +1 -0
  191. package/dist/peculiar/index.esm.js +1 -1
  192. package/dist/peculiar/index.esm.js.map +1 -1
  193. package/dist/peculiar/{p-5a662d6f.system.js → p-02529999.system.js} +2 -2
  194. package/dist/peculiar/{p-5a662d6f.system.js.map → p-02529999.system.js.map} +1 -1
  195. package/dist/peculiar/{p-9263e7ee.system.entry.js → p-04228f9c.system.entry.js} +3 -3
  196. package/dist/peculiar/{p-9263e7ee.system.entry.js.map → p-04228f9c.system.entry.js.map} +1 -1
  197. package/dist/peculiar/{p-1566ad92.system.entry.js → p-12bc3ebc.system.entry.js} +2 -2
  198. package/dist/peculiar/{p-1566ad92.system.entry.js.map → p-12bc3ebc.system.entry.js.map} +1 -1
  199. package/dist/peculiar/{p-afbd1c8e.entry.js → p-161f7f97.entry.js} +2 -2
  200. package/dist/peculiar/{p-afbd1c8e.entry.js.map → p-161f7f97.entry.js.map} +1 -1
  201. package/dist/peculiar/p-25a532a3.js.map +1 -1
  202. package/dist/peculiar/p-32cf293c.system.js +5 -0
  203. package/dist/peculiar/p-32cf293c.system.js.map +1 -0
  204. package/dist/peculiar/{p-2bc2abea.system.js → p-35cd359e.system.js} +2 -2
  205. package/dist/peculiar/{p-2bc2abea.system.js.map → p-35cd359e.system.js.map} +1 -1
  206. package/dist/peculiar/p-39bbe0b9.system.entry.js +5 -0
  207. package/dist/peculiar/{p-b5389885.system.entry.js.map → p-39bbe0b9.system.entry.js.map} +1 -1
  208. package/dist/peculiar/p-41eacbcd.system.entry.js +111 -0
  209. package/dist/peculiar/p-41eacbcd.system.entry.js.map +1 -0
  210. package/dist/peculiar/p-47b7dd9e.entry.js +110 -0
  211. package/dist/peculiar/p-47b7dd9e.entry.js.map +1 -0
  212. package/dist/peculiar/{p-8bbee8f4.system.js → p-4ee5beee.system.js} +2 -2
  213. package/dist/peculiar/{p-8bbee8f4.system.js.map → p-4ee5beee.system.js.map} +1 -1
  214. package/dist/peculiar/p-55303453.system.js.map +1 -1
  215. package/dist/peculiar/{p-ae91d778.js → p-562652dd.js} +2 -2
  216. package/dist/peculiar/{p-ae91d778.js.map → p-562652dd.js.map} +1 -1
  217. package/dist/peculiar/p-5b4db88b.system.js +5 -0
  218. package/dist/peculiar/p-5b4db88b.system.js.map +1 -0
  219. package/dist/peculiar/{p-e4ad4f13.system.entry.js → p-67452b74.system.entry.js} +2 -2
  220. package/dist/peculiar/{p-e4ad4f13.system.entry.js.map → p-67452b74.system.entry.js.map} +1 -1
  221. package/dist/peculiar/p-684b7f0f.system.js +142 -0
  222. package/dist/peculiar/p-684b7f0f.system.js.map +1 -0
  223. package/dist/peculiar/{p-bafd67f3.entry.js → p-6eb92f5a.entry.js} +2 -2
  224. package/dist/peculiar/{p-bafd67f3.entry.js.map → p-6eb92f5a.entry.js.map} +1 -1
  225. package/dist/peculiar/p-8dd6d1ee.entry.js +5 -0
  226. package/dist/peculiar/p-8dd6d1ee.entry.js.map +1 -0
  227. package/dist/peculiar/{p-a9487007.js → p-90c3a063.js} +2 -2
  228. package/dist/peculiar/{p-a9487007.js.map → p-90c3a063.js.map} +1 -1
  229. package/dist/peculiar/{p-6e2ad7eb.js → p-90f461c0.js} +13 -13
  230. package/dist/peculiar/{p-6e2ad7eb.js.map → p-90f461c0.js.map} +1 -1
  231. package/dist/peculiar/{p-99efefea.js → p-92f9641a.js} +2 -2
  232. package/dist/peculiar/{p-99efefea.js.map → p-92f9641a.js.map} +1 -1
  233. package/dist/peculiar/p-93e299aa.system.entry.js +5 -0
  234. package/dist/peculiar/p-93e299aa.system.entry.js.map +1 -0
  235. package/dist/peculiar/p-9987b899.js +19 -0
  236. package/dist/peculiar/{p-4bc5ddbe.js.map → p-9987b899.js.map} +1 -1
  237. package/dist/peculiar/p-9b64adaa.system.js +13 -0
  238. package/dist/peculiar/p-9b64adaa.system.js.map +1 -0
  239. package/dist/peculiar/{p-243244af.system.js → p-9ca02302.system.js} +2 -2
  240. package/dist/peculiar/{p-243244af.system.js.map → p-9ca02302.system.js.map} +1 -1
  241. package/dist/peculiar/p-a1adb881.js +6 -0
  242. package/dist/peculiar/p-a1adb881.js.map +1 -0
  243. package/dist/peculiar/{p-eea904d7.system.js → p-a3054d6e.system.js} +2 -2
  244. package/dist/peculiar/{p-eea904d7.system.js.map → p-a3054d6e.system.js.map} +1 -1
  245. package/dist/peculiar/{p-32807e5e.js → p-a55fd6f1.js} +19 -12
  246. package/dist/peculiar/p-a55fd6f1.js.map +1 -0
  247. package/dist/peculiar/p-a87e1a0e.js +12 -0
  248. package/dist/peculiar/{p-e6a6e602.js.map → p-a87e1a0e.js.map} +1 -1
  249. package/dist/peculiar/p-a9ea6c79.system.js +20 -0
  250. package/dist/peculiar/p-a9ea6c79.system.js.map +1 -0
  251. package/dist/peculiar/{p-67e82386.entry.js → p-b01c70cf.entry.js} +3 -3
  252. package/dist/peculiar/{p-67e82386.entry.js.map → p-b01c70cf.entry.js.map} +1 -1
  253. package/dist/peculiar/p-b5674f82.js +19 -0
  254. package/dist/peculiar/p-b5674f82.js.map +1 -0
  255. package/dist/peculiar/{p-27ca6743.js → p-ba3dfc03.js} +2 -2
  256. package/dist/peculiar/{p-27ca6743.js.map → p-ba3dfc03.js.map} +1 -1
  257. package/dist/peculiar/p-bc91996c.system.js +6 -0
  258. package/dist/peculiar/p-bc91996c.system.js.map +1 -0
  259. package/dist/peculiar/p-c2995a63.system.js.map +1 -1
  260. package/dist/peculiar/p-c5d3333c.system.js +19 -0
  261. package/dist/peculiar/p-c5d3333c.system.js.map +1 -0
  262. package/dist/peculiar/p-cb8a0b79.js +19 -0
  263. package/dist/peculiar/p-cb8a0b79.js.map +1 -0
  264. package/dist/peculiar/{p-c241e4ba.system.js → p-d46670fa.system.js} +2 -2
  265. package/dist/peculiar/{p-c241e4ba.system.js.map → p-d46670fa.system.js.map} +1 -1
  266. package/dist/peculiar/{p-9712b827.system.js → p-d9145ee8.system.js} +2 -2
  267. package/dist/peculiar/{p-9712b827.system.js.map → p-d9145ee8.system.js.map} +1 -1
  268. package/dist/peculiar/p-dac867e8.js.map +1 -1
  269. package/dist/peculiar/p-f456fe47.js +12 -0
  270. package/dist/peculiar/p-f456fe47.js.map +1 -0
  271. package/dist/peculiar/p-f6ec61db.entry.js +5 -0
  272. package/dist/peculiar/{p-713563fb.entry.js.map → p-f6ec61db.entry.js.map} +1 -1
  273. package/dist/peculiar/peculiar.esm.js +1 -1
  274. package/dist/peculiar/peculiar.esm.js.map +1 -1
  275. package/dist/peculiar/peculiar.js +1 -1
  276. package/dist/types/components/certificate-chain-viewer/certificate-chain-viewer.d.ts +21 -0
  277. package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +5 -4
  278. package/dist/types/components/certificate-details-parts/miscellaneous.d.ts +2 -2
  279. package/dist/types/components/typography/typography.d.ts +0 -1
  280. package/dist/types/components.d.ts +33 -4
  281. package/dist/types/crypto/index.d.ts +1 -0
  282. package/dist/types/crypto/pem_converter.d.ts +71 -0
  283. package/dist/types/crypto/pkcs10_certificate_request.d.ts +2 -2
  284. package/dist/types/crypto/utils.d.ts +7 -3
  285. package/dist/types/crypto/x509_attribute_certificate.d.ts +2 -2
  286. package/dist/types/crypto/x509_certificate.d.ts +2 -2
  287. package/dist/types/crypto/x509_certificates.d.ts +9 -0
  288. package/dist/types/crypto/x509_crl.d.ts +2 -2
  289. package/dist/types/stencil-public-runtime.d.ts +9 -10
  290. package/dist/types/utils/index.d.ts +0 -2
  291. package/hydrate/index.d.ts +36 -12
  292. package/hydrate/index.js +25131 -15090
  293. package/hydrate/index.mjs +34931 -0
  294. package/hydrate/package.json +7 -1
  295. package/loader/cdn.js +1 -1
  296. package/loader/index.cjs.js +1 -1
  297. package/loader/index.d.ts +3 -0
  298. package/loader/index.es2017.js +1 -1
  299. package/loader/index.js +1 -1
  300. package/package.json +13 -10
  301. package/dist/cjs/certification_request-ad267278.js.map +0 -1
  302. package/dist/cjs/index-e2ae280a.js +0 -2730
  303. package/dist/cjs/index-e2ae280a.js.map +0 -1
  304. package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js.map +0 -1
  305. package/dist/cjs/pkcs10_certificate_request-64898c88.js.map +0 -1
  306. package/dist/cjs/x509_certificate-4b0894c2.js.map +0 -1
  307. package/dist/cjs/x509_crl-fc8d41a1.js.map +0 -1
  308. package/dist/collection/utils/validator.js +0 -25
  309. package/dist/collection/utils/validator.js.map +0 -1
  310. package/dist/esm/certification_request-a4699dcf.js.map +0 -1
  311. package/dist/esm/index-ae188432.js +0 -2701
  312. package/dist/esm/index-ae188432.js.map +0 -1
  313. package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js.map +0 -1
  314. package/dist/esm/pkcs10_certificate_request-785a4794.js.map +0 -1
  315. package/dist/esm/x509_certificate-05a23c0e.js.map +0 -1
  316. package/dist/esm/x509_crl-26081461.js.map +0 -1
  317. package/dist/esm-es5/certification_request-a4699dcf.js.map +0 -1
  318. package/dist/esm-es5/index-ae188432.js +0 -6
  319. package/dist/esm-es5/index-ae188432.js.map +0 -1
  320. package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +0 -110
  321. package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js.map +0 -1
  322. package/dist/esm-es5/pkcs10_certificate_request-785a4794.js.map +0 -1
  323. package/dist/esm-es5/x509_certificate-05a23c0e.js +0 -12
  324. package/dist/esm-es5/x509_certificate-05a23c0e.js.map +0 -1
  325. package/dist/esm-es5/x509_crl-26081461.js +0 -19
  326. package/dist/esm-es5/x509_crl-26081461.js.map +0 -1
  327. package/dist/peculiar/p-32807e5e.js.map +0 -1
  328. package/dist/peculiar/p-3cb79cd9.js +0 -6
  329. package/dist/peculiar/p-3cb79cd9.js.map +0 -1
  330. package/dist/peculiar/p-4bc5ddbe.js +0 -19
  331. package/dist/peculiar/p-5d1d4a96.entry.js +0 -110
  332. package/dist/peculiar/p-5d1d4a96.entry.js.map +0 -1
  333. package/dist/peculiar/p-713563fb.entry.js +0 -5
  334. package/dist/peculiar/p-7ddd9a82.system.js +0 -19
  335. package/dist/peculiar/p-7ddd9a82.system.js.map +0 -1
  336. package/dist/peculiar/p-821bdcdc.system.js +0 -6
  337. package/dist/peculiar/p-821bdcdc.system.js.map +0 -1
  338. package/dist/peculiar/p-8393399a.system.js +0 -5
  339. package/dist/peculiar/p-8393399a.system.js.map +0 -1
  340. package/dist/peculiar/p-98e3a016.system.js +0 -13
  341. package/dist/peculiar/p-98e3a016.system.js.map +0 -1
  342. package/dist/peculiar/p-9ad547d2.system.entry.js +0 -5
  343. package/dist/peculiar/p-9ad547d2.system.entry.js.map +0 -1
  344. package/dist/peculiar/p-a1a48332.system.js +0 -5
  345. package/dist/peculiar/p-a1a48332.system.js.map +0 -1
  346. package/dist/peculiar/p-ab5a4988.js +0 -12
  347. package/dist/peculiar/p-ab5a4988.js.map +0 -1
  348. package/dist/peculiar/p-ae44c2b0.system.js +0 -20
  349. package/dist/peculiar/p-ae44c2b0.system.js.map +0 -1
  350. package/dist/peculiar/p-b5389885.system.entry.js +0 -5
  351. package/dist/peculiar/p-cd1b1876.entry.js +0 -5
  352. package/dist/peculiar/p-cd1b1876.entry.js.map +0 -1
  353. package/dist/peculiar/p-d5ba4fc2.js +0 -19
  354. package/dist/peculiar/p-d5ba4fc2.js.map +0 -1
  355. package/dist/peculiar/p-e37e4df2.system.js +0 -135
  356. package/dist/peculiar/p-e37e4df2.system.js.map +0 -1
  357. package/dist/peculiar/p-e6a6e602.js +0 -12
  358. package/dist/peculiar/p-f8c91ee4.js +0 -19
  359. package/dist/peculiar/p-f8c91ee4.js.map +0 -1
  360. package/dist/peculiar/p-f9c07207.system.entry.js +0 -111
  361. package/dist/peculiar/p-f9c07207.system.entry.js.map +0 -1
  362. package/dist/types/utils/validator.d.ts +0 -10
@@ -12,7 +12,7 @@ var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setP
12
12
  /*!
13
13
  * MIT License
14
14
  *
15
- * Copyright (c) 2017-2022 Peculiar Ventures, LLC
15
+ * Copyright (c) 2017-2024 Peculiar Ventures, LLC
16
16
  *
17
17
  * Permission is hereby granted, free of charge, to any person obtaining a copy
18
18
  * of this software and associated documentation files (the "Software"), to deal
@@ -32,7 +32,7 @@ var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setP
32
32
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
33
  * SOFTWARE.
34
34
  *
35
- */var ARRAY_BUFFER_NAME="[object ArrayBuffer]";var BufferSourceConverter=function(){function e(){}e.isArrayBuffer=function(e){return Object.prototype.toString.call(e)===ARRAY_BUFFER_NAME};e.toArrayBuffer=function(e){if(this.isArrayBuffer(e)){return e}if(e.byteLength===e.buffer.byteLength){return e.buffer}if(e.byteOffset===0&&e.byteLength===e.buffer.byteLength){return e.buffer}return this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer};e.toUint8Array=function(e){return this.toView(e,Uint8Array)};e.toView=function(e,t){if(e.constructor===t){return e}if(this.isArrayBuffer(e)){return new t(e)}if(this.isArrayBufferView(e)){return new t(e.buffer,e.byteOffset,e.byteLength)}throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")};e.isBufferSource=function(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)};e.isArrayBufferView=function(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)};e.isEqual=function(t,r){var i=e.toUint8Array(t);var n=e.toUint8Array(r);if(i.length!==n.byteLength){return false}for(var o=0;o<i.length;o++){if(i[o]!==n[o]){return false}}return true};e.concat=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}var r;if(Array.isArray(e[0])&&!(e[1]instanceof Function)){r=e[0]}else if(Array.isArray(e[0])&&e[1]instanceof Function){r=e[0]}else{if(e[e.length-1]instanceof Function){r=e.slice(0,e.length-1)}else{r=e}}var i=0;for(var n=0,o=r;n<o.length;n++){var a=o[n];i+=a.byteLength}var s=new Uint8Array(i);var c=0;for(var u=0,p=r;u<p.length;u++){var a=p[u];var f=this.toUint8Array(a);s.set(f,c);c+=f.length}if(e[e.length-1]instanceof Function){return this.toView(s,e[e.length-1])}return s.buffer};return e}();var STRING_TYPE="string";var HEX_REGEX=/^[0-9a-f]+$/i;var BASE64_REGEX=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;var BASE64URL_REGEX=/^[a-zA-Z0-9-_]+$/;var Utf8Converter=function(){function e(){}e.fromString=function(e){var t=unescape(encodeURIComponent(e));var r=new Uint8Array(t.length);for(var i=0;i<t.length;i++){r[i]=t.charCodeAt(i)}return r.buffer};e.toString=function(e){var t=BufferSourceConverter.toUint8Array(e);var r="";for(var i=0;i<t.length;i++){r+=String.fromCharCode(t[i])}var n=decodeURIComponent(escape(r));return n};return e}();var Utf16Converter=function(){function e(){}e.toString=function(e,t){if(t===void 0){t=false}var r=BufferSourceConverter.toArrayBuffer(e);var i=new DataView(r);var n="";for(var o=0;o<r.byteLength;o+=2){var a=i.getUint16(o,t);n+=String.fromCharCode(a)}return n};e.fromString=function(e,t){if(t===void 0){t=false}var r=new ArrayBuffer(e.length*2);var i=new DataView(r);for(var n=0;n<e.length;n++){i.setUint16(n*2,e.charCodeAt(n),t)}return r};return e}();var Convert=function(){function e(){}e.isHex=function(e){return typeof e===STRING_TYPE&&HEX_REGEX.test(e)};e.isBase64=function(e){return typeof e===STRING_TYPE&&BASE64_REGEX.test(e)};e.isBase64Url=function(e){return typeof e===STRING_TYPE&&BASE64URL_REGEX.test(e)};e.ToString=function(e,t){if(t===void 0){t="utf8"}var r=BufferSourceConverter.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(r);case"binary":return this.ToBinary(r);case"hex":return this.ToHex(r);case"base64":return this.ToBase64(r);case"base64url":return this.ToBase64Url(r);case"utf16le":return Utf16Converter.toString(r,true);case"utf16":case"utf16be":return Utf16Converter.toString(r);default:throw new Error("Unknown type of encoding '".concat(t,"'"))}};e.FromString=function(e,t){if(t===void 0){t="utf8"}if(!e){return new ArrayBuffer(0)}switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return Utf16Converter.fromString(e,true);case"utf16":case"utf16be":return Utf16Converter.fromString(e);default:throw new Error("Unknown type of encoding '".concat(t,"'"))}};e.ToBase64=function(e){var t=BufferSourceConverter.toUint8Array(e);if(typeof btoa!=="undefined"){var r=this.ToString(t,"binary");return btoa(r)}else{return Buffer.from(t).toString("base64")}};e.FromBase64=function(t){var r=this.formatString(t);if(!r){return new ArrayBuffer(0)}if(!e.isBase64(r)){throw new TypeError("Argument 'base64Text' is not Base64 encoded")}if(typeof atob!=="undefined"){return this.FromBinary(atob(r))}else{return new Uint8Array(Buffer.from(r,"base64")).buffer}};e.FromBase64Url=function(t){var r=this.formatString(t);if(!r){return new ArrayBuffer(0)}if(!e.isBase64Url(r)){throw new TypeError("Argument 'base64url' is not Base64Url encoded")}return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))};e.ToBase64Url=function(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")};e.FromUtf8String=function(t,r){if(r===void 0){r=e.DEFAULT_UTF8_ENCODING}switch(r){case"ascii":return this.FromBinary(t);case"utf8":return Utf8Converter.fromString(t);case"utf16":case"utf16be":return Utf16Converter.fromString(t);case"utf16le":case"usc2":return Utf16Converter.fromString(t,true);default:throw new Error("Unknown type of encoding '".concat(r,"'"))}};e.ToUtf8String=function(t,r){if(r===void 0){r=e.DEFAULT_UTF8_ENCODING}switch(r){case"ascii":return this.ToBinary(t);case"utf8":return Utf8Converter.toString(t);case"utf16":case"utf16be":return Utf16Converter.toString(t);case"utf16le":case"usc2":return Utf16Converter.toString(t,true);default:throw new Error("Unknown type of encoding '".concat(r,"'"))}};e.FromBinary=function(e){var t=e.length;var r=new Uint8Array(t);for(var i=0;i<t;i++){r[i]=e.charCodeAt(i)}return r.buffer};e.ToBinary=function(e){var t=BufferSourceConverter.toUint8Array(e);var r="";for(var i=0;i<t.length;i++){r+=String.fromCharCode(t[i])}return r};e.ToHex=function(e){var t=BufferSourceConverter.toUint8Array(e);var r="";var i=t.length;for(var n=0;n<i;n++){var o=t[n];if(o<16){r+="0"}r+=o.toString(16)}return r};e.FromHex=function(t){var r=this.formatString(t);if(!r){return new ArrayBuffer(0)}if(!e.isHex(r)){throw new TypeError("Argument 'hexString' is not HEX encoded")}if(r.length%2){r="0".concat(r)}var i=new Uint8Array(r.length/2);for(var n=0;n<r.length;n=n+2){var o=r.slice(n,n+2);i[n/2]=parseInt(o,16)}return i.buffer};e.ToUtf16String=function(e,t){if(t===void 0){t=false}return Utf16Converter.toString(e,t)};e.FromUtf16String=function(e,t){if(t===void 0){t=false}return Utf16Converter.fromString(e,t)};e.Base64Padding=function(e){var t=4-e.length%4;if(t<4){for(var r=0;r<t;r++){e+="="}}return e};e.formatString=function(e){return(e===null||e===void 0?void 0:e.replace(/[\n\r\t ]/g,""))||""};return e}();Convert.DEFAULT_UTF8_ENCODING="utf8";function isEqual(e,t){if(!(e&&t)){return false}if(e.byteLength!==t.byteLength){return false}var r=new Uint8Array(e);var i=new Uint8Array(t);for(var n=0;n<e.byteLength;n++){if(r[n]!==i[n]){return false}}return true}var BufferSourceConverter_1=BufferSourceConverter;var Convert_1=Convert;var isEqual_1=isEqual;
35
+ */var ARRAY_BUFFER_NAME="[object ArrayBuffer]";var BufferSourceConverter=function(){function e(){}e.isArrayBuffer=function(e){return Object.prototype.toString.call(e)===ARRAY_BUFFER_NAME};e.toArrayBuffer=function(e){if(this.isArrayBuffer(e)){return e}if(e.byteLength===e.buffer.byteLength){return e.buffer}if(e.byteOffset===0&&e.byteLength===e.buffer.byteLength){return e.buffer}return this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer};e.toUint8Array=function(e){return this.toView(e,Uint8Array)};e.toView=function(e,t){if(e.constructor===t){return e}if(this.isArrayBuffer(e)){return new t(e)}if(this.isArrayBufferView(e)){return new t(e.buffer,e.byteOffset,e.byteLength)}throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")};e.isBufferSource=function(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)};e.isArrayBufferView=function(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)};e.isEqual=function(t,r){var i=e.toUint8Array(t);var n=e.toUint8Array(r);if(i.length!==n.byteLength){return false}for(var o=0;o<i.length;o++){if(i[o]!==n[o]){return false}}return true};e.concat=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}var r;if(Array.isArray(e[0])&&!(e[1]instanceof Function)){r=e[0]}else if(Array.isArray(e[0])&&e[1]instanceof Function){r=e[0]}else{if(e[e.length-1]instanceof Function){r=e.slice(0,e.length-1)}else{r=e}}var i=0;for(var n=0,o=r;n<o.length;n++){var a=o[n];i+=a.byteLength}var s=new Uint8Array(i);var c=0;for(var u=0,p=r;u<p.length;u++){var a=p[u];var f=this.toUint8Array(a);s.set(f,c);c+=f.length}if(e[e.length-1]instanceof Function){return this.toView(s,e[e.length-1])}return s.buffer};return e}();var STRING_TYPE="string";var HEX_REGEX=/^[0-9a-f\s]+$/i;var BASE64_REGEX=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;var BASE64URL_REGEX=/^[a-zA-Z0-9-_]+$/;var Utf8Converter=function(){function e(){}e.fromString=function(e){var t=unescape(encodeURIComponent(e));var r=new Uint8Array(t.length);for(var i=0;i<t.length;i++){r[i]=t.charCodeAt(i)}return r.buffer};e.toString=function(e){var t=BufferSourceConverter.toUint8Array(e);var r="";for(var i=0;i<t.length;i++){r+=String.fromCharCode(t[i])}var n=decodeURIComponent(escape(r));return n};return e}();var Utf16Converter=function(){function e(){}e.toString=function(e,t){if(t===void 0){t=false}var r=BufferSourceConverter.toArrayBuffer(e);var i=new DataView(r);var n="";for(var o=0;o<r.byteLength;o+=2){var a=i.getUint16(o,t);n+=String.fromCharCode(a)}return n};e.fromString=function(e,t){if(t===void 0){t=false}var r=new ArrayBuffer(e.length*2);var i=new DataView(r);for(var n=0;n<e.length;n++){i.setUint16(n*2,e.charCodeAt(n),t)}return r};return e}();var Convert=function(){function e(){}e.isHex=function(e){return typeof e===STRING_TYPE&&HEX_REGEX.test(e)};e.isBase64=function(e){return typeof e===STRING_TYPE&&BASE64_REGEX.test(e)};e.isBase64Url=function(e){return typeof e===STRING_TYPE&&BASE64URL_REGEX.test(e)};e.ToString=function(e,t){if(t===void 0){t="utf8"}var r=BufferSourceConverter.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(r);case"binary":return this.ToBinary(r);case"hex":return this.ToHex(r);case"base64":return this.ToBase64(r);case"base64url":return this.ToBase64Url(r);case"utf16le":return Utf16Converter.toString(r,true);case"utf16":case"utf16be":return Utf16Converter.toString(r);default:throw new Error("Unknown type of encoding '".concat(t,"'"))}};e.FromString=function(e,t){if(t===void 0){t="utf8"}if(!e){return new ArrayBuffer(0)}switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return Utf16Converter.fromString(e,true);case"utf16":case"utf16be":return Utf16Converter.fromString(e);default:throw new Error("Unknown type of encoding '".concat(t,"'"))}};e.ToBase64=function(e){var t=BufferSourceConverter.toUint8Array(e);if(typeof btoa!=="undefined"){var r=this.ToString(t,"binary");return btoa(r)}else{return Buffer.from(t).toString("base64")}};e.FromBase64=function(t){var r=this.formatString(t);if(!r){return new ArrayBuffer(0)}if(!e.isBase64(r)){throw new TypeError("Argument 'base64Text' is not Base64 encoded")}if(typeof atob!=="undefined"){return this.FromBinary(atob(r))}else{return new Uint8Array(Buffer.from(r,"base64")).buffer}};e.FromBase64Url=function(t){var r=this.formatString(t);if(!r){return new ArrayBuffer(0)}if(!e.isBase64Url(r)){throw new TypeError("Argument 'base64url' is not Base64Url encoded")}return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))};e.ToBase64Url=function(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")};e.FromUtf8String=function(t,r){if(r===void 0){r=e.DEFAULT_UTF8_ENCODING}switch(r){case"ascii":return this.FromBinary(t);case"utf8":return Utf8Converter.fromString(t);case"utf16":case"utf16be":return Utf16Converter.fromString(t);case"utf16le":case"usc2":return Utf16Converter.fromString(t,true);default:throw new Error("Unknown type of encoding '".concat(r,"'"))}};e.ToUtf8String=function(t,r){if(r===void 0){r=e.DEFAULT_UTF8_ENCODING}switch(r){case"ascii":return this.ToBinary(t);case"utf8":return Utf8Converter.toString(t);case"utf16":case"utf16be":return Utf16Converter.toString(t);case"utf16le":case"usc2":return Utf16Converter.toString(t,true);default:throw new Error("Unknown type of encoding '".concat(r,"'"))}};e.FromBinary=function(e){var t=e.length;var r=new Uint8Array(t);for(var i=0;i<t;i++){r[i]=e.charCodeAt(i)}return r.buffer};e.ToBinary=function(e){var t=BufferSourceConverter.toUint8Array(e);var r="";for(var i=0;i<t.length;i++){r+=String.fromCharCode(t[i])}return r};e.ToHex=function(e){var t=BufferSourceConverter.toUint8Array(e);var r="";var i=t.length;for(var n=0;n<i;n++){var o=t[n];if(o<16){r+="0"}r+=o.toString(16)}return r};e.FromHex=function(t){var r=this.formatString(t);if(!r){return new ArrayBuffer(0)}if(!e.isHex(r)){throw new TypeError("Argument 'hexString' is not HEX encoded")}if(r.length%2){r="0".concat(r)}var i=new Uint8Array(r.length/2);for(var n=0;n<r.length;n=n+2){var o=r.slice(n,n+2);i[n/2]=parseInt(o,16)}return i.buffer};e.ToUtf16String=function(e,t){if(t===void 0){t=false}return Utf16Converter.toString(e,t)};e.FromUtf16String=function(e,t){if(t===void 0){t=false}return Utf16Converter.fromString(e,t)};e.Base64Padding=function(e){var t=4-e.length%4;if(t<4){for(var r=0;r<t;r++){e+="="}}return e};e.formatString=function(e){return(e===null||e===void 0?void 0:e.replace(/[\n\r\t ]/g,""))||""};return e}();Convert.DEFAULT_UTF8_ENCODING="utf8";function isEqual(e,t){if(!(e&&t)){return false}if(e.byteLength!==t.byteLength){return false}var r=new Uint8Array(e);var i=new Uint8Array(t);for(var n=0;n<e.byteLength;n++){if(r[n]!==i[n]){return false}}return true}var BufferSourceConverter_1=BufferSourceConverter;var Convert_1=Convert;var isEqual_1=isEqual;
36
36
  /**
37
37
  * @license
38
38
  * Copyright (c) Peculiar Ventures, LLC.
@@ -75,14 +75,7 @@ var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setP
75
75
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
76
76
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
77
77
  *
78
- */function assertBigInt(){if(typeof BigInt==="undefined"){throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}}function concat(e){var t=0;var r=0;for(var i=0;i<e.length;i++){var n=e[i];t+=n.byteLength}var o=new Uint8Array(t);for(var i=0;i<e.length;i++){var n=e[i];o.set(new Uint8Array(n),r);r+=n.byteLength}return o.buffer}function checkBufferParams(e,t,r,i){if(!(t instanceof Uint8Array)){e.error="Wrong parameter: inputBuffer must be 'Uint8Array'";return false}if(!t.byteLength){e.error="Wrong parameter: inputBuffer has zero length";return false}if(r<0){e.error="Wrong parameter: inputOffset less than zero";return false}if(i<0){e.error="Wrong parameter: inputLength less than zero";return false}if(t.byteLength-r-i<0){e.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return false}return true}var ViewWriter=function(){function e(){this.items=[]}e.prototype.write=function(e){this.items.push(e)};e.prototype.final=function(){return concat(this.items)};return e}();var powers2=[new Uint8Array([1])];var digitsString="0123456789";var NAME="name";var VALUE_HEX_VIEW="valueHexView";var IS_HEX_ONLY="isHexOnly";var ID_BLOCK="idBlock";var TAG_CLASS="tagClass";var TAG_NUMBER="tagNumber";var IS_CONSTRUCTED="isConstructed";var FROM_BER="fromBER";var TO_BER="toBER";var LOCAL="local";var EMPTY_STRING="";var EMPTY_BUFFER=new ArrayBuffer(0);var EMPTY_VIEW=new Uint8Array(0);var END_OF_CONTENT_NAME="EndOfContent";var OCTET_STRING_NAME="OCTET STRING";var BIT_STRING_NAME="BIT STRING";function HexBlock(e){var t;return t=function(e){__extends(t,e);function t(){var t=[];for(var r=0;r<arguments.length;r++){t[r]=arguments[r]}var i;var n=e.apply(this,t)||this;var o=t[0]||{};n.isHexOnly=(i=o.isHexOnly)!==null&&i!==void 0?i:false;n.valueHexView=o.valueHex?BufferSourceConverter_1.toUint8Array(o.valueHex):EMPTY_VIEW;return n}Object.defineProperty(t.prototype,"valueHex",{get:function(){return this.valueHexView.slice().buffer},set:function(e){this.valueHexView=new Uint8Array(e)},enumerable:false,configurable:true});t.prototype.fromBER=function(e,t,r){var i=e instanceof ArrayBuffer?new Uint8Array(e):e;if(!checkBufferParams(this,i,t,r)){return-1}var n=t+r;this.valueHexView=i.subarray(t,n);if(!this.valueHexView.length){this.warnings.push("Zero buffer length");return t}this.blockLength=r;return n};t.prototype.toBER=function(e){if(e===void 0){e=false}if(!this.isHexOnly){this.error="Flag 'isHexOnly' is not set, abort";return EMPTY_BUFFER}if(e){return new ArrayBuffer(this.valueHexView.byteLength)}return this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{isHexOnly:this.isHexOnly,valueHex:Convert_1.ToHex(this.valueHexView)})};return t}(e),t.NAME="hexBlock",t}var LocalBaseBlock=function(){function e(e){var t=e===void 0?{}:e,r=t.blockLength,i=r===void 0?0:r,n=t.error,o=n===void 0?EMPTY_STRING:n,a=t.warnings,s=a===void 0?[]:a,c=t.valueBeforeDecode,u=c===void 0?EMPTY_VIEW:c;this.blockLength=i;this.error=o;this.warnings=s;this.valueBeforeDecodeView=BufferSourceConverter_1.toUint8Array(u)}e.blockName=function(){return this.NAME};Object.defineProperty(e.prototype,"valueBeforeDecode",{get:function(){return this.valueBeforeDecodeView.slice().buffer},set:function(e){this.valueBeforeDecodeView=new Uint8Array(e)},enumerable:false,configurable:true});e.prototype.toJSON=function(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:Convert_1.ToHex(this.valueBeforeDecodeView)}};return e}();LocalBaseBlock.NAME="baseBlock";var ValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBER=function(e,t,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")};t.prototype.toBER=function(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")};return t}(LocalBaseBlock);ValueBlock.NAME="valueBlock";var LocalIdentificationBlock=function(e){__extends(t,e);function t(t){var r=t===void 0?{}:t,i=r.idBlock,n=i===void 0?{}:i;var o,a,s,c;var u=e.call(this)||this;if(n){u.isHexOnly=(o=n.isHexOnly)!==null&&o!==void 0?o:false;u.valueHexView=n.valueHex?BufferSourceConverter_1.toUint8Array(n.valueHex):EMPTY_VIEW;u.tagClass=(a=n.tagClass)!==null&&a!==void 0?a:-1;u.tagNumber=(s=n.tagNumber)!==null&&s!==void 0?s:-1;u.isConstructed=(c=n.isConstructed)!==null&&c!==void 0?c:false}else{u.tagClass=-1;u.tagNumber=-1;u.isConstructed=false}return u}t.prototype.toBER=function(e){if(e===void 0){e=false}var t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:this.error="Unknown tag class";return EMPTY_BUFFER}if(this.isConstructed)t|=32;if(this.tagNumber<31&&!this.isHexOnly){var r=new Uint8Array(1);if(!e){var i=this.tagNumber;i&=31;t|=i;r[0]=t}return r.buffer}if(!this.isHexOnly){var n=utilToBase(this.tagNumber,7);var o=new Uint8Array(n);var a=n.byteLength;var s=new Uint8Array(a+1);s[0]=t|31;if(!e){for(var c=0;c<a-1;c++)s[c+1]=o[c]|128;s[a]=o[a-1]}return s.buffer}var u=new Uint8Array(this.valueHexView.byteLength+1);u[0]=t|31;if(!e){var p=this.valueHexView;for(var c=0;c<p.length-1;c++)u[c+1]=p[c]|128;u[this.valueHexView.byteLength]=p[p.length-1]}return u.buffer};t.prototype.fromBER=function(e,t,r){var i=BufferSourceConverter_1.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}var n=i.subarray(t,t+r);if(n.length===0){this.error="Zero buffer length";return-1}var o=n[0]&192;switch(o){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:this.error="Unknown tag class";return-1}this.isConstructed=(n[0]&32)===32;this.isHexOnly=false;var a=n[0]&31;if(a!==31){this.tagNumber=a;this.blockLength=1}else{var s=1;var c=this.valueHexView=new Uint8Array(255);var u=255;while(n[s]&128){c[s-1]=n[s]&127;s++;if(s>=n.length){this.error="End of input reached before message was fully decoded";return-1}if(s===u){u+=255;var p=new Uint8Array(u);for(var f=0;f<c.length;f++)p[f]=c[f];c=this.valueHexView=new Uint8Array(u)}}this.blockLength=s+1;c[s-1]=n[s]&127;var d=new Uint8Array(s);for(var f=0;f<s;f++)d[f]=c[f];c=this.valueHexView=new Uint8Array(s);c.set(d);if(this.blockLength<=9)this.tagNumber=utilFromBase(c,7);else{this.isHexOnly=true;this.warnings.push("Tag too long, represented as hex-coded")}}if(this.tagClass===1&&this.isConstructed){switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:this.error="Constructed encoding used for primitive type";return-1}}return t+this.blockLength};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed})};return t}(HexBlock(LocalBaseBlock));LocalIdentificationBlock.NAME="identificationBlock";var LocalLengthBlock=function(e){__extends(t,e);function t(t){var r=t===void 0?{}:t,i=r.lenBlock,n=i===void 0?{}:i;var o,a,s;var c=e.call(this)||this;c.isIndefiniteForm=(o=n.isIndefiniteForm)!==null&&o!==void 0?o:false;c.longFormUsed=(a=n.longFormUsed)!==null&&a!==void 0?a:false;c.length=(s=n.length)!==null&&s!==void 0?s:0;return c}t.prototype.fromBER=function(e,t,r){var i=BufferSourceConverter_1.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}var n=i.subarray(t,t+r);if(n.length===0){this.error="Zero buffer length";return-1}if(n[0]===255){this.error="Length block 0xFF is reserved by standard";return-1}this.isIndefiniteForm=n[0]===128;if(this.isIndefiniteForm){this.blockLength=1;return t+this.blockLength}this.longFormUsed=!!(n[0]&128);if(this.longFormUsed===false){this.length=n[0];this.blockLength=1;return t+this.blockLength}var o=n[0]&127;if(o>8){this.error="Too big integer";return-1}if(o+1>n.length){this.error="End of input reached before message was fully decoded";return-1}var a=t+1;var s=i.subarray(a,a+o);if(s[o-1]===0)this.warnings.push("Needlessly long encoded length");this.length=utilFromBase(s,8);if(this.longFormUsed&&this.length<=127)this.warnings.push("Unnecessary usage of long length form");this.blockLength=o+1;return t+this.blockLength};t.prototype.toBER=function(e){if(e===void 0){e=false}var t;var r;if(this.length>127)this.longFormUsed=true;if(this.isIndefiniteForm){t=new ArrayBuffer(1);if(e===false){r=new Uint8Array(t);r[0]=128}return t}if(this.longFormUsed){var i=utilToBase(this.length,8);if(i.byteLength>127){this.error="Too big length";return EMPTY_BUFFER}t=new ArrayBuffer(i.byteLength+1);if(e)return t;var n=new Uint8Array(i);r=new Uint8Array(t);r[0]=i.byteLength|128;for(var o=0;o<i.byteLength;o++)r[o+1]=n[o];return t}t=new ArrayBuffer(1);if(e===false){r=new Uint8Array(t);r[0]=this.length}return t};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length})};return t}(LocalBaseBlock);LocalLengthBlock.NAME="lengthBlock";var typeStore={};var BaseBlock=function(e){__extends(t,e);function t(t,r){if(t===void 0){t={}}var i=this;var n=t.name,o=n===void 0?EMPTY_STRING:n,a=t.optional,s=a===void 0?false:a,c=t.primitiveSchema,u=__rest(t,["name","optional","primitiveSchema"]);i=e.call(this,u)||this;i.name=o;i.optional=s;if(c){i.primitiveSchema=c}i.idBlock=new LocalIdentificationBlock(u);i.lenBlock=new LocalLengthBlock(u);i.valueBlock=r?new r(u):new ValueBlock(u);return i}t.prototype.fromBER=function(e,t,r){var i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);if(i===-1){this.error=this.valueBlock.error;return i}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return i};t.prototype.toBER=function(e,t){var r=t||new ViewWriter;if(!t){prepareIndefiniteForm(this)}var i=this.idBlock.toBER(e);r.write(i);if(this.lenBlock.isIndefiniteForm){r.write(new Uint8Array([128]).buffer);this.valueBlock.toBER(e,r);r.write(new ArrayBuffer(2))}else{var n=this.valueBlock.toBER(e);this.lenBlock.length=n.byteLength;var o=this.lenBlock.toBER(e);r.write(o);r.write(n)}if(!t){return r.final()}return EMPTY_BUFFER};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional});if(this.primitiveSchema)t.primitiveSchema=this.primitiveSchema.toJSON();return t};t.prototype.toString=function(e){if(e===void 0){e="ascii"}if(e==="ascii"){return this.onAsciiEncoding()}return Convert_1.ToHex(this.toBER())};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(Convert_1.ToHex(this.valueBlock.valueBeforeDecodeView))};t.prototype.isEqual=function(e){if(this===e){return true}if(!(e instanceof this.constructor)){return false}var t=this.toBER();var r=e.toBER();return isEqualBuffer(t,r)};return t}(LocalBaseBlock);BaseBlock.NAME="BaseBlock";function prepareIndefiniteForm(e){if(e instanceof typeStore.Constructed){for(var t=0,r=e.valueBlock.value;t<r.length;t++){var i=r[t];if(prepareIndefiniteForm(i)){e.lenBlock.isIndefiniteForm=true}}}return!!e.lenBlock.isIndefiniteForm}var BaseStringBlock=function(e){__extends(t,e);function t(t,r){if(t===void 0){t={}}var i=this;var n=t.value,o=n===void 0?EMPTY_STRING:n,a=__rest(t,["value"]);i=e.call(this,a,r)||this;if(o){i.fromString(o)}return i}t.prototype.getValue=function(){return this.valueBlock.value};t.prototype.setValue=function(e){this.valueBlock.value=e};t.prototype.fromBER=function(e,t,r){var i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);if(i===-1){this.error=this.valueBlock.error;return i}this.fromBuffer(this.valueBlock.valueHexView);if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return i};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : '").concat(this.valueBlock.value,"'")};return t}(BaseBlock);BaseStringBlock.NAME="BaseStringBlock";var LocalPrimitiveValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.isHexOnly,n=i===void 0?true:i,o=__rest(t,["isHexOnly"]);r=e.call(this,o)||this;r.isHexOnly=n;return r}return t}(HexBlock(ValueBlock));LocalPrimitiveValueBlock.NAME="PrimitiveValueBlock";var _a$w;var Primitive=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalPrimitiveValueBlock)||this;r.idBlock.isConstructed=false;return r}return t}(BaseBlock);_a$w=Primitive;(function(){typeStore.Primitive=_a$w})();Primitive.NAME="PRIMITIVE";function localChangeType(e,t){if(e instanceof t){return e}var r=new t;r.idBlock=e.idBlock;r.lenBlock=e.lenBlock;r.warnings=e.warnings;r.valueBeforeDecodeView=e.valueBeforeDecodeView;return r}function localFromBER(e,t,r){if(t===void 0){t=0}if(r===void 0){r=e.length}var i=t;var n=new BaseBlock({},ValueBlock);var o=new LocalBaseBlock;if(!checkBufferParams(o,e,t,r)){n.error=o.error;return{offset:-1,result:n}}var a=e.subarray(t,t+r);if(!a.length){n.error="Zero buffer length";return{offset:-1,result:n}}var s=n.idBlock.fromBER(e,t,r);if(n.idBlock.warnings.length){n.warnings.concat(n.idBlock.warnings)}if(s===-1){n.error=n.idBlock.error;return{offset:-1,result:n}}t=s;r-=n.idBlock.blockLength;s=n.lenBlock.fromBER(e,t,r);if(n.lenBlock.warnings.length){n.warnings.concat(n.lenBlock.warnings)}if(s===-1){n.error=n.lenBlock.error;return{offset:-1,result:n}}t=s;r-=n.lenBlock.blockLength;if(!n.idBlock.isConstructed&&n.lenBlock.isIndefiniteForm){n.error="Indefinite length form used for primitive encoding form";return{offset:-1,result:n}}var c=BaseBlock;switch(n.idBlock.tagClass){case 1:if(n.idBlock.tagNumber>=37&&n.idBlock.isHexOnly===false){n.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard";return{offset:-1,result:n}}switch(n.idBlock.tagNumber){case 0:if(n.idBlock.isConstructed&&n.lenBlock.length>0){n.error="Type [UNIVERSAL 0] is reserved";return{offset:-1,result:n}}c=typeStore.EndOfContent;break;case 1:c=typeStore.Boolean;break;case 2:c=typeStore.Integer;break;case 3:c=typeStore.BitString;break;case 4:c=typeStore.OctetString;break;case 5:c=typeStore.Null;break;case 6:c=typeStore.ObjectIdentifier;break;case 10:c=typeStore.Enumerated;break;case 12:c=typeStore.Utf8String;break;case 13:c=typeStore.RelativeObjectIdentifier;break;case 14:c=typeStore.TIME;break;case 15:n.error="[UNIVERSAL 15] is reserved by ASN.1 standard";return{offset:-1,result:n};case 16:c=typeStore.Sequence;break;case 17:c=typeStore.Set;break;case 18:c=typeStore.NumericString;break;case 19:c=typeStore.PrintableString;break;case 20:c=typeStore.TeletexString;break;case 21:c=typeStore.VideotexString;break;case 22:c=typeStore.IA5String;break;case 23:c=typeStore.UTCTime;break;case 24:c=typeStore.GeneralizedTime;break;case 25:c=typeStore.GraphicString;break;case 26:c=typeStore.VisibleString;break;case 27:c=typeStore.GeneralString;break;case 28:c=typeStore.UniversalString;break;case 29:c=typeStore.CharacterString;break;case 30:c=typeStore.BmpString;break;case 31:c=typeStore.DATE;break;case 32:c=typeStore.TimeOfDay;break;case 33:c=typeStore.DateTime;break;case 34:c=typeStore.Duration;break;default:{var u=n.idBlock.isConstructed?new typeStore.Constructed:new typeStore.Primitive;u.idBlock=n.idBlock;u.lenBlock=n.lenBlock;u.warnings=n.warnings;n=u}}break;case 2:case 3:case 4:default:{c=n.idBlock.isConstructed?typeStore.Constructed:typeStore.Primitive}}n=localChangeType(n,c);s=n.fromBER(e,t,n.lenBlock.isIndefiniteForm?r:n.lenBlock.length);n.valueBeforeDecodeView=e.subarray(i,i+n.blockLength);return{offset:s,result:n}}function fromBER(e){if(!e.byteLength){var t=new BaseBlock({},ValueBlock);t.error="Input buffer has zero length";return{offset:-1,result:t}}return localFromBER(BufferSourceConverter_1.toUint8Array(e).slice(),0,e.byteLength)}function checkLen(e,t){if(e){return 1}return t}var LocalConstructedValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?[]:i,o=t.isIndefiniteForm,a=o===void 0?false:o,s=__rest(t,["value","isIndefiniteForm"]);r=e.call(this,s)||this;r.value=n;r.isIndefiniteForm=a;return r}t.prototype.fromBER=function(e,t,r){var i=BufferSourceConverter_1.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}this.valueBeforeDecodeView=i.subarray(t,t+r);if(this.valueBeforeDecodeView.length===0){this.warnings.push("Zero buffer length");return t}var n=t;while(checkLen(this.isIndefiniteForm,r)>0){var o=localFromBER(i,n,r);if(o.offset===-1){this.error=o.result.error;this.warnings.concat(o.result.warnings);return-1}n=o.offset;this.blockLength+=o.result.blockLength;r-=o.result.blockLength;this.value.push(o.result);if(this.isIndefiniteForm&&o.result.constructor.NAME===END_OF_CONTENT_NAME){break}}if(this.isIndefiniteForm){if(this.value[this.value.length-1].constructor.NAME===END_OF_CONTENT_NAME){this.value.pop()}else{this.warnings.push("No EndOfContent block encoded")}}return n};t.prototype.toBER=function(e,t){var r=t||new ViewWriter;for(var i=0;i<this.value.length;i++){this.value[i].toBER(e,r)}if(!t){return r.final()}return EMPTY_BUFFER};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{isIndefiniteForm:this.isIndefiniteForm,value:[]});for(var r=0,i=this.value;r<i.length;r++){var n=i[r];t.value.push(n.toJSON())}return t};return t}(ValueBlock);LocalConstructedValueBlock.NAME="ConstructedValueBlock";var _a$v;var Constructed=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalConstructedValueBlock)||this;r.idBlock.isConstructed=true;return r}t.prototype.fromBER=function(e,t,r){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;var i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);if(i===-1){this.error=this.valueBlock.error;return i}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return i};t.prototype.onAsciiEncoding=function(){var e=[];for(var t=0,r=this.valueBlock.value;t<r.length;t++){var i=r[t];e.push(i.toString("ascii").split("\n").map((function(e){return" ".concat(e)})).join("\n"))}var n=this.idBlock.tagClass===3?"[".concat(this.idBlock.tagNumber,"]"):this.constructor.NAME;return e.length?"".concat(n," :\n").concat(e.join("\n")):"".concat(n," :")};return t}(BaseBlock);_a$v=Constructed;(function(){typeStore.Constructed=_a$v})();Constructed.NAME="CONSTRUCTED";var LocalEndOfContentValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBER=function(e,t,r){return t};t.prototype.toBER=function(e){return EMPTY_BUFFER};return t}(ValueBlock);LocalEndOfContentValueBlock.override="EndOfContentValueBlock";var _a$u;var EndOfContent=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalEndOfContentValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=0;return r}return t}(BaseBlock);_a$u=EndOfContent;(function(){typeStore.EndOfContent=_a$u})();EndOfContent.NAME=END_OF_CONTENT_NAME;var _a$t;var Null=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,ValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=5;return r}t.prototype.fromBER=function(e,t,r){if(this.lenBlock.length>0)this.warnings.push("Non-zero length of value block for Null type");if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;this.blockLength+=r;if(t+r>e.byteLength){this.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return-1}return t+r};t.prototype.toBER=function(e,t){var r=new ArrayBuffer(2);if(!e){var i=new Uint8Array(r);i[0]=5;i[1]=0}if(t){t.write(r)}return r};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME)};return t}(BaseBlock);_a$t=Null;(function(){typeStore.Null=_a$t})();Null.NAME="NULL";var LocalBooleanValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=__rest(t,["value"]);r=e.call(this,n)||this;if(n.valueHex){r.valueHexView=BufferSourceConverter_1.toUint8Array(n.valueHex)}else{r.valueHexView=new Uint8Array(1)}if(i){r.value=i}return r}Object.defineProperty(t.prototype,"value",{get:function(){for(var e=0,t=this.valueHexView;e<t.length;e++){var r=t[e];if(r>0){return true}}return false},set:function(e){this.valueHexView[0]=e?255:0},enumerable:false,configurable:true});t.prototype.fromBER=function(e,t,r){var i=BufferSourceConverter_1.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}this.valueHexView=i.subarray(t,t+r);if(r>1)this.warnings.push("Boolean value encoded in more then 1 octet");this.isHexOnly=true;utilDecodeTC.call(this);this.blockLength=r;return t+r};t.prototype.toBER=function(){return this.valueHexView.slice()};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.value})};return t}(HexBlock(ValueBlock));LocalBooleanValueBlock.NAME="BooleanValueBlock";var _a$s;var Boolean=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalBooleanValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=1;return r}t.prototype.getValue=function(){return this.valueBlock.value};t.prototype.setValue=function(e){this.valueBlock.value=e};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.getValue)};return t}(BaseBlock);_a$s=Boolean;(function(){typeStore.Boolean=_a$s})();Boolean.NAME="BOOLEAN";var LocalOctetStringValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.isConstructed,n=i===void 0?false:i,o=__rest(t,["isConstructed"]);r=e.call(this,o)||this;r.isConstructed=n;return r}t.prototype.fromBER=function(t,r,i){var n=0;if(this.isConstructed){this.isHexOnly=false;n=LocalConstructedValueBlock.prototype.fromBER.call(this,t,r,i);if(n===-1)return n;for(var o=0;o<this.value.length;o++){var a=this.value[o].constructor.NAME;if(a===END_OF_CONTENT_NAME){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only";return-1}}if(a!==OCTET_STRING_NAME){this.error="OCTET STRING may consists of OCTET STRINGs only";return-1}}}else{this.isHexOnly=true;n=e.prototype.fromBER.call(this,t,r,i);this.blockLength=i}return n};t.prototype.toBER=function(e,t){if(this.isConstructed)return LocalConstructedValueBlock.prototype.toBER.call(this,e,t);return e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{isConstructed:this.isConstructed})};return t}(HexBlock(LocalConstructedValueBlock));LocalOctetStringValueBlock.NAME="OctetStringValueBlock";var _a$r;var OctetString$1=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.idBlock,n=i===void 0?{}:i,o=t.lenBlock,a=o===void 0?{}:o,s=__rest(t,["idBlock","lenBlock"]);var c,u;(c=s.isConstructed)!==null&&c!==void 0?c:s.isConstructed=!!((u=s.value)===null||u===void 0?void 0:u.length);r=e.call(this,__assign({idBlock:__assign({isConstructed:s.isConstructed},n),lenBlock:__assign(__assign({},a),{isIndefiniteForm:!!s.isIndefiniteForm})},s),LocalOctetStringValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=4;return r}t.prototype.fromBER=function(t,r,i){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;if(i===0){if(this.idBlock.error.length===0)this.blockLength+=this.idBlock.blockLength;if(this.lenBlock.error.length===0)this.blockLength+=this.lenBlock.blockLength;return r}if(!this.valueBlock.isConstructed){var n=t instanceof ArrayBuffer?new Uint8Array(t):t;var o=n.subarray(r,r+i);try{if(o.byteLength){var a=localFromBER(o,0,o.byteLength);if(a.offset!==-1&&a.offset===i){this.valueBlock.value=[a.result]}}}catch(e){}}return e.prototype.fromBER.call(this,t,r,i)};t.prototype.onAsciiEncoding=function(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return Constructed.prototype.onAsciiEncoding.call(this)}return"".concat(this.constructor.NAME," : ").concat(Convert_1.ToHex(this.valueBlock.valueHexView))};t.prototype.getValue=function(){if(!this.idBlock.isConstructed){return this.valueBlock.valueHexView.slice().buffer}var e=[];for(var r=0,i=this.valueBlock.value;r<i.length;r++){var n=i[r];if(n instanceof t){e.push(n.valueBlock.valueHexView)}}return BufferSourceConverter_1.concat(e)};return t}(BaseBlock);_a$r=OctetString$1;(function(){typeStore.OctetString=_a$r})();OctetString$1.NAME=OCTET_STRING_NAME;var LocalBitStringValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.unusedBits,n=i===void 0?0:i,o=t.isConstructed,a=o===void 0?false:o,s=__rest(t,["unusedBits","isConstructed"]);r=e.call(this,s)||this;r.unusedBits=n;r.isConstructed=a;r.blockLength=r.valueHexView.byteLength;return r}t.prototype.fromBER=function(e,t,r){if(!r){return t}var i=-1;if(this.isConstructed){i=LocalConstructedValueBlock.prototype.fromBER.call(this,e,t,r);if(i===-1)return i;for(var n=0,o=this.value;n<o.length;n++){var a=o[n];var s=a.constructor.NAME;if(s===END_OF_CONTENT_NAME){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only";return-1}}if(s!==BIT_STRING_NAME){this.error="BIT STRING may consists of BIT STRINGs only";return-1}var c=a.valueBlock;if(this.unusedBits>0&&c.unusedBits>0){this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only';return-1}this.unusedBits=c.unusedBits}return i}var u=BufferSourceConverter_1.toUint8Array(e);if(!checkBufferParams(this,u,t,r)){return-1}var p=u.subarray(t,t+r);this.unusedBits=p[0];if(this.unusedBits>7){this.error="Unused bits for BitString must be in range 0-7";return-1}if(!this.unusedBits){var f=p.subarray(1);try{if(f.byteLength){var d=localFromBER(f,0,f.byteLength);if(d.offset!==-1&&d.offset===r-1){this.value=[d.result]}}}catch(e){}}this.valueHexView=p.subarray(1);this.blockLength=p.length;return t+r};t.prototype.toBER=function(e,t){if(this.isConstructed){return LocalConstructedValueBlock.prototype.toBER.call(this,e,t)}if(e){return new ArrayBuffer(this.valueHexView.byteLength+1)}if(!this.valueHexView.byteLength){return EMPTY_BUFFER}var r=new Uint8Array(this.valueHexView.length+1);r[0]=this.unusedBits;r.set(this.valueHexView,1);return r.buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{unusedBits:this.unusedBits,isConstructed:this.isConstructed})};return t}(HexBlock(LocalConstructedValueBlock));LocalBitStringValueBlock.NAME="BitStringValueBlock";var _a$q;var BitString$1=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.idBlock,n=i===void 0?{}:i,o=t.lenBlock,a=o===void 0?{}:o,s=__rest(t,["idBlock","lenBlock"]);var c,u;(c=s.isConstructed)!==null&&c!==void 0?c:s.isConstructed=!!((u=s.value)===null||u===void 0?void 0:u.length);r=e.call(this,__assign({idBlock:__assign({isConstructed:s.isConstructed},n),lenBlock:__assign(__assign({},a),{isIndefiniteForm:!!s.isIndefiniteForm})},s),LocalBitStringValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=3;return r}t.prototype.fromBER=function(t,r,i){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;return e.prototype.fromBER.call(this,t,r,i)};t.prototype.onAsciiEncoding=function(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return Constructed.prototype.onAsciiEncoding.call(this)}else{var e=[];var t=this.valueBlock.valueHexView;for(var r=0,i=t;r<i.length;r++){var n=i[r];e.push(n.toString(2).padStart(8,"0"))}var o=e.join("");return"".concat(this.constructor.NAME," : ").concat(o.substring(0,o.length-this.valueBlock.unusedBits))}};return t}(BaseBlock);_a$q=BitString$1;(function(){typeStore.BitString=_a$q})();BitString$1.NAME=BIT_STRING_NAME;var _a$p;function viewAdd(e,t){var r=new Uint8Array([0]);var i=new Uint8Array(e);var n=new Uint8Array(t);var o=i.slice(0);var a=o.length-1;var s=n.slice(0);var c=s.length-1;var u=0;var p=c<a?a:c;var f=0;for(var d=p;d>=0;d--,f++){switch(true){case f<s.length:u=o[a-f]+s[c-f]+r[0];break;default:u=o[a-f]+r[0]}r[0]=u/10;switch(true){case f>=o.length:o=utilConcatView(new Uint8Array([u%10]),o);break;default:o[a-f]=u%10}}if(r[0]>0)o=utilConcatView(r,o);return o}function power2(e){if(e>=powers2.length){for(var t=powers2.length;t<=e;t++){var r=new Uint8Array([0]);var i=powers2[t-1].slice(0);for(var n=i.length-1;n>=0;n--){var o=new Uint8Array([(i[n]<<1)+r[0]]);r[0]=o[0]/10;i[n]=o[0]%10}if(r[0]>0)i=utilConcatView(r,i);powers2.push(i)}}return powers2[e]}function viewSub(e,t){var r=0;var i=new Uint8Array(e);var n=new Uint8Array(t);var o=i.slice(0);var a=o.length-1;var s=n.slice(0);var c=s.length-1;var u;var p=0;for(var f=c;f>=0;f--,p++){u=o[a-p]-s[c-p]-r;switch(true){case u<0:r=1;o[a-p]=u+10;break;default:r=0;o[a-p]=u}}if(r>0){for(var f=a-c+1;f>=0;f--,p++){u=o[a-p]-r;if(u<0){r=1;o[a-p]=u+10}else{r=0;o[a-p]=u;break}}}return o.slice()}var LocalIntegerValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=__rest(t,["value"]);r=e.call(this,n)||this;r._valueDec=0;if(n.valueHex){r.setValueHex()}if(i!==undefined){r.valueDec=i}return r}t.prototype.setValueHex=function(){if(this.valueHexView.length>=4){this.warnings.push("Too big Integer for decoding, hex only");this.isHexOnly=true;this._valueDec=0}else{this.isHexOnly=false;if(this.valueHexView.length>0){this._valueDec=utilDecodeTC.call(this)}}};Object.defineProperty(t.prototype,"valueDec",{get:function(){return this._valueDec},set:function(e){this._valueDec=e;this.isHexOnly=false;this.valueHexView=new Uint8Array(utilEncodeTC(e))},enumerable:false,configurable:true});t.prototype.fromDER=function(e,t,r,i){if(i===void 0){i=0}var n=this.fromBER(e,t,r);if(n===-1)return n;var o=this.valueHexView;if(o[0]===0&&(o[1]&128)!==0){this.valueHexView=o.subarray(1)}else{if(i!==0){if(o.length<i){if(i-o.length>1)i=o.length+1;this.valueHexView=o.subarray(i-o.length)}}}return n};t.prototype.toDER=function(e){if(e===void 0){e=false}var t=this.valueHexView;switch(true){case(t[0]&128)!==0:{var r=new Uint8Array(this.valueHexView.length+1);r[0]=0;r.set(t,1);this.valueHexView=r}break;case t[0]===0&&(t[1]&128)===0:{this.valueHexView=this.valueHexView.subarray(1)}break}return this.toBER(e)};t.prototype.fromBER=function(t,r,i){var n=e.prototype.fromBER.call(this,t,r,i);if(n===-1){return n}this.setValueHex();return n};t.prototype.toBER=function(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{valueDec:this.valueDec})};t.prototype.toString=function(){var e=this.valueHexView.length*8-1;var t=new Uint8Array(this.valueHexView.length*8/3);var r=0;var i;var n=this.valueHexView;var o="";var a=false;for(var s=n.byteLength-1;s>=0;s--){i=n[s];for(var c=0;c<8;c++){if((i&1)===1){switch(r){case e:t=viewSub(power2(r),t);o="-";break;default:t=viewAdd(t,power2(r))}}r++;i>>=1}}for(var c=0;c<t.length;c++){if(t[c])a=true;if(a)o+=digitsString.charAt(t[c])}if(a===false)o+=digitsString.charAt(0);return o};return t}(HexBlock(ValueBlock));_a$p=LocalIntegerValueBlock;LocalIntegerValueBlock.NAME="IntegerValueBlock";(function(){Object.defineProperty(_a$p.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e);this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}})})();var _a$o;var Integer=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalIntegerValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=2;return r}t.prototype.toBigInt=function(){assertBigInt();return BigInt(this.valueBlock.toString())};t.fromBigInt=function(e){assertBigInt();var r=BigInt(e);var i=new ViewWriter;var n=r.toString(16).replace(/^-/,"");var o=new Uint8Array(Convert_1.FromHex(n));if(r<0){var a=new Uint8Array(o.length+(o[0]&128?1:0));a[0]|=128;var s=BigInt("0x".concat(Convert_1.ToHex(a)));var c=s+r;var u=BufferSourceConverter_1.toUint8Array(Convert_1.FromHex(c.toString(16)));u[0]|=128;i.write(u)}else{if(o[0]&128){i.write(new Uint8Array([0]))}i.write(o)}var p=new t({valueHex:i.final()});return p};t.prototype.convertToDER=function(){var e=new t({valueHex:this.valueBlock.valueHexView});e.valueBlock.toDER();return e};t.prototype.convertFromDER=function(){return new t({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString())};return t}(BaseBlock);_a$o=Integer;(function(){typeStore.Integer=_a$o})();Integer.NAME="INTEGER";var _a$n;var Enumerated=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=10;return r}return t}(Integer);_a$n=Enumerated;(function(){typeStore.Enumerated=_a$n})();Enumerated.NAME="ENUMERATED";var LocalSidValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.valueDec,n=i===void 0?-1:i,o=t.isFirstSid,a=o===void 0?false:o,s=__rest(t,["valueDec","isFirstSid"]);r=e.call(this,s)||this;r.valueDec=n;r.isFirstSid=a;return r}t.prototype.fromBER=function(e,t,r){if(!r){return t}var i=BufferSourceConverter_1.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}var n=i.subarray(t,t+r);this.valueHexView=new Uint8Array(r);for(var o=0;o<r;o++){this.valueHexView[o]=n[o]&127;this.blockLength++;if((n[o]&128)===0)break}var a=new Uint8Array(this.blockLength);for(var o=0;o<this.blockLength;o++){a[o]=this.valueHexView[o]}this.valueHexView=a;if((n[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=utilFromBase(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return t+this.blockLength};Object.defineProperty(t.prototype,"valueBigInt",{set:function(e){assertBigInt();var t=BigInt(e).toString(2);while(t.length%7){t="0"+t}var r=new Uint8Array(t.length/7);for(var i=0;i<r.length;i++){r[i]=parseInt(t.slice(i*7,i*7+7),2)+(i+1<r.length?128:0)}this.fromBER(r.buffer,0,r.length)},enumerable:false,configurable:true});t.prototype.toBER=function(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);var t=this.valueHexView;var r=new Uint8Array(this.blockLength);for(var i=0;i<this.blockLength-1;i++)r[i]=t[i]|128;r[this.blockLength-1]=t[this.blockLength-1];return r.buffer}var n=utilToBase(this.valueDec,7);if(n.byteLength===0){this.error="Error during encoding SID value";return EMPTY_BUFFER}var o=new Uint8Array(n.byteLength);if(!e){var a=new Uint8Array(n);var s=n.byteLength-1;for(var i=0;i<s;i++)o[i]=a[i]|128;o[s]=a[s]}return o};t.prototype.toString=function(){var e="";if(this.isHexOnly)e=Convert_1.ToHex(this.valueHexView);else{if(this.isFirstSid){var t=this.valueDec;if(this.valueDec<=39)e="0.";else{if(this.valueDec<=79){e="1.";t-=40}else{e="2.";t-=80}}e+=t.toString()}else e=this.valueDec.toString()}return e};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{valueDec:this.valueDec,isFirstSid:this.isFirstSid})};return t}(HexBlock(ValueBlock));LocalSidValueBlock.NAME="sidBlock";var LocalObjectIdentifierValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?EMPTY_STRING:i,o=__rest(t,["value"]);r=e.call(this,o)||this;r.value=[];if(n){r.fromString(n)}return r}t.prototype.fromBER=function(e,t,r){var i=t;while(r>0){var n=new LocalSidValueBlock;i=n.fromBER(e,i,r);if(i===-1){this.blockLength=0;this.error=n.error;return i}if(this.value.length===0)n.isFirstSid=true;this.blockLength+=n.blockLength;r-=n.blockLength;this.value.push(n)}return i};t.prototype.toBER=function(e){var t=[];for(var r=0;r<this.value.length;r++){var i=this.value[r].toBER(e);if(i.byteLength===0){this.error=this.value[r].error;return EMPTY_BUFFER}t.push(i)}return concat(t)};t.prototype.fromString=function(e){this.value=[];var t=0;var r=0;var i="";var n=false;do{r=e.indexOf(".",t);if(r===-1)i=e.substring(t);else i=e.substring(t,r);t=r+1;if(n){var o=this.value[0];var a=0;switch(o.valueDec){case 0:break;case 1:a=40;break;case 2:a=80;break;default:this.value=[];return}var s=parseInt(i,10);if(isNaN(s))return;o.valueDec=s+a;n=false}else{var o=new LocalSidValueBlock;if(i>Number.MAX_SAFE_INTEGER){assertBigInt();var c=BigInt(i);o.valueBigInt=c}else{o.valueDec=parseInt(i,10);if(isNaN(o.valueDec))return}if(!this.value.length){o.isFirstSid=true;n=true}this.value.push(o)}}while(r!==-1)};t.prototype.toString=function(){var e="";var t=false;for(var r=0;r<this.value.length;r++){t=this.value[r].isHexOnly;var i=this.value[r].toString();if(r!==0)e="".concat(e,".");if(t){i="{".concat(i,"}");if(this.value[r].isFirstSid)e="2.{".concat(i," - 80}");else e+=i}else e+=i}return e};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{value:this.toString(),sidArray:[]});for(var r=0;r<this.value.length;r++){t.sidArray.push(this.value[r].toJSON())}return t};return t}(ValueBlock);LocalObjectIdentifierValueBlock.NAME="ObjectIdentifierValueBlock";var _a$m;var ObjectIdentifier=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalObjectIdentifierValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=6;return r}t.prototype.getValue=function(){return this.valueBlock.toString()};t.prototype.setValue=function(e){this.valueBlock.fromString(e)};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString()||"empty")};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.getValue()})};return t}(BaseBlock);_a$m=ObjectIdentifier;(function(){typeStore.ObjectIdentifier=_a$m})();ObjectIdentifier.NAME="OBJECT IDENTIFIER";var LocalRelativeSidValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.valueDec,n=i===void 0?0:i,o=__rest(t,["valueDec"]);r=e.call(this,o)||this;r.valueDec=n;return r}t.prototype.fromBER=function(e,t,r){if(r===0)return t;var i=BufferSourceConverter_1.toUint8Array(e);if(!checkBufferParams(this,i,t,r))return-1;var n=i.subarray(t,t+r);this.valueHexView=new Uint8Array(r);for(var o=0;o<r;o++){this.valueHexView[o]=n[o]&127;this.blockLength++;if((n[o]&128)===0)break}var a=new Uint8Array(this.blockLength);for(var o=0;o<this.blockLength;o++)a[o]=this.valueHexView[o];this.valueHexView=a;if((n[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=utilFromBase(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return t+this.blockLength};t.prototype.toBER=function(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);var t=this.valueHexView;var r=new Uint8Array(this.blockLength);for(var i=0;i<this.blockLength-1;i++)r[i]=t[i]|128;r[this.blockLength-1]=t[this.blockLength-1];return r.buffer}var n=utilToBase(this.valueDec,7);if(n.byteLength===0){this.error="Error during encoding SID value";return EMPTY_BUFFER}var o=new Uint8Array(n.byteLength);if(!e){var a=new Uint8Array(n);var s=n.byteLength-1;for(var i=0;i<s;i++)o[i]=a[i]|128;o[s]=a[s]}return o.buffer};t.prototype.toString=function(){var e="";if(this.isHexOnly)e=Convert_1.ToHex(this.valueHexView);else{e=this.valueDec.toString()}return e};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{valueDec:this.valueDec})};return t}(HexBlock(LocalBaseBlock));LocalRelativeSidValueBlock.NAME="relativeSidBlock";var LocalRelativeObjectIdentifierValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?EMPTY_STRING:i,o=__rest(t,["value"]);r=e.call(this,o)||this;r.value=[];if(n){r.fromString(n)}return r}t.prototype.fromBER=function(e,t,r){var i=t;while(r>0){var n=new LocalRelativeSidValueBlock;i=n.fromBER(e,i,r);if(i===-1){this.blockLength=0;this.error=n.error;return i}this.blockLength+=n.blockLength;r-=n.blockLength;this.value.push(n)}return i};t.prototype.toBER=function(e,t){var r=[];for(var i=0;i<this.value.length;i++){var n=this.value[i].toBER(e);if(n.byteLength===0){this.error=this.value[i].error;return EMPTY_BUFFER}r.push(n)}return concat(r)};t.prototype.fromString=function(e){this.value=[];var t=0;var r=0;var i="";do{r=e.indexOf(".",t);if(r===-1)i=e.substring(t);else i=e.substring(t,r);t=r+1;var n=new LocalRelativeSidValueBlock;n.valueDec=parseInt(i,10);if(isNaN(n.valueDec))return true;this.value.push(n)}while(r!==-1);return true};t.prototype.toString=function(){var e="";var t=false;for(var r=0;r<this.value.length;r++){t=this.value[r].isHexOnly;var i=this.value[r].toString();if(r!==0)e="".concat(e,".");if(t){i="{".concat(i,"}");e+=i}else e+=i}return e};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{value:this.toString(),sidArray:[]});for(var r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t};return t}(ValueBlock);LocalRelativeObjectIdentifierValueBlock.NAME="RelativeObjectIdentifierValueBlock";var _a$l;var RelativeObjectIdentifier=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalRelativeObjectIdentifierValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=13;return r}t.prototype.getValue=function(){return this.valueBlock.toString()};t.prototype.setValue=function(e){this.valueBlock.fromString(e)};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString()||"empty")};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.getValue()})};return t}(BaseBlock);_a$l=RelativeObjectIdentifier;(function(){typeStore.RelativeObjectIdentifier=_a$l})();RelativeObjectIdentifier.NAME="RelativeObjectIdentifier";var _a$k;var Sequence=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=16;return r}return t}(Constructed);_a$k=Sequence;(function(){typeStore.Sequence=_a$k})();Sequence.NAME="SEQUENCE";var _a$j;var Set=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=17;return r}return t}(Constructed);_a$j=Set;(function(){typeStore.Set=_a$j})();Set.NAME="SET";var LocalStringValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=__rest(t,[]);r=e.call(this,i)||this;r.isHexOnly=true;r.value=EMPTY_STRING;return r}t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.value})};return t}(HexBlock(ValueBlock));LocalStringValueBlock.NAME="StringValueBlock";var LocalSimpleStringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(LocalStringValueBlock);LocalSimpleStringValueBlock.NAME="SimpleStringValueBlock";var LocalSimpleStringBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=__rest(t,[]);return e.call(this,r,LocalSimpleStringValueBlock)||this}t.prototype.fromBuffer=function(e){this.valueBlock.value=String.fromCharCode.apply(null,BufferSourceConverter_1.toUint8Array(e))};t.prototype.fromString=function(e){var t=e.length;var r=this.valueBlock.valueHexView=new Uint8Array(t);for(var i=0;i<t;i++)r[i]=e.charCodeAt(i);this.valueBlock.value=e};return t}(BaseStringBlock);LocalSimpleStringBlock.NAME="SIMPLE STRING";var LocalUtf8StringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBuffer=function(e){this.valueBlock.valueHexView=BufferSourceConverter_1.toUint8Array(e);try{this.valueBlock.value=Convert_1.ToUtf8String(e)}catch(t){this.warnings.push('Error during "decodeURIComponent": '.concat(t,", using raw string"));this.valueBlock.value=Convert_1.ToBinary(e)}};t.prototype.fromString=function(e){this.valueBlock.valueHexView=new Uint8Array(Convert_1.FromUtf8String(e));this.valueBlock.value=e};return t}(LocalSimpleStringBlock);LocalUtf8StringValueBlock.NAME="Utf8StringValueBlock";var _a$i;var Utf8String=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=12;return r}return t}(LocalUtf8StringValueBlock);_a$i=Utf8String;(function(){typeStore.Utf8String=_a$i})();Utf8String.NAME="UTF8String";var LocalBmpStringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBuffer=function(e){this.valueBlock.value=Convert_1.ToUtf16String(e);this.valueBlock.valueHexView=BufferSourceConverter_1.toUint8Array(e)};t.prototype.fromString=function(e){this.valueBlock.value=e;this.valueBlock.valueHexView=new Uint8Array(Convert_1.FromUtf16String(e))};return t}(LocalSimpleStringBlock);LocalBmpStringValueBlock.NAME="BmpStringValueBlock";var _a$h;var BmpString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=__rest(t,[]);r=e.call(this,i)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=30;return r}return t}(LocalBmpStringValueBlock);_a$h=BmpString;(function(){typeStore.BmpString=_a$h})();BmpString.NAME="BMPString";var LocalUniversalStringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBuffer=function(e){var t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0);var r=new Uint8Array(t);for(var i=0;i<r.length;i+=4){r[i]=r[i+3];r[i+1]=r[i+2];r[i+2]=0;r[i+3]=0}this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))};t.prototype.fromString=function(e){var t=e.length;var r=this.valueBlock.valueHexView=new Uint8Array(t*4);for(var i=0;i<t;i++){var n=utilToBase(e.charCodeAt(i),8);var o=new Uint8Array(n);if(o.length>4)continue;var a=4-o.length;for(var s=o.length-1;s>=0;s--)r[i*4+s+a]=o[s]}this.valueBlock.value=e};return t}(LocalSimpleStringBlock);LocalUniversalStringValueBlock.NAME="UniversalStringValueBlock";var _a$g;var UniversalString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=__rest(t,[]);r=e.call(this,i)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=28;return r}return t}(LocalUniversalStringValueBlock);_a$g=UniversalString;(function(){typeStore.UniversalString=_a$g})();UniversalString.NAME="UniversalString";var _a$f;var NumericString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=18;return r}return t}(LocalSimpleStringBlock);_a$f=NumericString;(function(){typeStore.NumericString=_a$f})();NumericString.NAME="NumericString";var _a$e;var PrintableString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=19;return r}return t}(LocalSimpleStringBlock);_a$e=PrintableString;(function(){typeStore.PrintableString=_a$e})();PrintableString.NAME="PrintableString";var _a$d;var TeletexString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=20;return r}return t}(LocalSimpleStringBlock);_a$d=TeletexString;(function(){typeStore.TeletexString=_a$d})();TeletexString.NAME="TeletexString";var _a$c;var VideotexString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=21;return r}return t}(LocalSimpleStringBlock);_a$c=VideotexString;(function(){typeStore.VideotexString=_a$c})();VideotexString.NAME="VideotexString";var _a$b;var IA5String=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=22;return r}return t}(LocalSimpleStringBlock);_a$b=IA5String;(function(){typeStore.IA5String=_a$b})();IA5String.NAME="IA5String";var _a$a;var GraphicString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=25;return r}return t}(LocalSimpleStringBlock);_a$a=GraphicString;(function(){typeStore.GraphicString=_a$a})();GraphicString.NAME="GraphicString";var _a$9;var VisibleString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=26;return r}return t}(LocalSimpleStringBlock);_a$9=VisibleString;(function(){typeStore.VisibleString=_a$9})();VisibleString.NAME="VisibleString";var _a$8;var GeneralString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=27;return r}return t}(LocalSimpleStringBlock);_a$8=GeneralString;(function(){typeStore.GeneralString=_a$8})();GeneralString.NAME="GeneralString";var _a$7;var CharacterString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=29;return r}return t}(LocalSimpleStringBlock);_a$7=CharacterString;(function(){typeStore.CharacterString=_a$7})();CharacterString.NAME="CharacterString";var _a$6;var UTCTime=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=t.valueDate,o=__rest(t,["value","valueDate"]);r=e.call(this,o)||this;r.year=0;r.month=0;r.day=0;r.hour=0;r.minute=0;r.second=0;if(i){r.fromString(i);r.valueBlock.valueHexView=new Uint8Array(i.length);for(var a=0;a<i.length;a++)r.valueBlock.valueHexView[a]=i.charCodeAt(a)}if(n){r.fromDate(n);r.valueBlock.valueHexView=new Uint8Array(r.toBuffer())}r.idBlock.tagClass=1;r.idBlock.tagNumber=23;return r}t.prototype.fromBuffer=function(e){this.fromString(String.fromCharCode.apply(null,BufferSourceConverter_1.toUint8Array(e)))};t.prototype.toBuffer=function(){var e=this.toString();var t=new ArrayBuffer(e.length);var r=new Uint8Array(t);for(var i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return t};t.prototype.fromDate=function(e){this.year=e.getUTCFullYear();this.month=e.getUTCMonth()+1;this.day=e.getUTCDate();this.hour=e.getUTCHours();this.minute=e.getUTCMinutes();this.second=e.getUTCSeconds()};t.prototype.toDate=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))};t.prototype.fromString=function(e){var t=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/gi;var r=t.exec(e);if(r===null){this.error="Wrong input string for conversion";return}var i=parseInt(r[1],10);if(i>=50)this.year=1900+i;else this.year=2e3+i;this.month=parseInt(r[2],10);this.day=parseInt(r[3],10);this.hour=parseInt(r[4],10);this.minute=parseInt(r[5],10);this.second=parseInt(r[6],10)};t.prototype.toString=function(t){if(t===void 0){t="iso"}if(t==="iso"){var r=new Array(7);r[0]=padNumber(this.year<2e3?this.year-1900:this.year-2e3,2);r[1]=padNumber(this.month,2);r[2]=padNumber(this.day,2);r[3]=padNumber(this.hour,2);r[4]=padNumber(this.minute,2);r[5]=padNumber(this.second,2);r[6]="Z";return r.join("")}return e.prototype.toString.call(this,t)};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.toDate().toISOString())};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second})};return t}(VisibleString);_a$6=UTCTime;(function(){typeStore.UTCTime=_a$6})();UTCTime.NAME="UTCTime";var _a$5;var GeneralizedTime=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r;var i=e.call(this,t)||this;(r=i.millisecond)!==null&&r!==void 0?r:i.millisecond=0;i.idBlock.tagClass=1;i.idBlock.tagNumber=24;return i}t.prototype.fromDate=function(t){e.prototype.fromDate.call(this,t);this.millisecond=t.getUTCMilliseconds()};t.prototype.toDate=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))};t.prototype.fromString=function(e){var t=false;var r="";var i="";var n=0;var o;var a=0;var s=0;if(e[e.length-1]==="Z"){r=e.substring(0,e.length-1);t=true}else{var c=new Number(e[e.length-1]);if(isNaN(c.valueOf()))throw new Error("Wrong input string for conversion");r=e}if(t){if(r.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(r.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{var u=1;var p=r.indexOf("+");var f="";if(p===-1){p=r.indexOf("-");u=-1}if(p!==-1){f=r.substring(p+1);r=r.substring(0,p);if(f.length!==2&&f.length!==4)throw new Error("Wrong input string for conversion");var c=parseInt(f.substring(0,2),10);if(isNaN(c.valueOf()))throw new Error("Wrong input string for conversion");a=u*c;if(f.length===4){c=parseInt(f.substring(2,4),10);if(isNaN(c.valueOf()))throw new Error("Wrong input string for conversion");s=u*c}}}var d=r.indexOf(".");if(d===-1)d=r.indexOf(",");if(d!==-1){var l=new Number("0".concat(r.substring(d)));if(isNaN(l.valueOf()))throw new Error("Wrong input string for conversion");n=l.valueOf();i=r.substring(0,d)}else i=r;switch(true){case i.length===8:o=/(\d{4})(\d{2})(\d{2})/gi;if(d!==-1)throw new Error("Wrong input string for conversion");break;case i.length===10:o=/(\d{4})(\d{2})(\d{2})(\d{2})/gi;if(d!==-1){var y=60*n;this.minute=Math.floor(y);y=60*(y-this.minute);this.second=Math.floor(y);y=1e3*(y-this.second);this.millisecond=Math.floor(y)}break;case i.length===12:o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(d!==-1){var y=60*n;this.second=Math.floor(y);y=1e3*(y-this.second);this.millisecond=Math.floor(y)}break;case i.length===14:o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(d!==-1){var y=1e3*n;this.millisecond=Math.floor(y)}break;default:throw new Error("Wrong input string for conversion")}var A=o.exec(i);if(A===null)throw new Error("Wrong input string for conversion");for(var v=1;v<A.length;v++){switch(v){case 1:this.year=parseInt(A[v],10);break;case 2:this.month=parseInt(A[v],10);break;case 3:this.day=parseInt(A[v],10);break;case 4:this.hour=parseInt(A[v],10)+a;break;case 5:this.minute=parseInt(A[v],10)+s;break;case 6:this.second=parseInt(A[v],10);break;default:throw new Error("Wrong input string for conversion")}}if(t===false){var h=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=h.getUTCFullYear();this.month=h.getUTCMonth();this.day=h.getUTCDay();this.hour=h.getUTCHours();this.minute=h.getUTCMinutes();this.second=h.getUTCSeconds();this.millisecond=h.getUTCMilliseconds()}};t.prototype.toString=function(t){if(t===void 0){t="iso"}if(t==="iso"){var r=[];r.push(padNumber(this.year,4));r.push(padNumber(this.month,2));r.push(padNumber(this.day,2));r.push(padNumber(this.hour,2));r.push(padNumber(this.minute,2));r.push(padNumber(this.second,2));if(this.millisecond!==0){r.push(".");r.push(padNumber(this.millisecond,3))}r.push("Z");return r.join("")}return e.prototype.toString.call(this,t)};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{millisecond:this.millisecond})};return t}(UTCTime);_a$5=GeneralizedTime;(function(){typeStore.GeneralizedTime=_a$5})();GeneralizedTime.NAME="GeneralizedTime";var _a$4;var DATE=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=31;return r}return t}(Utf8String);_a$4=DATE;(function(){typeStore.DATE=_a$4})();DATE.NAME="DATE";var _a$3;var TimeOfDay=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=32;return r}return t}(Utf8String);_a$3=TimeOfDay;(function(){typeStore.TimeOfDay=_a$3})();TimeOfDay.NAME="TimeOfDay";var _a$2;var DateTime=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=33;return r}return t}(Utf8String);_a$2=DateTime;(function(){typeStore.DateTime=_a$2})();DateTime.NAME="DateTime";var _a$1;var Duration=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=34;return r}return t}(Utf8String);_a$1=Duration;(function(){typeStore.Duration=_a$1})();Duration.NAME="Duration";var _a;var TIME=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=14;return r}return t}(Utf8String);_a=TIME;(function(){typeStore.TIME=_a})();TIME.NAME="TIME";var Any=function(){function e(e){var t=e===void 0?{}:e,r=t.name,i=r===void 0?EMPTY_STRING:r,n=t.optional,o=n===void 0?false:n;this.name=i;this.optional=o}return e}();var Choice=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?[]:i,o=__rest(t,["value"]);r=e.call(this,o)||this;r.value=n;return r}return t}(Any);var Repeated=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?new Any:i,o=t.local,a=o===void 0?false:o,s=__rest(t,["value","local"]);r=e.call(this,s)||this;r.value=n;r.local=a;return r}return t}(Any);var RawData=function(){function e(e){var t=e===void 0?{}:e,r=t.data,i=r===void 0?EMPTY_VIEW:r;this.dataView=BufferSourceConverter_1.toUint8Array(i)}Object.defineProperty(e.prototype,"data",{get:function(){return this.dataView.slice().buffer},set:function(e){this.dataView=BufferSourceConverter_1.toUint8Array(e)},enumerable:false,configurable:true});e.prototype.fromBER=function(e,t,r){var i=t+r;this.dataView=BufferSourceConverter_1.toUint8Array(e).subarray(t,i);return i};e.prototype.toBER=function(e){return this.dataView.slice().buffer};return e}();function compareSchema(e,t,r){if(r instanceof Choice){for(var i=0;i<r.value.length;i++){var n=compareSchema(e,t,r.value[i]);if(n.verified){return{verified:true,result:e}}}{var o={verified:false,result:{error:"Wrong values for Choice type"}};if(r.hasOwnProperty(NAME))o.name=r.name;return o}}if(r instanceof Any){if(r.hasOwnProperty(NAME))e[r.name]=t;return{verified:true,result:e}}if(e instanceof Object===false){return{verified:false,result:{error:"Wrong root object"}}}if(t instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 data"}}}if(r instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(ID_BLOCK in r===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(FROM_BER in r.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(TO_BER in r.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}var a=r.idBlock.toBER(false);if(a.byteLength===0){return{verified:false,result:{error:"Error encoding idBlock for ASN.1 schema"}}}var s=r.idBlock.fromBER(a,0,a.byteLength);if(s===-1){return{verified:false,result:{error:"Error decoding idBlock for ASN.1 schema"}}}if(r.idBlock.hasOwnProperty(TAG_CLASS)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.tagClass!==t.idBlock.tagClass){return{verified:false,result:e}}if(r.idBlock.hasOwnProperty(TAG_NUMBER)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.tagNumber!==t.idBlock.tagNumber){return{verified:false,result:e}}if(r.idBlock.hasOwnProperty(IS_CONSTRUCTED)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.isConstructed!==t.idBlock.isConstructed){return{verified:false,result:e}}if(!(IS_HEX_ONLY in r.idBlock)){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.isHexOnly!==t.idBlock.isHexOnly){return{verified:false,result:e}}if(r.idBlock.isHexOnly){if(VALUE_HEX_VIEW in r.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}var c=r.idBlock.valueHexView;var u=t.idBlock.valueHexView;if(c.length!==u.length){return{verified:false,result:e}}for(var p=0;p<c.length;p++){if(c[p]!==u[1]){return{verified:false,result:e}}}}if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)e[r.name]=t}if(r instanceof typeStore.Constructed){var f=0;var n={verified:false,result:{error:"Unknown error"}};var d=r.valueBlock.value.length;if(d>0){if(r.valueBlock.value[0]instanceof Repeated){d=t.valueBlock.value.length}}if(d===0){return{verified:true,result:e}}if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){var l=true;for(var p=0;p<r.valueBlock.value.length;p++)l=l&&(r.valueBlock.value[p].optional||false);if(l){return{verified:true,result:e}}if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)delete e[r.name]}e.error="Inconsistent object length";return{verified:false,result:e}}for(var p=0;p<d;p++){if(p-f>=t.valueBlock.value.length){if(r.valueBlock.value[p].optional===false){var o={verified:false,result:e};e.error="Inconsistent length between ASN.1 data and schema";if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name){delete e[r.name];o.name=r.name}}return o}}else{if(r.valueBlock.value[0]instanceof Repeated){n=compareSchema(e,t.valueBlock.value[p],r.valueBlock.value[0].value);if(n.verified===false){if(r.valueBlock.value[0].optional)f++;else{if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)delete e[r.name]}return n}}if(NAME in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){var y={};if(LOCAL in r.valueBlock.value[0]&&r.valueBlock.value[0].local)y=t;else y=e;if(typeof y[r.valueBlock.value[0].name]==="undefined")y[r.valueBlock.value[0].name]=[];y[r.valueBlock.value[0].name].push(t.valueBlock.value[p])}}else{n=compareSchema(e,t.valueBlock.value[p-f],r.valueBlock.value[p]);if(n.verified===false){if(r.valueBlock.value[p].optional)f++;else{if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)delete e[r.name]}return n}}}}}if(n.verified===false){var o={verified:false,result:e};if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name){delete e[r.name];o.name=r.name}}return o}return{verified:true,result:e}}if(r.primitiveSchema&&VALUE_HEX_VIEW in t.valueBlock){var A=localFromBER(t.valueBlock.valueHexView);if(A.offset===-1){var o={verified:false,result:A.result};if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name){delete e[r.name];o.name=r.name}}return o}return compareSchema(e,A.result,r.primitiveSchema)}return{verified:true,result:e}}function verifySchema(e,t){if(t instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema type"}}}var r=localFromBER(BufferSourceConverter_1.toUint8Array(e));if(r.offset===-1){return{verified:false,result:r.result}}return compareSchema(r.result,r.result,t)}var asn1js=Object.freeze({__proto__:null,Any:Any,BaseBlock:BaseBlock,BaseStringBlock:BaseStringBlock,BitString:BitString$1,BmpString:BmpString,Boolean:Boolean,CharacterString:CharacterString,Choice:Choice,Constructed:Constructed,DATE:DATE,DateTime:DateTime,Duration:Duration,EndOfContent:EndOfContent,Enumerated:Enumerated,GeneralString:GeneralString,GeneralizedTime:GeneralizedTime,GraphicString:GraphicString,HexBlock:HexBlock,IA5String:IA5String,Integer:Integer,Null:Null,NumericString:NumericString,ObjectIdentifier:ObjectIdentifier,OctetString:OctetString$1,Primitive:Primitive,PrintableString:PrintableString,RawData:RawData,RelativeObjectIdentifier:RelativeObjectIdentifier,Repeated:Repeated,Sequence:Sequence,Set:Set,TIME:TIME,TeletexString:TeletexString,TimeOfDay:TimeOfDay,UTCTime:UTCTime,UniversalString:UniversalString,Utf8String:Utf8String,ValueBlock:ValueBlock,VideotexString:VideotexString,ViewWriter:ViewWriter,VisibleString:VisibleString,compareSchema:compareSchema,fromBER:fromBER,verifySchema:verifySchema});var AsnTypeTypes;(function(e){e[e["Sequence"]=0]="Sequence";e[e["Set"]=1]="Set";e[e["Choice"]=2]="Choice"})(AsnTypeTypes||(AsnTypeTypes={}));var AsnPropTypes;(function(e){e[e["Any"]=1]="Any";e[e["Boolean"]=2]="Boolean";e[e["OctetString"]=3]="OctetString";e[e["BitString"]=4]="BitString";e[e["Integer"]=5]="Integer";e[e["Enumerated"]=6]="Enumerated";e[e["ObjectIdentifier"]=7]="ObjectIdentifier";e[e["Utf8String"]=8]="Utf8String";e[e["BmpString"]=9]="BmpString";e[e["UniversalString"]=10]="UniversalString";e[e["NumericString"]=11]="NumericString";e[e["PrintableString"]=12]="PrintableString";e[e["TeletexString"]=13]="TeletexString";e[e["VideotexString"]=14]="VideotexString";e[e["IA5String"]=15]="IA5String";e[e["GraphicString"]=16]="GraphicString";e[e["VisibleString"]=17]="VisibleString";e[e["GeneralString"]=18]="GeneralString";e[e["CharacterString"]=19]="CharacterString";e[e["UTCTime"]=20]="UTCTime";e[e["GeneralizedTime"]=21]="GeneralizedTime";e[e["DATE"]=22]="DATE";e[e["TimeOfDay"]=23]="TimeOfDay";e[e["DateTime"]=24]="DateTime";e[e["Duration"]=25]="Duration";e[e["TIME"]=26]="TIME";e[e["Null"]=27]="Null"})(AsnPropTypes||(AsnPropTypes={}));var BitString=function(){function e(e,t){if(t===void 0){t=0}this.unusedBits=0;this.value=new ArrayBuffer(0);if(e){if(typeof e==="number"){this.fromNumber(e)}else if(BufferSourceConverter_1.isBufferSource(e)){this.unusedBits=t;this.value=BufferSourceConverter_1.toArrayBuffer(e)}else{throw TypeError("Unsupported type of 'params' argument for BitString")}}}e.prototype.fromASN=function(e){if(!(e instanceof BitString$1)){throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString")}this.unusedBits=e.valueBlock.unusedBits;this.value=e.valueBlock.valueHex;return this};e.prototype.toASN=function(){return new BitString$1({unusedBits:this.unusedBits,valueHex:this.value})};e.prototype.toSchema=function(e){return new BitString$1({name:e})};e.prototype.toNumber=function(){var e="";var t=new Uint8Array(this.value);for(var r=0,i=t;r<i.length;r++){var n=i[r];e+=n.toString(2).padStart(8,"0")}e=e.split("").reverse().join("");if(this.unusedBits){e=e.slice(this.unusedBits).padStart(this.unusedBits,"0")}return parseInt(e,2)};e.prototype.fromNumber=function(e){var t=e.toString(2);var r=t.length+7>>3;this.unusedBits=(r<<3)-t.length;var i=new Uint8Array(r);t=t.padStart(r<<3,"0").split("").reverse().join("");var n=0;while(n<r){i[n]=parseInt(t.slice(n<<3,(n<<3)+8),2);n++}this.value=i.buffer};return e}();var OctetString=function(){function e(e){if(typeof e==="number"){this.buffer=new ArrayBuffer(e)}else{if(BufferSourceConverter_1.isBufferSource(e)){this.buffer=BufferSourceConverter_1.toArrayBuffer(e)}else if(Array.isArray(e)){this.buffer=new Uint8Array(e)}else{this.buffer=new ArrayBuffer(0)}}}Object.defineProperty(e.prototype,"byteLength",{get:function(){return this.buffer.byteLength},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"byteOffset",{get:function(){return 0},enumerable:false,configurable:true});e.prototype.fromASN=function(e){if(!(e instanceof OctetString$1)){throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString")}this.buffer=e.valueBlock.valueHex;return this};e.prototype.toASN=function(){return new OctetString$1({valueHex:this.buffer})};e.prototype.toSchema=function(e){return new OctetString$1({name:e})};return e}();var AsnAnyConverter={fromASN:function(e){return e instanceof Null?null:e.valueBeforeDecodeView},toASN:function(e){if(e===null){return new Null}var t=fromBER(e);if(t.result.error){throw new Error(t.result.error)}return t.result}};var AsnIntegerConverter={fromASN:function(e){return e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec},toASN:function(e){return new Integer({value:+e})}};var AsnEnumeratedConverter={fromASN:function(e){return e.valueBlock.valueDec},toASN:function(e){return new Enumerated({value:e})}};var AsnIntegerArrayBufferConverter={fromASN:function(e){return e.valueBlock.valueHexView},toASN:function(e){return new Integer({valueHex:e})}};var AsnBitStringConverter={fromASN:function(e){return e.valueBlock.valueHexView},toASN:function(e){return new BitString$1({valueHex:e})}};var AsnObjectIdentifierConverter={fromASN:function(e){return e.valueBlock.toString()},toASN:function(e){return new ObjectIdentifier({value:e})}};var AsnBooleanConverter={fromASN:function(e){return e.valueBlock.value},toASN:function(e){return new Boolean({value:e})}};var AsnOctetStringConverter={fromASN:function(e){return e.valueBlock.valueHexView},toASN:function(e){return new OctetString$1({valueHex:e})}};var AsnConstructedOctetStringConverter={fromASN:function(e){return new OctetString(e.getValue())},toASN:function(e){return e.toASN()}};function createStringConverter(e){return{fromASN:function(e){return e.valueBlock.value},toASN:function(t){return new e({value:t})}}}var AsnUtf8StringConverter=createStringConverter(Utf8String);var AsnBmpStringConverter=createStringConverter(BmpString);var AsnUniversalStringConverter=createStringConverter(UniversalString);var AsnNumericStringConverter=createStringConverter(NumericString);var AsnPrintableStringConverter=createStringConverter(PrintableString);var AsnTeletexStringConverter=createStringConverter(TeletexString);var AsnVideotexStringConverter=createStringConverter(VideotexString);var AsnIA5StringConverter=createStringConverter(IA5String);var AsnGraphicStringConverter=createStringConverter(GraphicString);var AsnVisibleStringConverter=createStringConverter(VisibleString);var AsnGeneralStringConverter=createStringConverter(GeneralString);var AsnCharacterStringConverter=createStringConverter(CharacterString);var AsnUTCTimeConverter={fromASN:function(e){return e.toDate()},toASN:function(e){return new UTCTime({valueDate:e})}};var AsnGeneralizedTimeConverter={fromASN:function(e){return e.toDate()},toASN:function(e){return new GeneralizedTime({valueDate:e})}};var AsnNullConverter={fromASN:function(){return null},toASN:function(){return new Null}};function defaultConverter(e){switch(e){case AsnPropTypes.Any:return AsnAnyConverter;case AsnPropTypes.BitString:return AsnBitStringConverter;case AsnPropTypes.BmpString:return AsnBmpStringConverter;case AsnPropTypes.Boolean:return AsnBooleanConverter;case AsnPropTypes.CharacterString:return AsnCharacterStringConverter;case AsnPropTypes.Enumerated:return AsnEnumeratedConverter;case AsnPropTypes.GeneralString:return AsnGeneralStringConverter;case AsnPropTypes.GeneralizedTime:return AsnGeneralizedTimeConverter;case AsnPropTypes.GraphicString:return AsnGraphicStringConverter;case AsnPropTypes.IA5String:return AsnIA5StringConverter;case AsnPropTypes.Integer:return AsnIntegerConverter;case AsnPropTypes.Null:return AsnNullConverter;case AsnPropTypes.NumericString:return AsnNumericStringConverter;case AsnPropTypes.ObjectIdentifier:return AsnObjectIdentifierConverter;case AsnPropTypes.OctetString:return AsnOctetStringConverter;case AsnPropTypes.PrintableString:return AsnPrintableStringConverter;case AsnPropTypes.TeletexString:return AsnTeletexStringConverter;case AsnPropTypes.UTCTime:return AsnUTCTimeConverter;case AsnPropTypes.UniversalString:return AsnUniversalStringConverter;case AsnPropTypes.Utf8String:return AsnUtf8StringConverter;case AsnPropTypes.VideotexString:return AsnVideotexStringConverter;case AsnPropTypes.VisibleString:return AsnVisibleStringConverter;default:return null}}function isConvertible(e){if(typeof e==="function"&&e.prototype){if(e.prototype.toASN&&e.prototype.fromASN){return true}else{return isConvertible(e.prototype)}}else{return!!(e&&typeof e==="object"&&"toASN"in e&&"fromASN"in e)}}function isTypeOfArray(e){var t;if(e){var r=Object.getPrototypeOf(e);if(((t=r===null||r===void 0?void 0:r.prototype)===null||t===void 0?void 0:t.constructor)===Array){return true}return isTypeOfArray(r)}return false}function isArrayEqual(e,t){if(!(e&&t)){return false}if(e.byteLength!==t.byteLength){return false}var r=new Uint8Array(e);var i=new Uint8Array(t);for(var n=0;n<e.byteLength;n++){if(r[n]!==i[n]){return false}}return true}var AsnSchemaStorage=function(){function e(){this.items=new WeakMap}e.prototype.has=function(e){return this.items.has(e)};e.prototype.get=function(e,t){if(t===void 0){t=false}var r=this.items.get(e);if(!r){throw new Error("Cannot get schema for '".concat(e.prototype.constructor.name,"' target"))}if(t&&!r.schema){throw new Error("Schema '".concat(e.prototype.constructor.name,"' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'."))}return r};e.prototype.cache=function(e){var t=this.get(e);if(!t.schema){t.schema=this.create(e,true)}};e.prototype.createDefault=function(e){var t={type:AsnTypeTypes.Sequence,items:{}};var r=this.findParentSchema(e);if(r){Object.assign(t,r);t.items=Object.assign({},t.items,r.items)}return t};e.prototype.create=function(e,t){var r=this.items.get(e)||this.createDefault(e);var i=[];for(var n in r.items){var o=r.items[n];var a=t?n:"";var s=void 0;if(typeof o.type==="number"){var c=AsnPropTypes[o.type];var u=asn1js[c];if(!u){throw new Error("Cannot get ASN1 class by name '".concat(c,"'"))}s=new u({name:a})}else if(isConvertible(o.type)){var p=new o.type;s=p.toSchema(a)}else if(o.optional){var f=this.get(o.type);if(f.type===AsnTypeTypes.Choice){s=new Any({name:a})}else{s=this.create(o.type,false);s.name=a}}else{s=new Any({name:a})}var d=!!o.optional||o.defaultValue!==undefined;if(o.repeated){s.name="";var l=o.repeated==="set"?Set:Sequence;s=new l({name:"",value:[new Repeated({name:a,value:s})]})}if(o.context!==null&&o.context!==undefined){if(o.implicit){if(typeof o.type==="number"||isConvertible(o.type)){var l=o.repeated?Constructed:Primitive;i.push(new l({name:a,optional:d,idBlock:{tagClass:3,tagNumber:o.context}}))}else{this.cache(o.type);var y=!!o.repeated;var A=!y?this.get(o.type,true).schema:s;A="valueBlock"in A?A.valueBlock.value:A.value;i.push(new Constructed({name:!y?a:"",optional:d,idBlock:{tagClass:3,tagNumber:o.context},value:A}))}}else{i.push(new Constructed({optional:d,idBlock:{tagClass:3,tagNumber:o.context},value:[s]}))}}else{s.optional=d;i.push(s)}}switch(r.type){case AsnTypeTypes.Sequence:return new Sequence({value:i,name:""});case AsnTypeTypes.Set:return new Set({value:i,name:""});case AsnTypeTypes.Choice:return new Choice({value:i,name:""});default:throw new Error("Unsupported ASN1 type in use")}};e.prototype.set=function(e,t){this.items.set(e,t);return this};e.prototype.findParentSchema=function(e){var t=Object.getPrototypeOf(e);if(t){var r=this.items.get(t);return r||this.findParentSchema(t)}return null};return e}();var schemaStorage=new AsnSchemaStorage;var AsnType=function(e){return function(t){var r;if(!schemaStorage.has(t)){r=schemaStorage.createDefault(t);schemaStorage.set(t,r)}else{r=schemaStorage.get(t)}Object.assign(r,e)}};var AsnProp=function(e){return function(t,r){var i;if(!schemaStorage.has(t.constructor)){i=schemaStorage.createDefault(t.constructor);schemaStorage.set(t.constructor,i)}else{i=schemaStorage.get(t.constructor)}var n=Object.assign({},e);if(typeof n.type==="number"&&!n.converter){var o=defaultConverter(e.type);if(!o){throw new Error("Cannot get default converter for property '".concat(r,"' of ").concat(t.constructor.name))}n.converter=o}i.items[r]=n}};var AsnSchemaValidationError=function(e){__extends(t,e);function t(){var t=e.apply(this,arguments)||this;t.schemas=[];return t}return t}(Error);var AsnParser=function(){function e(){}e.parse=function(e,t){var r=fromBER(e);if(r.result.error){throw new Error(r.result.error)}var i=this.fromASN(r.result,t);return i};e.fromASN=function(e,t){var r=this;var i;try{if(isConvertible(t)){var n=new t;return n.fromASN(e)}var o=schemaStorage.get(t);schemaStorage.cache(t);var a=o.schema;if(e.constructor===Constructed&&o.type!==AsnTypeTypes.Choice){a=new Constructed({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:o.schema.valueBlock.value});for(var s in o.items){delete e[s]}}var c=compareSchema({},e,a);if(!c.verified){throw new AsnSchemaValidationError("Data does not match to ".concat(t.name," ASN1 schema. ").concat(c.result.error))}var u=new t;if(isTypeOfArray(t)){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value))){throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.")}var p=o.itemType;if(typeof p==="number"){var f=defaultConverter(p);if(!f){throw new Error("Cannot get default converter for array item of ".concat(t.name," ASN1 schema"))}return t.from(e.valueBlock.value,(function(e){return f.fromASN(e)}))}else{return t.from(e.valueBlock.value,(function(e){return r.fromASN(e,p)}))}}var d=function(e){var t=c.result[e];if(!t){return"continue"}var n=o.items[e];var a=n.type;if(typeof a==="number"||isConvertible(a)){var s=(i=n.converter)!==null&&i!==void 0?i:isConvertible(a)?new a:null;if(!s){throw new Error("Converter is empty")}if(n.repeated){if(n.implicit){var p=n.repeated==="sequence"?Sequence:Set;var f=new p;f.valueBlock=t.valueBlock;var d=fromBER(f.toBER(false));if(d.offset===-1){throw new Error("Cannot parse the child item. ".concat(d.result.error))}if(!("value"in d.result.valueBlock&&Array.isArray(d.result.valueBlock.value))){throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.")}var y=d.result.valueBlock.value;u[e]=Array.from(y,(function(e){return s.fromASN(e)}))}else{u[e]=Array.from(t,(function(e){return s.fromASN(e)}))}}else{var A=t;if(n.implicit){var f=void 0;if(isConvertible(a)){f=(new a).toSchema("")}else{var v=AsnPropTypes[a];var h=asn1js[v];if(!h){throw new Error("Cannot get '".concat(v,"' class from asn1js module"))}f=new h}f.valueBlock=A.valueBlock;A=fromBER(f.toBER(false)).result}u[e]=s.fromASN(A)}}else{if(n.repeated){if(!Array.isArray(t)){throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.")}u[e]=Array.from(t,(function(e){return r.fromASN(e,a)}))}else{u[e]=l.fromASN(t,a)}}};var l=this;for(var s in o.items){d(s)}return u}catch(e){if(e instanceof AsnSchemaValidationError){e.schemas.push(t.name)}throw e}};return e}();var AsnSerializer=function(){function e(){}e.serialize=function(e){if(e instanceof BaseBlock){return e.toBER(false)}return this.toASN(e).toBER(false)};e.toASN=function(t){var r=this;if(t&&typeof t==="object"&&isConvertible(t)){return t.toASN()}if(!(t&&typeof t==="object")){throw new TypeError("Parameter 1 should be type of Object.")}var i=t.constructor;var n=schemaStorage.get(i);schemaStorage.cache(i);var o=[];if(n.itemType){if(!Array.isArray(t)){throw new TypeError("Parameter 1 should be type of Array.")}if(typeof n.itemType==="number"){var a=defaultConverter(n.itemType);if(!a){throw new Error("Cannot get default converter for array item of ".concat(i.name," ASN1 schema"))}o=t.map((function(e){return a.toASN(e)}))}else{o=t.map((function(e){return r.toAsnItem({type:n.itemType},"[]",i,e)}))}}else{for(var s in n.items){var c=n.items[s];var u=t[s];if(u===undefined||c.defaultValue===u||typeof c.defaultValue==="object"&&typeof u==="object"&&isArrayEqual(this.serialize(c.defaultValue),this.serialize(u))){continue}var p=e.toAsnItem(c,s,i,u);if(typeof c.context==="number"){if(c.implicit){if(!c.repeated&&(typeof c.type==="number"||isConvertible(c.type))){var f={};f.valueHex=p instanceof Null?p.valueBeforeDecodeView:p.valueBlock.toBER();o.push(new Primitive(__assign({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context}},f)))}else{o.push(new Constructed({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:p.valueBlock.value}))}}else{o.push(new Constructed({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[p]}))}}else if(c.repeated){o=o.concat(p)}else{o.push(p)}}}var d;switch(n.type){case AsnTypeTypes.Sequence:d=new Sequence({value:o});break;case AsnTypeTypes.Set:d=new Set({value:o});break;case AsnTypeTypes.Choice:if(!o[0]){throw new Error("Schema '".concat(i.name,"' has wrong data. Choice cannot be empty."))}d=o[0];break}return d};e.toAsnItem=function(e,t,r,i){var n=this;var o;if(typeof e.type==="number"){var a=e.converter;if(!a){throw new Error("Property '".concat(t,"' doesn't have converter for type ").concat(AsnPropTypes[e.type]," in schema '").concat(r.name,"'"))}if(e.repeated){if(!Array.isArray(i)){throw new TypeError("Parameter 'objProp' should be type of Array.")}var s=Array.from(i,(function(e){return a.toASN(e)}));var c=e.repeated==="sequence"?Sequence:Set;o=new c({value:s})}else{o=a.toASN(i)}}else{if(e.repeated){if(!Array.isArray(i)){throw new TypeError("Parameter 'objProp' should be type of Array.")}var s=Array.from(i,(function(e){return n.toASN(e)}));var c=e.repeated==="sequence"?Sequence:Set;o=new c({value:s})}else{o=this.toASN(i)}}return o};return e}();var AsnArray=function(e){__extends(t,e);function t(t){if(t===void 0){t=[]}var r=this;if(typeof t==="number"){r=e.call(this,t)||this}else{r=e.call(this)||this;for(var i=0,n=t;i<n.length;i++){var o=n[i];r.push(o)}}return r}return t}(Array);var AsnConvert=function(){function e(){}e.serialize=function(e){return AsnSerializer.serialize(e)};e.parse=function(e,t){return AsnParser.parse(e,t)};e.toString=function(t){var r=BufferSourceConverter_1.isBufferSource(t)?BufferSourceConverter_1.toArrayBuffer(t):e.serialize(t);var i=fromBER(r);if(i.offset===-1){throw new Error("Cannot decode ASN.1 data. ".concat(i.result.error))}return i.result.toString()};return e}();function __decorate$1(e,t,r,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(n<3?a(o):n>3?a(t,r,o):a(t,r))||o;return n>3&&o&&Object.defineProperty(t,r,o),o}typeof SuppressedError==="function"?SuppressedError:function(e,t,r){var i=new Error(r);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};var ipaddr={exports:{}};(function(e){(function(t){var r="(0?\\d+|0x[a-f0-9]+)";var i={fourOctet:new RegExp("^".concat(r,"\\.").concat(r,"\\.").concat(r,"\\.").concat(r,"$"),"i"),threeOctet:new RegExp("^".concat(r,"\\.").concat(r,"\\.").concat(r,"$"),"i"),twoOctet:new RegExp("^".concat(r,"\\.").concat(r,"$"),"i"),longValue:new RegExp("^".concat(r,"$"),"i")};var n=new RegExp("^0[0-7]+$","i");var o=new RegExp("^0x[a-f0-9]+$","i");var a="%[0-9a-z]{1,}";var s="(?:[0-9a-f]+::?)+";var c={zoneIndex:new RegExp(a,"i"),native:new RegExp("^(::)?(".concat(s,")?([0-9a-f]+)?(::)?(").concat(a,")?$"),"i"),deprecatedTransitional:new RegExp("^(?:::)(".concat(r,"\\.").concat(r,"\\.").concat(r,"\\.").concat(r,"(").concat(a,")?)$"),"i"),transitional:new RegExp("^((?:".concat(s,")|(?:::)(?:").concat(s,")?)").concat(r,"\\.").concat(r,"\\.").concat(r,"\\.").concat(r,"(").concat(a,")?$"),"i")};function u(e,t){if(e.indexOf("::")!==e.lastIndexOf("::")){return null}var r=0;var i=-1;var n=(e.match(c.zoneIndex)||[])[0];var o,a;if(n){n=n.substring(1);e=e.replace(/%.+$/,"")}while((i=e.indexOf(":",i+1))>=0){r++}if(e.substr(0,2)==="::"){r--}if(e.substr(-2,2)==="::"){r--}if(r>t){return null}a=t-r;o=":";while(a--){o+="0:"}e=e.replace("::",o);if(e[0]===":"){e=e.slice(1)}if(e[e.length-1]===":"){e=e.slice(0,-1)}t=function(){var t=e.split(":");var r=[];for(var i=0;i<t.length;i++){r.push(parseInt(t[i],16))}return r}();return{parts:t,zoneId:n}}function p(e,t,r,i){if(e.length!==t.length){throw new Error("ipaddr: cannot match CIDR for objects with different lengths")}var n=0;var o;while(i>0){o=r-i;if(o<0){o=0}if(e[n]>>o!==t[n]>>o){return false}i-=r;n+=1}return true}function f(e){if(o.test(e)){return parseInt(e,16)}if(e[0]==="0"&&!isNaN(parseInt(e[1],10))){if(n.test(e)){return parseInt(e,8)}throw new Error("ipaddr: cannot parse ".concat(e," as octal"))}return parseInt(e,10)}function d(e,t){while(e.length<t){e="0".concat(e)}return e}var l={};l.IPv4=function(){function e(e){if(e.length!==4){throw new Error("ipaddr: ipv4 octet count should be 4")}var t,r;for(t=0;t<e.length;t++){r=e[t];if(!(0<=r&&r<=255)){throw new Error("ipaddr: ipv4 octet should fit in 8 bits")}}this.octets=e}e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]]};e.prototype.kind=function(){return"ipv4"};e.prototype.match=function(e,t){var r;if(t===undefined){r=e;e=r[0];t=r[1]}if(e.kind()!=="ipv4"){throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one")}return p(this.octets,e.octets,8,t)};e.prototype.prefixLengthFromSubnetMask=function(){var e=0;var t=false;var r={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};var i,n,o;for(i=3;i>=0;i-=1){n=this.octets[i];if(n in r){o=r[n];if(t&&o!==0){return null}if(o!==8){t=true}e+=o}else{return null}}return 32-e};e.prototype.range=function(){return l.subnetMatch(this,this.SpecialRanges)};e.prototype.toByteArray=function(){return this.octets.slice(0)};e.prototype.toIPv4MappedAddress=function(){return l.IPv6.parse("::ffff:".concat(this.toString()))};e.prototype.toNormalizedString=function(){return this.toString()};e.prototype.toString=function(){return this.octets.join(".")};return e}();l.IPv4.broadcastAddressFromCIDR=function(e){try{var t=this.parseCIDR(e);var r=t[0].toByteArray();var i=this.subnetMaskFromPrefixLength(t[1]).toByteArray();var n=[];var o=0;while(o<4){n.push(parseInt(r[o],10)|parseInt(i[o],10)^255);o++}return new this(n)}catch(e){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}};l.IPv4.isIPv4=function(e){return this.parser(e)!==null};l.IPv4.isValid=function(e){try{new this(this.parser(e));return true}catch(e){return false}};l.IPv4.isValidFourPartDecimal=function(e){if(l.IPv4.isValid(e)&&e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/)){return true}else{return false}};l.IPv4.networkAddressFromCIDR=function(e){var t,r,i,n,o;try{t=this.parseCIDR(e);i=t[0].toByteArray();o=this.subnetMaskFromPrefixLength(t[1]).toByteArray();n=[];r=0;while(r<4){n.push(parseInt(i[r],10)&parseInt(o[r],10));r++}return new this(n)}catch(e){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}};l.IPv4.parse=function(e){var t=this.parser(e);if(t===null){throw new Error("ipaddr: string is not formatted like an IPv4 Address")}return new this(t)};l.IPv4.parseCIDR=function(e){var t;if(t=e.match(/^(.+)\/(\d+)$/)){var r=parseInt(t[2]);if(r>=0&&r<=32){var i=[this.parse(t[1]),r];Object.defineProperty(i,"toString",{value:function(){return this.join("/")}});return i}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")};l.IPv4.parser=function(e){var t,r,n;if(t=e.match(i.fourOctet)){return function(){var e=t.slice(1,6);var i=[];for(var n=0;n<e.length;n++){r=e[n];i.push(f(r))}return i}()}else if(t=e.match(i.longValue)){n=f(t[1]);if(n>4294967295||n<0){throw new Error("ipaddr: address outside defined range")}return function(){var e=[];var t;for(t=0;t<=24;t+=8){e.push(n>>t&255)}return e}().reverse()}else if(t=e.match(i.twoOctet)){return function(){var e=t.slice(1,4);var r=[];n=f(e[1]);if(n>16777215||n<0){throw new Error("ipaddr: address outside defined range")}r.push(f(e[0]));r.push(n>>16&255);r.push(n>>8&255);r.push(n&255);return r}()}else if(t=e.match(i.threeOctet)){return function(){var e=t.slice(1,5);var r=[];n=f(e[2]);if(n>65535||n<0){throw new Error("ipaddr: address outside defined range")}r.push(f(e[0]));r.push(f(e[1]));r.push(n>>8&255);r.push(n&255);return r}()}else{return null}};l.IPv4.subnetMaskFromPrefixLength=function(e){e=parseInt(e);if(e<0||e>32){throw new Error("ipaddr: invalid IPv4 prefix length")}var t=[0,0,0,0];var r=0;var i=Math.floor(e/8);while(r<i){t[r]=255;r++}if(i<4){t[i]=Math.pow(2,e%8)-1<<8-e%8}return new this(t)};l.IPv6=function(){function e(e,t){var r,i;if(e.length===16){this.parts=[];for(r=0;r<=14;r+=2){this.parts.push(e[r]<<8|e[r+1])}}else if(e.length===8){this.parts=e}else{throw new Error("ipaddr: ipv6 part count should be 8 or 16")}for(r=0;r<this.parts.length;r++){i=this.parts[r];if(!(0<=i&&i<=65535)){throw new Error("ipaddr: ipv6 part should fit in 16 bits")}}if(t){this.zoneId=t}}e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[new e([100,65435,0,0,0,0,0,0]),96],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],reserved:[[new e([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[new e([8193,4,274,0,0,0,0,0]),48],deprecated:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28]};e.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"};e.prototype.kind=function(){return"ipv6"};e.prototype.match=function(e,t){var r;if(t===undefined){r=e;e=r[0];t=r[1]}if(e.kind()!=="ipv6"){throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one")}return p(this.parts,e.parts,16,t)};e.prototype.prefixLengthFromSubnetMask=function(){var e=0;var t=false;var r={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};var i,n;for(var o=7;o>=0;o-=1){i=this.parts[o];if(i in r){n=r[i];if(t&&n!==0){return null}if(n!==16){t=true}e+=n}else{return null}}return 128-e};e.prototype.range=function(){return l.subnetMatch(this,this.SpecialRanges)};e.prototype.toByteArray=function(){var e;var t=[];var r=this.parts;for(var i=0;i<r.length;i++){e=r[i];t.push(e>>8);t.push(e&255)}return t};e.prototype.toFixedLengthString=function(){var e=function(){var e=[];for(var t=0;t<this.parts.length;t++){e.push(d(this.parts[t].toString(16),4))}return e}.call(this).join(":");var t="";if(this.zoneId){t="%".concat(this.zoneId)}return e+t};e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress()){throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4")}var e=this.parts.slice(-2);var t=e[0];var r=e[1];return new l.IPv4([t>>8,t&255,r>>8,r&255])};e.prototype.toNormalizedString=function(){var e=function(){var e=[];for(var t=0;t<this.parts.length;t++){e.push(this.parts[t].toString(16))}return e}.call(this).join(":");var t="";if(this.zoneId){t="%".concat(this.zoneId)}return e+t};e.prototype.toRFC5952String=function(){var e=/((^|:)(0(:|$)){2,})/g;var t=this.toNormalizedString();var r=0;var i=-1;var n;while(n=e.exec(t)){if(n[0].length>i){r=n.index;i=n[0].length}}if(i<0){return t}return"".concat(t.substring(0,r),"::").concat(t.substring(r+i))};e.prototype.toString=function(){return this.toRFC5952String()};return e}();l.IPv6.broadcastAddressFromCIDR=function(e){try{var t=this.parseCIDR(e);var r=t[0].toByteArray();var i=this.subnetMaskFromPrefixLength(t[1]).toByteArray();var n=[];var o=0;while(o<16){n.push(parseInt(r[o],10)|parseInt(i[o],10)^255);o++}return new this(n)}catch(e){throw new Error("ipaddr: the address does not have IPv6 CIDR format (".concat(e,")"))}};l.IPv6.isIPv6=function(e){return this.parser(e)!==null};l.IPv6.isValid=function(e){if(typeof e==="string"&&e.indexOf(":")===-1){return false}try{var t=this.parser(e);new this(t.parts,t.zoneId);return true}catch(e){return false}};l.IPv6.networkAddressFromCIDR=function(e){var t,r,i,n,o;try{t=this.parseCIDR(e);i=t[0].toByteArray();o=this.subnetMaskFromPrefixLength(t[1]).toByteArray();n=[];r=0;while(r<16){n.push(parseInt(i[r],10)&parseInt(o[r],10));r++}return new this(n)}catch(e){throw new Error("ipaddr: the address does not have IPv6 CIDR format (".concat(e,")"))}};l.IPv6.parse=function(e){var t=this.parser(e);if(t.parts===null){throw new Error("ipaddr: string is not formatted like an IPv6 Address")}return new this(t.parts,t.zoneId)};l.IPv6.parseCIDR=function(e){var t,r,i;if(r=e.match(/^(.+)\/(\d+)$/)){t=parseInt(r[2]);if(t>=0&&t<=128){i=[this.parse(r[1]),t];Object.defineProperty(i,"toString",{value:function(){return this.join("/")}});return i}}throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")};l.IPv6.parser=function(e){var t,r,i,n,o,a;if(i=e.match(c.deprecatedTransitional)){return this.parser("::ffff:".concat(i[1]))}if(c.native.test(e)){return u(e,8)}if(i=e.match(c.transitional)){a=i[6]||"";t=u(i[1].slice(0,-1)+a,6);if(t.parts){o=[parseInt(i[2]),parseInt(i[3]),parseInt(i[4]),parseInt(i[5])];for(r=0;r<o.length;r++){n=o[r];if(!(0<=n&&n<=255)){return null}}t.parts.push(o[0]<<8|o[1]);t.parts.push(o[2]<<8|o[3]);return{parts:t.parts,zoneId:t.zoneId}}}return null};l.IPv6.subnetMaskFromPrefixLength=function(e){e=parseInt(e);if(e<0||e>128){throw new Error("ipaddr: invalid IPv6 prefix length")}var t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var r=0;var i=Math.floor(e/8);while(r<i){t[r]=255;r++}if(i<16){t[i]=Math.pow(2,e%8)-1<<8-e%8}return new this(t)};l.fromByteArray=function(e){var t=e.length;if(t===4){return new l.IPv4(e)}else if(t===16){return new l.IPv6(e)}else{throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")}};l.isValid=function(e){return l.IPv6.isValid(e)||l.IPv4.isValid(e)};l.parse=function(e){if(l.IPv6.isValid(e)){return l.IPv6.parse(e)}else if(l.IPv4.isValid(e)){return l.IPv4.parse(e)}else{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")}};l.parseCIDR=function(e){try{return l.IPv6.parseCIDR(e)}catch(t){try{return l.IPv4.parseCIDR(e)}catch(e){throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}};l.process=function(e){var t=this.parse(e);if(t.kind()==="ipv6"&&t.isIPv4MappedAddress()){return t.toIPv4Address()}else{return t}};l.subnetMatch=function(e,t,r){var i,n,o,a;if(r===undefined||r===null){r="unicast"}for(n in t){if(Object.prototype.hasOwnProperty.call(t,n)){o=t[n];if(o[0]&&!(o[0]instanceof Array)){o=[o]}for(i=0;i<o.length;i++){a=o[i];if(e.kind()===a[0].kind()&&e.match.apply(e,a)){return n}}}}return r};if(e.exports){e.exports=l}else{t.ipaddr=l}})(commonjsGlobal)})(ipaddr);var IpConverter=function(){function e(){}e.decodeIP=function(e){if(e.length===64&&parseInt(e,16)===0){return"::/0"}if(e.length!==16){return e}var t=parseInt(e.slice(8),16).toString(2).split("").reduce((function(e,t){return e+ +t}),0);var r=e.slice(0,8).replace(/(.{2})/g,(function(e){return"".concat(parseInt(e,16),".")}));r=r.slice(0,-1);return"".concat(r,"/").concat(t)};e.toString=function(e){if(e.byteLength===4||e.byteLength===16){var t=new Uint8Array(e);var r=ipaddr.exports.fromByteArray(Array.from(t));return r.toString()}return this.decodeIP(Convert_1.ToHex(e))};e.fromString=function(e){var t=ipaddr.exports.parse(e);return new Uint8Array(t.toByteArray()).buffer};return e}();var RelativeDistinguishedName_1,RDNSequence_1,Name_1;var DirectoryString=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}e.prototype.toString=function(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""};return e}();__decorate$1([AsnProp({type:AsnPropTypes.TeletexString})],DirectoryString.prototype,"teletexString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],DirectoryString.prototype,"printableString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.UniversalString})],DirectoryString.prototype,"universalString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],DirectoryString.prototype,"utf8String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],DirectoryString.prototype,"bmpString",void 0);DirectoryString=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DirectoryString);var AttributeValue=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;Object.assign(r,t);return r}t.prototype.toString=function(){return this.ia5String||(this.anyValue?Convert_1.ToHex(this.anyValue):e.prototype.toString.call(this))};return t}(DirectoryString);__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],AttributeValue.prototype,"ia5String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],AttributeValue.prototype,"anyValue",void 0);AttributeValue=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],AttributeValue);var AttributeTypeAndValue=function(){function e(e){if(e===void 0){e={}}this.type="";this.value=new AttributeValue;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],AttributeTypeAndValue.prototype,"type",void 0);__decorate$1([AsnProp({type:AttributeValue})],AttributeTypeAndValue.prototype,"value",void 0);var RelativeDistinguishedName=RelativeDistinguishedName_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RelativeDistinguishedName_1.prototype);return r}return t}(AsnArray);RelativeDistinguishedName=RelativeDistinguishedName_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:AttributeTypeAndValue})],RelativeDistinguishedName);var RDNSequence=RDNSequence_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RDNSequence_1.prototype);return r}return t}(AsnArray);RDNSequence=RDNSequence_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:RelativeDistinguishedName})],RDNSequence);var Name$1=Name_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name_1.prototype);return r}return t}(RDNSequence);Name$1=Name_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],Name$1);var AsnIpConverter={fromASN:function(e){return IpConverter.toString(AsnOctetStringConverter.fromASN(e))},toASN:function(e){return AsnOctetStringConverter.toASN(IpConverter.fromString(e))}};var OtherName=function(){function e(e){if(e===void 0){e={}}this.typeId="";this.value=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherName.prototype,"typeId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],OtherName.prototype,"value",void 0);var EDIPartyName=function(){function e(e){if(e===void 0){e={}}this.partyName=new DirectoryString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DirectoryString,optional:true,context:0,implicit:true})],EDIPartyName.prototype,"nameAssigner",void 0);__decorate$1([AsnProp({type:DirectoryString,context:1,implicit:true})],EDIPartyName.prototype,"partyName",void 0);var GeneralName=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OtherName,context:0,implicit:true})],GeneralName.prototype,"otherName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:1,implicit:true})],GeneralName.prototype,"rfc822Name",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:2,implicit:true})],GeneralName.prototype,"dNSName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:3,implicit:true})],GeneralName.prototype,"x400Address",void 0);__decorate$1([AsnProp({type:Name$1,context:4,implicit:false})],GeneralName.prototype,"directoryName",void 0);__decorate$1([AsnProp({type:EDIPartyName,context:5})],GeneralName.prototype,"ediPartyName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:6,implicit:true})],GeneralName.prototype,"uniformResourceIdentifier",void 0);__decorate$1([AsnProp({type:AsnPropTypes.OctetString,context:7,implicit:true,converter:AsnIpConverter})],GeneralName.prototype,"iPAddress",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier,context:8,implicit:true})],GeneralName.prototype,"registeredID",void 0);GeneralName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],GeneralName);var id_pkix$1="1.3.6.1.5.5.7";var id_pe$1="".concat(id_pkix$1,".1");var id_ce="2.5.29";var AuthorityInfoAccessSyntax_1;var id_pe_authorityInfoAccess="".concat(id_pe$1,".1");var AccessDescription=function(){function e(e){if(e===void 0){e={}}this.accessMethod="";this.accessLocation=new GeneralName;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],AccessDescription.prototype,"accessMethod",void 0);__decorate$1([AsnProp({type:GeneralName})],AccessDescription.prototype,"accessLocation",void 0);var AuthorityInfoAccessSyntax=AuthorityInfoAccessSyntax_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AuthorityInfoAccessSyntax_1.prototype);return r}return t}(AsnArray);AuthorityInfoAccessSyntax=AuthorityInfoAccessSyntax_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AccessDescription})],AuthorityInfoAccessSyntax);var id_ce_authorityKeyIdentifier="".concat(id_ce,".35");var KeyIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var AuthorityKeyIdentifier=function(){function e(e){if(e===void 0){e={}}if(e){Object.assign(this,e)}}return e}();__decorate$1([AsnProp({type:KeyIdentifier,context:0,optional:true,implicit:true})],AuthorityKeyIdentifier.prototype,"keyIdentifier",void 0);__decorate$1([AsnProp({type:GeneralName,context:1,optional:true,implicit:true,repeated:"sequence"})],AuthorityKeyIdentifier.prototype,"authorityCertIssuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:2,optional:true,implicit:true,converter:AsnIntegerArrayBufferConverter})],AuthorityKeyIdentifier.prototype,"authorityCertSerialNumber",void 0);var id_ce_basicConstraints="".concat(id_ce,".19");var BasicConstraints=function(){function e(e){if(e===void 0){e={}}this.cA=false;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Boolean,defaultValue:false})],BasicConstraints.prototype,"cA",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],BasicConstraints.prototype,"pathLenConstraint",void 0);var GeneralNames_1;var GeneralNames=GeneralNames_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,GeneralNames_1.prototype);return r}return t}(AsnArray);GeneralNames=GeneralNames_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:GeneralName})],GeneralNames);var CertificateIssuer_1;var id_ce_certificateIssuer="".concat(id_ce,".29");var CertificateIssuer=CertificateIssuer_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertificateIssuer_1.prototype);return r}return t}(GeneralNames);CertificateIssuer=CertificateIssuer_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CertificateIssuer);var CertificatePolicies_1;var id_ce_certificatePolicies="".concat(id_ce,".32");var DisplayText=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}e.prototype.toString=function(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""};return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],DisplayText.prototype,"ia5String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.VisibleString})],DisplayText.prototype,"visibleString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],DisplayText.prototype,"bmpString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],DisplayText.prototype,"utf8String",void 0);DisplayText=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DisplayText);var NoticeReference=function(){function e(e){if(e===void 0){e={}}this.organization=new DisplayText;this.noticeNumbers=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DisplayText})],NoticeReference.prototype,"organization",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,repeated:"sequence"})],NoticeReference.prototype,"noticeNumbers",void 0);var UserNotice=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:NoticeReference,optional:true})],UserNotice.prototype,"noticeRef",void 0);__decorate$1([AsnProp({type:DisplayText,optional:true})],UserNotice.prototype,"explicitText",void 0);var Qualifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],Qualifier.prototype,"cPSuri",void 0);__decorate$1([AsnProp({type:UserNotice})],Qualifier.prototype,"userNotice",void 0);Qualifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Qualifier);var PolicyQualifierInfo=function(){function e(e){if(e===void 0){e={}}this.policyQualifierId="";this.qualifier=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyQualifierInfo.prototype,"policyQualifierId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],PolicyQualifierInfo.prototype,"qualifier",void 0);var PolicyInformation=function(){function e(e){if(e===void 0){e={}}this.policyIdentifier="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyInformation.prototype,"policyIdentifier",void 0);__decorate$1([AsnProp({type:PolicyQualifierInfo,repeated:"sequence",optional:true})],PolicyInformation.prototype,"policyQualifiers",void 0);var CertificatePolicies=CertificatePolicies_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertificatePolicies_1.prototype);return r}return t}(AsnArray);CertificatePolicies=CertificatePolicies_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:PolicyInformation})],CertificatePolicies);var id_ce_cRLNumber="".concat(id_ce,".20");var CRLNumber=function(){function e(e){if(e===void 0){e=0}this.value=e}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],CRLNumber.prototype,"value",void 0);CRLNumber=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CRLNumber);var id_ce_deltaCRLIndicator="".concat(id_ce,".27");var BaseCRLNumber=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(CRLNumber);BaseCRLNumber=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],BaseCRLNumber);var CRLDistributionPoints_1;var id_ce_cRLDistributionPoints="".concat(id_ce,".31");var ReasonFlags;(function(e){e[e["unused"]=1]="unused";e[e["keyCompromise"]=2]="keyCompromise";e[e["cACompromise"]=4]="cACompromise";e[e["affiliationChanged"]=8]="affiliationChanged";e[e["superseded"]=16]="superseded";e[e["cessationOfOperation"]=32]="cessationOfOperation";e[e["certificateHold"]=64]="certificateHold";e[e["privilegeWithdrawn"]=128]="privilegeWithdrawn";e[e["aACompromise"]=256]="aACompromise"})(ReasonFlags||(ReasonFlags={}));var Reason=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.toJSON=function(){var e=[];var t=this.toNumber();if(t&ReasonFlags.aACompromise){e.push("aACompromise")}if(t&ReasonFlags.affiliationChanged){e.push("affiliationChanged")}if(t&ReasonFlags.cACompromise){e.push("cACompromise")}if(t&ReasonFlags.certificateHold){e.push("certificateHold")}if(t&ReasonFlags.cessationOfOperation){e.push("cessationOfOperation")}if(t&ReasonFlags.keyCompromise){e.push("keyCompromise")}if(t&ReasonFlags.privilegeWithdrawn){e.push("privilegeWithdrawn")}if(t&ReasonFlags.superseded){e.push("superseded")}if(t&ReasonFlags.unused){e.push("unused")}return e};t.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return t}(BitString);var DistributionPointName=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0,repeated:"sequence",implicit:true})],DistributionPointName.prototype,"fullName",void 0);__decorate$1([AsnProp({type:RelativeDistinguishedName,context:1,implicit:true})],DistributionPointName.prototype,"nameRelativeToCRLIssuer",void 0);DistributionPointName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DistributionPointName);var DistributionPoint=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DistributionPointName,context:0,optional:true})],DistributionPoint.prototype,"distributionPoint",void 0);__decorate$1([AsnProp({type:Reason,context:1,optional:true,implicit:true})],DistributionPoint.prototype,"reasons",void 0);__decorate$1([AsnProp({type:GeneralName,context:2,optional:true,repeated:"sequence",implicit:true})],DistributionPoint.prototype,"cRLIssuer",void 0);var CRLDistributionPoints=CRLDistributionPoints_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CRLDistributionPoints_1.prototype);return r}return t}(AsnArray);CRLDistributionPoints=CRLDistributionPoints_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:DistributionPoint})],CRLDistributionPoints);var FreshestCRL_1;var FreshestCRL=FreshestCRL_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,FreshestCRL_1.prototype);return r}return t}(CRLDistributionPoints);FreshestCRL=FreshestCRL_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:DistributionPoint})],FreshestCRL);var id_ce_issuingDistributionPoint="".concat(id_ce,".28");var IssuingDistributionPoint=function(){function e(t){if(t===void 0){t={}}this.onlyContainsUserCerts=e.ONLY;this.onlyContainsCACerts=e.ONLY;this.indirectCRL=e.ONLY;this.onlyContainsAttributeCerts=e.ONLY;Object.assign(this,t)}return e}();IssuingDistributionPoint.ONLY=false;__decorate$1([AsnProp({type:DistributionPointName,context:0,optional:true})],IssuingDistributionPoint.prototype,"distributionPoint",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:1,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"onlyContainsUserCerts",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:2,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"onlyContainsCACerts",void 0);__decorate$1([AsnProp({type:Reason,context:3,optional:true,implicit:true})],IssuingDistributionPoint.prototype,"onlySomeReasons",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:4,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"indirectCRL",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:5,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"onlyContainsAttributeCerts",void 0);var id_ce_cRLReasons="".concat(id_ce,".21");var CRLReasons;(function(e){e[e["unspecified"]=0]="unspecified";e[e["keyCompromise"]=1]="keyCompromise";e[e["cACompromise"]=2]="cACompromise";e[e["affiliationChanged"]=3]="affiliationChanged";e[e["superseded"]=4]="superseded";e[e["cessationOfOperation"]=5]="cessationOfOperation";e[e["certificateHold"]=6]="certificateHold";e[e["removeFromCRL"]=8]="removeFromCRL";e[e["privilegeWithdrawn"]=9]="privilegeWithdrawn";e[e["aACompromise"]=10]="aACompromise"})(CRLReasons||(CRLReasons={}));var CRLReason=function(){function e(e){if(e===void 0){e=CRLReasons.unspecified}this.reason=CRLReasons.unspecified;this.reason=e}e.prototype.toJSON=function(){return CRLReasons[this.reason]};e.prototype.toString=function(){return this.toJSON()};return e}();__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],CRLReason.prototype,"reason",void 0);CRLReason=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CRLReason);var ExtendedKeyUsage_1;var id_ce_extKeyUsage="".concat(id_ce,".37");var ExtendedKeyUsage=ExtendedKeyUsage_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ExtendedKeyUsage_1.prototype);return r}return t}(AsnArray);ExtendedKeyUsage=ExtendedKeyUsage_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.ObjectIdentifier})],ExtendedKeyUsage);var id_ce_inhibitAnyPolicy="".concat(id_ce,".54");var InhibitAnyPolicy=function(){function e(e){if(e===void 0){e=new ArrayBuffer(0)}this.value=e}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],InhibitAnyPolicy.prototype,"value",void 0);InhibitAnyPolicy=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],InhibitAnyPolicy);var id_ce_invalidityDate="".concat(id_ce,".24");var InvalidityDate=function(){function e(e){this.value=new Date;if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],InvalidityDate.prototype,"value",void 0);InvalidityDate=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],InvalidityDate);var IssueAlternativeName_1;var id_ce_issuerAltName="".concat(id_ce,".18");var IssueAlternativeName=IssueAlternativeName_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,IssueAlternativeName_1.prototype);return r}return t}(GeneralNames);IssueAlternativeName=IssueAlternativeName_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],IssueAlternativeName);var id_ce_keyUsage="".concat(id_ce,".15");var KeyUsageFlags;(function(e){e[e["digitalSignature"]=1]="digitalSignature";e[e["nonRepudiation"]=2]="nonRepudiation";e[e["keyEncipherment"]=4]="keyEncipherment";e[e["dataEncipherment"]=8]="dataEncipherment";e[e["keyAgreement"]=16]="keyAgreement";e[e["keyCertSign"]=32]="keyCertSign";e[e["cRLSign"]=64]="cRLSign";e[e["encipherOnly"]=128]="encipherOnly";e[e["decipherOnly"]=256]="decipherOnly"})(KeyUsageFlags||(KeyUsageFlags={}));var KeyUsage=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.toJSON=function(){var e=this.toNumber();var t=[];if(e&KeyUsageFlags.cRLSign){t.push("crlSign")}if(e&KeyUsageFlags.dataEncipherment){t.push("dataEncipherment")}if(e&KeyUsageFlags.decipherOnly){t.push("decipherOnly")}if(e&KeyUsageFlags.digitalSignature){t.push("digitalSignature")}if(e&KeyUsageFlags.encipherOnly){t.push("encipherOnly")}if(e&KeyUsageFlags.keyAgreement){t.push("keyAgreement")}if(e&KeyUsageFlags.keyCertSign){t.push("keyCertSign")}if(e&KeyUsageFlags.keyEncipherment){t.push("keyEncipherment")}if(e&KeyUsageFlags.nonRepudiation){t.push("nonRepudiation")}return t};t.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return t}(BitString);var GeneralSubtrees_1;var id_ce_nameConstraints="".concat(id_ce,".30");var GeneralSubtree=function(){function e(e){if(e===void 0){e={}}this.base=new GeneralName;this.minimum=0;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName})],GeneralSubtree.prototype,"base",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:0,defaultValue:0,implicit:true})],GeneralSubtree.prototype,"minimum",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:1,optional:true,implicit:true})],GeneralSubtree.prototype,"maximum",void 0);var GeneralSubtrees=GeneralSubtrees_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,GeneralSubtrees_1.prototype);return r}return t}(AsnArray);GeneralSubtrees=GeneralSubtrees_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:GeneralSubtree})],GeneralSubtrees);var NameConstraints=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralSubtrees,context:0,optional:true,implicit:true})],NameConstraints.prototype,"permittedSubtrees",void 0);__decorate$1([AsnProp({type:GeneralSubtrees,context:1,optional:true,implicit:true})],NameConstraints.prototype,"excludedSubtrees",void 0);var id_ce_policyConstraints="".concat(id_ce,".36");var PolicyConstraints=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:0,implicit:true,optional:true,converter:AsnIntegerArrayBufferConverter})],PolicyConstraints.prototype,"requireExplicitPolicy",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:1,implicit:true,optional:true,converter:AsnIntegerArrayBufferConverter})],PolicyConstraints.prototype,"inhibitPolicyMapping",void 0);var PolicyMappings_1;var id_ce_policyMappings="".concat(id_ce,".33");var PolicyMapping=function(){function e(e){if(e===void 0){e={}}this.issuerDomainPolicy="";this.subjectDomainPolicy="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyMapping.prototype,"issuerDomainPolicy",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyMapping.prototype,"subjectDomainPolicy",void 0);var PolicyMappings=PolicyMappings_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,PolicyMappings_1.prototype);return r}return t}(AsnArray);PolicyMappings=PolicyMappings_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:PolicyMapping})],PolicyMappings);var SubjectAlternativeName_1;var id_ce_subjectAltName="".concat(id_ce,".17");var SubjectAlternativeName=SubjectAlternativeName_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SubjectAlternativeName_1.prototype);return r}return t}(GeneralNames);SubjectAlternativeName=SubjectAlternativeName_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SubjectAlternativeName);var Attribute$1=function(){function e(e){if(e===void 0){e={}}this.type="";this.values=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Attribute$1.prototype,"type",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,repeated:"set"})],Attribute$1.prototype,"values",void 0);var SubjectDirectoryAttributes_1;var id_ce_subjectDirectoryAttributes="".concat(id_ce,".9");var SubjectDirectoryAttributes=SubjectDirectoryAttributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SubjectDirectoryAttributes_1.prototype);return r}return t}(AsnArray);SubjectDirectoryAttributes=SubjectDirectoryAttributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Attribute$1})],SubjectDirectoryAttributes);var id_ce_subjectKeyIdentifier="".concat(id_ce,".14");var SubjectKeyIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(KeyIdentifier);var id_ce_privateKeyUsagePeriod="".concat(id_ce,".16");var PrivateKeyUsagePeriod=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,context:0,implicit:true,optional:true})],PrivateKeyUsagePeriod.prototype,"notBefore",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,context:1,implicit:true,optional:true})],PrivateKeyUsagePeriod.prototype,"notAfter",void 0);var id_entrust_entrustVersInfo="1.2.840.113533.7.65.0";var EntrustInfoFlags;(function(e){e[e["keyUpdateAllowed"]=1]="keyUpdateAllowed";e[e["newExtensions"]=2]="newExtensions";e[e["pKIXCertificate"]=4]="pKIXCertificate"})(EntrustInfoFlags||(EntrustInfoFlags={}));var EntrustInfo=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.toJSON=function(){var e=[];var t=this.toNumber();if(t&EntrustInfoFlags.pKIXCertificate){e.push("pKIXCertificate")}if(t&EntrustInfoFlags.newExtensions){e.push("newExtensions")}if(t&EntrustInfoFlags.keyUpdateAllowed){e.push("keyUpdateAllowed")}return e};t.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return t}(BitString);var EntrustVersionInfo=function(){function e(e){if(e===void 0){e={}}this.entrustVers="";this.entrustInfoFlags=new EntrustInfo;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralString})],EntrustVersionInfo.prototype,"entrustVers",void 0);__decorate$1([AsnProp({type:EntrustInfo})],EntrustVersionInfo.prototype,"entrustInfoFlags",void 0);var SubjectInfoAccessSyntax_1;var id_pe_subjectInfoAccess="".concat(id_pe$1,".11");var SubjectInfoAccessSyntax=SubjectInfoAccessSyntax_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SubjectInfoAccessSyntax_1.prototype);return r}return t}(AsnArray);SubjectInfoAccessSyntax=SubjectInfoAccessSyntax_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AccessDescription})],SubjectInfoAccessSyntax);var AlgorithmIdentifier=function(){function e(e){if(e===void 0){e={}}this.algorithm="";Object.assign(this,e)}e.prototype.isEqual=function(t){return t instanceof e&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&isEqual_1(t.parameters,this.parameters)||t.parameters===this.parameters)};return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],AlgorithmIdentifier.prototype,"algorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,optional:true})],AlgorithmIdentifier.prototype,"parameters",void 0);var SubjectPublicKeyInfo=function(){function e(e){if(e===void 0){e={}}this.algorithm=new AlgorithmIdentifier;this.subjectPublicKey=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],SubjectPublicKeyInfo.prototype,"algorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],SubjectPublicKeyInfo.prototype,"subjectPublicKey",void 0);var Time=function(){function e(e){if(e){if(typeof e==="string"||typeof e==="number"||e instanceof Date){var t=new Date(e);if(t.getUTCFullYear()>2049){this.generalTime=t}else{this.utcTime=t}}else{Object.assign(this,e)}}}e.prototype.getTime=function(){var e=this.utcTime||this.generalTime;if(!e){throw new Error("Cannot get time from CHOICE object")}return e};return e}();__decorate$1([AsnProp({type:AsnPropTypes.UTCTime})],Time.prototype,"utcTime",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],Time.prototype,"generalTime",void 0);Time=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Time);var Validity=function(){function e(e){this.notBefore=new Time(new Date);this.notAfter=new Time(new Date);if(e){this.notBefore=new Time(e.notBefore);this.notAfter=new Time(e.notAfter)}}return e}();__decorate$1([AsnProp({type:Time})],Validity.prototype,"notBefore",void 0);__decorate$1([AsnProp({type:Time})],Validity.prototype,"notAfter",void 0);var Extensions_1;var Extension$1=function(){function e(t){if(t===void 0){t={}}this.extnID="";this.critical=e.CRITICAL;this.extnValue=new OctetString;Object.assign(this,t)}return e}();Extension$1.CRITICAL=false;__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Extension$1.prototype,"extnID",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,defaultValue:Extension$1.CRITICAL})],Extension$1.prototype,"critical",void 0);__decorate$1([AsnProp({type:OctetString})],Extension$1.prototype,"extnValue",void 0);var Extensions=Extensions_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Extensions_1.prototype);return r}return t}(AsnArray);Extensions=Extensions_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Extension$1})],Extensions);var Version$4;(function(e){e[e["v1"]=0]="v1";e[e["v2"]=1]="v2";e[e["v3"]=2]="v3"})(Version$4||(Version$4={}));var TBSCertificate=function(){function e(e){if(e===void 0){e={}}this.version=Version$4.v1;this.serialNumber=new ArrayBuffer(0);this.signature=new AlgorithmIdentifier;this.issuer=new Name$1;this.validity=new Validity;this.subject=new Name$1;this.subjectPublicKeyInfo=new SubjectPublicKeyInfo;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:0,defaultValue:Version$4.v1})],TBSCertificate.prototype,"version",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],TBSCertificate.prototype,"serialNumber",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],TBSCertificate.prototype,"signature",void 0);__decorate$1([AsnProp({type:Name$1})],TBSCertificate.prototype,"issuer",void 0);__decorate$1([AsnProp({type:Validity})],TBSCertificate.prototype,"validity",void 0);__decorate$1([AsnProp({type:Name$1})],TBSCertificate.prototype,"subject",void 0);__decorate$1([AsnProp({type:SubjectPublicKeyInfo})],TBSCertificate.prototype,"subjectPublicKeyInfo",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:1,implicit:true,optional:true})],TBSCertificate.prototype,"issuerUniqueID",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:2,implicit:true,optional:true})],TBSCertificate.prototype,"subjectUniqueID",void 0);__decorate$1([AsnProp({type:Extensions,context:3,optional:true})],TBSCertificate.prototype,"extensions",void 0);var Certificate=function(){function e(e){if(e===void 0){e={}}this.tbsCertificate=new TBSCertificate;this.signatureAlgorithm=new AlgorithmIdentifier;this.signatureValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:TBSCertificate})],Certificate.prototype,"tbsCertificate",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],Certificate.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],Certificate.prototype,"signatureValue",void 0);var RevokedCertificate=function(){function e(e){if(e===void 0){e={}}this.userCertificate=new ArrayBuffer(0);this.revocationDate=new Time;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RevokedCertificate.prototype,"userCertificate",void 0);__decorate$1([AsnProp({type:Time})],RevokedCertificate.prototype,"revocationDate",void 0);__decorate$1([AsnProp({type:Extension$1,optional:true,repeated:"sequence"})],RevokedCertificate.prototype,"crlEntryExtensions",void 0);var TBSCertList=function(){function e(e){if(e===void 0){e={}}this.signature=new AlgorithmIdentifier;this.issuer=new Name$1;this.thisUpdate=new Time;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],TBSCertList.prototype,"version",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],TBSCertList.prototype,"signature",void 0);__decorate$1([AsnProp({type:Name$1})],TBSCertList.prototype,"issuer",void 0);__decorate$1([AsnProp({type:Time})],TBSCertList.prototype,"thisUpdate",void 0);__decorate$1([AsnProp({type:Time,optional:true})],TBSCertList.prototype,"nextUpdate",void 0);__decorate$1([AsnProp({type:RevokedCertificate,repeated:"sequence",optional:true})],TBSCertList.prototype,"revokedCertificates",void 0);__decorate$1([AsnProp({type:Extension$1,optional:true,context:0,repeated:"sequence"})],TBSCertList.prototype,"crlExtensions",void 0);var CertificateList=function(){function e(e){if(e===void 0){e={}}this.tbsCertList=new TBSCertList;this.signatureAlgorithm=new AlgorithmIdentifier;this.signature=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:TBSCertList})],CertificateList.prototype,"tbsCertList",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],CertificateList.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],CertificateList.prototype,"signature",void 0);var id_ecPublicKey="1.2.840.10045.2.1";var id_ecdsaWithSHA1="1.2.840.10045.4.1";var id_ecdsaWithSHA224="1.2.840.10045.4.3.1";var id_ecdsaWithSHA256="1.2.840.10045.4.3.2";var id_ecdsaWithSHA384="1.2.840.10045.4.3.3";var id_ecdsaWithSHA512="1.2.840.10045.4.3.4";function create$1(e){return new AlgorithmIdentifier({algorithm:e})}create$1(id_ecdsaWithSHA1);create$1(id_ecdsaWithSHA224);create$1(id_ecdsaWithSHA256);create$1(id_ecdsaWithSHA384);create$1(id_ecdsaWithSHA512);var FieldID=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],FieldID.prototype,"fieldType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],FieldID.prototype,"parameters",void 0);FieldID=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],FieldID);var ECPoint=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var Curve=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.OctetString})],Curve.prototype,"a",void 0);__decorate$1([AsnProp({type:AsnPropTypes.OctetString})],Curve.prototype,"b",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,optional:true})],Curve.prototype,"seed",void 0);Curve=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],Curve);var ECPVer;(function(e){e[e["ecpVer1"]=1]="ecpVer1"})(ECPVer||(ECPVer={}));var SpecifiedECDomain=function(){function e(e){if(e===void 0){e={}}this.version=ECPVer.ecpVer1;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SpecifiedECDomain.prototype,"version",void 0);__decorate$1([AsnProp({type:FieldID})],SpecifiedECDomain.prototype,"fieldID",void 0);__decorate$1([AsnProp({type:Curve})],SpecifiedECDomain.prototype,"curve",void 0);__decorate$1([AsnProp({type:ECPoint})],SpecifiedECDomain.prototype,"base",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],SpecifiedECDomain.prototype,"order",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],SpecifiedECDomain.prototype,"cofactor",void 0);SpecifiedECDomain=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SpecifiedECDomain);var ECParameters=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],ECParameters.prototype,"namedCurve",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Null})],ECParameters.prototype,"implicitCurve",void 0);__decorate$1([AsnProp({type:SpecifiedECDomain})],ECParameters.prototype,"specifiedCurve",void 0);ECParameters=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],ECParameters);var ECPrivateKey=function(){function e(e){if(e===void 0){e={}}this.version=1;this.privateKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ECPrivateKey.prototype,"version",void 0);__decorate$1([AsnProp({type:OctetString})],ECPrivateKey.prototype,"privateKey",void 0);__decorate$1([AsnProp({type:ECParameters,context:0,optional:true})],ECPrivateKey.prototype,"parameters",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:1,optional:true})],ECPrivateKey.prototype,"publicKey",void 0);var ECDSASigValue=function(){function e(e){if(e===void 0){e={}}this.r=new ArrayBuffer(0);this.s=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],ECDSASigValue.prototype,"r",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],ECDSASigValue.prototype,"s",void 0);var id_pkcs_1="1.2.840.113549.1.1";var id_rsaEncryption="".concat(id_pkcs_1,".1");var id_RSAES_OAEP="".concat(id_pkcs_1,".7");var id_pSpecified="".concat(id_pkcs_1,".9");var id_RSASSA_PSS="".concat(id_pkcs_1,".10");var id_md2WithRSAEncryption="".concat(id_pkcs_1,".2");var id_md5WithRSAEncryption="".concat(id_pkcs_1,".4");var id_sha1WithRSAEncryption="".concat(id_pkcs_1,".5");var id_sha384WithRSAEncryption="".concat(id_pkcs_1,".12");var id_sha512WithRSAEncryption="".concat(id_pkcs_1,".13");var id_sha512_224WithRSAEncryption="".concat(id_pkcs_1,".15");var id_sha512_256WithRSAEncryption="".concat(id_pkcs_1,".16");var id_sha1="1.3.14.3.2.26";var id_sha224="2.16.840.1.101.3.4.2.4";var id_sha256="2.16.840.1.101.3.4.2.1";var id_sha384="2.16.840.1.101.3.4.2.2";var id_sha512="2.16.840.1.101.3.4.2.3";var id_sha512_224="2.16.840.1.101.3.4.2.5";var id_sha512_256="2.16.840.1.101.3.4.2.6";var id_md2="1.2.840.113549.2.2";var id_md5="1.2.840.113549.2.5";var id_mgf1="".concat(id_pkcs_1,".8");function create(e){return new AlgorithmIdentifier({algorithm:e,parameters:null})}create(id_md2);create(id_md5);var sha1=create(id_sha1);create(id_sha224);create(id_sha256);create(id_sha384);create(id_sha512);create(id_sha512_224);create(id_sha512_256);var mgf1SHA1=new AlgorithmIdentifier({algorithm:id_mgf1,parameters:AsnConvert.serialize(sha1)});var pSpecifiedEmpty=new AlgorithmIdentifier({algorithm:id_pSpecified,parameters:AsnConvert.serialize(AsnOctetStringConverter.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});create(id_rsaEncryption);create(id_md2WithRSAEncryption);create(id_md5WithRSAEncryption);create(id_sha1WithRSAEncryption);create(id_sha512_224WithRSAEncryption);create(id_sha512_256WithRSAEncryption);create(id_sha384WithRSAEncryption);create(id_sha512WithRSAEncryption);create(id_sha512_224WithRSAEncryption);create(id_sha512_256WithRSAEncryption);var RsaEsOaepParams=function(){function e(e){if(e===void 0){e={}}this.hashAlgorithm=new AlgorithmIdentifier(sha1);this.maskGenAlgorithm=new AlgorithmIdentifier({algorithm:id_mgf1,parameters:AsnConvert.serialize(sha1)});this.pSourceAlgorithm=new AlgorithmIdentifier(pSpecifiedEmpty);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier,context:0,defaultValue:sha1})],RsaEsOaepParams.prototype,"hashAlgorithm",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier,context:1,defaultValue:mgf1SHA1})],RsaEsOaepParams.prototype,"maskGenAlgorithm",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier,context:2,defaultValue:pSpecifiedEmpty})],RsaEsOaepParams.prototype,"pSourceAlgorithm",void 0);new AlgorithmIdentifier({algorithm:id_RSAES_OAEP,parameters:AsnConvert.serialize(new RsaEsOaepParams)});var RsaSaPssParams=function(){function e(e){if(e===void 0){e={}}this.hashAlgorithm=new AlgorithmIdentifier(sha1);this.maskGenAlgorithm=new AlgorithmIdentifier({algorithm:id_mgf1,parameters:AsnConvert.serialize(sha1)});this.saltLength=20;this.trailerField=1;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier,context:0,defaultValue:sha1})],RsaSaPssParams.prototype,"hashAlgorithm",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier,context:1,defaultValue:mgf1SHA1})],RsaSaPssParams.prototype,"maskGenAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:2,defaultValue:20})],RsaSaPssParams.prototype,"saltLength",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:3,defaultValue:1})],RsaSaPssParams.prototype,"trailerField",void 0);new AlgorithmIdentifier({algorithm:id_RSASSA_PSS,parameters:AsnConvert.serialize(new RsaSaPssParams)});var DigestInfo=function(){function e(e){if(e===void 0){e={}}this.digestAlgorithm=new AlgorithmIdentifier;this.digest=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],DigestInfo.prototype,"digestAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],DigestInfo.prototype,"digest",void 0);var OtherPrimeInfos_1;var OtherPrimeInfo=function(){function e(e){if(e===void 0){e={}}this.prime=new ArrayBuffer(0);this.exponent=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],OtherPrimeInfo.prototype,"prime",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],OtherPrimeInfo.prototype,"exponent",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],OtherPrimeInfo.prototype,"coefficient",void 0);var OtherPrimeInfos=OtherPrimeInfos_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,OtherPrimeInfos_1.prototype);return r}return t}(AsnArray);OtherPrimeInfos=OtherPrimeInfos_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:OtherPrimeInfo})],OtherPrimeInfos);var RSAPrivateKey=function(){function e(e){if(e===void 0){e={}}this.version=0;this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);this.privateExponent=new ArrayBuffer(0);this.prime1=new ArrayBuffer(0);this.prime2=new ArrayBuffer(0);this.exponent1=new ArrayBuffer(0);this.exponent2=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],RSAPrivateKey.prototype,"version",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"modulus",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"publicExponent",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"privateExponent",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"prime1",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"prime2",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"exponent1",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"exponent2",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"coefficient",void 0);__decorate$1([AsnProp({type:OtherPrimeInfos,optional:true})],RSAPrivateKey.prototype,"otherPrimeInfos",void 0);var RSAPublicKey=function(){function e(e){if(e===void 0){e={}}this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPublicKey.prototype,"modulus",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPublicKey.prototype,"publicExponent",void 0);var CompositeParams_1,CompositeSignatureValue_1;var id_alg_composite="1.3.6.1.4.1.18227.2.1";var CompositeParams=CompositeParams_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositeParams_1.prototype);return r}return t}(AsnArray);CompositeParams=CompositeParams_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AlgorithmIdentifier})],CompositeParams);var CompositeSignatureValue=CompositeSignatureValue_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositeSignatureValue_1.prototype);return r}return t}(AsnArray);CompositeSignatureValue=CompositeSignatureValue_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.BitString})],CompositeSignatureValue);var EncryptedData=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var EncryptedPrivateKeyInfo$1=function(){function e(e){if(e===void 0){e={}}this.encryptionAlgorithm=new AlgorithmIdentifier;this.encryptedData=new EncryptedData;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],EncryptedPrivateKeyInfo$1.prototype,"encryptionAlgorithm",void 0);__decorate$1([AsnProp({type:EncryptedData})],EncryptedPrivateKeyInfo$1.prototype,"encryptedData",void 0);var Attributes_1$1;var Version$3;(function(e){e[e["v1"]=0]="v1"})(Version$3||(Version$3={}));var PrivateKey=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var Attributes$1=Attributes_1$1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Attributes_1$1.prototype);return r}return t}(AsnArray);Attributes$1=Attributes_1$1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Attribute$1})],Attributes$1);var PrivateKeyInfo$1=function(){function e(e){if(e===void 0){e={}}this.version=Version$3.v1;this.privateKeyAlgorithm=new AlgorithmIdentifier;this.privateKey=new PrivateKey;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],PrivateKeyInfo$1.prototype,"version",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],PrivateKeyInfo$1.prototype,"privateKeyAlgorithm",void 0);__decorate$1([AsnProp({type:PrivateKey})],PrivateKeyInfo$1.prototype,"privateKey",void 0);__decorate$1([AsnProp({type:Attributes$1,implicit:true,context:0,optional:true})],PrivateKeyInfo$1.prototype,"attributes",void 0);var AsymmetricKeyPackage_1;var Version$2;(function(e){e[e["v1"]=0]="v1";e[e["v2"]=1]="v2"})(Version$2||(Version$2={}));var PrivateKeyAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);PrivateKeyAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],PrivateKeyAlgorithmIdentifier);var OneAsymmetricKey=function(){function e(){this.version=Version$2.v1;this.privateKeyAlgorithm=new AlgorithmIdentifier;this.privateKey=new ArrayBuffer(0)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],OneAsymmetricKey.prototype,"version",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],OneAsymmetricKey.prototype,"privateKeyAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.OctetString})],OneAsymmetricKey.prototype,"privateKey",void 0);__decorate$1([AsnProp({type:Attributes$1,context:0,implicit:true,optional:true})],OneAsymmetricKey.prototype,"attributes",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:1,implicit:true,optional:true})],OneAsymmetricKey.prototype,"publicKey",void 0);OneAsymmetricKey=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],OneAsymmetricKey);var PrivateKeyInfo=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OneAsymmetricKey);PrivateKeyInfo=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],PrivateKeyInfo);var AsymmetricKeyPackage=AsymmetricKeyPackage_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AsymmetricKeyPackage_1.prototype);return r}return t}(AsnArray);AsymmetricKeyPackage=AsymmetricKeyPackage_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:OneAsymmetricKey})],AsymmetricKeyPackage);var CompositePublicKey_1,CompositePrivateKey_1;var id_composite_key="2.16.840.1.114027.80.4.1";var CompositeAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);CompositeAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CompositeAlgorithmIdentifier);var CompositePublicKey=CompositePublicKey_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositePublicKey_1.prototype);return r}return t}(AsnArray);CompositePublicKey=CompositePublicKey_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:SubjectPublicKeyInfo})],CompositePublicKey);var CompositePrivateKey=CompositePrivateKey_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositePrivateKey_1.prototype);return r}return t}(AsnArray);CompositePrivateKey=CompositePrivateKey_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:OneAsymmetricKey})],CompositePrivateKey);
79
- /**
80
- * @license
81
- * Copyright (c) Peculiar Ventures, LLC.
82
- *
83
- * This source code is licensed under the MIT license found in the
84
- * LICENSE file in the root directory of this source tree.
85
- */var isHex=function(e){return/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)};var isPem=function(e){return/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/.test(e)};var isBase64=function(e){try{window.atob(e);return true}catch(e){return false}};var dayjs_min={exports:{}};(function(e,t){!function(t,r){e.exports=r()}(commonjsGlobal,(function(){var e=1e3,t=6e4,r=36e5,i="millisecond",n="second",o="minute",a="hour",s="day",c="week",u="month",p="quarter",f="year",d="date",l="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,A=/\[([^\]]+)]|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,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},h=function(e,t,r){var i=String(e);return!i||i.length>=t?e:""+Array(t+1-i.length).join(r)+e},_={s:h,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),i=Math.floor(r/60),n=r%60;return(t<=0?"+":"-")+h(i,2,"0")+":"+h(n,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var i=12*(r.year()-t.year())+(r.month()-t.month()),n=t.clone().add(i,u),o=r-n<0,a=t.clone().add(i+(o?-1:1),u);return+(-(i+(r-n)/(o?n-a:a-n))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:f,w:c,d:s,D:d,h:a,m:o,s:n,ms:i,Q:p}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},S="en",C={};C[S]=v;var m="$isDayjsObject",g=function(e){return e instanceof E||!(!e||!e[m])},P=function e(t,r,i){var n;if(!t)return S;if("string"==typeof t){var o=t.toLowerCase();C[o]&&(n=o),r&&(C[o]=r,n=o);var a=t.split("-");if(!n&&a.length>1)return e(a[0])}else{var s=t.name;C[s]=t,n=s}return!i&&n&&(S=n),n||!i&&S},T=function(e,t){if(g(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new E(r)},I=_;I.l=P,I.i=g,I.w=function(e,t){return T(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function v(e){this.$L=P(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[m]=!0}var h=v.prototype;return h.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(I.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var i=t.match(y);if(i){var n=i[2]-1||0,o=(i[7]||"0").substring(0,3);return r?new Date(Date.UTC(i[1],n,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)):new Date(i[1],n,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)}}return new Date(t)}(e),this.init()},h.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},h.$utils=function(){return I},h.isValid=function(){return!(this.$d.toString()===l)},h.isSame=function(e,t){var r=T(e);return this.startOf(t)<=r&&r<=this.endOf(t)},h.isAfter=function(e,t){return T(e)<this.startOf(t)},h.isBefore=function(e,t){return this.endOf(t)<T(e)},h.$g=function(e,t,r){return I.u(e)?this[t]:this.set(r,e)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(e,t){var r=this,i=!!I.u(t)||t,p=I.p(e),l=function(e,t){var n=I.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return i?n:n.endOf(s)},y=function(e,t){return I.w(r.toDate()[e].apply(r.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},A=this.$W,v=this.$M,h=this.$D,_="set"+(this.$u?"UTC":"");switch(p){case f:return i?l(1,0):l(31,11);case u:return i?l(1,v):l(0,v+1);case c:var S=this.$locale().weekStart||0,C=(A<S?A+7:A)-S;return l(i?h-C:h+(6-C),v);case s:case d:return y(_+"Hours",0);case a:return y(_+"Minutes",1);case o:return y(_+"Seconds",2);case n:return y(_+"Milliseconds",3);default:return this.clone()}},h.endOf=function(e){return this.startOf(e,!1)},h.$set=function(e,t){var r,c=I.p(e),p="set"+(this.$u?"UTC":""),l=(r={},r[s]=p+"Date",r[d]=p+"Date",r[u]=p+"Month",r[f]=p+"FullYear",r[a]=p+"Hours",r[o]=p+"Minutes",r[n]=p+"Seconds",r[i]=p+"Milliseconds",r)[c],y=c===s?this.$D+(t-this.$W):t;if(c===u||c===f){var A=this.clone().set(d,1);A.$d[l](y),A.init(),this.$d=A.set(d,Math.min(this.$D,A.daysInMonth())).$d}else l&&this.$d[l](y);return this.init(),this},h.set=function(e,t){return this.clone().$set(e,t)},h.get=function(e){return this[I.p(e)]()},h.add=function(i,p){var d,l=this;i=Number(i);var y=I.p(p),A=function(e){var t=T(l);return I.w(t.date(t.date()+Math.round(e*i)),l)};if(y===u)return this.set(u,this.$M+i);if(y===f)return this.set(f,this.$y+i);if(y===s)return A(1);if(y===c)return A(7);var v=(d={},d[o]=t,d[a]=r,d[n]=e,d)[y]||1,h=this.$d.getTime()+i*v;return I.w(h,this)},h.subtract=function(e,t){return this.add(-1*e,t)},h.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||l;var i=e||"YYYY-MM-DDTHH:mm:ssZ",n=I.z(this),o=this.$H,a=this.$m,s=this.$M,c=r.weekdays,u=r.months,p=r.meridiem,f=function(e,r,n,o){return e&&(e[r]||e(t,i))||n[r].slice(0,o)},d=function(e){return I.s(o%12||12,e,"0")},y=p||function(e,t,r){var i=e<12?"AM":"PM";return r?i.toLowerCase():i};return i.replace(A,(function(e,i){return i||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return I.s(t.$y,4,"0");case"M":return s+1;case"MM":return I.s(s+1,2,"0");case"MMM":return f(r.monthsShort,s,u,3);case"MMMM":return f(u,s);case"D":return t.$D;case"DD":return I.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return f(r.weekdaysMin,t.$W,c,2);case"ddd":return f(r.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(o);case"HH":return I.s(o,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return y(o,a,!0);case"A":return y(o,a,!1);case"m":return String(a);case"mm":return I.s(a,2,"0");case"s":return String(t.$s);case"ss":return I.s(t.$s,2,"0");case"SSS":return I.s(t.$ms,3,"0");case"Z":return n}return null}(e)||n.replace(":","")}))},h.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},h.diff=function(i,d,l){var y,A=this,v=I.p(d),h=T(i),_=(h.utcOffset()-this.utcOffset())*t,S=this-h,C=function(){return I.m(A,h)};switch(v){case f:y=C()/12;break;case u:y=C();break;case p:y=C()/3;break;case c:y=(S-_)/6048e5;break;case s:y=(S-_)/864e5;break;case a:y=S/r;break;case o:y=S/t;break;case n:y=S/e;break;default:y=S}return l?y:I.a(y)},h.daysInMonth=function(){return this.endOf(u).$D},h.$locale=function(){return C[this.$L]},h.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),i=P(e,t,!0);return i&&(r.$L=i),r},h.clone=function(){return I.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},v}(),b=E.prototype;return T.prototype=b,[["$ms",i],["$s",n],["$m",o],["$H",a],["$W",s],["$M",u],["$y",f],["$D",d]].forEach((function(e){b[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),T.extend=function(e,t){return e.$i||(e(t,E,T),e.$i=!0),T},T.locale=P,T.isDayjs=g,T.unix=function(e){return T(1e3*e)},T.en=C[S],T.Ls=C,T.p={},T}))})(dayjs_min);var dayjs=dayjs_min.exports;var relativeTime$1={exports:{}};(function(e,t){!function(t,r){e.exports=r()}(commonjsGlobal,(function(){return function(e,t,r){e=e||{};var i=t.prototype,n={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function o(e,t,r,n){return i.fromToBase(e,t,r,n)}r.en.relativeTime=n,i.fromToBase=function(t,i,o,a,s){for(var c,u,p,f=o.$locale().relativeTime||n,d=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],l=d.length,y=0;y<l;y+=1){var A=d[y];A.d&&(c=a?r(t).diff(o,A.d,!0):o.diff(t,A.d,!0));var v=(e.rounding||Math.round)(Math.abs(c));if(p=c>0,v<=A.r||!A.r){v<=1&&y>0&&(A=d[y-1]);var h=f[A.l];s&&(v=s(""+v)),u="string"==typeof h?h.replace("%d",v):h(v,i,A.l,p);break}}if(i)return u;var _=p?f.future:f.past;return"function"==typeof _?_(u):_.replace("%s",u)},i.to=function(e,t){return o(e,t,this,!0)},i.from=function(e,t){return o(e,t,this)};var a=function(e){return e.$u?r.utc():r()};i.toNow=function(e){return this.to(a(this),e)},i.fromNow=function(e){return this.from(a(this),e)}}}))})(relativeTime$1);var relativeTime=relativeTime$1.exports;
78
+ */function assertBigInt(){if(typeof BigInt==="undefined"){throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}}function concat(e){var t=0;var r=0;for(var i=0;i<e.length;i++){var n=e[i];t+=n.byteLength}var o=new Uint8Array(t);for(var i=0;i<e.length;i++){var n=e[i];o.set(new Uint8Array(n),r);r+=n.byteLength}return o.buffer}function checkBufferParams(e,t,r,i){if(!(t instanceof Uint8Array)){e.error="Wrong parameter: inputBuffer must be 'Uint8Array'";return false}if(!t.byteLength){e.error="Wrong parameter: inputBuffer has zero length";return false}if(r<0){e.error="Wrong parameter: inputOffset less than zero";return false}if(i<0){e.error="Wrong parameter: inputLength less than zero";return false}if(t.byteLength-r-i<0){e.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return false}return true}var ViewWriter=function(){function e(){this.items=[]}e.prototype.write=function(e){this.items.push(e)};e.prototype.final=function(){return concat(this.items)};return e}();var powers2=[new Uint8Array([1])];var digitsString="0123456789";var NAME="name";var VALUE_HEX_VIEW="valueHexView";var IS_HEX_ONLY="isHexOnly";var ID_BLOCK="idBlock";var TAG_CLASS="tagClass";var TAG_NUMBER="tagNumber";var IS_CONSTRUCTED="isConstructed";var FROM_BER="fromBER";var TO_BER="toBER";var LOCAL="local";var EMPTY_STRING="";var EMPTY_BUFFER=new ArrayBuffer(0);var EMPTY_VIEW=new Uint8Array(0);var END_OF_CONTENT_NAME="EndOfContent";var OCTET_STRING_NAME="OCTET STRING";var BIT_STRING_NAME="BIT STRING";function HexBlock(e){var t;return t=function(e){__extends(t,e);function t(){var t=[];for(var r=0;r<arguments.length;r++){t[r]=arguments[r]}var i;var n=e.apply(this,t)||this;var o=t[0]||{};n.isHexOnly=(i=o.isHexOnly)!==null&&i!==void 0?i:false;n.valueHexView=o.valueHex?BufferSourceConverter_1.toUint8Array(o.valueHex):EMPTY_VIEW;return n}Object.defineProperty(t.prototype,"valueHex",{get:function(){return this.valueHexView.slice().buffer},set:function(e){this.valueHexView=new Uint8Array(e)},enumerable:false,configurable:true});t.prototype.fromBER=function(e,t,r){var i=e instanceof ArrayBuffer?new Uint8Array(e):e;if(!checkBufferParams(this,i,t,r)){return-1}var n=t+r;this.valueHexView=i.subarray(t,n);if(!this.valueHexView.length){this.warnings.push("Zero buffer length");return t}this.blockLength=r;return n};t.prototype.toBER=function(e){if(e===void 0){e=false}if(!this.isHexOnly){this.error="Flag 'isHexOnly' is not set, abort";return EMPTY_BUFFER}if(e){return new ArrayBuffer(this.valueHexView.byteLength)}return this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{isHexOnly:this.isHexOnly,valueHex:Convert_1.ToHex(this.valueHexView)})};return t}(e),t.NAME="hexBlock",t}var LocalBaseBlock=function(){function e(e){var t=e===void 0?{}:e,r=t.blockLength,i=r===void 0?0:r,n=t.error,o=n===void 0?EMPTY_STRING:n,a=t.warnings,s=a===void 0?[]:a,c=t.valueBeforeDecode,u=c===void 0?EMPTY_VIEW:c;this.blockLength=i;this.error=o;this.warnings=s;this.valueBeforeDecodeView=BufferSourceConverter_1.toUint8Array(u)}e.blockName=function(){return this.NAME};Object.defineProperty(e.prototype,"valueBeforeDecode",{get:function(){return this.valueBeforeDecodeView.slice().buffer},set:function(e){this.valueBeforeDecodeView=new Uint8Array(e)},enumerable:false,configurable:true});e.prototype.toJSON=function(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:Convert_1.ToHex(this.valueBeforeDecodeView)}};return e}();LocalBaseBlock.NAME="baseBlock";var ValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBER=function(e,t,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")};t.prototype.toBER=function(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")};return t}(LocalBaseBlock);ValueBlock.NAME="valueBlock";var LocalIdentificationBlock=function(e){__extends(t,e);function t(t){var r=t===void 0?{}:t,i=r.idBlock,n=i===void 0?{}:i;var o,a,s,c;var u=e.call(this)||this;if(n){u.isHexOnly=(o=n.isHexOnly)!==null&&o!==void 0?o:false;u.valueHexView=n.valueHex?BufferSourceConverter_1.toUint8Array(n.valueHex):EMPTY_VIEW;u.tagClass=(a=n.tagClass)!==null&&a!==void 0?a:-1;u.tagNumber=(s=n.tagNumber)!==null&&s!==void 0?s:-1;u.isConstructed=(c=n.isConstructed)!==null&&c!==void 0?c:false}else{u.tagClass=-1;u.tagNumber=-1;u.isConstructed=false}return u}t.prototype.toBER=function(e){if(e===void 0){e=false}var t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:this.error="Unknown tag class";return EMPTY_BUFFER}if(this.isConstructed)t|=32;if(this.tagNumber<31&&!this.isHexOnly){var r=new Uint8Array(1);if(!e){var i=this.tagNumber;i&=31;t|=i;r[0]=t}return r.buffer}if(!this.isHexOnly){var n=utilToBase(this.tagNumber,7);var o=new Uint8Array(n);var a=n.byteLength;var s=new Uint8Array(a+1);s[0]=t|31;if(!e){for(var c=0;c<a-1;c++)s[c+1]=o[c]|128;s[a]=o[a-1]}return s.buffer}var u=new Uint8Array(this.valueHexView.byteLength+1);u[0]=t|31;if(!e){var p=this.valueHexView;for(var c=0;c<p.length-1;c++)u[c+1]=p[c]|128;u[this.valueHexView.byteLength]=p[p.length-1]}return u.buffer};t.prototype.fromBER=function(e,t,r){var i=BufferSourceConverter_1.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}var n=i.subarray(t,t+r);if(n.length===0){this.error="Zero buffer length";return-1}var o=n[0]&192;switch(o){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:this.error="Unknown tag class";return-1}this.isConstructed=(n[0]&32)===32;this.isHexOnly=false;var a=n[0]&31;if(a!==31){this.tagNumber=a;this.blockLength=1}else{var s=1;var c=this.valueHexView=new Uint8Array(255);var u=255;while(n[s]&128){c[s-1]=n[s]&127;s++;if(s>=n.length){this.error="End of input reached before message was fully decoded";return-1}if(s===u){u+=255;var p=new Uint8Array(u);for(var f=0;f<c.length;f++)p[f]=c[f];c=this.valueHexView=new Uint8Array(u)}}this.blockLength=s+1;c[s-1]=n[s]&127;var d=new Uint8Array(s);for(var f=0;f<s;f++)d[f]=c[f];c=this.valueHexView=new Uint8Array(s);c.set(d);if(this.blockLength<=9)this.tagNumber=utilFromBase(c,7);else{this.isHexOnly=true;this.warnings.push("Tag too long, represented as hex-coded")}}if(this.tagClass===1&&this.isConstructed){switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:this.error="Constructed encoding used for primitive type";return-1}}return t+this.blockLength};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed})};return t}(HexBlock(LocalBaseBlock));LocalIdentificationBlock.NAME="identificationBlock";var LocalLengthBlock=function(e){__extends(t,e);function t(t){var r=t===void 0?{}:t,i=r.lenBlock,n=i===void 0?{}:i;var o,a,s;var c=e.call(this)||this;c.isIndefiniteForm=(o=n.isIndefiniteForm)!==null&&o!==void 0?o:false;c.longFormUsed=(a=n.longFormUsed)!==null&&a!==void 0?a:false;c.length=(s=n.length)!==null&&s!==void 0?s:0;return c}t.prototype.fromBER=function(e,t,r){var i=BufferSourceConverter_1.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}var n=i.subarray(t,t+r);if(n.length===0){this.error="Zero buffer length";return-1}if(n[0]===255){this.error="Length block 0xFF is reserved by standard";return-1}this.isIndefiniteForm=n[0]===128;if(this.isIndefiniteForm){this.blockLength=1;return t+this.blockLength}this.longFormUsed=!!(n[0]&128);if(this.longFormUsed===false){this.length=n[0];this.blockLength=1;return t+this.blockLength}var o=n[0]&127;if(o>8){this.error="Too big integer";return-1}if(o+1>n.length){this.error="End of input reached before message was fully decoded";return-1}var a=t+1;var s=i.subarray(a,a+o);if(s[o-1]===0)this.warnings.push("Needlessly long encoded length");this.length=utilFromBase(s,8);if(this.longFormUsed&&this.length<=127)this.warnings.push("Unnecessary usage of long length form");this.blockLength=o+1;return t+this.blockLength};t.prototype.toBER=function(e){if(e===void 0){e=false}var t;var r;if(this.length>127)this.longFormUsed=true;if(this.isIndefiniteForm){t=new ArrayBuffer(1);if(e===false){r=new Uint8Array(t);r[0]=128}return t}if(this.longFormUsed){var i=utilToBase(this.length,8);if(i.byteLength>127){this.error="Too big length";return EMPTY_BUFFER}t=new ArrayBuffer(i.byteLength+1);if(e)return t;var n=new Uint8Array(i);r=new Uint8Array(t);r[0]=i.byteLength|128;for(var o=0;o<i.byteLength;o++)r[o+1]=n[o];return t}t=new ArrayBuffer(1);if(e===false){r=new Uint8Array(t);r[0]=this.length}return t};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length})};return t}(LocalBaseBlock);LocalLengthBlock.NAME="lengthBlock";var typeStore={};var BaseBlock=function(e){__extends(t,e);function t(t,r){if(t===void 0){t={}}var i=this;var n=t.name,o=n===void 0?EMPTY_STRING:n,a=t.optional,s=a===void 0?false:a,c=t.primitiveSchema,u=__rest(t,["name","optional","primitiveSchema"]);i=e.call(this,u)||this;i.name=o;i.optional=s;if(c){i.primitiveSchema=c}i.idBlock=new LocalIdentificationBlock(u);i.lenBlock=new LocalLengthBlock(u);i.valueBlock=r?new r(u):new ValueBlock(u);return i}t.prototype.fromBER=function(e,t,r){var i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);if(i===-1){this.error=this.valueBlock.error;return i}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return i};t.prototype.toBER=function(e,t){var r=t||new ViewWriter;if(!t){prepareIndefiniteForm(this)}var i=this.idBlock.toBER(e);r.write(i);if(this.lenBlock.isIndefiniteForm){r.write(new Uint8Array([128]).buffer);this.valueBlock.toBER(e,r);r.write(new ArrayBuffer(2))}else{var n=this.valueBlock.toBER(e);this.lenBlock.length=n.byteLength;var o=this.lenBlock.toBER(e);r.write(o);r.write(n)}if(!t){return r.final()}return EMPTY_BUFFER};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional});if(this.primitiveSchema)t.primitiveSchema=this.primitiveSchema.toJSON();return t};t.prototype.toString=function(e){if(e===void 0){e="ascii"}if(e==="ascii"){return this.onAsciiEncoding()}return Convert_1.ToHex(this.toBER())};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(Convert_1.ToHex(this.valueBlock.valueBeforeDecodeView))};t.prototype.isEqual=function(e){if(this===e){return true}if(!(e instanceof this.constructor)){return false}var t=this.toBER();var r=e.toBER();return isEqualBuffer(t,r)};return t}(LocalBaseBlock);BaseBlock.NAME="BaseBlock";function prepareIndefiniteForm(e){if(e instanceof typeStore.Constructed){for(var t=0,r=e.valueBlock.value;t<r.length;t++){var i=r[t];if(prepareIndefiniteForm(i)){e.lenBlock.isIndefiniteForm=true}}}return!!e.lenBlock.isIndefiniteForm}var BaseStringBlock=function(e){__extends(t,e);function t(t,r){if(t===void 0){t={}}var i=this;var n=t.value,o=n===void 0?EMPTY_STRING:n,a=__rest(t,["value"]);i=e.call(this,a,r)||this;if(o){i.fromString(o)}return i}t.prototype.getValue=function(){return this.valueBlock.value};t.prototype.setValue=function(e){this.valueBlock.value=e};t.prototype.fromBER=function(e,t,r){var i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);if(i===-1){this.error=this.valueBlock.error;return i}this.fromBuffer(this.valueBlock.valueHexView);if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return i};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : '").concat(this.valueBlock.value,"'")};return t}(BaseBlock);BaseStringBlock.NAME="BaseStringBlock";var LocalPrimitiveValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.isHexOnly,n=i===void 0?true:i,o=__rest(t,["isHexOnly"]);r=e.call(this,o)||this;r.isHexOnly=n;return r}return t}(HexBlock(ValueBlock));LocalPrimitiveValueBlock.NAME="PrimitiveValueBlock";var _a$w;var Primitive=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalPrimitiveValueBlock)||this;r.idBlock.isConstructed=false;return r}return t}(BaseBlock);_a$w=Primitive;(function(){typeStore.Primitive=_a$w})();Primitive.NAME="PRIMITIVE";function localChangeType(e,t){if(e instanceof t){return e}var r=new t;r.idBlock=e.idBlock;r.lenBlock=e.lenBlock;r.warnings=e.warnings;r.valueBeforeDecodeView=e.valueBeforeDecodeView;return r}function localFromBER(e,t,r){if(t===void 0){t=0}if(r===void 0){r=e.length}var i=t;var n=new BaseBlock({},ValueBlock);var o=new LocalBaseBlock;if(!checkBufferParams(o,e,t,r)){n.error=o.error;return{offset:-1,result:n}}var a=e.subarray(t,t+r);if(!a.length){n.error="Zero buffer length";return{offset:-1,result:n}}var s=n.idBlock.fromBER(e,t,r);if(n.idBlock.warnings.length){n.warnings.concat(n.idBlock.warnings)}if(s===-1){n.error=n.idBlock.error;return{offset:-1,result:n}}t=s;r-=n.idBlock.blockLength;s=n.lenBlock.fromBER(e,t,r);if(n.lenBlock.warnings.length){n.warnings.concat(n.lenBlock.warnings)}if(s===-1){n.error=n.lenBlock.error;return{offset:-1,result:n}}t=s;r-=n.lenBlock.blockLength;if(!n.idBlock.isConstructed&&n.lenBlock.isIndefiniteForm){n.error="Indefinite length form used for primitive encoding form";return{offset:-1,result:n}}var c=BaseBlock;switch(n.idBlock.tagClass){case 1:if(n.idBlock.tagNumber>=37&&n.idBlock.isHexOnly===false){n.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard";return{offset:-1,result:n}}switch(n.idBlock.tagNumber){case 0:if(n.idBlock.isConstructed&&n.lenBlock.length>0){n.error="Type [UNIVERSAL 0] is reserved";return{offset:-1,result:n}}c=typeStore.EndOfContent;break;case 1:c=typeStore.Boolean;break;case 2:c=typeStore.Integer;break;case 3:c=typeStore.BitString;break;case 4:c=typeStore.OctetString;break;case 5:c=typeStore.Null;break;case 6:c=typeStore.ObjectIdentifier;break;case 10:c=typeStore.Enumerated;break;case 12:c=typeStore.Utf8String;break;case 13:c=typeStore.RelativeObjectIdentifier;break;case 14:c=typeStore.TIME;break;case 15:n.error="[UNIVERSAL 15] is reserved by ASN.1 standard";return{offset:-1,result:n};case 16:c=typeStore.Sequence;break;case 17:c=typeStore.Set;break;case 18:c=typeStore.NumericString;break;case 19:c=typeStore.PrintableString;break;case 20:c=typeStore.TeletexString;break;case 21:c=typeStore.VideotexString;break;case 22:c=typeStore.IA5String;break;case 23:c=typeStore.UTCTime;break;case 24:c=typeStore.GeneralizedTime;break;case 25:c=typeStore.GraphicString;break;case 26:c=typeStore.VisibleString;break;case 27:c=typeStore.GeneralString;break;case 28:c=typeStore.UniversalString;break;case 29:c=typeStore.CharacterString;break;case 30:c=typeStore.BmpString;break;case 31:c=typeStore.DATE;break;case 32:c=typeStore.TimeOfDay;break;case 33:c=typeStore.DateTime;break;case 34:c=typeStore.Duration;break;default:{var u=n.idBlock.isConstructed?new typeStore.Constructed:new typeStore.Primitive;u.idBlock=n.idBlock;u.lenBlock=n.lenBlock;u.warnings=n.warnings;n=u}}break;case 2:case 3:case 4:default:{c=n.idBlock.isConstructed?typeStore.Constructed:typeStore.Primitive}}n=localChangeType(n,c);s=n.fromBER(e,t,n.lenBlock.isIndefiniteForm?r:n.lenBlock.length);n.valueBeforeDecodeView=e.subarray(i,i+n.blockLength);return{offset:s,result:n}}function fromBER(e){if(!e.byteLength){var t=new BaseBlock({},ValueBlock);t.error="Input buffer has zero length";return{offset:-1,result:t}}return localFromBER(BufferSourceConverter_1.toUint8Array(e).slice(),0,e.byteLength)}function checkLen(e,t){if(e){return 1}return t}var LocalConstructedValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?[]:i,o=t.isIndefiniteForm,a=o===void 0?false:o,s=__rest(t,["value","isIndefiniteForm"]);r=e.call(this,s)||this;r.value=n;r.isIndefiniteForm=a;return r}t.prototype.fromBER=function(e,t,r){var i=BufferSourceConverter_1.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}this.valueBeforeDecodeView=i.subarray(t,t+r);if(this.valueBeforeDecodeView.length===0){this.warnings.push("Zero buffer length");return t}var n=t;while(checkLen(this.isIndefiniteForm,r)>0){var o=localFromBER(i,n,r);if(o.offset===-1){this.error=o.result.error;this.warnings.concat(o.result.warnings);return-1}n=o.offset;this.blockLength+=o.result.blockLength;r-=o.result.blockLength;this.value.push(o.result);if(this.isIndefiniteForm&&o.result.constructor.NAME===END_OF_CONTENT_NAME){break}}if(this.isIndefiniteForm){if(this.value[this.value.length-1].constructor.NAME===END_OF_CONTENT_NAME){this.value.pop()}else{this.warnings.push("No EndOfContent block encoded")}}return n};t.prototype.toBER=function(e,t){var r=t||new ViewWriter;for(var i=0;i<this.value.length;i++){this.value[i].toBER(e,r)}if(!t){return r.final()}return EMPTY_BUFFER};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{isIndefiniteForm:this.isIndefiniteForm,value:[]});for(var r=0,i=this.value;r<i.length;r++){var n=i[r];t.value.push(n.toJSON())}return t};return t}(ValueBlock);LocalConstructedValueBlock.NAME="ConstructedValueBlock";var _a$v;var Constructed=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalConstructedValueBlock)||this;r.idBlock.isConstructed=true;return r}t.prototype.fromBER=function(e,t,r){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;var i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);if(i===-1){this.error=this.valueBlock.error;return i}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return i};t.prototype.onAsciiEncoding=function(){var e=[];for(var t=0,r=this.valueBlock.value;t<r.length;t++){var i=r[t];e.push(i.toString("ascii").split("\n").map((function(e){return" ".concat(e)})).join("\n"))}var n=this.idBlock.tagClass===3?"[".concat(this.idBlock.tagNumber,"]"):this.constructor.NAME;return e.length?"".concat(n," :\n").concat(e.join("\n")):"".concat(n," :")};return t}(BaseBlock);_a$v=Constructed;(function(){typeStore.Constructed=_a$v})();Constructed.NAME="CONSTRUCTED";var LocalEndOfContentValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBER=function(e,t,r){return t};t.prototype.toBER=function(e){return EMPTY_BUFFER};return t}(ValueBlock);LocalEndOfContentValueBlock.override="EndOfContentValueBlock";var _a$u;var EndOfContent=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalEndOfContentValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=0;return r}return t}(BaseBlock);_a$u=EndOfContent;(function(){typeStore.EndOfContent=_a$u})();EndOfContent.NAME=END_OF_CONTENT_NAME;var _a$t;var Null=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,ValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=5;return r}t.prototype.fromBER=function(e,t,r){if(this.lenBlock.length>0)this.warnings.push("Non-zero length of value block for Null type");if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;this.blockLength+=r;if(t+r>e.byteLength){this.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return-1}return t+r};t.prototype.toBER=function(e,t){var r=new ArrayBuffer(2);if(!e){var i=new Uint8Array(r);i[0]=5;i[1]=0}if(t){t.write(r)}return r};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME)};return t}(BaseBlock);_a$t=Null;(function(){typeStore.Null=_a$t})();Null.NAME="NULL";var LocalBooleanValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=__rest(t,["value"]);r=e.call(this,n)||this;if(n.valueHex){r.valueHexView=BufferSourceConverter_1.toUint8Array(n.valueHex)}else{r.valueHexView=new Uint8Array(1)}if(i){r.value=i}return r}Object.defineProperty(t.prototype,"value",{get:function(){for(var e=0,t=this.valueHexView;e<t.length;e++){var r=t[e];if(r>0){return true}}return false},set:function(e){this.valueHexView[0]=e?255:0},enumerable:false,configurable:true});t.prototype.fromBER=function(e,t,r){var i=BufferSourceConverter_1.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}this.valueHexView=i.subarray(t,t+r);if(r>1)this.warnings.push("Boolean value encoded in more then 1 octet");this.isHexOnly=true;utilDecodeTC.call(this);this.blockLength=r;return t+r};t.prototype.toBER=function(){return this.valueHexView.slice()};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.value})};return t}(HexBlock(ValueBlock));LocalBooleanValueBlock.NAME="BooleanValueBlock";var _a$s;var Boolean=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalBooleanValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=1;return r}t.prototype.getValue=function(){return this.valueBlock.value};t.prototype.setValue=function(e){this.valueBlock.value=e};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.getValue)};return t}(BaseBlock);_a$s=Boolean;(function(){typeStore.Boolean=_a$s})();Boolean.NAME="BOOLEAN";var LocalOctetStringValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.isConstructed,n=i===void 0?false:i,o=__rest(t,["isConstructed"]);r=e.call(this,o)||this;r.isConstructed=n;return r}t.prototype.fromBER=function(t,r,i){var n=0;if(this.isConstructed){this.isHexOnly=false;n=LocalConstructedValueBlock.prototype.fromBER.call(this,t,r,i);if(n===-1)return n;for(var o=0;o<this.value.length;o++){var a=this.value[o].constructor.NAME;if(a===END_OF_CONTENT_NAME){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only";return-1}}if(a!==OCTET_STRING_NAME){this.error="OCTET STRING may consists of OCTET STRINGs only";return-1}}}else{this.isHexOnly=true;n=e.prototype.fromBER.call(this,t,r,i);this.blockLength=i}return n};t.prototype.toBER=function(e,t){if(this.isConstructed)return LocalConstructedValueBlock.prototype.toBER.call(this,e,t);return e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{isConstructed:this.isConstructed})};return t}(HexBlock(LocalConstructedValueBlock));LocalOctetStringValueBlock.NAME="OctetStringValueBlock";var _a$r;var OctetString$1=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.idBlock,n=i===void 0?{}:i,o=t.lenBlock,a=o===void 0?{}:o,s=__rest(t,["idBlock","lenBlock"]);var c,u;(c=s.isConstructed)!==null&&c!==void 0?c:s.isConstructed=!!((u=s.value)===null||u===void 0?void 0:u.length);r=e.call(this,__assign({idBlock:__assign({isConstructed:s.isConstructed},n),lenBlock:__assign(__assign({},a),{isIndefiniteForm:!!s.isIndefiniteForm})},s),LocalOctetStringValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=4;return r}t.prototype.fromBER=function(t,r,i){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;if(i===0){if(this.idBlock.error.length===0)this.blockLength+=this.idBlock.blockLength;if(this.lenBlock.error.length===0)this.blockLength+=this.lenBlock.blockLength;return r}if(!this.valueBlock.isConstructed){var n=t instanceof ArrayBuffer?new Uint8Array(t):t;var o=n.subarray(r,r+i);try{if(o.byteLength){var a=localFromBER(o,0,o.byteLength);if(a.offset!==-1&&a.offset===i){this.valueBlock.value=[a.result]}}}catch(e){}}return e.prototype.fromBER.call(this,t,r,i)};t.prototype.onAsciiEncoding=function(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return Constructed.prototype.onAsciiEncoding.call(this)}return"".concat(this.constructor.NAME," : ").concat(Convert_1.ToHex(this.valueBlock.valueHexView))};t.prototype.getValue=function(){if(!this.idBlock.isConstructed){return this.valueBlock.valueHexView.slice().buffer}var e=[];for(var r=0,i=this.valueBlock.value;r<i.length;r++){var n=i[r];if(n instanceof t){e.push(n.valueBlock.valueHexView)}}return BufferSourceConverter_1.concat(e)};return t}(BaseBlock);_a$r=OctetString$1;(function(){typeStore.OctetString=_a$r})();OctetString$1.NAME=OCTET_STRING_NAME;var LocalBitStringValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.unusedBits,n=i===void 0?0:i,o=t.isConstructed,a=o===void 0?false:o,s=__rest(t,["unusedBits","isConstructed"]);r=e.call(this,s)||this;r.unusedBits=n;r.isConstructed=a;r.blockLength=r.valueHexView.byteLength;return r}t.prototype.fromBER=function(e,t,r){if(!r){return t}var i=-1;if(this.isConstructed){i=LocalConstructedValueBlock.prototype.fromBER.call(this,e,t,r);if(i===-1)return i;for(var n=0,o=this.value;n<o.length;n++){var a=o[n];var s=a.constructor.NAME;if(s===END_OF_CONTENT_NAME){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only";return-1}}if(s!==BIT_STRING_NAME){this.error="BIT STRING may consists of BIT STRINGs only";return-1}var c=a.valueBlock;if(this.unusedBits>0&&c.unusedBits>0){this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only';return-1}this.unusedBits=c.unusedBits}return i}var u=BufferSourceConverter_1.toUint8Array(e);if(!checkBufferParams(this,u,t,r)){return-1}var p=u.subarray(t,t+r);this.unusedBits=p[0];if(this.unusedBits>7){this.error="Unused bits for BitString must be in range 0-7";return-1}if(!this.unusedBits){var f=p.subarray(1);try{if(f.byteLength){var d=localFromBER(f,0,f.byteLength);if(d.offset!==-1&&d.offset===r-1){this.value=[d.result]}}}catch(e){}}this.valueHexView=p.subarray(1);this.blockLength=p.length;return t+r};t.prototype.toBER=function(e,t){if(this.isConstructed){return LocalConstructedValueBlock.prototype.toBER.call(this,e,t)}if(e){return new ArrayBuffer(this.valueHexView.byteLength+1)}if(!this.valueHexView.byteLength){return EMPTY_BUFFER}var r=new Uint8Array(this.valueHexView.length+1);r[0]=this.unusedBits;r.set(this.valueHexView,1);return r.buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{unusedBits:this.unusedBits,isConstructed:this.isConstructed})};return t}(HexBlock(LocalConstructedValueBlock));LocalBitStringValueBlock.NAME="BitStringValueBlock";var _a$q;var BitString$1=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.idBlock,n=i===void 0?{}:i,o=t.lenBlock,a=o===void 0?{}:o,s=__rest(t,["idBlock","lenBlock"]);var c,u;(c=s.isConstructed)!==null&&c!==void 0?c:s.isConstructed=!!((u=s.value)===null||u===void 0?void 0:u.length);r=e.call(this,__assign({idBlock:__assign({isConstructed:s.isConstructed},n),lenBlock:__assign(__assign({},a),{isIndefiniteForm:!!s.isIndefiniteForm})},s),LocalBitStringValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=3;return r}t.prototype.fromBER=function(t,r,i){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;return e.prototype.fromBER.call(this,t,r,i)};t.prototype.onAsciiEncoding=function(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return Constructed.prototype.onAsciiEncoding.call(this)}else{var e=[];var t=this.valueBlock.valueHexView;for(var r=0,i=t;r<i.length;r++){var n=i[r];e.push(n.toString(2).padStart(8,"0"))}var o=e.join("");return"".concat(this.constructor.NAME," : ").concat(o.substring(0,o.length-this.valueBlock.unusedBits))}};return t}(BaseBlock);_a$q=BitString$1;(function(){typeStore.BitString=_a$q})();BitString$1.NAME=BIT_STRING_NAME;var _a$p;function viewAdd(e,t){var r=new Uint8Array([0]);var i=new Uint8Array(e);var n=new Uint8Array(t);var o=i.slice(0);var a=o.length-1;var s=n.slice(0);var c=s.length-1;var u=0;var p=c<a?a:c;var f=0;for(var d=p;d>=0;d--,f++){switch(true){case f<s.length:u=o[a-f]+s[c-f]+r[0];break;default:u=o[a-f]+r[0]}r[0]=u/10;switch(true){case f>=o.length:o=utilConcatView(new Uint8Array([u%10]),o);break;default:o[a-f]=u%10}}if(r[0]>0)o=utilConcatView(r,o);return o}function power2(e){if(e>=powers2.length){for(var t=powers2.length;t<=e;t++){var r=new Uint8Array([0]);var i=powers2[t-1].slice(0);for(var n=i.length-1;n>=0;n--){var o=new Uint8Array([(i[n]<<1)+r[0]]);r[0]=o[0]/10;i[n]=o[0]%10}if(r[0]>0)i=utilConcatView(r,i);powers2.push(i)}}return powers2[e]}function viewSub(e,t){var r=0;var i=new Uint8Array(e);var n=new Uint8Array(t);var o=i.slice(0);var a=o.length-1;var s=n.slice(0);var c=s.length-1;var u;var p=0;for(var f=c;f>=0;f--,p++){u=o[a-p]-s[c-p]-r;switch(true){case u<0:r=1;o[a-p]=u+10;break;default:r=0;o[a-p]=u}}if(r>0){for(var f=a-c+1;f>=0;f--,p++){u=o[a-p]-r;if(u<0){r=1;o[a-p]=u+10}else{r=0;o[a-p]=u;break}}}return o.slice()}var LocalIntegerValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=__rest(t,["value"]);r=e.call(this,n)||this;r._valueDec=0;if(n.valueHex){r.setValueHex()}if(i!==undefined){r.valueDec=i}return r}t.prototype.setValueHex=function(){if(this.valueHexView.length>=4){this.warnings.push("Too big Integer for decoding, hex only");this.isHexOnly=true;this._valueDec=0}else{this.isHexOnly=false;if(this.valueHexView.length>0){this._valueDec=utilDecodeTC.call(this)}}};Object.defineProperty(t.prototype,"valueDec",{get:function(){return this._valueDec},set:function(e){this._valueDec=e;this.isHexOnly=false;this.valueHexView=new Uint8Array(utilEncodeTC(e))},enumerable:false,configurable:true});t.prototype.fromDER=function(e,t,r,i){if(i===void 0){i=0}var n=this.fromBER(e,t,r);if(n===-1)return n;var o=this.valueHexView;if(o[0]===0&&(o[1]&128)!==0){this.valueHexView=o.subarray(1)}else{if(i!==0){if(o.length<i){if(i-o.length>1)i=o.length+1;this.valueHexView=o.subarray(i-o.length)}}}return n};t.prototype.toDER=function(e){if(e===void 0){e=false}var t=this.valueHexView;switch(true){case(t[0]&128)!==0:{var r=new Uint8Array(this.valueHexView.length+1);r[0]=0;r.set(t,1);this.valueHexView=r}break;case t[0]===0&&(t[1]&128)===0:{this.valueHexView=this.valueHexView.subarray(1)}break}return this.toBER(e)};t.prototype.fromBER=function(t,r,i){var n=e.prototype.fromBER.call(this,t,r,i);if(n===-1){return n}this.setValueHex();return n};t.prototype.toBER=function(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{valueDec:this.valueDec})};t.prototype.toString=function(){var e=this.valueHexView.length*8-1;var t=new Uint8Array(this.valueHexView.length*8/3);var r=0;var i;var n=this.valueHexView;var o="";var a=false;for(var s=n.byteLength-1;s>=0;s--){i=n[s];for(var c=0;c<8;c++){if((i&1)===1){switch(r){case e:t=viewSub(power2(r),t);o="-";break;default:t=viewAdd(t,power2(r))}}r++;i>>=1}}for(var c=0;c<t.length;c++){if(t[c])a=true;if(a)o+=digitsString.charAt(t[c])}if(a===false)o+=digitsString.charAt(0);return o};return t}(HexBlock(ValueBlock));_a$p=LocalIntegerValueBlock;LocalIntegerValueBlock.NAME="IntegerValueBlock";(function(){Object.defineProperty(_a$p.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e);this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}})})();var _a$o;var Integer=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalIntegerValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=2;return r}t.prototype.toBigInt=function(){assertBigInt();return BigInt(this.valueBlock.toString())};t.fromBigInt=function(e){assertBigInt();var r=BigInt(e);var i=new ViewWriter;var n=r.toString(16).replace(/^-/,"");var o=new Uint8Array(Convert_1.FromHex(n));if(r<0){var a=new Uint8Array(o.length+(o[0]&128?1:0));a[0]|=128;var s=BigInt("0x".concat(Convert_1.ToHex(a)));var c=s+r;var u=BufferSourceConverter_1.toUint8Array(Convert_1.FromHex(c.toString(16)));u[0]|=128;i.write(u)}else{if(o[0]&128){i.write(new Uint8Array([0]))}i.write(o)}var p=new t({valueHex:i.final()});return p};t.prototype.convertToDER=function(){var e=new t({valueHex:this.valueBlock.valueHexView});e.valueBlock.toDER();return e};t.prototype.convertFromDER=function(){return new t({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString())};return t}(BaseBlock);_a$o=Integer;(function(){typeStore.Integer=_a$o})();Integer.NAME="INTEGER";var _a$n;var Enumerated=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=10;return r}return t}(Integer);_a$n=Enumerated;(function(){typeStore.Enumerated=_a$n})();Enumerated.NAME="ENUMERATED";var LocalSidValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.valueDec,n=i===void 0?-1:i,o=t.isFirstSid,a=o===void 0?false:o,s=__rest(t,["valueDec","isFirstSid"]);r=e.call(this,s)||this;r.valueDec=n;r.isFirstSid=a;return r}t.prototype.fromBER=function(e,t,r){if(!r){return t}var i=BufferSourceConverter_1.toUint8Array(e);if(!checkBufferParams(this,i,t,r)){return-1}var n=i.subarray(t,t+r);this.valueHexView=new Uint8Array(r);for(var o=0;o<r;o++){this.valueHexView[o]=n[o]&127;this.blockLength++;if((n[o]&128)===0)break}var a=new Uint8Array(this.blockLength);for(var o=0;o<this.blockLength;o++){a[o]=this.valueHexView[o]}this.valueHexView=a;if((n[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=utilFromBase(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return t+this.blockLength};Object.defineProperty(t.prototype,"valueBigInt",{set:function(e){assertBigInt();var t=BigInt(e).toString(2);while(t.length%7){t="0"+t}var r=new Uint8Array(t.length/7);for(var i=0;i<r.length;i++){r[i]=parseInt(t.slice(i*7,i*7+7),2)+(i+1<r.length?128:0)}this.fromBER(r.buffer,0,r.length)},enumerable:false,configurable:true});t.prototype.toBER=function(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);var t=this.valueHexView;var r=new Uint8Array(this.blockLength);for(var i=0;i<this.blockLength-1;i++)r[i]=t[i]|128;r[this.blockLength-1]=t[this.blockLength-1];return r.buffer}var n=utilToBase(this.valueDec,7);if(n.byteLength===0){this.error="Error during encoding SID value";return EMPTY_BUFFER}var o=new Uint8Array(n.byteLength);if(!e){var a=new Uint8Array(n);var s=n.byteLength-1;for(var i=0;i<s;i++)o[i]=a[i]|128;o[s]=a[s]}return o};t.prototype.toString=function(){var e="";if(this.isHexOnly)e=Convert_1.ToHex(this.valueHexView);else{if(this.isFirstSid){var t=this.valueDec;if(this.valueDec<=39)e="0.";else{if(this.valueDec<=79){e="1.";t-=40}else{e="2.";t-=80}}e+=t.toString()}else e=this.valueDec.toString()}return e};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{valueDec:this.valueDec,isFirstSid:this.isFirstSid})};return t}(HexBlock(ValueBlock));LocalSidValueBlock.NAME="sidBlock";var LocalObjectIdentifierValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?EMPTY_STRING:i,o=__rest(t,["value"]);r=e.call(this,o)||this;r.value=[];if(n){r.fromString(n)}return r}t.prototype.fromBER=function(e,t,r){var i=t;while(r>0){var n=new LocalSidValueBlock;i=n.fromBER(e,i,r);if(i===-1){this.blockLength=0;this.error=n.error;return i}if(this.value.length===0)n.isFirstSid=true;this.blockLength+=n.blockLength;r-=n.blockLength;this.value.push(n)}return i};t.prototype.toBER=function(e){var t=[];for(var r=0;r<this.value.length;r++){var i=this.value[r].toBER(e);if(i.byteLength===0){this.error=this.value[r].error;return EMPTY_BUFFER}t.push(i)}return concat(t)};t.prototype.fromString=function(e){this.value=[];var t=0;var r=0;var i="";var n=false;do{r=e.indexOf(".",t);if(r===-1)i=e.substring(t);else i=e.substring(t,r);t=r+1;if(n){var o=this.value[0];var a=0;switch(o.valueDec){case 0:break;case 1:a=40;break;case 2:a=80;break;default:this.value=[];return}var s=parseInt(i,10);if(isNaN(s))return;o.valueDec=s+a;n=false}else{var o=new LocalSidValueBlock;if(i>Number.MAX_SAFE_INTEGER){assertBigInt();var c=BigInt(i);o.valueBigInt=c}else{o.valueDec=parseInt(i,10);if(isNaN(o.valueDec))return}if(!this.value.length){o.isFirstSid=true;n=true}this.value.push(o)}}while(r!==-1)};t.prototype.toString=function(){var e="";var t=false;for(var r=0;r<this.value.length;r++){t=this.value[r].isHexOnly;var i=this.value[r].toString();if(r!==0)e="".concat(e,".");if(t){i="{".concat(i,"}");if(this.value[r].isFirstSid)e="2.{".concat(i," - 80}");else e+=i}else e+=i}return e};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{value:this.toString(),sidArray:[]});for(var r=0;r<this.value.length;r++){t.sidArray.push(this.value[r].toJSON())}return t};return t}(ValueBlock);LocalObjectIdentifierValueBlock.NAME="ObjectIdentifierValueBlock";var _a$m;var ObjectIdentifier=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalObjectIdentifierValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=6;return r}t.prototype.getValue=function(){return this.valueBlock.toString()};t.prototype.setValue=function(e){this.valueBlock.fromString(e)};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString()||"empty")};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.getValue()})};return t}(BaseBlock);_a$m=ObjectIdentifier;(function(){typeStore.ObjectIdentifier=_a$m})();ObjectIdentifier.NAME="OBJECT IDENTIFIER";var LocalRelativeSidValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.valueDec,n=i===void 0?0:i,o=__rest(t,["valueDec"]);r=e.call(this,o)||this;r.valueDec=n;return r}t.prototype.fromBER=function(e,t,r){if(r===0)return t;var i=BufferSourceConverter_1.toUint8Array(e);if(!checkBufferParams(this,i,t,r))return-1;var n=i.subarray(t,t+r);this.valueHexView=new Uint8Array(r);for(var o=0;o<r;o++){this.valueHexView[o]=n[o]&127;this.blockLength++;if((n[o]&128)===0)break}var a=new Uint8Array(this.blockLength);for(var o=0;o<this.blockLength;o++)a[o]=this.valueHexView[o];this.valueHexView=a;if((n[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=utilFromBase(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return t+this.blockLength};t.prototype.toBER=function(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);var t=this.valueHexView;var r=new Uint8Array(this.blockLength);for(var i=0;i<this.blockLength-1;i++)r[i]=t[i]|128;r[this.blockLength-1]=t[this.blockLength-1];return r.buffer}var n=utilToBase(this.valueDec,7);if(n.byteLength===0){this.error="Error during encoding SID value";return EMPTY_BUFFER}var o=new Uint8Array(n.byteLength);if(!e){var a=new Uint8Array(n);var s=n.byteLength-1;for(var i=0;i<s;i++)o[i]=a[i]|128;o[s]=a[s]}return o.buffer};t.prototype.toString=function(){var e="";if(this.isHexOnly)e=Convert_1.ToHex(this.valueHexView);else{e=this.valueDec.toString()}return e};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{valueDec:this.valueDec})};return t}(HexBlock(LocalBaseBlock));LocalRelativeSidValueBlock.NAME="relativeSidBlock";var LocalRelativeObjectIdentifierValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?EMPTY_STRING:i,o=__rest(t,["value"]);r=e.call(this,o)||this;r.value=[];if(n){r.fromString(n)}return r}t.prototype.fromBER=function(e,t,r){var i=t;while(r>0){var n=new LocalRelativeSidValueBlock;i=n.fromBER(e,i,r);if(i===-1){this.blockLength=0;this.error=n.error;return i}this.blockLength+=n.blockLength;r-=n.blockLength;this.value.push(n)}return i};t.prototype.toBER=function(e,t){var r=[];for(var i=0;i<this.value.length;i++){var n=this.value[i].toBER(e);if(n.byteLength===0){this.error=this.value[i].error;return EMPTY_BUFFER}r.push(n)}return concat(r)};t.prototype.fromString=function(e){this.value=[];var t=0;var r=0;var i="";do{r=e.indexOf(".",t);if(r===-1)i=e.substring(t);else i=e.substring(t,r);t=r+1;var n=new LocalRelativeSidValueBlock;n.valueDec=parseInt(i,10);if(isNaN(n.valueDec))return true;this.value.push(n)}while(r!==-1);return true};t.prototype.toString=function(){var e="";var t=false;for(var r=0;r<this.value.length;r++){t=this.value[r].isHexOnly;var i=this.value[r].toString();if(r!==0)e="".concat(e,".");if(t){i="{".concat(i,"}");e+=i}else e+=i}return e};t.prototype.toJSON=function(){var t=__assign(__assign({},e.prototype.toJSON.call(this)),{value:this.toString(),sidArray:[]});for(var r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t};return t}(ValueBlock);LocalRelativeObjectIdentifierValueBlock.NAME="RelativeObjectIdentifierValueBlock";var _a$l;var RelativeObjectIdentifier=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t,LocalRelativeObjectIdentifierValueBlock)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=13;return r}t.prototype.getValue=function(){return this.valueBlock.toString()};t.prototype.setValue=function(e){this.valueBlock.fromString(e)};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.valueBlock.toString()||"empty")};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.getValue()})};return t}(BaseBlock);_a$l=RelativeObjectIdentifier;(function(){typeStore.RelativeObjectIdentifier=_a$l})();RelativeObjectIdentifier.NAME="RelativeObjectIdentifier";var _a$k;var Sequence=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=16;return r}return t}(Constructed);_a$k=Sequence;(function(){typeStore.Sequence=_a$k})();Sequence.NAME="SEQUENCE";var _a$j;var Set=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=17;return r}return t}(Constructed);_a$j=Set;(function(){typeStore.Set=_a$j})();Set.NAME="SET";var LocalStringValueBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=__rest(t,[]);r=e.call(this,i)||this;r.isHexOnly=true;r.value=EMPTY_STRING;return r}t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{value:this.value})};return t}(HexBlock(ValueBlock));LocalStringValueBlock.NAME="StringValueBlock";var LocalSimpleStringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(LocalStringValueBlock);LocalSimpleStringValueBlock.NAME="SimpleStringValueBlock";var LocalSimpleStringBlock=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=__rest(t,[]);return e.call(this,r,LocalSimpleStringValueBlock)||this}t.prototype.fromBuffer=function(e){this.valueBlock.value=String.fromCharCode.apply(null,BufferSourceConverter_1.toUint8Array(e))};t.prototype.fromString=function(e){var t=e.length;var r=this.valueBlock.valueHexView=new Uint8Array(t);for(var i=0;i<t;i++)r[i]=e.charCodeAt(i);this.valueBlock.value=e};return t}(BaseStringBlock);LocalSimpleStringBlock.NAME="SIMPLE STRING";var LocalUtf8StringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBuffer=function(e){this.valueBlock.valueHexView=BufferSourceConverter_1.toUint8Array(e);try{this.valueBlock.value=Convert_1.ToUtf8String(e)}catch(t){this.warnings.push('Error during "decodeURIComponent": '.concat(t,", using raw string"));this.valueBlock.value=Convert_1.ToBinary(e)}};t.prototype.fromString=function(e){this.valueBlock.valueHexView=new Uint8Array(Convert_1.FromUtf8String(e));this.valueBlock.value=e};return t}(LocalSimpleStringBlock);LocalUtf8StringValueBlock.NAME="Utf8StringValueBlock";var _a$i;var Utf8String=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=12;return r}return t}(LocalUtf8StringValueBlock);_a$i=Utf8String;(function(){typeStore.Utf8String=_a$i})();Utf8String.NAME="UTF8String";var LocalBmpStringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBuffer=function(e){this.valueBlock.value=Convert_1.ToUtf16String(e);this.valueBlock.valueHexView=BufferSourceConverter_1.toUint8Array(e)};t.prototype.fromString=function(e){this.valueBlock.value=e;this.valueBlock.valueHexView=new Uint8Array(Convert_1.FromUtf16String(e))};return t}(LocalSimpleStringBlock);LocalBmpStringValueBlock.NAME="BmpStringValueBlock";var _a$h;var BmpString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=__rest(t,[]);r=e.call(this,i)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=30;return r}return t}(LocalBmpStringValueBlock);_a$h=BmpString;(function(){typeStore.BmpString=_a$h})();BmpString.NAME="BMPString";var LocalUniversalStringValueBlock=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.fromBuffer=function(e){var t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0);var r=new Uint8Array(t);for(var i=0;i<r.length;i+=4){r[i]=r[i+3];r[i+1]=r[i+2];r[i+2]=0;r[i+3]=0}this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))};t.prototype.fromString=function(e){var t=e.length;var r=this.valueBlock.valueHexView=new Uint8Array(t*4);for(var i=0;i<t;i++){var n=utilToBase(e.charCodeAt(i),8);var o=new Uint8Array(n);if(o.length>4)continue;var a=4-o.length;for(var s=o.length-1;s>=0;s--)r[i*4+s+a]=o[s]}this.valueBlock.value=e};return t}(LocalSimpleStringBlock);LocalUniversalStringValueBlock.NAME="UniversalStringValueBlock";var _a$g;var UniversalString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=__rest(t,[]);r=e.call(this,i)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=28;return r}return t}(LocalUniversalStringValueBlock);_a$g=UniversalString;(function(){typeStore.UniversalString=_a$g})();UniversalString.NAME="UniversalString";var _a$f;var NumericString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=18;return r}return t}(LocalSimpleStringBlock);_a$f=NumericString;(function(){typeStore.NumericString=_a$f})();NumericString.NAME="NumericString";var _a$e;var PrintableString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=19;return r}return t}(LocalSimpleStringBlock);_a$e=PrintableString;(function(){typeStore.PrintableString=_a$e})();PrintableString.NAME="PrintableString";var _a$d;var TeletexString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=20;return r}return t}(LocalSimpleStringBlock);_a$d=TeletexString;(function(){typeStore.TeletexString=_a$d})();TeletexString.NAME="TeletexString";var _a$c;var VideotexString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=21;return r}return t}(LocalSimpleStringBlock);_a$c=VideotexString;(function(){typeStore.VideotexString=_a$c})();VideotexString.NAME="VideotexString";var _a$b;var IA5String=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=22;return r}return t}(LocalSimpleStringBlock);_a$b=IA5String;(function(){typeStore.IA5String=_a$b})();IA5String.NAME="IA5String";var _a$a;var GraphicString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=25;return r}return t}(LocalSimpleStringBlock);_a$a=GraphicString;(function(){typeStore.GraphicString=_a$a})();GraphicString.NAME="GraphicString";var _a$9;var VisibleString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=26;return r}return t}(LocalSimpleStringBlock);_a$9=VisibleString;(function(){typeStore.VisibleString=_a$9})();VisibleString.NAME="VisibleString";var _a$8;var GeneralString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=27;return r}return t}(LocalSimpleStringBlock);_a$8=GeneralString;(function(){typeStore.GeneralString=_a$8})();GeneralString.NAME="GeneralString";var _a$7;var CharacterString=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=29;return r}return t}(LocalSimpleStringBlock);_a$7=CharacterString;(function(){typeStore.CharacterString=_a$7})();CharacterString.NAME="CharacterString";var _a$6;var UTCTime=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=t.valueDate,o=__rest(t,["value","valueDate"]);r=e.call(this,o)||this;r.year=0;r.month=0;r.day=0;r.hour=0;r.minute=0;r.second=0;if(i){r.fromString(i);r.valueBlock.valueHexView=new Uint8Array(i.length);for(var a=0;a<i.length;a++)r.valueBlock.valueHexView[a]=i.charCodeAt(a)}if(n){r.fromDate(n);r.valueBlock.valueHexView=new Uint8Array(r.toBuffer())}r.idBlock.tagClass=1;r.idBlock.tagNumber=23;return r}t.prototype.fromBuffer=function(e){this.fromString(String.fromCharCode.apply(null,BufferSourceConverter_1.toUint8Array(e)))};t.prototype.toBuffer=function(){var e=this.toString();var t=new ArrayBuffer(e.length);var r=new Uint8Array(t);for(var i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return t};t.prototype.fromDate=function(e){this.year=e.getUTCFullYear();this.month=e.getUTCMonth()+1;this.day=e.getUTCDate();this.hour=e.getUTCHours();this.minute=e.getUTCMinutes();this.second=e.getUTCSeconds()};t.prototype.toDate=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))};t.prototype.fromString=function(e){var t=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/gi;var r=t.exec(e);if(r===null){this.error="Wrong input string for conversion";return}var i=parseInt(r[1],10);if(i>=50)this.year=1900+i;else this.year=2e3+i;this.month=parseInt(r[2],10);this.day=parseInt(r[3],10);this.hour=parseInt(r[4],10);this.minute=parseInt(r[5],10);this.second=parseInt(r[6],10)};t.prototype.toString=function(t){if(t===void 0){t="iso"}if(t==="iso"){var r=new Array(7);r[0]=padNumber(this.year<2e3?this.year-1900:this.year-2e3,2);r[1]=padNumber(this.month,2);r[2]=padNumber(this.day,2);r[3]=padNumber(this.hour,2);r[4]=padNumber(this.minute,2);r[5]=padNumber(this.second,2);r[6]="Z";return r.join("")}return e.prototype.toString.call(this,t)};t.prototype.onAsciiEncoding=function(){return"".concat(this.constructor.NAME," : ").concat(this.toDate().toISOString())};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second})};return t}(VisibleString);_a$6=UTCTime;(function(){typeStore.UTCTime=_a$6})();UTCTime.NAME="UTCTime";var _a$5;var GeneralizedTime=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r;var i=e.call(this,t)||this;(r=i.millisecond)!==null&&r!==void 0?r:i.millisecond=0;i.idBlock.tagClass=1;i.idBlock.tagNumber=24;return i}t.prototype.fromDate=function(t){e.prototype.fromDate.call(this,t);this.millisecond=t.getUTCMilliseconds()};t.prototype.toDate=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))};t.prototype.fromString=function(e){var t=false;var r="";var i="";var n=0;var o;var a=0;var s=0;if(e[e.length-1]==="Z"){r=e.substring(0,e.length-1);t=true}else{var c=new Number(e[e.length-1]);if(isNaN(c.valueOf()))throw new Error("Wrong input string for conversion");r=e}if(t){if(r.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(r.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{var u=1;var p=r.indexOf("+");var f="";if(p===-1){p=r.indexOf("-");u=-1}if(p!==-1){f=r.substring(p+1);r=r.substring(0,p);if(f.length!==2&&f.length!==4)throw new Error("Wrong input string for conversion");var c=parseInt(f.substring(0,2),10);if(isNaN(c.valueOf()))throw new Error("Wrong input string for conversion");a=u*c;if(f.length===4){c=parseInt(f.substring(2,4),10);if(isNaN(c.valueOf()))throw new Error("Wrong input string for conversion");s=u*c}}}var d=r.indexOf(".");if(d===-1)d=r.indexOf(",");if(d!==-1){var l=new Number("0".concat(r.substring(d)));if(isNaN(l.valueOf()))throw new Error("Wrong input string for conversion");n=l.valueOf();i=r.substring(0,d)}else i=r;switch(true){case i.length===8:o=/(\d{4})(\d{2})(\d{2})/gi;if(d!==-1)throw new Error("Wrong input string for conversion");break;case i.length===10:o=/(\d{4})(\d{2})(\d{2})(\d{2})/gi;if(d!==-1){var y=60*n;this.minute=Math.floor(y);y=60*(y-this.minute);this.second=Math.floor(y);y=1e3*(y-this.second);this.millisecond=Math.floor(y)}break;case i.length===12:o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(d!==-1){var y=60*n;this.second=Math.floor(y);y=1e3*(y-this.second);this.millisecond=Math.floor(y)}break;case i.length===14:o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(d!==-1){var y=1e3*n;this.millisecond=Math.floor(y)}break;default:throw new Error("Wrong input string for conversion")}var v=o.exec(i);if(v===null)throw new Error("Wrong input string for conversion");for(var A=1;A<v.length;A++){switch(A){case 1:this.year=parseInt(v[A],10);break;case 2:this.month=parseInt(v[A],10);break;case 3:this.day=parseInt(v[A],10);break;case 4:this.hour=parseInt(v[A],10)+a;break;case 5:this.minute=parseInt(v[A],10)+s;break;case 6:this.second=parseInt(v[A],10);break;default:throw new Error("Wrong input string for conversion")}}if(t===false){var h=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=h.getUTCFullYear();this.month=h.getUTCMonth();this.day=h.getUTCDay();this.hour=h.getUTCHours();this.minute=h.getUTCMinutes();this.second=h.getUTCSeconds();this.millisecond=h.getUTCMilliseconds()}};t.prototype.toString=function(t){if(t===void 0){t="iso"}if(t==="iso"){var r=[];r.push(padNumber(this.year,4));r.push(padNumber(this.month,2));r.push(padNumber(this.day,2));r.push(padNumber(this.hour,2));r.push(padNumber(this.minute,2));r.push(padNumber(this.second,2));if(this.millisecond!==0){r.push(".");r.push(padNumber(this.millisecond,3))}r.push("Z");return r.join("")}return e.prototype.toString.call(this,t)};t.prototype.toJSON=function(){return __assign(__assign({},e.prototype.toJSON.call(this)),{millisecond:this.millisecond})};return t}(UTCTime);_a$5=GeneralizedTime;(function(){typeStore.GeneralizedTime=_a$5})();GeneralizedTime.NAME="GeneralizedTime";var _a$4;var DATE=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=31;return r}return t}(Utf8String);_a$4=DATE;(function(){typeStore.DATE=_a$4})();DATE.NAME="DATE";var _a$3;var TimeOfDay=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=32;return r}return t}(Utf8String);_a$3=TimeOfDay;(function(){typeStore.TimeOfDay=_a$3})();TimeOfDay.NAME="TimeOfDay";var _a$2;var DateTime=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=33;return r}return t}(Utf8String);_a$2=DateTime;(function(){typeStore.DateTime=_a$2})();DateTime.NAME="DateTime";var _a$1;var Duration=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=34;return r}return t}(Utf8String);_a$1=Duration;(function(){typeStore.Duration=_a$1})();Duration.NAME="Duration";var _a;var TIME=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;r.idBlock.tagClass=1;r.idBlock.tagNumber=14;return r}return t}(Utf8String);_a=TIME;(function(){typeStore.TIME=_a})();TIME.NAME="TIME";var Any=function(){function e(e){var t=e===void 0?{}:e,r=t.name,i=r===void 0?EMPTY_STRING:r,n=t.optional,o=n===void 0?false:n;this.name=i;this.optional=o}return e}();var Choice=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?[]:i,o=__rest(t,["value"]);r=e.call(this,o)||this;r.value=n;return r}return t}(Any);var Repeated=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=this;var i=t.value,n=i===void 0?new Any:i,o=t.local,a=o===void 0?false:o,s=__rest(t,["value","local"]);r=e.call(this,s)||this;r.value=n;r.local=a;return r}return t}(Any);var RawData=function(){function e(e){var t=e===void 0?{}:e,r=t.data,i=r===void 0?EMPTY_VIEW:r;this.dataView=BufferSourceConverter_1.toUint8Array(i)}Object.defineProperty(e.prototype,"data",{get:function(){return this.dataView.slice().buffer},set:function(e){this.dataView=BufferSourceConverter_1.toUint8Array(e)},enumerable:false,configurable:true});e.prototype.fromBER=function(e,t,r){var i=t+r;this.dataView=BufferSourceConverter_1.toUint8Array(e).subarray(t,i);return i};e.prototype.toBER=function(e){return this.dataView.slice().buffer};return e}();function compareSchema(e,t,r){if(r instanceof Choice){for(var i=0;i<r.value.length;i++){var n=compareSchema(e,t,r.value[i]);if(n.verified){return{verified:true,result:e}}}{var o={verified:false,result:{error:"Wrong values for Choice type"}};if(r.hasOwnProperty(NAME))o.name=r.name;return o}}if(r instanceof Any){if(r.hasOwnProperty(NAME))e[r.name]=t;return{verified:true,result:e}}if(e instanceof Object===false){return{verified:false,result:{error:"Wrong root object"}}}if(t instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 data"}}}if(r instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(ID_BLOCK in r===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(FROM_BER in r.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(TO_BER in r.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}var a=r.idBlock.toBER(false);if(a.byteLength===0){return{verified:false,result:{error:"Error encoding idBlock for ASN.1 schema"}}}var s=r.idBlock.fromBER(a,0,a.byteLength);if(s===-1){return{verified:false,result:{error:"Error decoding idBlock for ASN.1 schema"}}}if(r.idBlock.hasOwnProperty(TAG_CLASS)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.tagClass!==t.idBlock.tagClass){return{verified:false,result:e}}if(r.idBlock.hasOwnProperty(TAG_NUMBER)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.tagNumber!==t.idBlock.tagNumber){return{verified:false,result:e}}if(r.idBlock.hasOwnProperty(IS_CONSTRUCTED)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.isConstructed!==t.idBlock.isConstructed){return{verified:false,result:e}}if(!(IS_HEX_ONLY in r.idBlock)){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(r.idBlock.isHexOnly!==t.idBlock.isHexOnly){return{verified:false,result:e}}if(r.idBlock.isHexOnly){if(VALUE_HEX_VIEW in r.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}var c=r.idBlock.valueHexView;var u=t.idBlock.valueHexView;if(c.length!==u.length){return{verified:false,result:e}}for(var p=0;p<c.length;p++){if(c[p]!==u[1]){return{verified:false,result:e}}}}if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)e[r.name]=t}if(r instanceof typeStore.Constructed){var f=0;var n={verified:false,result:{error:"Unknown error"}};var d=r.valueBlock.value.length;if(d>0){if(r.valueBlock.value[0]instanceof Repeated){d=t.valueBlock.value.length}}if(d===0){return{verified:true,result:e}}if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){var l=true;for(var p=0;p<r.valueBlock.value.length;p++)l=l&&(r.valueBlock.value[p].optional||false);if(l){return{verified:true,result:e}}if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)delete e[r.name]}e.error="Inconsistent object length";return{verified:false,result:e}}for(var p=0;p<d;p++){if(p-f>=t.valueBlock.value.length){if(r.valueBlock.value[p].optional===false){var o={verified:false,result:e};e.error="Inconsistent length between ASN.1 data and schema";if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name){delete e[r.name];o.name=r.name}}return o}}else{if(r.valueBlock.value[0]instanceof Repeated){n=compareSchema(e,t.valueBlock.value[p],r.valueBlock.value[0].value);if(n.verified===false){if(r.valueBlock.value[0].optional)f++;else{if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)delete e[r.name]}return n}}if(NAME in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){var y={};if(LOCAL in r.valueBlock.value[0]&&r.valueBlock.value[0].local)y=t;else y=e;if(typeof y[r.valueBlock.value[0].name]==="undefined")y[r.valueBlock.value[0].name]=[];y[r.valueBlock.value[0].name].push(t.valueBlock.value[p])}}else{n=compareSchema(e,t.valueBlock.value[p-f],r.valueBlock.value[p]);if(n.verified===false){if(r.valueBlock.value[p].optional)f++;else{if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name)delete e[r.name]}return n}}}}}if(n.verified===false){var o={verified:false,result:e};if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name){delete e[r.name];o.name=r.name}}return o}return{verified:true,result:e}}if(r.primitiveSchema&&VALUE_HEX_VIEW in t.valueBlock){var v=localFromBER(t.valueBlock.valueHexView);if(v.offset===-1){var o={verified:false,result:v.result};if(r.name){r.name=r.name.replace(/^\s+|\s+$/g,EMPTY_STRING);if(r.name){delete e[r.name];o.name=r.name}}return o}return compareSchema(e,v.result,r.primitiveSchema)}return{verified:true,result:e}}function verifySchema(e,t){if(t instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema type"}}}var r=localFromBER(BufferSourceConverter_1.toUint8Array(e));if(r.offset===-1){return{verified:false,result:r.result}}return compareSchema(r.result,r.result,t)}var asn1js=Object.freeze({__proto__:null,Any:Any,BaseBlock:BaseBlock,BaseStringBlock:BaseStringBlock,BitString:BitString$1,BmpString:BmpString,Boolean:Boolean,CharacterString:CharacterString,Choice:Choice,Constructed:Constructed,DATE:DATE,DateTime:DateTime,Duration:Duration,EndOfContent:EndOfContent,Enumerated:Enumerated,GeneralString:GeneralString,GeneralizedTime:GeneralizedTime,GraphicString:GraphicString,HexBlock:HexBlock,IA5String:IA5String,Integer:Integer,Null:Null,NumericString:NumericString,ObjectIdentifier:ObjectIdentifier,OctetString:OctetString$1,Primitive:Primitive,PrintableString:PrintableString,RawData:RawData,RelativeObjectIdentifier:RelativeObjectIdentifier,Repeated:Repeated,Sequence:Sequence,Set:Set,TIME:TIME,TeletexString:TeletexString,TimeOfDay:TimeOfDay,UTCTime:UTCTime,UniversalString:UniversalString,Utf8String:Utf8String,ValueBlock:ValueBlock,VideotexString:VideotexString,ViewWriter:ViewWriter,VisibleString:VisibleString,compareSchema:compareSchema,fromBER:fromBER,verifySchema:verifySchema});var AsnTypeTypes;(function(e){e[e["Sequence"]=0]="Sequence";e[e["Set"]=1]="Set";e[e["Choice"]=2]="Choice"})(AsnTypeTypes||(AsnTypeTypes={}));var AsnPropTypes;(function(e){e[e["Any"]=1]="Any";e[e["Boolean"]=2]="Boolean";e[e["OctetString"]=3]="OctetString";e[e["BitString"]=4]="BitString";e[e["Integer"]=5]="Integer";e[e["Enumerated"]=6]="Enumerated";e[e["ObjectIdentifier"]=7]="ObjectIdentifier";e[e["Utf8String"]=8]="Utf8String";e[e["BmpString"]=9]="BmpString";e[e["UniversalString"]=10]="UniversalString";e[e["NumericString"]=11]="NumericString";e[e["PrintableString"]=12]="PrintableString";e[e["TeletexString"]=13]="TeletexString";e[e["VideotexString"]=14]="VideotexString";e[e["IA5String"]=15]="IA5String";e[e["GraphicString"]=16]="GraphicString";e[e["VisibleString"]=17]="VisibleString";e[e["GeneralString"]=18]="GeneralString";e[e["CharacterString"]=19]="CharacterString";e[e["UTCTime"]=20]="UTCTime";e[e["GeneralizedTime"]=21]="GeneralizedTime";e[e["DATE"]=22]="DATE";e[e["TimeOfDay"]=23]="TimeOfDay";e[e["DateTime"]=24]="DateTime";e[e["Duration"]=25]="Duration";e[e["TIME"]=26]="TIME";e[e["Null"]=27]="Null"})(AsnPropTypes||(AsnPropTypes={}));var BitString=function(){function e(e,t){if(t===void 0){t=0}this.unusedBits=0;this.value=new ArrayBuffer(0);if(e){if(typeof e==="number"){this.fromNumber(e)}else if(BufferSourceConverter_1.isBufferSource(e)){this.unusedBits=t;this.value=BufferSourceConverter_1.toArrayBuffer(e)}else{throw TypeError("Unsupported type of 'params' argument for BitString")}}}e.prototype.fromASN=function(e){if(!(e instanceof BitString$1)){throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString")}this.unusedBits=e.valueBlock.unusedBits;this.value=e.valueBlock.valueHex;return this};e.prototype.toASN=function(){return new BitString$1({unusedBits:this.unusedBits,valueHex:this.value})};e.prototype.toSchema=function(e){return new BitString$1({name:e})};e.prototype.toNumber=function(){var e="";var t=new Uint8Array(this.value);for(var r=0,i=t;r<i.length;r++){var n=i[r];e+=n.toString(2).padStart(8,"0")}e=e.split("").reverse().join("");if(this.unusedBits){e=e.slice(this.unusedBits).padStart(this.unusedBits,"0")}return parseInt(e,2)};e.prototype.fromNumber=function(e){var t=e.toString(2);var r=t.length+7>>3;this.unusedBits=(r<<3)-t.length;var i=new Uint8Array(r);t=t.padStart(r<<3,"0").split("").reverse().join("");var n=0;while(n<r){i[n]=parseInt(t.slice(n<<3,(n<<3)+8),2);n++}this.value=i.buffer};return e}();var OctetString=function(){function e(e){if(typeof e==="number"){this.buffer=new ArrayBuffer(e)}else{if(BufferSourceConverter_1.isBufferSource(e)){this.buffer=BufferSourceConverter_1.toArrayBuffer(e)}else if(Array.isArray(e)){this.buffer=new Uint8Array(e)}else{this.buffer=new ArrayBuffer(0)}}}Object.defineProperty(e.prototype,"byteLength",{get:function(){return this.buffer.byteLength},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"byteOffset",{get:function(){return 0},enumerable:false,configurable:true});e.prototype.fromASN=function(e){if(!(e instanceof OctetString$1)){throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString")}this.buffer=e.valueBlock.valueHex;return this};e.prototype.toASN=function(){return new OctetString$1({valueHex:this.buffer})};e.prototype.toSchema=function(e){return new OctetString$1({name:e})};return e}();var AsnAnyConverter={fromASN:function(e){return e instanceof Null?null:e.valueBeforeDecodeView},toASN:function(e){if(e===null){return new Null}var t=fromBER(e);if(t.result.error){throw new Error(t.result.error)}return t.result}};var AsnIntegerConverter={fromASN:function(e){return e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec},toASN:function(e){return new Integer({value:+e})}};var AsnEnumeratedConverter={fromASN:function(e){return e.valueBlock.valueDec},toASN:function(e){return new Enumerated({value:e})}};var AsnIntegerArrayBufferConverter={fromASN:function(e){return e.valueBlock.valueHexView},toASN:function(e){return new Integer({valueHex:e})}};var AsnBitStringConverter={fromASN:function(e){return e.valueBlock.valueHexView},toASN:function(e){return new BitString$1({valueHex:e})}};var AsnObjectIdentifierConverter={fromASN:function(e){return e.valueBlock.toString()},toASN:function(e){return new ObjectIdentifier({value:e})}};var AsnBooleanConverter={fromASN:function(e){return e.valueBlock.value},toASN:function(e){return new Boolean({value:e})}};var AsnOctetStringConverter={fromASN:function(e){return e.valueBlock.valueHexView},toASN:function(e){return new OctetString$1({valueHex:e})}};var AsnConstructedOctetStringConverter={fromASN:function(e){return new OctetString(e.getValue())},toASN:function(e){return e.toASN()}};function createStringConverter(e){return{fromASN:function(e){return e.valueBlock.value},toASN:function(t){return new e({value:t})}}}var AsnUtf8StringConverter=createStringConverter(Utf8String);var AsnBmpStringConverter=createStringConverter(BmpString);var AsnUniversalStringConverter=createStringConverter(UniversalString);var AsnNumericStringConverter=createStringConverter(NumericString);var AsnPrintableStringConverter=createStringConverter(PrintableString);var AsnTeletexStringConverter=createStringConverter(TeletexString);var AsnVideotexStringConverter=createStringConverter(VideotexString);var AsnIA5StringConverter=createStringConverter(IA5String);var AsnGraphicStringConverter=createStringConverter(GraphicString);var AsnVisibleStringConverter=createStringConverter(VisibleString);var AsnGeneralStringConverter=createStringConverter(GeneralString);var AsnCharacterStringConverter=createStringConverter(CharacterString);var AsnUTCTimeConverter={fromASN:function(e){return e.toDate()},toASN:function(e){return new UTCTime({valueDate:e})}};var AsnGeneralizedTimeConverter={fromASN:function(e){return e.toDate()},toASN:function(e){return new GeneralizedTime({valueDate:e})}};var AsnNullConverter={fromASN:function(){return null},toASN:function(){return new Null}};function defaultConverter(e){switch(e){case AsnPropTypes.Any:return AsnAnyConverter;case AsnPropTypes.BitString:return AsnBitStringConverter;case AsnPropTypes.BmpString:return AsnBmpStringConverter;case AsnPropTypes.Boolean:return AsnBooleanConverter;case AsnPropTypes.CharacterString:return AsnCharacterStringConverter;case AsnPropTypes.Enumerated:return AsnEnumeratedConverter;case AsnPropTypes.GeneralString:return AsnGeneralStringConverter;case AsnPropTypes.GeneralizedTime:return AsnGeneralizedTimeConverter;case AsnPropTypes.GraphicString:return AsnGraphicStringConverter;case AsnPropTypes.IA5String:return AsnIA5StringConverter;case AsnPropTypes.Integer:return AsnIntegerConverter;case AsnPropTypes.Null:return AsnNullConverter;case AsnPropTypes.NumericString:return AsnNumericStringConverter;case AsnPropTypes.ObjectIdentifier:return AsnObjectIdentifierConverter;case AsnPropTypes.OctetString:return AsnOctetStringConverter;case AsnPropTypes.PrintableString:return AsnPrintableStringConverter;case AsnPropTypes.TeletexString:return AsnTeletexStringConverter;case AsnPropTypes.UTCTime:return AsnUTCTimeConverter;case AsnPropTypes.UniversalString:return AsnUniversalStringConverter;case AsnPropTypes.Utf8String:return AsnUtf8StringConverter;case AsnPropTypes.VideotexString:return AsnVideotexStringConverter;case AsnPropTypes.VisibleString:return AsnVisibleStringConverter;default:return null}}function isConvertible(e){if(typeof e==="function"&&e.prototype){if(e.prototype.toASN&&e.prototype.fromASN){return true}else{return isConvertible(e.prototype)}}else{return!!(e&&typeof e==="object"&&"toASN"in e&&"fromASN"in e)}}function isTypeOfArray(e){var t;if(e){var r=Object.getPrototypeOf(e);if(((t=r===null||r===void 0?void 0:r.prototype)===null||t===void 0?void 0:t.constructor)===Array){return true}return isTypeOfArray(r)}return false}function isArrayEqual(e,t){if(!(e&&t)){return false}if(e.byteLength!==t.byteLength){return false}var r=new Uint8Array(e);var i=new Uint8Array(t);for(var n=0;n<e.byteLength;n++){if(r[n]!==i[n]){return false}}return true}var AsnSchemaStorage=function(){function e(){this.items=new WeakMap}e.prototype.has=function(e){return this.items.has(e)};e.prototype.get=function(e,t){if(t===void 0){t=false}var r=this.items.get(e);if(!r){throw new Error("Cannot get schema for '".concat(e.prototype.constructor.name,"' target"))}if(t&&!r.schema){throw new Error("Schema '".concat(e.prototype.constructor.name,"' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'."))}return r};e.prototype.cache=function(e){var t=this.get(e);if(!t.schema){t.schema=this.create(e,true)}};e.prototype.createDefault=function(e){var t={type:AsnTypeTypes.Sequence,items:{}};var r=this.findParentSchema(e);if(r){Object.assign(t,r);t.items=Object.assign({},t.items,r.items)}return t};e.prototype.create=function(e,t){var r=this.items.get(e)||this.createDefault(e);var i=[];for(var n in r.items){var o=r.items[n];var a=t?n:"";var s=void 0;if(typeof o.type==="number"){var c=AsnPropTypes[o.type];var u=asn1js[c];if(!u){throw new Error("Cannot get ASN1 class by name '".concat(c,"'"))}s=new u({name:a})}else if(isConvertible(o.type)){var p=new o.type;s=p.toSchema(a)}else if(o.optional){var f=this.get(o.type);if(f.type===AsnTypeTypes.Choice){s=new Any({name:a})}else{s=this.create(o.type,false);s.name=a}}else{s=new Any({name:a})}var d=!!o.optional||o.defaultValue!==undefined;if(o.repeated){s.name="";var l=o.repeated==="set"?Set:Sequence;s=new l({name:"",value:[new Repeated({name:a,value:s})]})}if(o.context!==null&&o.context!==undefined){if(o.implicit){if(typeof o.type==="number"||isConvertible(o.type)){var l=o.repeated?Constructed:Primitive;i.push(new l({name:a,optional:d,idBlock:{tagClass:3,tagNumber:o.context}}))}else{this.cache(o.type);var y=!!o.repeated;var v=!y?this.get(o.type,true).schema:s;v="valueBlock"in v?v.valueBlock.value:v.value;i.push(new Constructed({name:!y?a:"",optional:d,idBlock:{tagClass:3,tagNumber:o.context},value:v}))}}else{i.push(new Constructed({optional:d,idBlock:{tagClass:3,tagNumber:o.context},value:[s]}))}}else{s.optional=d;i.push(s)}}switch(r.type){case AsnTypeTypes.Sequence:return new Sequence({value:i,name:""});case AsnTypeTypes.Set:return new Set({value:i,name:""});case AsnTypeTypes.Choice:return new Choice({value:i,name:""});default:throw new Error("Unsupported ASN1 type in use")}};e.prototype.set=function(e,t){this.items.set(e,t);return this};e.prototype.findParentSchema=function(e){var t=Object.getPrototypeOf(e);if(t){var r=this.items.get(t);return r||this.findParentSchema(t)}return null};return e}();var schemaStorage=new AsnSchemaStorage;var AsnType=function(e){return function(t){var r;if(!schemaStorage.has(t)){r=schemaStorage.createDefault(t);schemaStorage.set(t,r)}else{r=schemaStorage.get(t)}Object.assign(r,e)}};var AsnProp=function(e){return function(t,r){var i;if(!schemaStorage.has(t.constructor)){i=schemaStorage.createDefault(t.constructor);schemaStorage.set(t.constructor,i)}else{i=schemaStorage.get(t.constructor)}var n=Object.assign({},e);if(typeof n.type==="number"&&!n.converter){var o=defaultConverter(e.type);if(!o){throw new Error("Cannot get default converter for property '".concat(r,"' of ").concat(t.constructor.name))}n.converter=o}i.items[r]=n}};var AsnSchemaValidationError=function(e){__extends(t,e);function t(){var t=e.apply(this,arguments)||this;t.schemas=[];return t}return t}(Error);var AsnParser=function(){function e(){}e.parse=function(e,t){var r=fromBER(e);if(r.result.error){throw new Error(r.result.error)}var i=this.fromASN(r.result,t);return i};e.fromASN=function(e,t){var r=this;var i;try{if(isConvertible(t)){var n=new t;return n.fromASN(e)}var o=schemaStorage.get(t);schemaStorage.cache(t);var a=o.schema;if(e.constructor===Constructed&&o.type!==AsnTypeTypes.Choice){a=new Constructed({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:o.schema.valueBlock.value});for(var s in o.items){delete e[s]}}var c=compareSchema({},e,a);if(!c.verified){throw new AsnSchemaValidationError("Data does not match to ".concat(t.name," ASN1 schema. ").concat(c.result.error))}var u=new t;if(isTypeOfArray(t)){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value))){throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.")}var p=o.itemType;if(typeof p==="number"){var f=defaultConverter(p);if(!f){throw new Error("Cannot get default converter for array item of ".concat(t.name," ASN1 schema"))}return t.from(e.valueBlock.value,(function(e){return f.fromASN(e)}))}else{return t.from(e.valueBlock.value,(function(e){return r.fromASN(e,p)}))}}var d=function(e){var t=c.result[e];if(!t){return"continue"}var n=o.items[e];var a=n.type;if(typeof a==="number"||isConvertible(a)){var s=(i=n.converter)!==null&&i!==void 0?i:isConvertible(a)?new a:null;if(!s){throw new Error("Converter is empty")}if(n.repeated){if(n.implicit){var p=n.repeated==="sequence"?Sequence:Set;var f=new p;f.valueBlock=t.valueBlock;var d=fromBER(f.toBER(false));if(d.offset===-1){throw new Error("Cannot parse the child item. ".concat(d.result.error))}if(!("value"in d.result.valueBlock&&Array.isArray(d.result.valueBlock.value))){throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.")}var y=d.result.valueBlock.value;u[e]=Array.from(y,(function(e){return s.fromASN(e)}))}else{u[e]=Array.from(t,(function(e){return s.fromASN(e)}))}}else{var v=t;if(n.implicit){var f=void 0;if(isConvertible(a)){f=(new a).toSchema("")}else{var A=AsnPropTypes[a];var h=asn1js[A];if(!h){throw new Error("Cannot get '".concat(A,"' class from asn1js module"))}f=new h}f.valueBlock=v.valueBlock;v=fromBER(f.toBER(false)).result}u[e]=s.fromASN(v)}}else{if(n.repeated){if(!Array.isArray(t)){throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.")}u[e]=Array.from(t,(function(e){return r.fromASN(e,a)}))}else{u[e]=l.fromASN(t,a)}}};var l=this;for(var s in o.items){d(s)}return u}catch(e){if(e instanceof AsnSchemaValidationError){e.schemas.push(t.name)}throw e}};return e}();var AsnSerializer=function(){function e(){}e.serialize=function(e){if(e instanceof BaseBlock){return e.toBER(false)}return this.toASN(e).toBER(false)};e.toASN=function(t){var r=this;if(t&&typeof t==="object"&&isConvertible(t)){return t.toASN()}if(!(t&&typeof t==="object")){throw new TypeError("Parameter 1 should be type of Object.")}var i=t.constructor;var n=schemaStorage.get(i);schemaStorage.cache(i);var o=[];if(n.itemType){if(!Array.isArray(t)){throw new TypeError("Parameter 1 should be type of Array.")}if(typeof n.itemType==="number"){var a=defaultConverter(n.itemType);if(!a){throw new Error("Cannot get default converter for array item of ".concat(i.name," ASN1 schema"))}o=t.map((function(e){return a.toASN(e)}))}else{o=t.map((function(e){return r.toAsnItem({type:n.itemType},"[]",i,e)}))}}else{for(var s in n.items){var c=n.items[s];var u=t[s];if(u===undefined||c.defaultValue===u||typeof c.defaultValue==="object"&&typeof u==="object"&&isArrayEqual(this.serialize(c.defaultValue),this.serialize(u))){continue}var p=e.toAsnItem(c,s,i,u);if(typeof c.context==="number"){if(c.implicit){if(!c.repeated&&(typeof c.type==="number"||isConvertible(c.type))){var f={};f.valueHex=p instanceof Null?p.valueBeforeDecodeView:p.valueBlock.toBER();o.push(new Primitive(__assign({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context}},f)))}else{o.push(new Constructed({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:p.valueBlock.value}))}}else{o.push(new Constructed({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[p]}))}}else if(c.repeated){o=o.concat(p)}else{o.push(p)}}}var d;switch(n.type){case AsnTypeTypes.Sequence:d=new Sequence({value:o});break;case AsnTypeTypes.Set:d=new Set({value:o});break;case AsnTypeTypes.Choice:if(!o[0]){throw new Error("Schema '".concat(i.name,"' has wrong data. Choice cannot be empty."))}d=o[0];break}return d};e.toAsnItem=function(e,t,r,i){var n=this;var o;if(typeof e.type==="number"){var a=e.converter;if(!a){throw new Error("Property '".concat(t,"' doesn't have converter for type ").concat(AsnPropTypes[e.type]," in schema '").concat(r.name,"'"))}if(e.repeated){if(!Array.isArray(i)){throw new TypeError("Parameter 'objProp' should be type of Array.")}var s=Array.from(i,(function(e){return a.toASN(e)}));var c=e.repeated==="sequence"?Sequence:Set;o=new c({value:s})}else{o=a.toASN(i)}}else{if(e.repeated){if(!Array.isArray(i)){throw new TypeError("Parameter 'objProp' should be type of Array.")}var s=Array.from(i,(function(e){return n.toASN(e)}));var c=e.repeated==="sequence"?Sequence:Set;o=new c({value:s})}else{o=this.toASN(i)}}return o};return e}();var AsnArray=function(e){__extends(t,e);function t(t){if(t===void 0){t=[]}var r=this;if(typeof t==="number"){r=e.call(this,t)||this}else{r=e.call(this)||this;for(var i=0,n=t;i<n.length;i++){var o=n[i];r.push(o)}}return r}return t}(Array);var AsnConvert=function(){function e(){}e.serialize=function(e){return AsnSerializer.serialize(e)};e.parse=function(e,t){return AsnParser.parse(e,t)};e.toString=function(t){var r=BufferSourceConverter_1.isBufferSource(t)?BufferSourceConverter_1.toArrayBuffer(t):e.serialize(t);var i=fromBER(r);if(i.offset===-1){throw new Error("Cannot decode ASN.1 data. ".concat(i.result.error))}return i.result.toString()};return e}();function __decorate$1(e,t,r,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(n<3?a(o):n>3?a(t,r,o):a(t,r))||o;return n>3&&o&&Object.defineProperty(t,r,o),o}typeof SuppressedError==="function"?SuppressedError:function(e,t,r){var i=new Error(r);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};var ipaddr={exports:{}};(function(e){(function(t){var r="(0?\\d+|0x[a-f0-9]+)";var i={fourOctet:new RegExp("^".concat(r,"\\.").concat(r,"\\.").concat(r,"\\.").concat(r,"$"),"i"),threeOctet:new RegExp("^".concat(r,"\\.").concat(r,"\\.").concat(r,"$"),"i"),twoOctet:new RegExp("^".concat(r,"\\.").concat(r,"$"),"i"),longValue:new RegExp("^".concat(r,"$"),"i")};var n=new RegExp("^0[0-7]+$","i");var o=new RegExp("^0x[a-f0-9]+$","i");var a="%[0-9a-z]{1,}";var s="(?:[0-9a-f]+::?)+";var c={zoneIndex:new RegExp(a,"i"),native:new RegExp("^(::)?(".concat(s,")?([0-9a-f]+)?(::)?(").concat(a,")?$"),"i"),deprecatedTransitional:new RegExp("^(?:::)(".concat(r,"\\.").concat(r,"\\.").concat(r,"\\.").concat(r,"(").concat(a,")?)$"),"i"),transitional:new RegExp("^((?:".concat(s,")|(?:::)(?:").concat(s,")?)").concat(r,"\\.").concat(r,"\\.").concat(r,"\\.").concat(r,"(").concat(a,")?$"),"i")};function u(e,t){if(e.indexOf("::")!==e.lastIndexOf("::")){return null}var r=0;var i=-1;var n=(e.match(c.zoneIndex)||[])[0];var o,a;if(n){n=n.substring(1);e=e.replace(/%.+$/,"")}while((i=e.indexOf(":",i+1))>=0){r++}if(e.substr(0,2)==="::"){r--}if(e.substr(-2,2)==="::"){r--}if(r>t){return null}a=t-r;o=":";while(a--){o+="0:"}e=e.replace("::",o);if(e[0]===":"){e=e.slice(1)}if(e[e.length-1]===":"){e=e.slice(0,-1)}t=function(){var t=e.split(":");var r=[];for(var i=0;i<t.length;i++){r.push(parseInt(t[i],16))}return r}();return{parts:t,zoneId:n}}function p(e,t,r,i){if(e.length!==t.length){throw new Error("ipaddr: cannot match CIDR for objects with different lengths")}var n=0;var o;while(i>0){o=r-i;if(o<0){o=0}if(e[n]>>o!==t[n]>>o){return false}i-=r;n+=1}return true}function f(e){if(o.test(e)){return parseInt(e,16)}if(e[0]==="0"&&!isNaN(parseInt(e[1],10))){if(n.test(e)){return parseInt(e,8)}throw new Error("ipaddr: cannot parse ".concat(e," as octal"))}return parseInt(e,10)}function d(e,t){while(e.length<t){e="0".concat(e)}return e}var l={};l.IPv4=function(){function e(e){if(e.length!==4){throw new Error("ipaddr: ipv4 octet count should be 4")}var t,r;for(t=0;t<e.length;t++){r=e[t];if(!(0<=r&&r<=255)){throw new Error("ipaddr: ipv4 octet should fit in 8 bits")}}this.octets=e}e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]]};e.prototype.kind=function(){return"ipv4"};e.prototype.match=function(e,t){var r;if(t===undefined){r=e;e=r[0];t=r[1]}if(e.kind()!=="ipv4"){throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one")}return p(this.octets,e.octets,8,t)};e.prototype.prefixLengthFromSubnetMask=function(){var e=0;var t=false;var r={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};var i,n,o;for(i=3;i>=0;i-=1){n=this.octets[i];if(n in r){o=r[n];if(t&&o!==0){return null}if(o!==8){t=true}e+=o}else{return null}}return 32-e};e.prototype.range=function(){return l.subnetMatch(this,this.SpecialRanges)};e.prototype.toByteArray=function(){return this.octets.slice(0)};e.prototype.toIPv4MappedAddress=function(){return l.IPv6.parse("::ffff:".concat(this.toString()))};e.prototype.toNormalizedString=function(){return this.toString()};e.prototype.toString=function(){return this.octets.join(".")};return e}();l.IPv4.broadcastAddressFromCIDR=function(e){try{var t=this.parseCIDR(e);var r=t[0].toByteArray();var i=this.subnetMaskFromPrefixLength(t[1]).toByteArray();var n=[];var o=0;while(o<4){n.push(parseInt(r[o],10)|parseInt(i[o],10)^255);o++}return new this(n)}catch(e){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}};l.IPv4.isIPv4=function(e){return this.parser(e)!==null};l.IPv4.isValid=function(e){try{new this(this.parser(e));return true}catch(e){return false}};l.IPv4.isValidFourPartDecimal=function(e){if(l.IPv4.isValid(e)&&e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/)){return true}else{return false}};l.IPv4.networkAddressFromCIDR=function(e){var t,r,i,n,o;try{t=this.parseCIDR(e);i=t[0].toByteArray();o=this.subnetMaskFromPrefixLength(t[1]).toByteArray();n=[];r=0;while(r<4){n.push(parseInt(i[r],10)&parseInt(o[r],10));r++}return new this(n)}catch(e){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}};l.IPv4.parse=function(e){var t=this.parser(e);if(t===null){throw new Error("ipaddr: string is not formatted like an IPv4 Address")}return new this(t)};l.IPv4.parseCIDR=function(e){var t;if(t=e.match(/^(.+)\/(\d+)$/)){var r=parseInt(t[2]);if(r>=0&&r<=32){var i=[this.parse(t[1]),r];Object.defineProperty(i,"toString",{value:function(){return this.join("/")}});return i}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")};l.IPv4.parser=function(e){var t,r,n;if(t=e.match(i.fourOctet)){return function(){var e=t.slice(1,6);var i=[];for(var n=0;n<e.length;n++){r=e[n];i.push(f(r))}return i}()}else if(t=e.match(i.longValue)){n=f(t[1]);if(n>4294967295||n<0){throw new Error("ipaddr: address outside defined range")}return function(){var e=[];var t;for(t=0;t<=24;t+=8){e.push(n>>t&255)}return e}().reverse()}else if(t=e.match(i.twoOctet)){return function(){var e=t.slice(1,4);var r=[];n=f(e[1]);if(n>16777215||n<0){throw new Error("ipaddr: address outside defined range")}r.push(f(e[0]));r.push(n>>16&255);r.push(n>>8&255);r.push(n&255);return r}()}else if(t=e.match(i.threeOctet)){return function(){var e=t.slice(1,5);var r=[];n=f(e[2]);if(n>65535||n<0){throw new Error("ipaddr: address outside defined range")}r.push(f(e[0]));r.push(f(e[1]));r.push(n>>8&255);r.push(n&255);return r}()}else{return null}};l.IPv4.subnetMaskFromPrefixLength=function(e){e=parseInt(e);if(e<0||e>32){throw new Error("ipaddr: invalid IPv4 prefix length")}var t=[0,0,0,0];var r=0;var i=Math.floor(e/8);while(r<i){t[r]=255;r++}if(i<4){t[i]=Math.pow(2,e%8)-1<<8-e%8}return new this(t)};l.IPv6=function(){function e(e,t){var r,i;if(e.length===16){this.parts=[];for(r=0;r<=14;r+=2){this.parts.push(e[r]<<8|e[r+1])}}else if(e.length===8){this.parts=e}else{throw new Error("ipaddr: ipv6 part count should be 8 or 16")}for(r=0;r<this.parts.length;r++){i=this.parts[r];if(!(0<=i&&i<=65535)){throw new Error("ipaddr: ipv6 part should fit in 16 bits")}}if(t){this.zoneId=t}}e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[new e([100,65435,0,0,0,0,0,0]),96],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],reserved:[[new e([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[new e([8193,4,274,0,0,0,0,0]),48],deprecated:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28]};e.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"};e.prototype.kind=function(){return"ipv6"};e.prototype.match=function(e,t){var r;if(t===undefined){r=e;e=r[0];t=r[1]}if(e.kind()!=="ipv6"){throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one")}return p(this.parts,e.parts,16,t)};e.prototype.prefixLengthFromSubnetMask=function(){var e=0;var t=false;var r={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};var i,n;for(var o=7;o>=0;o-=1){i=this.parts[o];if(i in r){n=r[i];if(t&&n!==0){return null}if(n!==16){t=true}e+=n}else{return null}}return 128-e};e.prototype.range=function(){return l.subnetMatch(this,this.SpecialRanges)};e.prototype.toByteArray=function(){var e;var t=[];var r=this.parts;for(var i=0;i<r.length;i++){e=r[i];t.push(e>>8);t.push(e&255)}return t};e.prototype.toFixedLengthString=function(){var e=function(){var e=[];for(var t=0;t<this.parts.length;t++){e.push(d(this.parts[t].toString(16),4))}return e}.call(this).join(":");var t="";if(this.zoneId){t="%".concat(this.zoneId)}return e+t};e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress()){throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4")}var e=this.parts.slice(-2);var t=e[0];var r=e[1];return new l.IPv4([t>>8,t&255,r>>8,r&255])};e.prototype.toNormalizedString=function(){var e=function(){var e=[];for(var t=0;t<this.parts.length;t++){e.push(this.parts[t].toString(16))}return e}.call(this).join(":");var t="";if(this.zoneId){t="%".concat(this.zoneId)}return e+t};e.prototype.toRFC5952String=function(){var e=/((^|:)(0(:|$)){2,})/g;var t=this.toNormalizedString();var r=0;var i=-1;var n;while(n=e.exec(t)){if(n[0].length>i){r=n.index;i=n[0].length}}if(i<0){return t}return"".concat(t.substring(0,r),"::").concat(t.substring(r+i))};e.prototype.toString=function(){return this.toRFC5952String()};return e}();l.IPv6.broadcastAddressFromCIDR=function(e){try{var t=this.parseCIDR(e);var r=t[0].toByteArray();var i=this.subnetMaskFromPrefixLength(t[1]).toByteArray();var n=[];var o=0;while(o<16){n.push(parseInt(r[o],10)|parseInt(i[o],10)^255);o++}return new this(n)}catch(e){throw new Error("ipaddr: the address does not have IPv6 CIDR format (".concat(e,")"))}};l.IPv6.isIPv6=function(e){return this.parser(e)!==null};l.IPv6.isValid=function(e){if(typeof e==="string"&&e.indexOf(":")===-1){return false}try{var t=this.parser(e);new this(t.parts,t.zoneId);return true}catch(e){return false}};l.IPv6.networkAddressFromCIDR=function(e){var t,r,i,n,o;try{t=this.parseCIDR(e);i=t[0].toByteArray();o=this.subnetMaskFromPrefixLength(t[1]).toByteArray();n=[];r=0;while(r<16){n.push(parseInt(i[r],10)&parseInt(o[r],10));r++}return new this(n)}catch(e){throw new Error("ipaddr: the address does not have IPv6 CIDR format (".concat(e,")"))}};l.IPv6.parse=function(e){var t=this.parser(e);if(t.parts===null){throw new Error("ipaddr: string is not formatted like an IPv6 Address")}return new this(t.parts,t.zoneId)};l.IPv6.parseCIDR=function(e){var t,r,i;if(r=e.match(/^(.+)\/(\d+)$/)){t=parseInt(r[2]);if(t>=0&&t<=128){i=[this.parse(r[1]),t];Object.defineProperty(i,"toString",{value:function(){return this.join("/")}});return i}}throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")};l.IPv6.parser=function(e){var t,r,i,n,o,a;if(i=e.match(c.deprecatedTransitional)){return this.parser("::ffff:".concat(i[1]))}if(c.native.test(e)){return u(e,8)}if(i=e.match(c.transitional)){a=i[6]||"";t=u(i[1].slice(0,-1)+a,6);if(t.parts){o=[parseInt(i[2]),parseInt(i[3]),parseInt(i[4]),parseInt(i[5])];for(r=0;r<o.length;r++){n=o[r];if(!(0<=n&&n<=255)){return null}}t.parts.push(o[0]<<8|o[1]);t.parts.push(o[2]<<8|o[3]);return{parts:t.parts,zoneId:t.zoneId}}}return null};l.IPv6.subnetMaskFromPrefixLength=function(e){e=parseInt(e);if(e<0||e>128){throw new Error("ipaddr: invalid IPv6 prefix length")}var t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var r=0;var i=Math.floor(e/8);while(r<i){t[r]=255;r++}if(i<16){t[i]=Math.pow(2,e%8)-1<<8-e%8}return new this(t)};l.fromByteArray=function(e){var t=e.length;if(t===4){return new l.IPv4(e)}else if(t===16){return new l.IPv6(e)}else{throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")}};l.isValid=function(e){return l.IPv6.isValid(e)||l.IPv4.isValid(e)};l.parse=function(e){if(l.IPv6.isValid(e)){return l.IPv6.parse(e)}else if(l.IPv4.isValid(e)){return l.IPv4.parse(e)}else{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")}};l.parseCIDR=function(e){try{return l.IPv6.parseCIDR(e)}catch(t){try{return l.IPv4.parseCIDR(e)}catch(e){throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}};l.process=function(e){var t=this.parse(e);if(t.kind()==="ipv6"&&t.isIPv4MappedAddress()){return t.toIPv4Address()}else{return t}};l.subnetMatch=function(e,t,r){var i,n,o,a;if(r===undefined||r===null){r="unicast"}for(n in t){if(Object.prototype.hasOwnProperty.call(t,n)){o=t[n];if(o[0]&&!(o[0]instanceof Array)){o=[o]}for(i=0;i<o.length;i++){a=o[i];if(e.kind()===a[0].kind()&&e.match.apply(e,a)){return n}}}}return r};if(e.exports){e.exports=l}else{t.ipaddr=l}})(commonjsGlobal)})(ipaddr);var IpConverter=function(){function e(){}e.decodeIP=function(e){if(e.length===64&&parseInt(e,16)===0){return"::/0"}if(e.length!==16){return e}var t=parseInt(e.slice(8),16).toString(2).split("").reduce((function(e,t){return e+ +t}),0);var r=e.slice(0,8).replace(/(.{2})/g,(function(e){return"".concat(parseInt(e,16),".")}));r=r.slice(0,-1);return"".concat(r,"/").concat(t)};e.toString=function(e){if(e.byteLength===4||e.byteLength===16){var t=new Uint8Array(e);var r=ipaddr.exports.fromByteArray(Array.from(t));return r.toString()}return this.decodeIP(Convert_1.ToHex(e))};e.fromString=function(e){var t=ipaddr.exports.parse(e);return new Uint8Array(t.toByteArray()).buffer};return e}();var RelativeDistinguishedName_1,RDNSequence_1,Name_1;var DirectoryString=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}e.prototype.toString=function(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""};return e}();__decorate$1([AsnProp({type:AsnPropTypes.TeletexString})],DirectoryString.prototype,"teletexString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],DirectoryString.prototype,"printableString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.UniversalString})],DirectoryString.prototype,"universalString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],DirectoryString.prototype,"utf8String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],DirectoryString.prototype,"bmpString",void 0);DirectoryString=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DirectoryString);var AttributeValue=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}var r=e.call(this,t)||this;Object.assign(r,t);return r}t.prototype.toString=function(){return this.ia5String||(this.anyValue?Convert_1.ToHex(this.anyValue):e.prototype.toString.call(this))};return t}(DirectoryString);__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],AttributeValue.prototype,"ia5String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],AttributeValue.prototype,"anyValue",void 0);AttributeValue=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],AttributeValue);var AttributeTypeAndValue=function(){function e(e){if(e===void 0){e={}}this.type="";this.value=new AttributeValue;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],AttributeTypeAndValue.prototype,"type",void 0);__decorate$1([AsnProp({type:AttributeValue})],AttributeTypeAndValue.prototype,"value",void 0);var RelativeDistinguishedName=RelativeDistinguishedName_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RelativeDistinguishedName_1.prototype);return r}return t}(AsnArray);RelativeDistinguishedName=RelativeDistinguishedName_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:AttributeTypeAndValue})],RelativeDistinguishedName);var RDNSequence=RDNSequence_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RDNSequence_1.prototype);return r}return t}(AsnArray);RDNSequence=RDNSequence_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:RelativeDistinguishedName})],RDNSequence);var Name$1=Name_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name_1.prototype);return r}return t}(RDNSequence);Name$1=Name_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],Name$1);var AsnIpConverter={fromASN:function(e){return IpConverter.toString(AsnOctetStringConverter.fromASN(e))},toASN:function(e){return AsnOctetStringConverter.toASN(IpConverter.fromString(e))}};var OtherName=function(){function e(e){if(e===void 0){e={}}this.typeId="";this.value=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherName.prototype,"typeId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],OtherName.prototype,"value",void 0);var EDIPartyName=function(){function e(e){if(e===void 0){e={}}this.partyName=new DirectoryString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DirectoryString,optional:true,context:0,implicit:true})],EDIPartyName.prototype,"nameAssigner",void 0);__decorate$1([AsnProp({type:DirectoryString,context:1,implicit:true})],EDIPartyName.prototype,"partyName",void 0);var GeneralName=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OtherName,context:0,implicit:true})],GeneralName.prototype,"otherName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:1,implicit:true})],GeneralName.prototype,"rfc822Name",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:2,implicit:true})],GeneralName.prototype,"dNSName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:3,implicit:true})],GeneralName.prototype,"x400Address",void 0);__decorate$1([AsnProp({type:Name$1,context:4,implicit:false})],GeneralName.prototype,"directoryName",void 0);__decorate$1([AsnProp({type:EDIPartyName,context:5})],GeneralName.prototype,"ediPartyName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.IA5String,context:6,implicit:true})],GeneralName.prototype,"uniformResourceIdentifier",void 0);__decorate$1([AsnProp({type:AsnPropTypes.OctetString,context:7,implicit:true,converter:AsnIpConverter})],GeneralName.prototype,"iPAddress",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier,context:8,implicit:true})],GeneralName.prototype,"registeredID",void 0);GeneralName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],GeneralName);var id_pkix$1="1.3.6.1.5.5.7";var id_pe$1="".concat(id_pkix$1,".1");var id_ce="2.5.29";var AuthorityInfoAccessSyntax_1;var id_pe_authorityInfoAccess="".concat(id_pe$1,".1");var AccessDescription=function(){function e(e){if(e===void 0){e={}}this.accessMethod="";this.accessLocation=new GeneralName;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],AccessDescription.prototype,"accessMethod",void 0);__decorate$1([AsnProp({type:GeneralName})],AccessDescription.prototype,"accessLocation",void 0);var AuthorityInfoAccessSyntax=AuthorityInfoAccessSyntax_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AuthorityInfoAccessSyntax_1.prototype);return r}return t}(AsnArray);AuthorityInfoAccessSyntax=AuthorityInfoAccessSyntax_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AccessDescription})],AuthorityInfoAccessSyntax);var id_ce_authorityKeyIdentifier="".concat(id_ce,".35");var KeyIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var AuthorityKeyIdentifier=function(){function e(e){if(e===void 0){e={}}if(e){Object.assign(this,e)}}return e}();__decorate$1([AsnProp({type:KeyIdentifier,context:0,optional:true,implicit:true})],AuthorityKeyIdentifier.prototype,"keyIdentifier",void 0);__decorate$1([AsnProp({type:GeneralName,context:1,optional:true,implicit:true,repeated:"sequence"})],AuthorityKeyIdentifier.prototype,"authorityCertIssuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:2,optional:true,implicit:true,converter:AsnIntegerArrayBufferConverter})],AuthorityKeyIdentifier.prototype,"authorityCertSerialNumber",void 0);var id_ce_basicConstraints="".concat(id_ce,".19");var BasicConstraints=function(){function e(e){if(e===void 0){e={}}this.cA=false;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Boolean,defaultValue:false})],BasicConstraints.prototype,"cA",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],BasicConstraints.prototype,"pathLenConstraint",void 0);var GeneralNames_1;var GeneralNames=GeneralNames_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,GeneralNames_1.prototype);return r}return t}(AsnArray);GeneralNames=GeneralNames_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:GeneralName})],GeneralNames);var CertificateIssuer_1;var id_ce_certificateIssuer="".concat(id_ce,".29");var CertificateIssuer=CertificateIssuer_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertificateIssuer_1.prototype);return r}return t}(GeneralNames);CertificateIssuer=CertificateIssuer_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CertificateIssuer);var CertificatePolicies_1;var id_ce_certificatePolicies="".concat(id_ce,".32");var DisplayText=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}e.prototype.toString=function(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""};return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],DisplayText.prototype,"ia5String",void 0);__decorate$1([AsnProp({type:AsnPropTypes.VisibleString})],DisplayText.prototype,"visibleString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],DisplayText.prototype,"bmpString",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],DisplayText.prototype,"utf8String",void 0);DisplayText=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DisplayText);var NoticeReference=function(){function e(e){if(e===void 0){e={}}this.organization=new DisplayText;this.noticeNumbers=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DisplayText})],NoticeReference.prototype,"organization",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,repeated:"sequence"})],NoticeReference.prototype,"noticeNumbers",void 0);var UserNotice=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:NoticeReference,optional:true})],UserNotice.prototype,"noticeRef",void 0);__decorate$1([AsnProp({type:DisplayText,optional:true})],UserNotice.prototype,"explicitText",void 0);var Qualifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],Qualifier.prototype,"cPSuri",void 0);__decorate$1([AsnProp({type:UserNotice})],Qualifier.prototype,"userNotice",void 0);Qualifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Qualifier);var PolicyQualifierInfo=function(){function e(e){if(e===void 0){e={}}this.policyQualifierId="";this.qualifier=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyQualifierInfo.prototype,"policyQualifierId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],PolicyQualifierInfo.prototype,"qualifier",void 0);var PolicyInformation=function(){function e(e){if(e===void 0){e={}}this.policyIdentifier="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyInformation.prototype,"policyIdentifier",void 0);__decorate$1([AsnProp({type:PolicyQualifierInfo,repeated:"sequence",optional:true})],PolicyInformation.prototype,"policyQualifiers",void 0);var CertificatePolicies=CertificatePolicies_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertificatePolicies_1.prototype);return r}return t}(AsnArray);CertificatePolicies=CertificatePolicies_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:PolicyInformation})],CertificatePolicies);var id_ce_cRLNumber="".concat(id_ce,".20");var CRLNumber=function(){function e(e){if(e===void 0){e=0}this.value=e}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],CRLNumber.prototype,"value",void 0);CRLNumber=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CRLNumber);var id_ce_deltaCRLIndicator="".concat(id_ce,".27");var BaseCRLNumber=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(CRLNumber);BaseCRLNumber=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],BaseCRLNumber);var CRLDistributionPoints_1;var id_ce_cRLDistributionPoints="".concat(id_ce,".31");var ReasonFlags;(function(e){e[e["unused"]=1]="unused";e[e["keyCompromise"]=2]="keyCompromise";e[e["cACompromise"]=4]="cACompromise";e[e["affiliationChanged"]=8]="affiliationChanged";e[e["superseded"]=16]="superseded";e[e["cessationOfOperation"]=32]="cessationOfOperation";e[e["certificateHold"]=64]="certificateHold";e[e["privilegeWithdrawn"]=128]="privilegeWithdrawn";e[e["aACompromise"]=256]="aACompromise"})(ReasonFlags||(ReasonFlags={}));var Reason=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.toJSON=function(){var e=[];var t=this.toNumber();if(t&ReasonFlags.aACompromise){e.push("aACompromise")}if(t&ReasonFlags.affiliationChanged){e.push("affiliationChanged")}if(t&ReasonFlags.cACompromise){e.push("cACompromise")}if(t&ReasonFlags.certificateHold){e.push("certificateHold")}if(t&ReasonFlags.cessationOfOperation){e.push("cessationOfOperation")}if(t&ReasonFlags.keyCompromise){e.push("keyCompromise")}if(t&ReasonFlags.privilegeWithdrawn){e.push("privilegeWithdrawn")}if(t&ReasonFlags.superseded){e.push("superseded")}if(t&ReasonFlags.unused){e.push("unused")}return e};t.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return t}(BitString);var DistributionPointName=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0,repeated:"sequence",implicit:true})],DistributionPointName.prototype,"fullName",void 0);__decorate$1([AsnProp({type:RelativeDistinguishedName,context:1,implicit:true})],DistributionPointName.prototype,"nameRelativeToCRLIssuer",void 0);DistributionPointName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DistributionPointName);var DistributionPoint=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DistributionPointName,context:0,optional:true})],DistributionPoint.prototype,"distributionPoint",void 0);__decorate$1([AsnProp({type:Reason,context:1,optional:true,implicit:true})],DistributionPoint.prototype,"reasons",void 0);__decorate$1([AsnProp({type:GeneralName,context:2,optional:true,repeated:"sequence",implicit:true})],DistributionPoint.prototype,"cRLIssuer",void 0);var CRLDistributionPoints=CRLDistributionPoints_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CRLDistributionPoints_1.prototype);return r}return t}(AsnArray);CRLDistributionPoints=CRLDistributionPoints_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:DistributionPoint})],CRLDistributionPoints);var FreshestCRL_1;var FreshestCRL=FreshestCRL_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,FreshestCRL_1.prototype);return r}return t}(CRLDistributionPoints);FreshestCRL=FreshestCRL_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:DistributionPoint})],FreshestCRL);var id_ce_issuingDistributionPoint="".concat(id_ce,".28");var IssuingDistributionPoint=function(){function e(t){if(t===void 0){t={}}this.onlyContainsUserCerts=e.ONLY;this.onlyContainsCACerts=e.ONLY;this.indirectCRL=e.ONLY;this.onlyContainsAttributeCerts=e.ONLY;Object.assign(this,t)}return e}();IssuingDistributionPoint.ONLY=false;__decorate$1([AsnProp({type:DistributionPointName,context:0,optional:true})],IssuingDistributionPoint.prototype,"distributionPoint",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:1,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"onlyContainsUserCerts",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:2,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"onlyContainsCACerts",void 0);__decorate$1([AsnProp({type:Reason,context:3,optional:true,implicit:true})],IssuingDistributionPoint.prototype,"onlySomeReasons",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:4,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"indirectCRL",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,context:5,defaultValue:IssuingDistributionPoint.ONLY,implicit:true})],IssuingDistributionPoint.prototype,"onlyContainsAttributeCerts",void 0);var id_ce_cRLReasons="".concat(id_ce,".21");var CRLReasons;(function(e){e[e["unspecified"]=0]="unspecified";e[e["keyCompromise"]=1]="keyCompromise";e[e["cACompromise"]=2]="cACompromise";e[e["affiliationChanged"]=3]="affiliationChanged";e[e["superseded"]=4]="superseded";e[e["cessationOfOperation"]=5]="cessationOfOperation";e[e["certificateHold"]=6]="certificateHold";e[e["removeFromCRL"]=8]="removeFromCRL";e[e["privilegeWithdrawn"]=9]="privilegeWithdrawn";e[e["aACompromise"]=10]="aACompromise"})(CRLReasons||(CRLReasons={}));var CRLReason=function(){function e(e){if(e===void 0){e=CRLReasons.unspecified}this.reason=CRLReasons.unspecified;this.reason=e}e.prototype.toJSON=function(){return CRLReasons[this.reason]};e.prototype.toString=function(){return this.toJSON()};return e}();__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],CRLReason.prototype,"reason",void 0);CRLReason=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CRLReason);var ExtendedKeyUsage_1;var id_ce_extKeyUsage="".concat(id_ce,".37");var ExtendedKeyUsage=ExtendedKeyUsage_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ExtendedKeyUsage_1.prototype);return r}return t}(AsnArray);ExtendedKeyUsage=ExtendedKeyUsage_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.ObjectIdentifier})],ExtendedKeyUsage);var id_ce_inhibitAnyPolicy="".concat(id_ce,".54");var InhibitAnyPolicy=function(){function e(e){if(e===void 0){e=new ArrayBuffer(0)}this.value=e}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],InhibitAnyPolicy.prototype,"value",void 0);InhibitAnyPolicy=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],InhibitAnyPolicy);var id_ce_invalidityDate="".concat(id_ce,".24");var InvalidityDate=function(){function e(e){this.value=new Date;if(e){this.value=e}}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],InvalidityDate.prototype,"value",void 0);InvalidityDate=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],InvalidityDate);var IssueAlternativeName_1;var id_ce_issuerAltName="".concat(id_ce,".18");var IssueAlternativeName=IssueAlternativeName_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,IssueAlternativeName_1.prototype);return r}return t}(GeneralNames);IssueAlternativeName=IssueAlternativeName_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],IssueAlternativeName);var id_ce_keyUsage="".concat(id_ce,".15");var KeyUsageFlags;(function(e){e[e["digitalSignature"]=1]="digitalSignature";e[e["nonRepudiation"]=2]="nonRepudiation";e[e["keyEncipherment"]=4]="keyEncipherment";e[e["dataEncipherment"]=8]="dataEncipherment";e[e["keyAgreement"]=16]="keyAgreement";e[e["keyCertSign"]=32]="keyCertSign";e[e["cRLSign"]=64]="cRLSign";e[e["encipherOnly"]=128]="encipherOnly";e[e["decipherOnly"]=256]="decipherOnly"})(KeyUsageFlags||(KeyUsageFlags={}));var KeyUsage=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.toJSON=function(){var e=this.toNumber();var t=[];if(e&KeyUsageFlags.cRLSign){t.push("crlSign")}if(e&KeyUsageFlags.dataEncipherment){t.push("dataEncipherment")}if(e&KeyUsageFlags.decipherOnly){t.push("decipherOnly")}if(e&KeyUsageFlags.digitalSignature){t.push("digitalSignature")}if(e&KeyUsageFlags.encipherOnly){t.push("encipherOnly")}if(e&KeyUsageFlags.keyAgreement){t.push("keyAgreement")}if(e&KeyUsageFlags.keyCertSign){t.push("keyCertSign")}if(e&KeyUsageFlags.keyEncipherment){t.push("keyEncipherment")}if(e&KeyUsageFlags.nonRepudiation){t.push("nonRepudiation")}return t};t.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return t}(BitString);var GeneralSubtrees_1;var id_ce_nameConstraints="".concat(id_ce,".30");var GeneralSubtree=function(){function e(e){if(e===void 0){e={}}this.base=new GeneralName;this.minimum=0;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName})],GeneralSubtree.prototype,"base",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:0,defaultValue:0,implicit:true})],GeneralSubtree.prototype,"minimum",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:1,optional:true,implicit:true})],GeneralSubtree.prototype,"maximum",void 0);var GeneralSubtrees=GeneralSubtrees_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,GeneralSubtrees_1.prototype);return r}return t}(AsnArray);GeneralSubtrees=GeneralSubtrees_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:GeneralSubtree})],GeneralSubtrees);var NameConstraints=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralSubtrees,context:0,optional:true,implicit:true})],NameConstraints.prototype,"permittedSubtrees",void 0);__decorate$1([AsnProp({type:GeneralSubtrees,context:1,optional:true,implicit:true})],NameConstraints.prototype,"excludedSubtrees",void 0);var id_ce_policyConstraints="".concat(id_ce,".36");var PolicyConstraints=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:0,implicit:true,optional:true,converter:AsnIntegerArrayBufferConverter})],PolicyConstraints.prototype,"requireExplicitPolicy",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:1,implicit:true,optional:true,converter:AsnIntegerArrayBufferConverter})],PolicyConstraints.prototype,"inhibitPolicyMapping",void 0);var PolicyMappings_1;var id_ce_policyMappings="".concat(id_ce,".33");var PolicyMapping=function(){function e(e){if(e===void 0){e={}}this.issuerDomainPolicy="";this.subjectDomainPolicy="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyMapping.prototype,"issuerDomainPolicy",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PolicyMapping.prototype,"subjectDomainPolicy",void 0);var PolicyMappings=PolicyMappings_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,PolicyMappings_1.prototype);return r}return t}(AsnArray);PolicyMappings=PolicyMappings_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:PolicyMapping})],PolicyMappings);var SubjectAlternativeName_1;var id_ce_subjectAltName="".concat(id_ce,".17");var SubjectAlternativeName=SubjectAlternativeName_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SubjectAlternativeName_1.prototype);return r}return t}(GeneralNames);SubjectAlternativeName=SubjectAlternativeName_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SubjectAlternativeName);var Attribute$1=function(){function e(e){if(e===void 0){e={}}this.type="";this.values=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Attribute$1.prototype,"type",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,repeated:"set"})],Attribute$1.prototype,"values",void 0);var SubjectDirectoryAttributes_1;var id_ce_subjectDirectoryAttributes="".concat(id_ce,".9");var SubjectDirectoryAttributes=SubjectDirectoryAttributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SubjectDirectoryAttributes_1.prototype);return r}return t}(AsnArray);SubjectDirectoryAttributes=SubjectDirectoryAttributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Attribute$1})],SubjectDirectoryAttributes);var id_ce_subjectKeyIdentifier="".concat(id_ce,".14");var SubjectKeyIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(KeyIdentifier);var id_ce_privateKeyUsagePeriod="".concat(id_ce,".16");var PrivateKeyUsagePeriod=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,context:0,implicit:true,optional:true})],PrivateKeyUsagePeriod.prototype,"notBefore",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,context:1,implicit:true,optional:true})],PrivateKeyUsagePeriod.prototype,"notAfter",void 0);var id_entrust_entrustVersInfo="1.2.840.113533.7.65.0";var EntrustInfoFlags;(function(e){e[e["keyUpdateAllowed"]=1]="keyUpdateAllowed";e[e["newExtensions"]=2]="newExtensions";e[e["pKIXCertificate"]=4]="pKIXCertificate"})(EntrustInfoFlags||(EntrustInfoFlags={}));var EntrustInfo=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.toJSON=function(){var e=[];var t=this.toNumber();if(t&EntrustInfoFlags.pKIXCertificate){e.push("pKIXCertificate")}if(t&EntrustInfoFlags.newExtensions){e.push("newExtensions")}if(t&EntrustInfoFlags.keyUpdateAllowed){e.push("keyUpdateAllowed")}return e};t.prototype.toString=function(){return"[".concat(this.toJSON().join(", "),"]")};return t}(BitString);var EntrustVersionInfo=function(){function e(e){if(e===void 0){e={}}this.entrustVers="";this.entrustInfoFlags=new EntrustInfo;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralString})],EntrustVersionInfo.prototype,"entrustVers",void 0);__decorate$1([AsnProp({type:EntrustInfo})],EntrustVersionInfo.prototype,"entrustInfoFlags",void 0);var SubjectInfoAccessSyntax_1;var id_pe_subjectInfoAccess="".concat(id_pe$1,".11");var SubjectInfoAccessSyntax=SubjectInfoAccessSyntax_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SubjectInfoAccessSyntax_1.prototype);return r}return t}(AsnArray);SubjectInfoAccessSyntax=SubjectInfoAccessSyntax_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AccessDescription})],SubjectInfoAccessSyntax);var AlgorithmIdentifier=function(){function e(e){if(e===void 0){e={}}this.algorithm="";Object.assign(this,e)}e.prototype.isEqual=function(t){return t instanceof e&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&isEqual_1(t.parameters,this.parameters)||t.parameters===this.parameters)};return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],AlgorithmIdentifier.prototype,"algorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,optional:true})],AlgorithmIdentifier.prototype,"parameters",void 0);var SubjectPublicKeyInfo=function(){function e(e){if(e===void 0){e={}}this.algorithm=new AlgorithmIdentifier;this.subjectPublicKey=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],SubjectPublicKeyInfo.prototype,"algorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],SubjectPublicKeyInfo.prototype,"subjectPublicKey",void 0);var Time=function(){function e(e){if(e){if(typeof e==="string"||typeof e==="number"||e instanceof Date){var t=new Date(e);if(t.getUTCFullYear()>2049){this.generalTime=t}else{this.utcTime=t}}else{Object.assign(this,e)}}}e.prototype.getTime=function(){var e=this.utcTime||this.generalTime;if(!e){throw new Error("Cannot get time from CHOICE object")}return e};return e}();__decorate$1([AsnProp({type:AsnPropTypes.UTCTime})],Time.prototype,"utcTime",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],Time.prototype,"generalTime",void 0);Time=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Time);var Validity=function(){function e(e){this.notBefore=new Time(new Date);this.notAfter=new Time(new Date);if(e){this.notBefore=new Time(e.notBefore);this.notAfter=new Time(e.notAfter)}}return e}();__decorate$1([AsnProp({type:Time})],Validity.prototype,"notBefore",void 0);__decorate$1([AsnProp({type:Time})],Validity.prototype,"notAfter",void 0);var Extensions_1;var Extension$1=function(){function e(t){if(t===void 0){t={}}this.extnID="";this.critical=e.CRITICAL;this.extnValue=new OctetString;Object.assign(this,t)}return e}();Extension$1.CRITICAL=false;__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Extension$1.prototype,"extnID",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,defaultValue:Extension$1.CRITICAL})],Extension$1.prototype,"critical",void 0);__decorate$1([AsnProp({type:OctetString})],Extension$1.prototype,"extnValue",void 0);var Extensions=Extensions_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Extensions_1.prototype);return r}return t}(AsnArray);Extensions=Extensions_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Extension$1})],Extensions);var Version$4;(function(e){e[e["v1"]=0]="v1";e[e["v2"]=1]="v2";e[e["v3"]=2]="v3"})(Version$4||(Version$4={}));var TBSCertificate=function(){function e(e){if(e===void 0){e={}}this.version=Version$4.v1;this.serialNumber=new ArrayBuffer(0);this.signature=new AlgorithmIdentifier;this.issuer=new Name$1;this.validity=new Validity;this.subject=new Name$1;this.subjectPublicKeyInfo=new SubjectPublicKeyInfo;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:0,defaultValue:Version$4.v1})],TBSCertificate.prototype,"version",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],TBSCertificate.prototype,"serialNumber",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],TBSCertificate.prototype,"signature",void 0);__decorate$1([AsnProp({type:Name$1})],TBSCertificate.prototype,"issuer",void 0);__decorate$1([AsnProp({type:Validity})],TBSCertificate.prototype,"validity",void 0);__decorate$1([AsnProp({type:Name$1})],TBSCertificate.prototype,"subject",void 0);__decorate$1([AsnProp({type:SubjectPublicKeyInfo})],TBSCertificate.prototype,"subjectPublicKeyInfo",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:1,implicit:true,optional:true})],TBSCertificate.prototype,"issuerUniqueID",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:2,implicit:true,optional:true})],TBSCertificate.prototype,"subjectUniqueID",void 0);__decorate$1([AsnProp({type:Extensions,context:3,optional:true})],TBSCertificate.prototype,"extensions",void 0);var Certificate=function(){function e(e){if(e===void 0){e={}}this.tbsCertificate=new TBSCertificate;this.signatureAlgorithm=new AlgorithmIdentifier;this.signatureValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:TBSCertificate})],Certificate.prototype,"tbsCertificate",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],Certificate.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],Certificate.prototype,"signatureValue",void 0);var RevokedCertificate=function(){function e(e){if(e===void 0){e={}}this.userCertificate=new ArrayBuffer(0);this.revocationDate=new Time;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RevokedCertificate.prototype,"userCertificate",void 0);__decorate$1([AsnProp({type:Time})],RevokedCertificate.prototype,"revocationDate",void 0);__decorate$1([AsnProp({type:Extension$1,optional:true,repeated:"sequence"})],RevokedCertificate.prototype,"crlEntryExtensions",void 0);var TBSCertList=function(){function e(e){if(e===void 0){e={}}this.signature=new AlgorithmIdentifier;this.issuer=new Name$1;this.thisUpdate=new Time;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],TBSCertList.prototype,"version",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],TBSCertList.prototype,"signature",void 0);__decorate$1([AsnProp({type:Name$1})],TBSCertList.prototype,"issuer",void 0);__decorate$1([AsnProp({type:Time})],TBSCertList.prototype,"thisUpdate",void 0);__decorate$1([AsnProp({type:Time,optional:true})],TBSCertList.prototype,"nextUpdate",void 0);__decorate$1([AsnProp({type:RevokedCertificate,repeated:"sequence",optional:true})],TBSCertList.prototype,"revokedCertificates",void 0);__decorate$1([AsnProp({type:Extension$1,optional:true,context:0,repeated:"sequence"})],TBSCertList.prototype,"crlExtensions",void 0);var CertificateList=function(){function e(e){if(e===void 0){e={}}this.tbsCertList=new TBSCertList;this.signatureAlgorithm=new AlgorithmIdentifier;this.signature=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:TBSCertList})],CertificateList.prototype,"tbsCertList",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],CertificateList.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],CertificateList.prototype,"signature",void 0);var id_ecPublicKey="1.2.840.10045.2.1";var id_ecdsaWithSHA1="1.2.840.10045.4.1";var id_ecdsaWithSHA224="1.2.840.10045.4.3.1";var id_ecdsaWithSHA256="1.2.840.10045.4.3.2";var id_ecdsaWithSHA384="1.2.840.10045.4.3.3";var id_ecdsaWithSHA512="1.2.840.10045.4.3.4";function create$1(e){return new AlgorithmIdentifier({algorithm:e})}create$1(id_ecdsaWithSHA1);create$1(id_ecdsaWithSHA224);create$1(id_ecdsaWithSHA256);create$1(id_ecdsaWithSHA384);create$1(id_ecdsaWithSHA512);var FieldID=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],FieldID.prototype,"fieldType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],FieldID.prototype,"parameters",void 0);FieldID=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],FieldID);var ECPoint=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var Curve=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.OctetString})],Curve.prototype,"a",void 0);__decorate$1([AsnProp({type:AsnPropTypes.OctetString})],Curve.prototype,"b",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,optional:true})],Curve.prototype,"seed",void 0);Curve=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],Curve);var ECPVer;(function(e){e[e["ecpVer1"]=1]="ecpVer1"})(ECPVer||(ECPVer={}));var SpecifiedECDomain=function(){function e(e){if(e===void 0){e={}}this.version=ECPVer.ecpVer1;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SpecifiedECDomain.prototype,"version",void 0);__decorate$1([AsnProp({type:FieldID})],SpecifiedECDomain.prototype,"fieldID",void 0);__decorate$1([AsnProp({type:Curve})],SpecifiedECDomain.prototype,"curve",void 0);__decorate$1([AsnProp({type:ECPoint})],SpecifiedECDomain.prototype,"base",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],SpecifiedECDomain.prototype,"order",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],SpecifiedECDomain.prototype,"cofactor",void 0);SpecifiedECDomain=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SpecifiedECDomain);var ECParameters=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],ECParameters.prototype,"namedCurve",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Null})],ECParameters.prototype,"implicitCurve",void 0);__decorate$1([AsnProp({type:SpecifiedECDomain})],ECParameters.prototype,"specifiedCurve",void 0);ECParameters=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],ECParameters);var ECPrivateKey=function(){function e(e){if(e===void 0){e={}}this.version=1;this.privateKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ECPrivateKey.prototype,"version",void 0);__decorate$1([AsnProp({type:OctetString})],ECPrivateKey.prototype,"privateKey",void 0);__decorate$1([AsnProp({type:ECParameters,context:0,optional:true})],ECPrivateKey.prototype,"parameters",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:1,optional:true})],ECPrivateKey.prototype,"publicKey",void 0);var ECDSASigValue=function(){function e(e){if(e===void 0){e={}}this.r=new ArrayBuffer(0);this.s=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],ECDSASigValue.prototype,"r",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],ECDSASigValue.prototype,"s",void 0);var id_pkcs_1="1.2.840.113549.1.1";var id_rsaEncryption="".concat(id_pkcs_1,".1");var id_RSAES_OAEP="".concat(id_pkcs_1,".7");var id_pSpecified="".concat(id_pkcs_1,".9");var id_RSASSA_PSS="".concat(id_pkcs_1,".10");var id_md2WithRSAEncryption="".concat(id_pkcs_1,".2");var id_md5WithRSAEncryption="".concat(id_pkcs_1,".4");var id_sha1WithRSAEncryption="".concat(id_pkcs_1,".5");var id_sha384WithRSAEncryption="".concat(id_pkcs_1,".12");var id_sha512WithRSAEncryption="".concat(id_pkcs_1,".13");var id_sha512_224WithRSAEncryption="".concat(id_pkcs_1,".15");var id_sha512_256WithRSAEncryption="".concat(id_pkcs_1,".16");var id_sha1="1.3.14.3.2.26";var id_sha224="2.16.840.1.101.3.4.2.4";var id_sha256="2.16.840.1.101.3.4.2.1";var id_sha384="2.16.840.1.101.3.4.2.2";var id_sha512="2.16.840.1.101.3.4.2.3";var id_sha512_224="2.16.840.1.101.3.4.2.5";var id_sha512_256="2.16.840.1.101.3.4.2.6";var id_md2="1.2.840.113549.2.2";var id_md5="1.2.840.113549.2.5";var id_mgf1="".concat(id_pkcs_1,".8");function create(e){return new AlgorithmIdentifier({algorithm:e,parameters:null})}create(id_md2);create(id_md5);var sha1=create(id_sha1);create(id_sha224);create(id_sha256);create(id_sha384);create(id_sha512);create(id_sha512_224);create(id_sha512_256);var mgf1SHA1=new AlgorithmIdentifier({algorithm:id_mgf1,parameters:AsnConvert.serialize(sha1)});var pSpecifiedEmpty=new AlgorithmIdentifier({algorithm:id_pSpecified,parameters:AsnConvert.serialize(AsnOctetStringConverter.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});create(id_rsaEncryption);create(id_md2WithRSAEncryption);create(id_md5WithRSAEncryption);create(id_sha1WithRSAEncryption);create(id_sha512_224WithRSAEncryption);create(id_sha512_256WithRSAEncryption);create(id_sha384WithRSAEncryption);create(id_sha512WithRSAEncryption);create(id_sha512_224WithRSAEncryption);create(id_sha512_256WithRSAEncryption);var RsaEsOaepParams=function(){function e(e){if(e===void 0){e={}}this.hashAlgorithm=new AlgorithmIdentifier(sha1);this.maskGenAlgorithm=new AlgorithmIdentifier({algorithm:id_mgf1,parameters:AsnConvert.serialize(sha1)});this.pSourceAlgorithm=new AlgorithmIdentifier(pSpecifiedEmpty);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier,context:0,defaultValue:sha1})],RsaEsOaepParams.prototype,"hashAlgorithm",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier,context:1,defaultValue:mgf1SHA1})],RsaEsOaepParams.prototype,"maskGenAlgorithm",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier,context:2,defaultValue:pSpecifiedEmpty})],RsaEsOaepParams.prototype,"pSourceAlgorithm",void 0);new AlgorithmIdentifier({algorithm:id_RSAES_OAEP,parameters:AsnConvert.serialize(new RsaEsOaepParams)});var RsaSaPssParams=function(){function e(e){if(e===void 0){e={}}this.hashAlgorithm=new AlgorithmIdentifier(sha1);this.maskGenAlgorithm=new AlgorithmIdentifier({algorithm:id_mgf1,parameters:AsnConvert.serialize(sha1)});this.saltLength=20;this.trailerField=1;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier,context:0,defaultValue:sha1})],RsaSaPssParams.prototype,"hashAlgorithm",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier,context:1,defaultValue:mgf1SHA1})],RsaSaPssParams.prototype,"maskGenAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:2,defaultValue:20})],RsaSaPssParams.prototype,"saltLength",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,context:3,defaultValue:1})],RsaSaPssParams.prototype,"trailerField",void 0);new AlgorithmIdentifier({algorithm:id_RSASSA_PSS,parameters:AsnConvert.serialize(new RsaSaPssParams)});var DigestInfo=function(){function e(e){if(e===void 0){e={}}this.digestAlgorithm=new AlgorithmIdentifier;this.digest=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],DigestInfo.prototype,"digestAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],DigestInfo.prototype,"digest",void 0);var OtherPrimeInfos_1;var OtherPrimeInfo=function(){function e(e){if(e===void 0){e={}}this.prime=new ArrayBuffer(0);this.exponent=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],OtherPrimeInfo.prototype,"prime",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],OtherPrimeInfo.prototype,"exponent",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],OtherPrimeInfo.prototype,"coefficient",void 0);var OtherPrimeInfos=OtherPrimeInfos_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,OtherPrimeInfos_1.prototype);return r}return t}(AsnArray);OtherPrimeInfos=OtherPrimeInfos_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:OtherPrimeInfo})],OtherPrimeInfos);var RSAPrivateKey=function(){function e(e){if(e===void 0){e={}}this.version=0;this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);this.privateExponent=new ArrayBuffer(0);this.prime1=new ArrayBuffer(0);this.prime2=new ArrayBuffer(0);this.exponent1=new ArrayBuffer(0);this.exponent2=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],RSAPrivateKey.prototype,"version",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"modulus",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"publicExponent",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"privateExponent",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"prime1",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"prime2",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"exponent1",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"exponent2",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPrivateKey.prototype,"coefficient",void 0);__decorate$1([AsnProp({type:OtherPrimeInfos,optional:true})],RSAPrivateKey.prototype,"otherPrimeInfos",void 0);var RSAPublicKey=function(){function e(e){if(e===void 0){e={}}this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPublicKey.prototype,"modulus",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],RSAPublicKey.prototype,"publicExponent",void 0);var CompositeParams_1,CompositeSignatureValue_1;var id_alg_composite="1.3.6.1.4.1.18227.2.1";var CompositeParams=CompositeParams_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositeParams_1.prototype);return r}return t}(AsnArray);CompositeParams=CompositeParams_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AlgorithmIdentifier})],CompositeParams);var CompositeSignatureValue=CompositeSignatureValue_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositeSignatureValue_1.prototype);return r}return t}(AsnArray);CompositeSignatureValue=CompositeSignatureValue_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.BitString})],CompositeSignatureValue);var EncryptedData=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var EncryptedPrivateKeyInfo$1=function(){function e(e){if(e===void 0){e={}}this.encryptionAlgorithm=new AlgorithmIdentifier;this.encryptedData=new EncryptedData;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],EncryptedPrivateKeyInfo$1.prototype,"encryptionAlgorithm",void 0);__decorate$1([AsnProp({type:EncryptedData})],EncryptedPrivateKeyInfo$1.prototype,"encryptedData",void 0);var Attributes_1$1;var Version$3;(function(e){e[e["v1"]=0]="v1"})(Version$3||(Version$3={}));var PrivateKey=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OctetString);var Attributes$1=Attributes_1$1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Attributes_1$1.prototype);return r}return t}(AsnArray);Attributes$1=Attributes_1$1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Attribute$1})],Attributes$1);var PrivateKeyInfo$1=function(){function e(e){if(e===void 0){e={}}this.version=Version$3.v1;this.privateKeyAlgorithm=new AlgorithmIdentifier;this.privateKey=new PrivateKey;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],PrivateKeyInfo$1.prototype,"version",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],PrivateKeyInfo$1.prototype,"privateKeyAlgorithm",void 0);__decorate$1([AsnProp({type:PrivateKey})],PrivateKeyInfo$1.prototype,"privateKey",void 0);__decorate$1([AsnProp({type:Attributes$1,implicit:true,context:0,optional:true})],PrivateKeyInfo$1.prototype,"attributes",void 0);var AsymmetricKeyPackage_1;var Version$2;(function(e){e[e["v1"]=0]="v1";e[e["v2"]=1]="v2"})(Version$2||(Version$2={}));var PrivateKeyAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);PrivateKeyAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],PrivateKeyAlgorithmIdentifier);var OneAsymmetricKey=function(){function e(){this.version=Version$2.v1;this.privateKeyAlgorithm=new AlgorithmIdentifier;this.privateKey=new ArrayBuffer(0)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],OneAsymmetricKey.prototype,"version",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],OneAsymmetricKey.prototype,"privateKeyAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.OctetString})],OneAsymmetricKey.prototype,"privateKey",void 0);__decorate$1([AsnProp({type:Attributes$1,context:0,implicit:true,optional:true})],OneAsymmetricKey.prototype,"attributes",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,context:1,implicit:true,optional:true})],OneAsymmetricKey.prototype,"publicKey",void 0);OneAsymmetricKey=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],OneAsymmetricKey);var PrivateKeyInfo=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(OneAsymmetricKey);PrivateKeyInfo=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],PrivateKeyInfo);var AsymmetricKeyPackage=AsymmetricKeyPackage_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AsymmetricKeyPackage_1.prototype);return r}return t}(AsnArray);AsymmetricKeyPackage=AsymmetricKeyPackage_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:OneAsymmetricKey})],AsymmetricKeyPackage);var CompositePublicKey_1,CompositePrivateKey_1;var id_composite_key="2.16.840.1.114027.80.4.1";var CompositeAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);CompositeAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CompositeAlgorithmIdentifier);var CompositePublicKey=CompositePublicKey_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositePublicKey_1.prototype);return r}return t}(AsnArray);CompositePublicKey=CompositePublicKey_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:SubjectPublicKeyInfo})],CompositePublicKey);var CompositePrivateKey=CompositePrivateKey_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CompositePrivateKey_1.prototype);return r}return t}(AsnArray);CompositePrivateKey=CompositePrivateKey_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:OneAsymmetricKey})],CompositePrivateKey);var dayjs_min={exports:{}};(function(e,t){!function(t,r){e.exports=r()}(commonjsGlobal,(function(){var e=1e3,t=6e4,r=36e5,i="millisecond",n="second",o="minute",a="hour",s="day",c="week",u="month",p="quarter",f="year",d="date",l="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,A={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},h=function(e,t,r){var i=String(e);return!i||i.length>=t?e:""+Array(t+1-i.length).join(r)+e},_={s:h,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),i=Math.floor(r/60),n=r%60;return(t<=0?"+":"-")+h(i,2,"0")+":"+h(n,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var i=12*(r.year()-t.year())+(r.month()-t.month()),n=t.clone().add(i,u),o=r-n<0,a=t.clone().add(i+(o?-1:1),u);return+(-(i+(r-n)/(o?n-a:a-n))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:f,w:c,d:s,D:d,h:a,m:o,s:n,ms:i,Q:p}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},S="en",C={};C[S]=A;var m="$isDayjsObject",g=function(e){return e instanceof E||!(!e||!e[m])},P=function e(t,r,i){var n;if(!t)return S;if("string"==typeof t){var o=t.toLowerCase();C[o]&&(n=o),r&&(C[o]=r,n=o);var a=t.split("-");if(!n&&a.length>1)return e(a[0])}else{var s=t.name;C[s]=t,n=s}return!i&&n&&(S=n),n||!i&&S},T=function(e,t){if(g(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new E(r)},I=_;I.l=P,I.i=g,I.w=function(e,t){return T(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function A(e){this.$L=P(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[m]=!0}var h=A.prototype;return h.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(I.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var i=t.match(y);if(i){var n=i[2]-1||0,o=(i[7]||"0").substring(0,3);return r?new Date(Date.UTC(i[1],n,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)):new Date(i[1],n,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)}}return new Date(t)}(e),this.init()},h.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},h.$utils=function(){return I},h.isValid=function(){return!(this.$d.toString()===l)},h.isSame=function(e,t){var r=T(e);return this.startOf(t)<=r&&r<=this.endOf(t)},h.isAfter=function(e,t){return T(e)<this.startOf(t)},h.isBefore=function(e,t){return this.endOf(t)<T(e)},h.$g=function(e,t,r){return I.u(e)?this[t]:this.set(r,e)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(e,t){var r=this,i=!!I.u(t)||t,p=I.p(e),l=function(e,t){var n=I.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return i?n:n.endOf(s)},y=function(e,t){return I.w(r.toDate()[e].apply(r.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},v=this.$W,A=this.$M,h=this.$D,_="set"+(this.$u?"UTC":"");switch(p){case f:return i?l(1,0):l(31,11);case u:return i?l(1,A):l(0,A+1);case c:var S=this.$locale().weekStart||0,C=(v<S?v+7:v)-S;return l(i?h-C:h+(6-C),A);case s:case d:return y(_+"Hours",0);case a:return y(_+"Minutes",1);case o:return y(_+"Seconds",2);case n:return y(_+"Milliseconds",3);default:return this.clone()}},h.endOf=function(e){return this.startOf(e,!1)},h.$set=function(e,t){var r,c=I.p(e),p="set"+(this.$u?"UTC":""),l=(r={},r[s]=p+"Date",r[d]=p+"Date",r[u]=p+"Month",r[f]=p+"FullYear",r[a]=p+"Hours",r[o]=p+"Minutes",r[n]=p+"Seconds",r[i]=p+"Milliseconds",r)[c],y=c===s?this.$D+(t-this.$W):t;if(c===u||c===f){var v=this.clone().set(d,1);v.$d[l](y),v.init(),this.$d=v.set(d,Math.min(this.$D,v.daysInMonth())).$d}else l&&this.$d[l](y);return this.init(),this},h.set=function(e,t){return this.clone().$set(e,t)},h.get=function(e){return this[I.p(e)]()},h.add=function(i,p){var d,l=this;i=Number(i);var y=I.p(p),v=function(e){var t=T(l);return I.w(t.date(t.date()+Math.round(e*i)),l)};if(y===u)return this.set(u,this.$M+i);if(y===f)return this.set(f,this.$y+i);if(y===s)return v(1);if(y===c)return v(7);var A=(d={},d[o]=t,d[a]=r,d[n]=e,d)[y]||1,h=this.$d.getTime()+i*A;return I.w(h,this)},h.subtract=function(e,t){return this.add(-1*e,t)},h.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||l;var i=e||"YYYY-MM-DDTHH:mm:ssZ",n=I.z(this),o=this.$H,a=this.$m,s=this.$M,c=r.weekdays,u=r.months,p=r.meridiem,f=function(e,r,n,o){return e&&(e[r]||e(t,i))||n[r].slice(0,o)},d=function(e){return I.s(o%12||12,e,"0")},y=p||function(e,t,r){var i=e<12?"AM":"PM";return r?i.toLowerCase():i};return i.replace(v,(function(e,i){return i||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return I.s(t.$y,4,"0");case"M":return s+1;case"MM":return I.s(s+1,2,"0");case"MMM":return f(r.monthsShort,s,u,3);case"MMMM":return f(u,s);case"D":return t.$D;case"DD":return I.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return f(r.weekdaysMin,t.$W,c,2);case"ddd":return f(r.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(o);case"HH":return I.s(o,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return y(o,a,!0);case"A":return y(o,a,!1);case"m":return String(a);case"mm":return I.s(a,2,"0");case"s":return String(t.$s);case"ss":return I.s(t.$s,2,"0");case"SSS":return I.s(t.$ms,3,"0");case"Z":return n}return null}(e)||n.replace(":","")}))},h.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},h.diff=function(i,d,l){var y,v=this,A=I.p(d),h=T(i),_=(h.utcOffset()-this.utcOffset())*t,S=this-h,C=function(){return I.m(v,h)};switch(A){case f:y=C()/12;break;case u:y=C();break;case p:y=C()/3;break;case c:y=(S-_)/6048e5;break;case s:y=(S-_)/864e5;break;case a:y=S/r;break;case o:y=S/t;break;case n:y=S/e;break;default:y=S}return l?y:I.a(y)},h.daysInMonth=function(){return this.endOf(u).$D},h.$locale=function(){return C[this.$L]},h.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),i=P(e,t,!0);return i&&(r.$L=i),r},h.clone=function(){return I.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},A}(),b=E.prototype;return T.prototype=b,[["$ms",i],["$s",n],["$m",o],["$H",a],["$W",s],["$M",u],["$y",f],["$D",d]].forEach((function(e){b[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),T.extend=function(e,t){return e.$i||(e(t,E,T),e.$i=!0),T},T.locale=P,T.isDayjs=g,T.unix=function(e){return T(1e3*e)},T.en=C[S],T.Ls=C,T.p={},T}))})(dayjs_min);var dayjs=dayjs_min.exports;var relativeTime$1={exports:{}};(function(e,t){!function(t,r){e.exports=r()}(commonjsGlobal,(function(){return function(e,t,r){e=e||{};var i=t.prototype,n={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function o(e,t,r,n){return i.fromToBase(e,t,r,n)}r.en.relativeTime=n,i.fromToBase=function(t,i,o,a,s){for(var c,u,p,f=o.$locale().relativeTime||n,d=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],l=d.length,y=0;y<l;y+=1){var v=d[y];v.d&&(c=a?r(t).diff(o,v.d,!0):o.diff(t,v.d,!0));var A=(e.rounding||Math.round)(Math.abs(c));if(p=c>0,A<=v.r||!v.r){A<=1&&y>0&&(v=d[y-1]);var h=f[v.l];s&&(A=s(""+A)),u="string"==typeof h?h.replace("%d",A):h(A,i,v.l,p);break}}if(i)return u;var _=p?f.future:f.past;return"function"==typeof _?_(u):_.replace("%s",u)},i.to=function(e,t){return o(e,t,this,!0)},i.from=function(e,t){return o(e,t,this)};var a=function(e){return e.$u?r.utc():r()};i.toNow=function(e){return this.to(a(this),e)},i.fromNow=function(e){return this.from(a(this),e)}}}))})(relativeTime$1);var relativeTime=relativeTime$1.exports;
86
79
  /**
87
80
  * @license
88
81
  * Copyright (c) Peculiar Ventures, LLC.
@@ -131,5 +124,19 @@ var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setP
131
124
  *
132
125
  * This source code is licensed under the MIT license found in the
133
126
  * LICENSE file in the root directory of this source tree.
134
- */var CryptoProvider=function(){function e(){this.providers=new Map;var t=window.crypto||window.msCrypto;if(typeof t!=="undefined"){this.set(e.DEFAULT,t)}}e.isCryptoKeyPair=function(e){return e&&e.privateKey&&e.publicKey};e.prototype.get=function(t){if(t===void 0){t=e.DEFAULT}var r=this.providers.get(t.toLowerCase());if(!r){throw new Error("Cannot get Crypto by name '".concat(t,"'"))}return r};e.prototype.set=function(t,r){if(typeof t==="string"){if(!r){throw new TypeError("Argument 'value' is required")}this.providers.set(t.toLowerCase(),r)}else{this.providers.set(e.DEFAULT,t)}return this};return e}();CryptoProvider.DEFAULT="default";var cryptoProvider=new CryptoProvider;var base64Re=/-----BEGIN [^-]+-----([A-Za-z0-9+/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+/=\s]+)====/;var base64Clarify=function(e){var t=base64Re.exec(e);return t?t[1]||t[2]:e};var hexFormat=function(e){return e.replace(/(.{32})/g,"$1\n").replace(/(.{4})/g,"$1 ").trim()};var base64Format=function(e){return e.replace(/(.{64})/g,"$1\n")};var certificateRawToBuffer=function(e){var t=base64Clarify(e);var r;if(isHex(t)){r=Convert_1.FromHex(t)}else if(isBase64(t)||isPem(t)){r=Convert_1.FromBase64(t)}else{r=Convert_1.FromBinary(e)}return r};var getCertificateThumbprint=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(i){r=cryptoProvider.get();if(r.subtle){return[2,r.subtle.digest(e,t)]}return[2,undefined]}))}))};var ACClearAttrs=function(){function e(e){if(e===void 0){e={}}this.acIssuer=new GeneralName;this.acSerial=0;this.attrs=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName})],ACClearAttrs.prototype,"acIssuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ACClearAttrs.prototype,"acSerial",void 0);__decorate$1([AsnProp({type:Attribute$1,repeated:"sequence"})],ACClearAttrs.prototype,"attrs",void 0);var AttrSpec_1;var AttrSpec=AttrSpec_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AttrSpec_1.prototype);return r}return t}(AsnArray);AttrSpec=AttrSpec_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.ObjectIdentifier})],AttrSpec);var AAControls=function(){function e(e){if(e===void 0){e={}}this.permitUnSpecified=true;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],AAControls.prototype,"pathLenConstraint",void 0);__decorate$1([AsnProp({type:AttrSpec,implicit:true,context:0,optional:true})],AAControls.prototype,"permittedAttrs",void 0);__decorate$1([AsnProp({type:AttrSpec,implicit:true,context:1,optional:true})],AAControls.prototype,"excludedAttrs",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,defaultValue:true})],AAControls.prototype,"permitUnSpecified",void 0);var IssuerSerial=function(){function e(e){if(e===void 0){e={}}this.issuer=new GeneralNames;this.serial=new ArrayBuffer(0);this.issuerUID=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames})],IssuerSerial.prototype,"issuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],IssuerSerial.prototype,"serial",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,optional:true})],IssuerSerial.prototype,"issuerUID",void 0);var DigestedObjectType;(function(e){e[e["publicKey"]=0]="publicKey";e[e["publicKeyCert"]=1]="publicKeyCert";e[e["otherObjectTypes"]=2]="otherObjectTypes"})(DigestedObjectType||(DigestedObjectType={}));var ObjectDigestInfo=function(){function e(e){if(e===void 0){e={}}this.digestedObjectType=DigestedObjectType.publicKey;this.digestAlgorithm=new AlgorithmIdentifier;this.objectDigest=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],ObjectDigestInfo.prototype,"digestedObjectType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier,optional:true})],ObjectDigestInfo.prototype,"otherObjectTypeID",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],ObjectDigestInfo.prototype,"digestAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],ObjectDigestInfo.prototype,"objectDigest",void 0);var V2Form=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames,optional:true})],V2Form.prototype,"issuerName",void 0);__decorate$1([AsnProp({type:IssuerSerial,context:0,implicit:true,optional:true})],V2Form.prototype,"baseCertificateID",void 0);__decorate$1([AsnProp({type:ObjectDigestInfo,context:1,implicit:true,optional:true})],V2Form.prototype,"objectDigestInfo",void 0);var AttCertIssuer=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,repeated:"sequence"})],AttCertIssuer.prototype,"v1Form",void 0);__decorate$1([AsnProp({type:V2Form,context:0,implicit:true})],AttCertIssuer.prototype,"v2Form",void 0);AttCertIssuer=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],AttCertIssuer);var AttCertValidityPeriod=function(){function e(e){if(e===void 0){e={}}this.notBeforeTime=new Date;this.notAfterTime=new Date;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],AttCertValidityPeriod.prototype,"notBeforeTime",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],AttCertValidityPeriod.prototype,"notAfterTime",void 0);var Holder=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:IssuerSerial,implicit:true,context:0,optional:true})],Holder.prototype,"baseCertificateID",void 0);__decorate$1([AsnProp({type:GeneralNames,implicit:true,context:1,optional:true})],Holder.prototype,"entityName",void 0);__decorate$1([AsnProp({type:ObjectDigestInfo,implicit:true,context:2,optional:true})],Holder.prototype,"objectDigestInfo",void 0);var AttCertVersion;(function(e){e[e["v2"]=1]="v2"})(AttCertVersion||(AttCertVersion={}));var AttributeCertificateInfo=function(){function e(e){if(e===void 0){e={}}this.version=AttCertVersion.v2;this.holder=new Holder;this.issuer=new AttCertIssuer;this.signature=new AlgorithmIdentifier;this.serialNumber=new ArrayBuffer(0);this.attrCertValidityPeriod=new AttCertValidityPeriod;this.attributes=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],AttributeCertificateInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:Holder})],AttributeCertificateInfo.prototype,"holder",void 0);__decorate$1([AsnProp({type:AttCertIssuer})],AttributeCertificateInfo.prototype,"issuer",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],AttributeCertificateInfo.prototype,"signature",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],AttributeCertificateInfo.prototype,"serialNumber",void 0);__decorate$1([AsnProp({type:AttCertValidityPeriod})],AttributeCertificateInfo.prototype,"attrCertValidityPeriod",void 0);__decorate$1([AsnProp({type:Attribute$1,repeated:"sequence"})],AttributeCertificateInfo.prototype,"attributes",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,optional:true})],AttributeCertificateInfo.prototype,"issuerUniqueID",void 0);__decorate$1([AsnProp({type:Extensions,optional:true})],AttributeCertificateInfo.prototype,"extensions",void 0);var AttributeCertificate=function(){function e(e){if(e===void 0){e={}}this.acinfo=new AttributeCertificateInfo;this.signatureAlgorithm=new AlgorithmIdentifier;this.signatureValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AttributeCertificateInfo})],AttributeCertificate.prototype,"acinfo",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],AttributeCertificate.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],AttributeCertificate.prototype,"signatureValue",void 0);var ClassListFlags;(function(e){e[e["unmarked"]=1]="unmarked";e[e["unclassified"]=2]="unclassified";e[e["restricted"]=4]="restricted";e[e["confidential"]=8]="confidential";e[e["secret"]=16]="secret";e[e["topSecret"]=32]="topSecret"})(ClassListFlags||(ClassListFlags={}));var ClassList=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(BitString);var SecurityCategory=function(){function e(e){if(e===void 0){e={}}this.type="";this.value=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier,implicit:true,context:0})],SecurityCategory.prototype,"type",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,implicit:true,context:1})],SecurityCategory.prototype,"value",void 0);var Clearance=function(){function e(e){if(e===void 0){e={}}this.policyId="";this.classList=new ClassList(ClassListFlags.unclassified);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Clearance.prototype,"policyId",void 0);__decorate$1([AsnProp({type:ClassList,defaultValue:new ClassList(ClassListFlags.unclassified)})],Clearance.prototype,"classList",void 0);__decorate$1([AsnProp({type:SecurityCategory,repeated:"set"})],Clearance.prototype,"securityCategories",void 0);var IetfAttrSyntaxValueChoices=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString})],IetfAttrSyntaxValueChoices.prototype,"cotets",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],IetfAttrSyntaxValueChoices.prototype,"oid",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],IetfAttrSyntaxValueChoices.prototype,"string",void 0);var IetfAttrSyntax=function(){function e(e){if(e===void 0){e={}}this.values=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames,implicit:true,context:0,optional:true})],IetfAttrSyntax.prototype,"policyAuthority",void 0);__decorate$1([AsnProp({type:IetfAttrSyntaxValueChoices,repeated:"sequence"})],IetfAttrSyntax.prototype,"values",void 0);var Targets_1;var TargetCert=function(){function e(e){if(e===void 0){e={}}this.targetCertificate=new IssuerSerial;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:IssuerSerial})],TargetCert.prototype,"targetCertificate",void 0);__decorate$1([AsnProp({type:GeneralName,optional:true})],TargetCert.prototype,"targetName",void 0);__decorate$1([AsnProp({type:ObjectDigestInfo,optional:true})],TargetCert.prototype,"certDigestInfo",void 0);var Target=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0,implicit:true})],Target.prototype,"targetName",void 0);__decorate$1([AsnProp({type:GeneralName,context:1,implicit:true})],Target.prototype,"targetGroup",void 0);__decorate$1([AsnProp({type:TargetCert,context:2,implicit:true})],Target.prototype,"targetCert",void 0);Target=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Target);var Targets=Targets_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Targets_1.prototype);return r}return t}(AsnArray);Targets=Targets_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Target})],Targets);var ProxyInfo_1;var ProxyInfo=ProxyInfo_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ProxyInfo_1.prototype);return r}return t}(AsnArray);ProxyInfo=ProxyInfo_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Targets})],ProxyInfo);var RoleSyntax=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames,implicit:true,context:0,optional:true})],RoleSyntax.prototype,"roleAuthority",void 0);__decorate$1([AsnProp({type:GeneralName,implicit:true,context:1})],RoleSyntax.prototype,"roleName",void 0);var SvceAuthInfo=function(){function e(e){if(e===void 0){e={}}this.service=new GeneralName;this.ident=new GeneralName;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName})],SvceAuthInfo.prototype,"service",void 0);__decorate$1([AsnProp({type:GeneralName})],SvceAuthInfo.prototype,"ident",void 0);__decorate$1([AsnProp({type:OctetString,optional:true})],SvceAuthInfo.prototype,"authInfo",void 0);var id_ntQWAC="0.4.0.9496";var id_ActivityDescription="".concat(id_ntQWAC,".6");var ActivityDescription=function(){function e(e){if(e===void 0){e={}}this.codeAuthority=new GeneralName;this.codeId=new GeneralName;this.shortName="";this.shortDescription="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0})],ActivityDescription.prototype,"codeAuthority",void 0);__decorate$1([AsnProp({type:GeneralName,context:1})],ActivityDescription.prototype,"codeId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String,context:2})],ActivityDescription.prototype,"shortName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String,context:3})],ActivityDescription.prototype,"shortDescription",void 0);ActivityDescription=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ActivityDescription);var DomainName=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(Name$1);DomainName=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainName);var id_DomainNameBeneficiary="".concat(id_ntQWAC,".1");var DomainNameBeneficiary=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameBeneficiary=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameBeneficiary);var id_DomainNameLegalRepresentative="".concat(id_ntQWAC,".2");var DomainNameLegalRepresentative=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameLegalRepresentative=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameLegalRepresentative);var id_DomainNameOwner="".concat(id_ntQWAC,".3");var DomainNameOwner=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameOwner=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameOwner);var id_DomainNameTechnicalOperator="".concat(id_ntQWAC,".4");var DomainNameTechnicalOperator=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameTechnicalOperator=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameTechnicalOperator);var id_InsuranceValue="".concat(id_ntQWAC,".8");var InsuranceValue=function(){function e(e){if(e===void 0){e={}}this.location="";this.base=0;this.degree=0;Object.assign(this,e)}e.prototype.toString=function(){return"".concat(this.base," x 10^").concat(this.degree," ").concat(this.location)};return e}();__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],InsuranceValue.prototype,"location",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],InsuranceValue.prototype,"base",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],InsuranceValue.prototype,"degree",void 0);InsuranceValue=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],InsuranceValue);var id_ValuationRanking="".concat(id_ntQWAC,".9");var ValuationRanking=function(){function e(e){if(e===void 0){e={}}this.stars5=0;this.stars4=0;this.stars3=0;this.stars2=0;this.stars1=0;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars5",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars4",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars3",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars2",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars1",void 0);ValuationRanking=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ValuationRanking);var id_TypeRelationship="".concat(id_ntQWAC,".5");var TypeRelationship=function(){function e(e){if(e===void 0){e={}}this.DNBvsDNO=new BitString(0);this.DNBvsDNT=new BitString(0);this.DNOvsDNT=new BitString(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:BitString,context:0})],TypeRelationship.prototype,"DNBvsDNO",void 0);__decorate$1([AsnProp({type:BitString,context:1})],TypeRelationship.prototype,"DNBvsDNT",void 0);__decorate$1([AsnProp({type:BitString,context:2})],TypeRelationship.prototype,"DNOvsDNT",void 0);TypeRelationship=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],TypeRelationship);var id_WebGDPR="".concat(id_ntQWAC,".7");var WebGDPR=function(){function e(e){if(e===void 0){e={}}this.assessmentAuthority=new GeneralName;this.assessmentRef=new GeneralName;this.assessmentLocation=new GeneralName;this.dataStorageTerritory="";this.description="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0})],WebGDPR.prototype,"assessmentAuthority",void 0);__decorate$1([AsnProp({type:GeneralName,context:1})],WebGDPR.prototype,"assessmentRef",void 0);__decorate$1([AsnProp({type:GeneralName,context:2})],WebGDPR.prototype,"assessmentLocation",void 0);__decorate$1([AsnProp({type:AsnPropTypes.PrintableString,context:3})],WebGDPR.prototype,"dataStorageTerritory",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String,context:4})],WebGDPR.prototype,"description",void 0);WebGDPR=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],WebGDPR);var IssuerAndSerialNumber=function(){function e(e){if(e===void 0){e={}}this.issuer=new Name$1;this.serialNumber=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:Name$1})],IssuerAndSerialNumber.prototype,"issuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],IssuerAndSerialNumber.prototype,"serialNumber",void 0);var SignerIdentifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier,context:0,implicit:true})],SignerIdentifier.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber})],SignerIdentifier.prototype,"issuerAndSerialNumber",void 0);SignerIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SignerIdentifier);var CMSVersion;(function(e){e[e["v0"]=0]="v0";e[e["v1"]=1]="v1";e[e["v2"]=2]="v2";e[e["v3"]=3]="v3";e[e["v4"]=4]="v4";e[e["v5"]=5]="v5"})(CMSVersion||(CMSVersion={}));var DigestAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);DigestAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DigestAlgorithmIdentifier);var SignatureAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);SignatureAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SignatureAlgorithmIdentifier);var KeyEncryptionAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);KeyEncryptionAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],KeyEncryptionAlgorithmIdentifier);var ContentEncryptionAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);ContentEncryptionAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ContentEncryptionAlgorithmIdentifier);var MessageAuthenticationCodeAlgorithm=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);MessageAuthenticationCodeAlgorithm=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],MessageAuthenticationCodeAlgorithm);var KeyDerivationAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);KeyDerivationAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],KeyDerivationAlgorithmIdentifier);var Attribute=function(){function e(e){if(e===void 0){e={}}this.attrType="";this.attrValues=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Attribute.prototype,"attrType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,repeated:"set"})],Attribute.prototype,"attrValues",void 0);var SignerInfos_1;var SignerInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.sid=new SignerIdentifier;this.digestAlgorithm=new DigestAlgorithmIdentifier;this.signatureAlgorithm=new SignatureAlgorithmIdentifier;this.signature=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SignerInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:SignerIdentifier})],SignerInfo.prototype,"sid",void 0);__decorate$1([AsnProp({type:DigestAlgorithmIdentifier})],SignerInfo.prototype,"digestAlgorithm",void 0);__decorate$1([AsnProp({type:Attribute,repeated:"set",context:0,implicit:true,optional:true})],SignerInfo.prototype,"signedAttrs",void 0);__decorate$1([AsnProp({type:SignatureAlgorithmIdentifier})],SignerInfo.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],SignerInfo.prototype,"signature",void 0);__decorate$1([AsnProp({type:Attribute,repeated:"set",context:1,implicit:true,optional:true})],SignerInfo.prototype,"unsignedAttrs",void 0);var SignerInfos=SignerInfos_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SignerInfos_1.prototype);return r}return t}(AsnArray);SignerInfos=SignerInfos_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:SignerInfo})],SignerInfos);var SigningTime$1=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Time);SigningTime$1=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SigningTime$1);var CounterSignature$1=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(SignerInfo);CounterSignature$1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CounterSignature$1);var CertificateSet_1;var OtherCertificateFormat=function(){function e(e){if(e===void 0){e={}}this.otherCertFormat="";this.otherCert=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherCertificateFormat.prototype,"otherCertFormat",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],OtherCertificateFormat.prototype,"otherCert",void 0);var CertificateChoices=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:Certificate})],CertificateChoices.prototype,"certificate",void 0);__decorate$1([AsnProp({type:AttributeCertificate,context:2,implicit:true})],CertificateChoices.prototype,"v2AttrCert",void 0);__decorate$1([AsnProp({type:OtherCertificateFormat,context:3,implicit:true})],CertificateChoices.prototype,"other",void 0);CertificateChoices=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CertificateChoices);var CertificateSet=CertificateSet_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertificateSet_1.prototype);return r}return t}(AsnArray);CertificateSet=CertificateSet_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:CertificateChoices})],CertificateSet);var ContentInfo=function(){function e(e){if(e===void 0){e={}}this.contentType="";this.content=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],ContentInfo.prototype,"contentType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],ContentInfo.prototype,"content",void 0);var EncapsulatedContent=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString})],EncapsulatedContent.prototype,"single",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],EncapsulatedContent.prototype,"any",void 0);EncapsulatedContent=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],EncapsulatedContent);var EncapsulatedContentInfo=function(){function e(e){if(e===void 0){e={}}this.eContentType="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],EncapsulatedContentInfo.prototype,"eContentType",void 0);__decorate$1([AsnProp({type:EncapsulatedContent,context:0,optional:true})],EncapsulatedContentInfo.prototype,"eContent",void 0);var EncryptedContent=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString,context:0,implicit:true,optional:true})],EncryptedContent.prototype,"value",void 0);__decorate$1([AsnProp({type:OctetString,converter:AsnConstructedOctetStringConverter,context:0,implicit:true,optional:true,repeated:"sequence"})],EncryptedContent.prototype,"constructedValue",void 0);EncryptedContent=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],EncryptedContent);var EncryptedContentInfo=function(){function e(e){if(e===void 0){e={}}this.contentType="";this.contentEncryptionAlgorithm=new ContentEncryptionAlgorithmIdentifier;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],EncryptedContentInfo.prototype,"contentType",void 0);__decorate$1([AsnProp({type:ContentEncryptionAlgorithmIdentifier})],EncryptedContentInfo.prototype,"contentEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:EncryptedContent,optional:true})],EncryptedContentInfo.prototype,"encryptedContent",void 0);var OtherKeyAttribute=function(){function e(e){if(e===void 0){e={}}this.keyAttrId="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherKeyAttribute.prototype,"keyAttrId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,optional:true})],OtherKeyAttribute.prototype,"keyAttr",void 0);var RecipientEncryptedKeys_1;var RecipientKeyIdentifier=function(){function e(e){if(e===void 0){e={}}this.subjectKeyIdentifier=new SubjectKeyIdentifier;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier})],RecipientKeyIdentifier.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,optional:true})],RecipientKeyIdentifier.prototype,"date",void 0);__decorate$1([AsnProp({type:OtherKeyAttribute,optional:true})],RecipientKeyIdentifier.prototype,"other",void 0);var KeyAgreeRecipientIdentifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:RecipientKeyIdentifier,context:0,implicit:true,optional:true})],KeyAgreeRecipientIdentifier.prototype,"rKeyId",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber,optional:true})],KeyAgreeRecipientIdentifier.prototype,"issuerAndSerialNumber",void 0);KeyAgreeRecipientIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],KeyAgreeRecipientIdentifier);var RecipientEncryptedKey=function(){function e(e){if(e===void 0){e={}}this.rid=new KeyAgreeRecipientIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:KeyAgreeRecipientIdentifier})],RecipientEncryptedKey.prototype,"rid",void 0);__decorate$1([AsnProp({type:OctetString})],RecipientEncryptedKey.prototype,"encryptedKey",void 0);var RecipientEncryptedKeys=RecipientEncryptedKeys_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RecipientEncryptedKeys_1.prototype);return r}return t}(AsnArray);RecipientEncryptedKeys=RecipientEncryptedKeys_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:RecipientEncryptedKey})],RecipientEncryptedKeys);var OriginatorPublicKey=function(){function e(e){if(e===void 0){e={}}this.algorithm=new AlgorithmIdentifier;this.publicKey=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],OriginatorPublicKey.prototype,"algorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],OriginatorPublicKey.prototype,"publicKey",void 0);var OriginatorIdentifierOrKey=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier,context:0,implicit:true,optional:true})],OriginatorIdentifierOrKey.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:OriginatorPublicKey,context:1,implicit:true,optional:true})],OriginatorIdentifierOrKey.prototype,"originatorKey",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber,optional:true})],OriginatorIdentifierOrKey.prototype,"issuerAndSerialNumber",void 0);OriginatorIdentifierOrKey=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],OriginatorIdentifierOrKey);var KeyAgreeRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v3;this.originator=new OriginatorIdentifierOrKey;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.recipientEncryptedKeys=new RecipientEncryptedKeys;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyAgreeRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:OriginatorIdentifierOrKey,context:0})],KeyAgreeRecipientInfo.prototype,"originator",void 0);__decorate$1([AsnProp({type:OctetString,context:1,optional:true})],KeyAgreeRecipientInfo.prototype,"ukm",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],KeyAgreeRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:RecipientEncryptedKeys})],KeyAgreeRecipientInfo.prototype,"recipientEncryptedKeys",void 0);var RecipientIdentifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier,context:0,implicit:true})],RecipientIdentifier.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber})],RecipientIdentifier.prototype,"issuerAndSerialNumber",void 0);RecipientIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],RecipientIdentifier);var KeyTransRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.rid=new RecipientIdentifier;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyTransRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:RecipientIdentifier})],KeyTransRecipientInfo.prototype,"rid",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],KeyTransRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],KeyTransRecipientInfo.prototype,"encryptedKey",void 0);var KEKIdentifier=function(){function e(e){if(e===void 0){e={}}this.keyIdentifier=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString})],KEKIdentifier.prototype,"keyIdentifier",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,optional:true})],KEKIdentifier.prototype,"date",void 0);__decorate$1([AsnProp({type:OtherKeyAttribute,optional:true})],KEKIdentifier.prototype,"other",void 0);var KEKRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v4;this.kekid=new KEKIdentifier;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KEKRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:KEKIdentifier})],KEKRecipientInfo.prototype,"kekid",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],KEKRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],KEKRecipientInfo.prototype,"encryptedKey",void 0);var PasswordRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],PasswordRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:KeyDerivationAlgorithmIdentifier,context:0,optional:true})],PasswordRecipientInfo.prototype,"keyDerivationAlgorithm",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],PasswordRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],PasswordRecipientInfo.prototype,"encryptedKey",void 0);var OtherRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.oriType="";this.oriValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherRecipientInfo.prototype,"oriType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],OtherRecipientInfo.prototype,"oriValue",void 0);var RecipientInfo=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:KeyTransRecipientInfo,optional:true})],RecipientInfo.prototype,"ktri",void 0);__decorate$1([AsnProp({type:KeyAgreeRecipientInfo,context:1,implicit:true,optional:true})],RecipientInfo.prototype,"kari",void 0);__decorate$1([AsnProp({type:KEKRecipientInfo,context:2,implicit:true,optional:true})],RecipientInfo.prototype,"kekri",void 0);__decorate$1([AsnProp({type:PasswordRecipientInfo,context:3,implicit:true,optional:true})],RecipientInfo.prototype,"pwri",void 0);__decorate$1([AsnProp({type:OtherRecipientInfo,context:4,implicit:true,optional:true})],RecipientInfo.prototype,"ori",void 0);RecipientInfo=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],RecipientInfo);var RecipientInfos_1;var RecipientInfos=RecipientInfos_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RecipientInfos_1.prototype);return r}return t}(AsnArray);RecipientInfos=RecipientInfos_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:RecipientInfo})],RecipientInfos);var RevocationInfoChoices_1;var OtherRevocationInfoFormat=function(){function e(e){if(e===void 0){e={}}this.otherRevInfoFormat="";this.otherRevInfo=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherRevocationInfoFormat.prototype,"otherRevInfoFormat",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],OtherRevocationInfoFormat.prototype,"otherRevInfo",void 0);var RevocationInfoChoice=function(){function e(e){if(e===void 0){e={}}this.other=new OtherRevocationInfoFormat;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OtherRevocationInfoFormat,context:1,implicit:true})],RevocationInfoChoice.prototype,"other",void 0);RevocationInfoChoice=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],RevocationInfoChoice);var RevocationInfoChoices=RevocationInfoChoices_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RevocationInfoChoices_1.prototype);return r}return t}(AsnArray);RevocationInfoChoices=RevocationInfoChoices_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:RevocationInfoChoice})],RevocationInfoChoices);var OriginatorInfo=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:CertificateSet,context:0,implicit:true,optional:true})],OriginatorInfo.prototype,"certs",void 0);__decorate$1([AsnProp({type:RevocationInfoChoices,context:1,implicit:true,optional:true})],OriginatorInfo.prototype,"crls",void 0);var UnprotectedAttributes_1;var UnprotectedAttributes=UnprotectedAttributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,UnprotectedAttributes_1.prototype);return r}return t}(AsnArray);UnprotectedAttributes=UnprotectedAttributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:Attribute})],UnprotectedAttributes);var EnvelopedData=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.recipientInfos=new RecipientInfos;this.encryptedContentInfo=new EncryptedContentInfo;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],EnvelopedData.prototype,"version",void 0);__decorate$1([AsnProp({type:OriginatorInfo,context:0,implicit:true,optional:true})],EnvelopedData.prototype,"originatorInfo",void 0);__decorate$1([AsnProp({type:RecipientInfos})],EnvelopedData.prototype,"recipientInfos",void 0);__decorate$1([AsnProp({type:EncryptedContentInfo})],EnvelopedData.prototype,"encryptedContentInfo",void 0);__decorate$1([AsnProp({type:UnprotectedAttributes,context:1,implicit:true,optional:true})],EnvelopedData.prototype,"unprotectedAttrs",void 0);var DigestAlgorithmIdentifiers_1;var DigestAlgorithmIdentifiers=DigestAlgorithmIdentifiers_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,DigestAlgorithmIdentifiers_1.prototype);return r}return t}(AsnArray);DigestAlgorithmIdentifiers=DigestAlgorithmIdentifiers_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:DigestAlgorithmIdentifier})],DigestAlgorithmIdentifiers);var SignedData=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.digestAlgorithms=new DigestAlgorithmIdentifiers;this.encapContentInfo=new EncapsulatedContentInfo;this.signerInfos=new SignerInfos;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SignedData.prototype,"version",void 0);__decorate$1([AsnProp({type:DigestAlgorithmIdentifiers})],SignedData.prototype,"digestAlgorithms",void 0);__decorate$1([AsnProp({type:EncapsulatedContentInfo})],SignedData.prototype,"encapContentInfo",void 0);__decorate$1([AsnProp({type:CertificateSet,context:0,implicit:true,optional:true})],SignedData.prototype,"certificates",void 0);__decorate$1([AsnProp({type:RevocationInfoChoices,context:1,implicit:true,optional:true})],SignedData.prototype,"crls",void 0);__decorate$1([AsnProp({type:SignerInfos})],SignedData.prototype,"signerInfos",void 0);var PKCS12AttrSet_1;var PKCS12Attribute=function(){function e(e){if(e===void 0){e={}}this.attrId="";this.attrValues=[];Object.assign(e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PKCS12Attribute.prototype,"attrId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,repeated:"set"})],PKCS12Attribute.prototype,"attrValues",void 0);var PKCS12AttrSet=PKCS12AttrSet_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,PKCS12AttrSet_1.prototype);return r}return t}(AsnArray);PKCS12AttrSet=PKCS12AttrSet_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:PKCS12Attribute})],PKCS12AttrSet);var AuthenticatedSafe_1;var AuthenticatedSafe=AuthenticatedSafe_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AuthenticatedSafe_1.prototype);return r}return t}(AsnArray);AuthenticatedSafe=AuthenticatedSafe_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:ContentInfo})],AuthenticatedSafe);var CertBag=function(){function e(e){if(e===void 0){e={}}this.certId="";this.certValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],CertBag.prototype,"certId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],CertBag.prototype,"certValue",void 0);var CRLBag=function(){function e(e){if(e===void 0){e={}}this.crlId="";this.crltValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],CRLBag.prototype,"crlId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],CRLBag.prototype,"crltValue",void 0);var KeyBag=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(PrivateKeyInfo$1);KeyBag=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],KeyBag);var PKCS8ShroudedKeyBag=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(EncryptedPrivateKeyInfo$1);PKCS8ShroudedKeyBag=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],PKCS8ShroudedKeyBag);var SecretBag=function(){function e(e){if(e===void 0){e={}}this.secretTypeId="";this.secretValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],SecretBag.prototype,"secretTypeId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],SecretBag.prototype,"secretValue",void 0);var MacData=function(){function e(e){if(e===void 0){e={}}this.mac=new DigestInfo;this.macSalt=new OctetString;this.iterations=1;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DigestInfo})],MacData.prototype,"mac",void 0);__decorate$1([AsnProp({type:OctetString})],MacData.prototype,"macSalt",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,defaultValue:1})],MacData.prototype,"iterations",void 0);var PFX=function(){function e(e){if(e===void 0){e={}}this.version=3;this.authSafe=new ContentInfo;this.macData=new MacData;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],PFX.prototype,"version",void 0);__decorate$1([AsnProp({type:ContentInfo})],PFX.prototype,"authSafe",void 0);__decorate$1([AsnProp({type:MacData,optional:true})],PFX.prototype,"macData",void 0);var SafeContents_1;var SafeBag=function(){function e(e){if(e===void 0){e={}}this.bagId="";this.bagValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],SafeBag.prototype,"bagId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],SafeBag.prototype,"bagValue",void 0);__decorate$1([AsnProp({type:PKCS12Attribute,repeated:"set",optional:true})],SafeBag.prototype,"bagAttributes",void 0);var SafeContents=SafeContents_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SafeContents_1.prototype);return r}return t}(AsnArray);SafeContents=SafeContents_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:SafeBag})],SafeContents);var ExtensionRequest_1,ExtendedCertificateAttributes_1,SMIMECapabilities_1;var id_pkcs9="1.2.840.113549.1.9";var id_pkcs9_at_unstructuredName="".concat(id_pkcs9,".2");var id_pkcs9_at_challengePassword="".concat(id_pkcs9,".7");var id_pkcs9_at_extensionRequest="".concat(id_pkcs9,".14");var PKCS9String=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}return e.call(this,t)||this}t.prototype.toString=function(){return this.ia5String||e.prototype.toString.call(this)};return t}(DirectoryString);__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],PKCS9String.prototype,"ia5String",void 0);PKCS9String=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],PKCS9String);var Pkcs7PDU=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(ContentInfo);Pkcs7PDU=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],Pkcs7PDU);var UserPKCS12=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(PFX);UserPKCS12=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],UserPKCS12);var EncryptedPrivateKeyInfo=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(EncryptedPrivateKeyInfo$1);EncryptedPrivateKeyInfo=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],EncryptedPrivateKeyInfo);var EmailAddress=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],EmailAddress.prototype,"value",void 0);EmailAddress=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],EmailAddress);var UnstructuredName=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(PKCS9String);UnstructuredName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],UnstructuredName);var UnstructuredAddress=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);UnstructuredAddress=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],UnstructuredAddress);var DateOfBirth=function(){function e(e){if(e===void 0){e=new Date}this.value=e}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],DateOfBirth.prototype,"value",void 0);DateOfBirth=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DateOfBirth);var PlaceOfBirth=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);PlaceOfBirth=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],PlaceOfBirth);var Gender=function(){function e(e){if(e===void 0){e="M"}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],Gender.prototype,"value",void 0);Gender=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Gender);var CountryOfCitizenship=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],CountryOfCitizenship.prototype,"value",void 0);CountryOfCitizenship=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CountryOfCitizenship);var CountryOfResidence=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(CountryOfCitizenship);CountryOfResidence=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CountryOfResidence);var Pseudonym=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);Pseudonym=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Pseudonym);var ContentType=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],ContentType.prototype,"value",void 0);ContentType=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],ContentType);var SigningTime=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Time);SigningTime=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SigningTime);var SequenceNumber=function(){function e(e){if(e===void 0){e=0}this.value=e}e.prototype.toString=function(){return this.value.toString()};return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SequenceNumber.prototype,"value",void 0);SequenceNumber=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SequenceNumber);var CounterSignature=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(SignerInfo);CounterSignature=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CounterSignature);var ChallengePassword=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);ChallengePassword=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],ChallengePassword);var ExtensionRequest=ExtensionRequest_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ExtensionRequest_1.prototype);return r}return t}(Extensions);ExtensionRequest=ExtensionRequest_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ExtensionRequest);var ExtendedCertificateAttributes=ExtendedCertificateAttributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ExtendedCertificateAttributes_1.prototype);return r}return t}(AsnArray);ExtendedCertificateAttributes=ExtendedCertificateAttributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:Attribute})],ExtendedCertificateAttributes);var FriendlyName=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],FriendlyName.prototype,"value",void 0);FriendlyName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],FriendlyName);var SMIMECapability=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);SMIMECapability=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SMIMECapability);var SMIMECapabilities=SMIMECapabilities_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SMIMECapabilities_1.prototype);return r}return t}(AsnArray);SMIMECapabilities=SMIMECapabilities_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:SMIMECapability})],SMIMECapabilities);var Attributes_1;var Attributes=Attributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Attributes_1.prototype);return r}return t}(AsnArray);Attributes=Attributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Attribute$1})],Attributes);var CertificationRequestInfo=function(){function e(e){if(e===void 0){e={}}this.version=0;this.subject=new Name$1;this.subjectPKInfo=new SubjectPublicKeyInfo;this.attributes=new Attributes;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],CertificationRequestInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:Name$1})],CertificationRequestInfo.prototype,"subject",void 0);__decorate$1([AsnProp({type:SubjectPublicKeyInfo})],CertificationRequestInfo.prototype,"subjectPKInfo",void 0);__decorate$1([AsnProp({type:Attributes,implicit:true,context:0})],CertificationRequestInfo.prototype,"attributes",void 0);var CertificationRequest=function(){function e(e){if(e===void 0){e={}}this.certificationRequestInfo=new CertificationRequestInfo;this.signatureAlgorithm=new AlgorithmIdentifier;this.signature=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:CertificationRequestInfo})],CertificationRequest.prototype,"certificationRequestInfo",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],CertificationRequest.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],CertificationRequest.prototype,"signature",void 0);export{OIDs as $,AsnData as A,id_rsaEncryption as B,Convert_1 as C,Download as D,ExtensionRequest as E,getCertificateThumbprint as F,Extension as G,base64Format as H,InsuranceValue as I,hexFormat as J,Certificate as K,dateDiff as L,id_composite_key as M,Name as N,CompositePublicKey as O,id_alg_composite as P,CompositeSignatureValue as Q,RSAPublicKey as R,CompositeParams as S,TypeRelationship as T,UnstructuredName as U,ValuationRanking as V,WebGDPR as W,AttributeCertificate as X,CertificateList as Y,l10n as Z,dateShort as _,Attribute$1 as a,Name$1 as a0,CRLReason as a1,InvalidityDate as a2,CertificateIssuer as a3,OtherName as a4,DisplayText as a5,UserNotice as a6,BufferSourceConverter_1 as a7,EDIPartyName as a8,__decorate$1 as a9,QCStatements as aA,NetscapeComment as aB,NetscapeCertType as aC,LeiRole as aD,LeiChoice as aE,Timestamp as aF,ArchiveRevInfo as aG,SubjectDirectoryAttributes as aH,PrivateKeyUsagePeriod as aI,EntrustVersionInfo as aJ,BiometricSyntax as aK,LogotypeExtn as aL,TNAuthorizationList as aM,PolicyConstraints as aN,PolicyMappings as aO,CRLNumber as aP,IssuingDistributionPoint as aQ,NonStandardKeyDescription as aR,CabforganizationIdentifier as aS,AsnProp as aa,AsnPropTypes as ab,AsnType as ac,AsnTypeTypes as ad,AsnArray as ae,id_qcs_pkixQCSyntax_v2 as af,SemanticsInformation as ag,AsnIntegerArrayBufferConverter as ah,AttestationApplicationId as ai,RootOfTrust as aj,IntegerSet as ak,KeyUsage as al,BasicConstraints as am,ExtendedKeyUsage as an,SubjectKeyIdentifier as ao,AuthorityKeyIdentifier as ap,CRLDistributionPoints as aq,AuthorityInfoAccessSyntax as ar,SubjectInfoAccessSyntax as as,SubjectAlternativeName as at,CertificatePolicies as au,CertificateTransparency as av,NameConstraints as aw,CertificateTemplate as ax,EnrollCertTypeChoice as ay,CaVersion as az,AsnParser as b,DomainNameBeneficiary as c,downloadFromBuffer as d,id_DomainNameLegalRepresentative as e,DomainNameLegalRepresentative as f,id_DomainNameOwner as g,DomainNameOwner as h,id_DomainNameBeneficiary as i,id_DomainNameTechnicalOperator as j,DomainNameTechnicalOperator as k,id_TypeRelationship as l,id_ActivityDescription as m,ActivityDescription as n,id_WebGDPR as o,id_InsuranceValue as p,id_ValuationRanking as q,id_pkcs9_at_challengePassword as r,ChallengePassword as s,id_pkcs9_at_unstructuredName as t,id_pkcs9_at_extensionRequest as u,certificateRawToBuffer as v,CertificationRequest as w,id_ecPublicKey as x,AsnConvert as y,ECParameters as z};
135
- //# sourceMappingURL=certification_request-a4699dcf.js.map
127
+ */var rPaddingTag="-{5}";var rEolChars="\\n";var rNameTag="[^".concat(rEolChars,"]+");var rBeginTag="".concat(rPaddingTag,"BEGIN (").concat(rNameTag,"(?=").concat(rPaddingTag,"))").concat(rPaddingTag);var rEndTag="".concat(rPaddingTag,"END \\1").concat(rPaddingTag);var rEolGroup="\\n";var rHeaderKey="[^:".concat(rEolChars,"]+");var rHeaderValue="(?:[^".concat(rEolChars,"]+").concat(rEolGroup,"(?: +[^").concat(rEolChars,"]+").concat(rEolGroup,")*)");var rBase64Chars="[a-zA-Z0-9=+/]+";var rBase64="(?:".concat(rBase64Chars).concat(rEolGroup,")+");var rPem="".concat(rBeginTag).concat(rEolGroup,"(?:((?:").concat(rHeaderKey,": ").concat(rHeaderValue,")+))?").concat(rEolGroup,"?(").concat(rBase64,")").concat(rEndTag);var PemConverter=function(){function e(){}e.isPem=function(e){return typeof e==="string"&&new RegExp(rPem,"g").test(e)};e.decodeWithHeaders=function(e){e=e.replace(/\r/g,"");var t=new RegExp(rPem,"g");var r=[];var i=null;while(i=t.exec(e)){var n=i[3].replace(new RegExp("[".concat(rEolChars,"]+"),"g"),"");var o={type:i[1],headers:[],rawData:Convert_1.FromBase64(n)};var a=i[2];if(a){var s=a.split(new RegExp(rEolGroup,"g"));var c=null;for(var u=0,p=s;u<p.length;u++){var f=p[u];var d=f.split(/:(.*)/),l=d[0],y=d[1];if(y===undefined){if(!c){throw new Error("Cannot parse PEM string. Incorrect header value")}c.value+=l.trim()}else{if(c){o.headers.push(c)}c={key:l,value:y.trim()}}}if(c){o.headers.push(c)}}r.push(o)}return r};e.decode=function(e){var t=this.decodeWithHeaders(e);return t.map((function(e){return e.rawData}))};e.encode=function(e,t){var r=this;if(Array.isArray(e)){var i=new Array;if(t){e.forEach((function(e){if(!BufferSourceConverter_1.isBufferSource(e)){throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource")}i.push(r.encodeStruct({type:t,rawData:BufferSourceConverter_1.toArrayBuffer(e)}))}))}else{e.forEach((function(e){if(!("type"in e)){throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut")}i.push(r.encodeStruct(e))}))}return i.join("\n")}if(!t){throw new Error("Required argument 'tag' is missed")}return this.encodeStruct({type:t,rawData:BufferSourceConverter_1.toArrayBuffer(e)})};e.encodeStruct=function(e){var t;var r=e.type.toLocaleUpperCase();var i=[];i.push("-----BEGIN ".concat(r,"-----"));if((t=e.headers)===null||t===void 0?void 0:t.length){for(var n=0,o=e.headers;n<o.length;n++){var a=o[n];i.push("".concat(a.key,": ").concat(a.value))}i.push("")}var s=Convert_1.ToBase64(e.rawData);var c;var u=0;var p=Array();while(u<s.length){if(s.length-u<64){c=s.substring(u)}else{c=s.substring(u,u+64);u+=64}if(c.length!==0){p.push(c);if(c.length<64){break}}else{break}}i.push.apply(i,p);i.push("-----END ".concat(r,"-----"));return i.join("\n")};return e}();PemConverter.CertificateTag="CERTIFICATE";PemConverter.CrlTag="CRL";PemConverter.CertificateRequestTag="CERTIFICATE REQUEST";PemConverter.AttributeCertificateTag="ATTRIBUTE CERTIFICATE";
128
+ /**
129
+ * @license
130
+ * Copyright (c) Peculiar Ventures, LLC.
131
+ *
132
+ * This source code is licensed under the MIT license found in the
133
+ * LICENSE file in the root directory of this source tree.
134
+ */var CryptoProvider=function(){function e(){this.providers=new Map;var t=window.crypto||window.msCrypto;if(typeof t!=="undefined"){this.set(e.DEFAULT,t)}}e.isCryptoKeyPair=function(e){return e&&e.privateKey&&e.publicKey};e.prototype.get=function(t){if(t===void 0){t=e.DEFAULT}var r=this.providers.get(t.toLowerCase());if(!r){throw new Error("Cannot get Crypto by name '".concat(t,"'"))}return r};e.prototype.set=function(t,r){if(typeof t==="string"){if(!r){throw new TypeError("Argument 'value' is required")}this.providers.set(t.toLowerCase(),r)}else{this.providers.set(e.DEFAULT,t)}return this};return e}();CryptoProvider.DEFAULT="default";var cryptoProvider=new CryptoProvider;
135
+ /**
136
+ * @license
137
+ * Copyright (c) Peculiar Ventures, LLC.
138
+ *
139
+ * This source code is licensed under the MIT license found in the
140
+ * LICENSE file in the root directory of this source tree.
141
+ */var certificateRawToBuffer=function(e){if(PemConverter.isPem(e)){return PemConverter.decode(e)[0]}if(Convert_1.isHex(e)){return Convert_1.FromHex(e)}if(Convert_1.isBase64(e)){return Convert_1.FromBase64(e)}if(Convert_1.isBase64Url(e)){return Convert_1.FromBase64Url(e)}throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")};var getCertificateThumbprint=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(i){r=cryptoProvider.get();if(r.subtle){return[2,r.subtle.digest(e,t)]}return[2,undefined]}))}))};var ACClearAttrs=function(){function e(e){if(e===void 0){e={}}this.acIssuer=new GeneralName;this.acSerial=0;this.attrs=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName})],ACClearAttrs.prototype,"acIssuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ACClearAttrs.prototype,"acSerial",void 0);__decorate$1([AsnProp({type:Attribute$1,repeated:"sequence"})],ACClearAttrs.prototype,"attrs",void 0);var AttrSpec_1;var AttrSpec=AttrSpec_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AttrSpec_1.prototype);return r}return t}(AsnArray);AttrSpec=AttrSpec_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:AsnPropTypes.ObjectIdentifier})],AttrSpec);var AAControls=function(){function e(e){if(e===void 0){e={}}this.permitUnSpecified=true;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer,optional:true})],AAControls.prototype,"pathLenConstraint",void 0);__decorate$1([AsnProp({type:AttrSpec,implicit:true,context:0,optional:true})],AAControls.prototype,"permittedAttrs",void 0);__decorate$1([AsnProp({type:AttrSpec,implicit:true,context:1,optional:true})],AAControls.prototype,"excludedAttrs",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Boolean,defaultValue:true})],AAControls.prototype,"permitUnSpecified",void 0);var IssuerSerial=function(){function e(e){if(e===void 0){e={}}this.issuer=new GeneralNames;this.serial=new ArrayBuffer(0);this.issuerUID=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames})],IssuerSerial.prototype,"issuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],IssuerSerial.prototype,"serial",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,optional:true})],IssuerSerial.prototype,"issuerUID",void 0);var DigestedObjectType;(function(e){e[e["publicKey"]=0]="publicKey";e[e["publicKeyCert"]=1]="publicKeyCert";e[e["otherObjectTypes"]=2]="otherObjectTypes"})(DigestedObjectType||(DigestedObjectType={}));var ObjectDigestInfo=function(){function e(e){if(e===void 0){e={}}this.digestedObjectType=DigestedObjectType.publicKey;this.digestAlgorithm=new AlgorithmIdentifier;this.objectDigest=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Enumerated})],ObjectDigestInfo.prototype,"digestedObjectType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier,optional:true})],ObjectDigestInfo.prototype,"otherObjectTypeID",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],ObjectDigestInfo.prototype,"digestAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],ObjectDigestInfo.prototype,"objectDigest",void 0);var V2Form=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames,optional:true})],V2Form.prototype,"issuerName",void 0);__decorate$1([AsnProp({type:IssuerSerial,context:0,implicit:true,optional:true})],V2Form.prototype,"baseCertificateID",void 0);__decorate$1([AsnProp({type:ObjectDigestInfo,context:1,implicit:true,optional:true})],V2Form.prototype,"objectDigestInfo",void 0);var AttCertIssuer=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,repeated:"sequence"})],AttCertIssuer.prototype,"v1Form",void 0);__decorate$1([AsnProp({type:V2Form,context:0,implicit:true})],AttCertIssuer.prototype,"v2Form",void 0);AttCertIssuer=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],AttCertIssuer);var AttCertValidityPeriod=function(){function e(e){if(e===void 0){e={}}this.notBeforeTime=new Date;this.notAfterTime=new Date;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],AttCertValidityPeriod.prototype,"notBeforeTime",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],AttCertValidityPeriod.prototype,"notAfterTime",void 0);var Holder=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:IssuerSerial,implicit:true,context:0,optional:true})],Holder.prototype,"baseCertificateID",void 0);__decorate$1([AsnProp({type:GeneralNames,implicit:true,context:1,optional:true})],Holder.prototype,"entityName",void 0);__decorate$1([AsnProp({type:ObjectDigestInfo,implicit:true,context:2,optional:true})],Holder.prototype,"objectDigestInfo",void 0);var AttCertVersion;(function(e){e[e["v2"]=1]="v2"})(AttCertVersion||(AttCertVersion={}));var AttributeCertificateInfo=function(){function e(e){if(e===void 0){e={}}this.version=AttCertVersion.v2;this.holder=new Holder;this.issuer=new AttCertIssuer;this.signature=new AlgorithmIdentifier;this.serialNumber=new ArrayBuffer(0);this.attrCertValidityPeriod=new AttCertValidityPeriod;this.attributes=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],AttributeCertificateInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:Holder})],AttributeCertificateInfo.prototype,"holder",void 0);__decorate$1([AsnProp({type:AttCertIssuer})],AttributeCertificateInfo.prototype,"issuer",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],AttributeCertificateInfo.prototype,"signature",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],AttributeCertificateInfo.prototype,"serialNumber",void 0);__decorate$1([AsnProp({type:AttCertValidityPeriod})],AttributeCertificateInfo.prototype,"attrCertValidityPeriod",void 0);__decorate$1([AsnProp({type:Attribute$1,repeated:"sequence"})],AttributeCertificateInfo.prototype,"attributes",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString,optional:true})],AttributeCertificateInfo.prototype,"issuerUniqueID",void 0);__decorate$1([AsnProp({type:Extensions,optional:true})],AttributeCertificateInfo.prototype,"extensions",void 0);var AttributeCertificate=function(){function e(e){if(e===void 0){e={}}this.acinfo=new AttributeCertificateInfo;this.signatureAlgorithm=new AlgorithmIdentifier;this.signatureValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AttributeCertificateInfo})],AttributeCertificate.prototype,"acinfo",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],AttributeCertificate.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],AttributeCertificate.prototype,"signatureValue",void 0);var ClassListFlags;(function(e){e[e["unmarked"]=1]="unmarked";e[e["unclassified"]=2]="unclassified";e[e["restricted"]=4]="restricted";e[e["confidential"]=8]="confidential";e[e["secret"]=16]="secret";e[e["topSecret"]=32]="topSecret"})(ClassListFlags||(ClassListFlags={}));var ClassList=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(BitString);var SecurityCategory=function(){function e(e){if(e===void 0){e={}}this.type="";this.value=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier,implicit:true,context:0})],SecurityCategory.prototype,"type",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,implicit:true,context:1})],SecurityCategory.prototype,"value",void 0);var Clearance=function(){function e(e){if(e===void 0){e={}}this.policyId="";this.classList=new ClassList(ClassListFlags.unclassified);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Clearance.prototype,"policyId",void 0);__decorate$1([AsnProp({type:ClassList,defaultValue:new ClassList(ClassListFlags.unclassified)})],Clearance.prototype,"classList",void 0);__decorate$1([AsnProp({type:SecurityCategory,repeated:"set"})],Clearance.prototype,"securityCategories",void 0);var IetfAttrSyntaxValueChoices=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString})],IetfAttrSyntaxValueChoices.prototype,"cotets",void 0);__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],IetfAttrSyntaxValueChoices.prototype,"oid",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String})],IetfAttrSyntaxValueChoices.prototype,"string",void 0);var IetfAttrSyntax=function(){function e(e){if(e===void 0){e={}}this.values=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames,implicit:true,context:0,optional:true})],IetfAttrSyntax.prototype,"policyAuthority",void 0);__decorate$1([AsnProp({type:IetfAttrSyntaxValueChoices,repeated:"sequence"})],IetfAttrSyntax.prototype,"values",void 0);var Targets_1;var TargetCert=function(){function e(e){if(e===void 0){e={}}this.targetCertificate=new IssuerSerial;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:IssuerSerial})],TargetCert.prototype,"targetCertificate",void 0);__decorate$1([AsnProp({type:GeneralName,optional:true})],TargetCert.prototype,"targetName",void 0);__decorate$1([AsnProp({type:ObjectDigestInfo,optional:true})],TargetCert.prototype,"certDigestInfo",void 0);var Target=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0,implicit:true})],Target.prototype,"targetName",void 0);__decorate$1([AsnProp({type:GeneralName,context:1,implicit:true})],Target.prototype,"targetGroup",void 0);__decorate$1([AsnProp({type:TargetCert,context:2,implicit:true})],Target.prototype,"targetCert",void 0);Target=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Target);var Targets=Targets_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Targets_1.prototype);return r}return t}(AsnArray);Targets=Targets_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Target})],Targets);var ProxyInfo_1;var ProxyInfo=ProxyInfo_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ProxyInfo_1.prototype);return r}return t}(AsnArray);ProxyInfo=ProxyInfo_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Targets})],ProxyInfo);var RoleSyntax=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralNames,implicit:true,context:0,optional:true})],RoleSyntax.prototype,"roleAuthority",void 0);__decorate$1([AsnProp({type:GeneralName,implicit:true,context:1})],RoleSyntax.prototype,"roleName",void 0);var SvceAuthInfo=function(){function e(e){if(e===void 0){e={}}this.service=new GeneralName;this.ident=new GeneralName;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName})],SvceAuthInfo.prototype,"service",void 0);__decorate$1([AsnProp({type:GeneralName})],SvceAuthInfo.prototype,"ident",void 0);__decorate$1([AsnProp({type:OctetString,optional:true})],SvceAuthInfo.prototype,"authInfo",void 0);var id_ntQWAC="0.4.0.9496";var id_ActivityDescription="".concat(id_ntQWAC,".6");var ActivityDescription=function(){function e(e){if(e===void 0){e={}}this.codeAuthority=new GeneralName;this.codeId=new GeneralName;this.shortName="";this.shortDescription="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0})],ActivityDescription.prototype,"codeAuthority",void 0);__decorate$1([AsnProp({type:GeneralName,context:1})],ActivityDescription.prototype,"codeId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String,context:2})],ActivityDescription.prototype,"shortName",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String,context:3})],ActivityDescription.prototype,"shortDescription",void 0);ActivityDescription=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ActivityDescription);var DomainName=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(Name$1);DomainName=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainName);var id_DomainNameBeneficiary="".concat(id_ntQWAC,".1");var DomainNameBeneficiary=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameBeneficiary=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameBeneficiary);var id_DomainNameLegalRepresentative="".concat(id_ntQWAC,".2");var DomainNameLegalRepresentative=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameLegalRepresentative=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameLegalRepresentative);var id_DomainNameOwner="".concat(id_ntQWAC,".3");var DomainNameOwner=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameOwner=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameOwner);var id_DomainNameTechnicalOperator="".concat(id_ntQWAC,".4");var DomainNameTechnicalOperator=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Name$1.prototype);return r}return t}(DomainName);DomainNameTechnicalOperator=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DomainNameTechnicalOperator);var id_InsuranceValue="".concat(id_ntQWAC,".8");var InsuranceValue=function(){function e(e){if(e===void 0){e={}}this.location="";this.base=0;this.degree=0;Object.assign(this,e)}e.prototype.toString=function(){return"".concat(this.base," x 10^").concat(this.degree," ").concat(this.location)};return e}();__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],InsuranceValue.prototype,"location",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],InsuranceValue.prototype,"base",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],InsuranceValue.prototype,"degree",void 0);InsuranceValue=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],InsuranceValue);var id_ValuationRanking="".concat(id_ntQWAC,".9");var ValuationRanking=function(){function e(e){if(e===void 0){e={}}this.stars5=0;this.stars4=0;this.stars3=0;this.stars2=0;this.stars1=0;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars5",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars4",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars3",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars2",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer})],ValuationRanking.prototype,"stars1",void 0);ValuationRanking=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ValuationRanking);var id_TypeRelationship="".concat(id_ntQWAC,".5");var TypeRelationship=function(){function e(e){if(e===void 0){e={}}this.DNBvsDNO=new BitString(0);this.DNBvsDNT=new BitString(0);this.DNOvsDNT=new BitString(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:BitString,context:0})],TypeRelationship.prototype,"DNBvsDNO",void 0);__decorate$1([AsnProp({type:BitString,context:1})],TypeRelationship.prototype,"DNBvsDNT",void 0);__decorate$1([AsnProp({type:BitString,context:2})],TypeRelationship.prototype,"DNOvsDNT",void 0);TypeRelationship=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],TypeRelationship);var id_WebGDPR="".concat(id_ntQWAC,".7");var WebGDPR=function(){function e(e){if(e===void 0){e={}}this.assessmentAuthority=new GeneralName;this.assessmentRef=new GeneralName;this.assessmentLocation=new GeneralName;this.dataStorageTerritory="";this.description="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:GeneralName,context:0})],WebGDPR.prototype,"assessmentAuthority",void 0);__decorate$1([AsnProp({type:GeneralName,context:1})],WebGDPR.prototype,"assessmentRef",void 0);__decorate$1([AsnProp({type:GeneralName,context:2})],WebGDPR.prototype,"assessmentLocation",void 0);__decorate$1([AsnProp({type:AsnPropTypes.PrintableString,context:3})],WebGDPR.prototype,"dataStorageTerritory",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Utf8String,context:4})],WebGDPR.prototype,"description",void 0);WebGDPR=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],WebGDPR);var IssuerAndSerialNumber=function(){function e(e){if(e===void 0){e={}}this.issuer=new Name$1;this.serialNumber=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:Name$1})],IssuerAndSerialNumber.prototype,"issuer",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,converter:AsnIntegerArrayBufferConverter})],IssuerAndSerialNumber.prototype,"serialNumber",void 0);var SignerIdentifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier,context:0,implicit:true})],SignerIdentifier.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber})],SignerIdentifier.prototype,"issuerAndSerialNumber",void 0);SignerIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SignerIdentifier);var CMSVersion;(function(e){e[e["v0"]=0]="v0";e[e["v1"]=1]="v1";e[e["v2"]=2]="v2";e[e["v3"]=3]="v3";e[e["v4"]=4]="v4";e[e["v5"]=5]="v5"})(CMSVersion||(CMSVersion={}));var DigestAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);DigestAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],DigestAlgorithmIdentifier);var SignatureAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);SignatureAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SignatureAlgorithmIdentifier);var KeyEncryptionAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);KeyEncryptionAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],KeyEncryptionAlgorithmIdentifier);var ContentEncryptionAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);ContentEncryptionAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ContentEncryptionAlgorithmIdentifier);var MessageAuthenticationCodeAlgorithm=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);MessageAuthenticationCodeAlgorithm=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],MessageAuthenticationCodeAlgorithm);var KeyDerivationAlgorithmIdentifier=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);KeyDerivationAlgorithmIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],KeyDerivationAlgorithmIdentifier);var Attribute=function(){function e(e){if(e===void 0){e={}}this.attrType="";this.attrValues=[];Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],Attribute.prototype,"attrType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,repeated:"set"})],Attribute.prototype,"attrValues",void 0);var SignerInfos_1;var SignerInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.sid=new SignerIdentifier;this.digestAlgorithm=new DigestAlgorithmIdentifier;this.signatureAlgorithm=new SignatureAlgorithmIdentifier;this.signature=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SignerInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:SignerIdentifier})],SignerInfo.prototype,"sid",void 0);__decorate$1([AsnProp({type:DigestAlgorithmIdentifier})],SignerInfo.prototype,"digestAlgorithm",void 0);__decorate$1([AsnProp({type:Attribute,repeated:"set",context:0,implicit:true,optional:true})],SignerInfo.prototype,"signedAttrs",void 0);__decorate$1([AsnProp({type:SignatureAlgorithmIdentifier})],SignerInfo.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],SignerInfo.prototype,"signature",void 0);__decorate$1([AsnProp({type:Attribute,repeated:"set",context:1,implicit:true,optional:true})],SignerInfo.prototype,"unsignedAttrs",void 0);var SignerInfos=SignerInfos_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SignerInfos_1.prototype);return r}return t}(AsnArray);SignerInfos=SignerInfos_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:SignerInfo})],SignerInfos);var SigningTime$1=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Time);SigningTime$1=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SigningTime$1);var CounterSignature$1=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(SignerInfo);CounterSignature$1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CounterSignature$1);var CertificateSet_1;var OtherCertificateFormat=function(){function e(e){if(e===void 0){e={}}this.otherCertFormat="";this.otherCert=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherCertificateFormat.prototype,"otherCertFormat",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],OtherCertificateFormat.prototype,"otherCert",void 0);var CertificateChoices=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:Certificate})],CertificateChoices.prototype,"certificate",void 0);__decorate$1([AsnProp({type:AttributeCertificate,context:2,implicit:true})],CertificateChoices.prototype,"v2AttrCert",void 0);__decorate$1([AsnProp({type:OtherCertificateFormat,context:3,implicit:true})],CertificateChoices.prototype,"other",void 0);CertificateChoices=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CertificateChoices);var CertificateSet=CertificateSet_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,CertificateSet_1.prototype);return r}return t}(AsnArray);CertificateSet=CertificateSet_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:CertificateChoices})],CertificateSet);var ContentInfo=function(){function e(e){if(e===void 0){e={}}this.contentType="";this.content=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],ContentInfo.prototype,"contentType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],ContentInfo.prototype,"content",void 0);var EncapsulatedContent=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString})],EncapsulatedContent.prototype,"single",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],EncapsulatedContent.prototype,"any",void 0);EncapsulatedContent=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],EncapsulatedContent);var EncapsulatedContentInfo=function(){function e(e){if(e===void 0){e={}}this.eContentType="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],EncapsulatedContentInfo.prototype,"eContentType",void 0);__decorate$1([AsnProp({type:EncapsulatedContent,context:0,optional:true})],EncapsulatedContentInfo.prototype,"eContent",void 0);var EncryptedContent=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString,context:0,implicit:true,optional:true})],EncryptedContent.prototype,"value",void 0);__decorate$1([AsnProp({type:OctetString,converter:AsnConstructedOctetStringConverter,context:0,implicit:true,optional:true,repeated:"sequence"})],EncryptedContent.prototype,"constructedValue",void 0);EncryptedContent=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],EncryptedContent);var EncryptedContentInfo=function(){function e(e){if(e===void 0){e={}}this.contentType="";this.contentEncryptionAlgorithm=new ContentEncryptionAlgorithmIdentifier;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],EncryptedContentInfo.prototype,"contentType",void 0);__decorate$1([AsnProp({type:ContentEncryptionAlgorithmIdentifier})],EncryptedContentInfo.prototype,"contentEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:EncryptedContent,optional:true})],EncryptedContentInfo.prototype,"encryptedContent",void 0);var OtherKeyAttribute=function(){function e(e){if(e===void 0){e={}}this.keyAttrId="";Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherKeyAttribute.prototype,"keyAttrId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,optional:true})],OtherKeyAttribute.prototype,"keyAttr",void 0);var RecipientEncryptedKeys_1;var RecipientKeyIdentifier=function(){function e(e){if(e===void 0){e={}}this.subjectKeyIdentifier=new SubjectKeyIdentifier;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier})],RecipientKeyIdentifier.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,optional:true})],RecipientKeyIdentifier.prototype,"date",void 0);__decorate$1([AsnProp({type:OtherKeyAttribute,optional:true})],RecipientKeyIdentifier.prototype,"other",void 0);var KeyAgreeRecipientIdentifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:RecipientKeyIdentifier,context:0,implicit:true,optional:true})],KeyAgreeRecipientIdentifier.prototype,"rKeyId",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber,optional:true})],KeyAgreeRecipientIdentifier.prototype,"issuerAndSerialNumber",void 0);KeyAgreeRecipientIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],KeyAgreeRecipientIdentifier);var RecipientEncryptedKey=function(){function e(e){if(e===void 0){e={}}this.rid=new KeyAgreeRecipientIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:KeyAgreeRecipientIdentifier})],RecipientEncryptedKey.prototype,"rid",void 0);__decorate$1([AsnProp({type:OctetString})],RecipientEncryptedKey.prototype,"encryptedKey",void 0);var RecipientEncryptedKeys=RecipientEncryptedKeys_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RecipientEncryptedKeys_1.prototype);return r}return t}(AsnArray);RecipientEncryptedKeys=RecipientEncryptedKeys_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:RecipientEncryptedKey})],RecipientEncryptedKeys);var OriginatorPublicKey=function(){function e(e){if(e===void 0){e={}}this.algorithm=new AlgorithmIdentifier;this.publicKey=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AlgorithmIdentifier})],OriginatorPublicKey.prototype,"algorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],OriginatorPublicKey.prototype,"publicKey",void 0);var OriginatorIdentifierOrKey=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier,context:0,implicit:true,optional:true})],OriginatorIdentifierOrKey.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:OriginatorPublicKey,context:1,implicit:true,optional:true})],OriginatorIdentifierOrKey.prototype,"originatorKey",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber,optional:true})],OriginatorIdentifierOrKey.prototype,"issuerAndSerialNumber",void 0);OriginatorIdentifierOrKey=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],OriginatorIdentifierOrKey);var KeyAgreeRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v3;this.originator=new OriginatorIdentifierOrKey;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.recipientEncryptedKeys=new RecipientEncryptedKeys;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyAgreeRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:OriginatorIdentifierOrKey,context:0})],KeyAgreeRecipientInfo.prototype,"originator",void 0);__decorate$1([AsnProp({type:OctetString,context:1,optional:true})],KeyAgreeRecipientInfo.prototype,"ukm",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],KeyAgreeRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:RecipientEncryptedKeys})],KeyAgreeRecipientInfo.prototype,"recipientEncryptedKeys",void 0);var RecipientIdentifier=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:SubjectKeyIdentifier,context:0,implicit:true})],RecipientIdentifier.prototype,"subjectKeyIdentifier",void 0);__decorate$1([AsnProp({type:IssuerAndSerialNumber})],RecipientIdentifier.prototype,"issuerAndSerialNumber",void 0);RecipientIdentifier=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],RecipientIdentifier);var KeyTransRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.rid=new RecipientIdentifier;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KeyTransRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:RecipientIdentifier})],KeyTransRecipientInfo.prototype,"rid",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],KeyTransRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],KeyTransRecipientInfo.prototype,"encryptedKey",void 0);var KEKIdentifier=function(){function e(e){if(e===void 0){e={}}this.keyIdentifier=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OctetString})],KEKIdentifier.prototype,"keyIdentifier",void 0);__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime,optional:true})],KEKIdentifier.prototype,"date",void 0);__decorate$1([AsnProp({type:OtherKeyAttribute,optional:true})],KEKIdentifier.prototype,"other",void 0);var KEKRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v4;this.kekid=new KEKIdentifier;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],KEKRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:KEKIdentifier})],KEKRecipientInfo.prototype,"kekid",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],KEKRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],KEKRecipientInfo.prototype,"encryptedKey",void 0);var PasswordRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.keyEncryptionAlgorithm=new KeyEncryptionAlgorithmIdentifier;this.encryptedKey=new OctetString;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],PasswordRecipientInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:KeyDerivationAlgorithmIdentifier,context:0,optional:true})],PasswordRecipientInfo.prototype,"keyDerivationAlgorithm",void 0);__decorate$1([AsnProp({type:KeyEncryptionAlgorithmIdentifier})],PasswordRecipientInfo.prototype,"keyEncryptionAlgorithm",void 0);__decorate$1([AsnProp({type:OctetString})],PasswordRecipientInfo.prototype,"encryptedKey",void 0);var OtherRecipientInfo=function(){function e(e){if(e===void 0){e={}}this.oriType="";this.oriValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherRecipientInfo.prototype,"oriType",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],OtherRecipientInfo.prototype,"oriValue",void 0);var RecipientInfo=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:KeyTransRecipientInfo,optional:true})],RecipientInfo.prototype,"ktri",void 0);__decorate$1([AsnProp({type:KeyAgreeRecipientInfo,context:1,implicit:true,optional:true})],RecipientInfo.prototype,"kari",void 0);__decorate$1([AsnProp({type:KEKRecipientInfo,context:2,implicit:true,optional:true})],RecipientInfo.prototype,"kekri",void 0);__decorate$1([AsnProp({type:PasswordRecipientInfo,context:3,implicit:true,optional:true})],RecipientInfo.prototype,"pwri",void 0);__decorate$1([AsnProp({type:OtherRecipientInfo,context:4,implicit:true,optional:true})],RecipientInfo.prototype,"ori",void 0);RecipientInfo=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],RecipientInfo);var RecipientInfos_1;var RecipientInfos=RecipientInfos_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RecipientInfos_1.prototype);return r}return t}(AsnArray);RecipientInfos=RecipientInfos_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:RecipientInfo})],RecipientInfos);var RevocationInfoChoices_1;var OtherRevocationInfoFormat=function(){function e(e){if(e===void 0){e={}}this.otherRevInfoFormat="";this.otherRevInfo=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],OtherRevocationInfoFormat.prototype,"otherRevInfoFormat",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any})],OtherRevocationInfoFormat.prototype,"otherRevInfo",void 0);var RevocationInfoChoice=function(){function e(e){if(e===void 0){e={}}this.other=new OtherRevocationInfoFormat;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:OtherRevocationInfoFormat,context:1,implicit:true})],RevocationInfoChoice.prototype,"other",void 0);RevocationInfoChoice=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],RevocationInfoChoice);var RevocationInfoChoices=RevocationInfoChoices_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,RevocationInfoChoices_1.prototype);return r}return t}(AsnArray);RevocationInfoChoices=RevocationInfoChoices_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:RevocationInfoChoice})],RevocationInfoChoices);var OriginatorInfo=function(){function e(e){if(e===void 0){e={}}Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:CertificateSet,context:0,implicit:true,optional:true})],OriginatorInfo.prototype,"certs",void 0);__decorate$1([AsnProp({type:RevocationInfoChoices,context:1,implicit:true,optional:true})],OriginatorInfo.prototype,"crls",void 0);var UnprotectedAttributes_1;var UnprotectedAttributes=UnprotectedAttributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,UnprotectedAttributes_1.prototype);return r}return t}(AsnArray);UnprotectedAttributes=UnprotectedAttributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:Attribute})],UnprotectedAttributes);var EnvelopedData=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.recipientInfos=new RecipientInfos;this.encryptedContentInfo=new EncryptedContentInfo;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],EnvelopedData.prototype,"version",void 0);__decorate$1([AsnProp({type:OriginatorInfo,context:0,implicit:true,optional:true})],EnvelopedData.prototype,"originatorInfo",void 0);__decorate$1([AsnProp({type:RecipientInfos})],EnvelopedData.prototype,"recipientInfos",void 0);__decorate$1([AsnProp({type:EncryptedContentInfo})],EnvelopedData.prototype,"encryptedContentInfo",void 0);__decorate$1([AsnProp({type:UnprotectedAttributes,context:1,implicit:true,optional:true})],EnvelopedData.prototype,"unprotectedAttrs",void 0);var DigestAlgorithmIdentifiers_1;var DigestAlgorithmIdentifiers=DigestAlgorithmIdentifiers_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,DigestAlgorithmIdentifiers_1.prototype);return r}return t}(AsnArray);DigestAlgorithmIdentifiers=DigestAlgorithmIdentifiers_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:DigestAlgorithmIdentifier})],DigestAlgorithmIdentifiers);var SignedData=function(){function e(e){if(e===void 0){e={}}this.version=CMSVersion.v0;this.digestAlgorithms=new DigestAlgorithmIdentifiers;this.encapContentInfo=new EncapsulatedContentInfo;this.signerInfos=new SignerInfos;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SignedData.prototype,"version",void 0);__decorate$1([AsnProp({type:DigestAlgorithmIdentifiers})],SignedData.prototype,"digestAlgorithms",void 0);__decorate$1([AsnProp({type:EncapsulatedContentInfo})],SignedData.prototype,"encapContentInfo",void 0);__decorate$1([AsnProp({type:CertificateSet,context:0,implicit:true,optional:true})],SignedData.prototype,"certificates",void 0);__decorate$1([AsnProp({type:RevocationInfoChoices,context:1,implicit:true,optional:true})],SignedData.prototype,"crls",void 0);__decorate$1([AsnProp({type:SignerInfos})],SignedData.prototype,"signerInfos",void 0);var PKCS12AttrSet_1;var PKCS12Attribute=function(){function e(e){if(e===void 0){e={}}this.attrId="";this.attrValues=[];Object.assign(e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],PKCS12Attribute.prototype,"attrId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,repeated:"set"})],PKCS12Attribute.prototype,"attrValues",void 0);var PKCS12AttrSet=PKCS12AttrSet_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,PKCS12AttrSet_1.prototype);return r}return t}(AsnArray);PKCS12AttrSet=PKCS12AttrSet_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:PKCS12Attribute})],PKCS12AttrSet);var AuthenticatedSafe_1;var AuthenticatedSafe=AuthenticatedSafe_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,AuthenticatedSafe_1.prototype);return r}return t}(AsnArray);AuthenticatedSafe=AuthenticatedSafe_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:ContentInfo})],AuthenticatedSafe);var CertBag=function(){function e(e){if(e===void 0){e={}}this.certId="";this.certValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],CertBag.prototype,"certId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],CertBag.prototype,"certValue",void 0);var CRLBag=function(){function e(e){if(e===void 0){e={}}this.crlId="";this.crltValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],CRLBag.prototype,"crlId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],CRLBag.prototype,"crltValue",void 0);var KeyBag=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(PrivateKeyInfo$1);KeyBag=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],KeyBag);var PKCS8ShroudedKeyBag=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(EncryptedPrivateKeyInfo$1);PKCS8ShroudedKeyBag=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],PKCS8ShroudedKeyBag);var SecretBag=function(){function e(e){if(e===void 0){e={}}this.secretTypeId="";this.secretValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],SecretBag.prototype,"secretTypeId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],SecretBag.prototype,"secretValue",void 0);var MacData=function(){function e(e){if(e===void 0){e={}}this.mac=new DigestInfo;this.macSalt=new OctetString;this.iterations=1;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:DigestInfo})],MacData.prototype,"mac",void 0);__decorate$1([AsnProp({type:OctetString})],MacData.prototype,"macSalt",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Integer,defaultValue:1})],MacData.prototype,"iterations",void 0);var PFX=function(){function e(e){if(e===void 0){e={}}this.version=3;this.authSafe=new ContentInfo;this.macData=new MacData;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],PFX.prototype,"version",void 0);__decorate$1([AsnProp({type:ContentInfo})],PFX.prototype,"authSafe",void 0);__decorate$1([AsnProp({type:MacData,optional:true})],PFX.prototype,"macData",void 0);var SafeContents_1;var SafeBag=function(){function e(e){if(e===void 0){e={}}this.bagId="";this.bagValue=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],SafeBag.prototype,"bagId",void 0);__decorate$1([AsnProp({type:AsnPropTypes.Any,context:0})],SafeBag.prototype,"bagValue",void 0);__decorate$1([AsnProp({type:PKCS12Attribute,repeated:"set",optional:true})],SafeBag.prototype,"bagAttributes",void 0);var SafeContents=SafeContents_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SafeContents_1.prototype);return r}return t}(AsnArray);SafeContents=SafeContents_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:SafeBag})],SafeContents);var ExtensionRequest_1,ExtendedCertificateAttributes_1,SMIMECapabilities_1;var id_pkcs9="1.2.840.113549.1.9";var id_pkcs9_at_unstructuredName="".concat(id_pkcs9,".2");var id_pkcs9_at_challengePassword="".concat(id_pkcs9,".7");var id_pkcs9_at_extensionRequest="".concat(id_pkcs9,".14");var PKCS9String=function(e){__extends(t,e);function t(t){if(t===void 0){t={}}return e.call(this,t)||this}t.prototype.toString=function(){return this.ia5String||e.prototype.toString.call(this)};return t}(DirectoryString);__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],PKCS9String.prototype,"ia5String",void 0);PKCS9String=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],PKCS9String);var Pkcs7PDU=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(ContentInfo);Pkcs7PDU=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],Pkcs7PDU);var UserPKCS12=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(PFX);UserPKCS12=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],UserPKCS12);var EncryptedPrivateKeyInfo=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(EncryptedPrivateKeyInfo$1);EncryptedPrivateKeyInfo=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],EncryptedPrivateKeyInfo);var EmailAddress=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.IA5String})],EmailAddress.prototype,"value",void 0);EmailAddress=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],EmailAddress);var UnstructuredName=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(PKCS9String);UnstructuredName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],UnstructuredName);var UnstructuredAddress=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);UnstructuredAddress=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],UnstructuredAddress);var DateOfBirth=function(){function e(e){if(e===void 0){e=new Date}this.value=e}return e}();__decorate$1([AsnProp({type:AsnPropTypes.GeneralizedTime})],DateOfBirth.prototype,"value",void 0);DateOfBirth=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],DateOfBirth);var PlaceOfBirth=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);PlaceOfBirth=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],PlaceOfBirth);var Gender=function(){function e(e){if(e===void 0){e="M"}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],Gender.prototype,"value",void 0);Gender=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Gender);var CountryOfCitizenship=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.PrintableString})],CountryOfCitizenship.prototype,"value",void 0);CountryOfCitizenship=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CountryOfCitizenship);var CountryOfResidence=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(CountryOfCitizenship);CountryOfResidence=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],CountryOfResidence);var Pseudonym=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);Pseudonym=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],Pseudonym);var ContentType=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.ObjectIdentifier})],ContentType.prototype,"value",void 0);ContentType=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],ContentType);var SigningTime=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Time);SigningTime=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SigningTime);var SequenceNumber=function(){function e(e){if(e===void 0){e=0}this.value=e}e.prototype.toString=function(){return this.value.toString()};return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],SequenceNumber.prototype,"value",void 0);SequenceNumber=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],SequenceNumber);var CounterSignature=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(SignerInfo);CounterSignature=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],CounterSignature);var ChallengePassword=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(DirectoryString);ChallengePassword=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],ChallengePassword);var ExtensionRequest=ExtensionRequest_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ExtensionRequest_1.prototype);return r}return t}(Extensions);ExtensionRequest=ExtensionRequest_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],ExtensionRequest);var ExtendedCertificateAttributes=ExtendedCertificateAttributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,ExtendedCertificateAttributes_1.prototype);return r}return t}(AsnArray);ExtendedCertificateAttributes=ExtendedCertificateAttributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Set,itemType:Attribute})],ExtendedCertificateAttributes);var FriendlyName=function(){function e(e){if(e===void 0){e=""}this.value=e}e.prototype.toString=function(){return this.value};return e}();__decorate$1([AsnProp({type:AsnPropTypes.BmpString})],FriendlyName.prototype,"value",void 0);FriendlyName=__decorate$1([AsnType({type:AsnTypeTypes.Choice})],FriendlyName);var SMIMECapability=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(AlgorithmIdentifier);SMIMECapability=__decorate$1([AsnType({type:AsnTypeTypes.Sequence})],SMIMECapability);var SMIMECapabilities=SMIMECapabilities_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,SMIMECapabilities_1.prototype);return r}return t}(AsnArray);SMIMECapabilities=SMIMECapabilities_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:SMIMECapability})],SMIMECapabilities);var Attributes_1;var Attributes=Attributes_1=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;Object.setPrototypeOf(r,Attributes_1.prototype);return r}return t}(AsnArray);Attributes=Attributes_1=__decorate$1([AsnType({type:AsnTypeTypes.Sequence,itemType:Attribute$1})],Attributes);var CertificationRequestInfo=function(){function e(e){if(e===void 0){e={}}this.version=0;this.subject=new Name$1;this.subjectPKInfo=new SubjectPublicKeyInfo;this.attributes=new Attributes;Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:AsnPropTypes.Integer})],CertificationRequestInfo.prototype,"version",void 0);__decorate$1([AsnProp({type:Name$1})],CertificationRequestInfo.prototype,"subject",void 0);__decorate$1([AsnProp({type:SubjectPublicKeyInfo})],CertificationRequestInfo.prototype,"subjectPKInfo",void 0);__decorate$1([AsnProp({type:Attributes,implicit:true,context:0})],CertificationRequestInfo.prototype,"attributes",void 0);var CertificationRequest=function(){function e(e){if(e===void 0){e={}}this.certificationRequestInfo=new CertificationRequestInfo;this.signatureAlgorithm=new AlgorithmIdentifier;this.signature=new ArrayBuffer(0);Object.assign(this,e)}return e}();__decorate$1([AsnProp({type:CertificationRequestInfo})],CertificationRequest.prototype,"certificationRequestInfo",void 0);__decorate$1([AsnProp({type:AlgorithmIdentifier})],CertificationRequest.prototype,"signatureAlgorithm",void 0);__decorate$1([AsnProp({type:AsnPropTypes.BitString})],CertificationRequest.prototype,"signature",void 0);export{CompositeParams as $,AsnData as A,id_rsaEncryption as B,Convert_1 as C,Download as D,ExtensionRequest as E,getCertificateThumbprint as F,Extension as G,EncapsulatedContent as H,InsuranceValue as I,CertificateSet as J,CertificateChoices as K,Certificate as L,ContentInfo as M,Name as N,OctetString as O,PemConverter as P,dateDiff as Q,RSAPublicKey as R,SignedData as S,TypeRelationship as T,UnstructuredName as U,ValuationRanking as V,WebGDPR as W,id_composite_key as X,CompositePublicKey as Y,id_alg_composite as Z,CompositeSignatureValue as _,Attribute$1 as a,AttributeCertificate as a0,CertificateList as a1,l10n as a2,dateShort as a3,OIDs as a4,Name$1 as a5,CRLReason as a6,InvalidityDate as a7,CertificateIssuer as a8,OtherName as a9,CertificateTransparency as aA,NameConstraints as aB,CertificateTemplate as aC,EnrollCertTypeChoice as aD,CaVersion as aE,QCStatements as aF,NetscapeComment as aG,NetscapeCertType as aH,LeiRole as aI,LeiChoice as aJ,Timestamp as aK,ArchiveRevInfo as aL,SubjectDirectoryAttributes as aM,PrivateKeyUsagePeriod as aN,EntrustVersionInfo as aO,BiometricSyntax as aP,LogotypeExtn as aQ,TNAuthorizationList as aR,PolicyConstraints as aS,PolicyMappings as aT,CRLNumber as aU,IssuingDistributionPoint as aV,NonStandardKeyDescription as aW,CabforganizationIdentifier as aX,DisplayText as aa,UserNotice as ab,BufferSourceConverter_1 as ac,EDIPartyName as ad,__decorate$1 as ae,AsnProp as af,AsnPropTypes as ag,AsnType as ah,AsnTypeTypes as ai,AsnArray as aj,id_qcs_pkixQCSyntax_v2 as ak,SemanticsInformation as al,AsnIntegerArrayBufferConverter as am,AttestationApplicationId as an,RootOfTrust as ao,IntegerSet as ap,KeyUsage as aq,BasicConstraints as ar,ExtendedKeyUsage as as,SubjectKeyIdentifier as at,AuthorityKeyIdentifier as au,CRLDistributionPoints as av,AuthorityInfoAccessSyntax as aw,SubjectInfoAccessSyntax as ax,SubjectAlternativeName as ay,CertificatePolicies as az,AsnParser as b,DomainNameBeneficiary as c,downloadFromBuffer as d,id_DomainNameLegalRepresentative as e,DomainNameLegalRepresentative as f,id_DomainNameOwner as g,DomainNameOwner as h,id_DomainNameBeneficiary as i,id_DomainNameTechnicalOperator as j,DomainNameTechnicalOperator as k,id_TypeRelationship as l,id_ActivityDescription as m,ActivityDescription as n,id_WebGDPR as o,id_InsuranceValue as p,id_ValuationRanking as q,id_pkcs9_at_challengePassword as r,ChallengePassword as s,id_pkcs9_at_unstructuredName as t,id_pkcs9_at_extensionRequest as u,certificateRawToBuffer as v,CertificationRequest as w,id_ecPublicKey as x,AsnConvert as y,ECParameters as z};
142
+ //# sourceMappingURL=certification_request-714bd438.js.map