@peculiar/certificates-viewer 4.6.1 → 4.7.1-alpha.1

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 (252) hide show
  1. package/components/attribute-certificate-viewer.js +4 -2
  2. package/components/attribute-certificate-viewer.js.map +1 -1
  3. package/components/attribute.js +2 -1
  4. package/components/attribute.js.map +1 -1
  5. package/components/certificate-chain-viewer.js +1 -1
  6. package/components/certificate-viewer.js +3 -2
  7. package/components/certificate-viewer.js.map +1 -1
  8. package/components/crl-viewer.js +4 -2
  9. package/components/crl-viewer.js.map +1 -1
  10. package/components/csr-viewer.js +3 -3
  11. package/components/csr-viewer.js.map +1 -1
  12. package/components/download.js +2 -12760
  13. package/components/download.js.map +1 -1
  14. package/components/index.js +2 -1
  15. package/components/index.js.map +1 -1
  16. package/components/index2.js +51 -2
  17. package/components/index2.js.map +1 -1
  18. package/components/issuer_name.js +2 -2
  19. package/components/link.js +14335 -0
  20. package/components/link.js.map +1 -0
  21. package/components/miscellaneous.js +96 -72
  22. package/components/miscellaneous.js.map +1 -1
  23. package/components/peculiar-certificate-decoder.js +32 -16
  24. package/components/peculiar-certificate-decoder.js.map +1 -1
  25. package/components/peculiar-certificates-viewer.js +2 -1
  26. package/components/peculiar-certificates-viewer.js.map +1 -1
  27. package/components/peculiar-ssh-certificate-viewer.d.ts +11 -0
  28. package/components/peculiar-ssh-certificate-viewer.js +12 -0
  29. package/components/peculiar-ssh-certificate-viewer.js.map +1 -0
  30. package/components/peculiar-text-hider.js +1 -32
  31. package/components/peculiar-text-hider.js.map +1 -1
  32. package/components/pkcs10_certificate_request.js +2 -6
  33. package/components/pkcs10_certificate_request.js.map +1 -1
  34. package/components/row.js +87 -0
  35. package/components/row.js.map +1 -0
  36. package/components/ssh-certificate-viewer.js +193 -0
  37. package/components/ssh-certificate-viewer.js.map +1 -0
  38. package/components/subject_name.js +2 -2
  39. package/components/text-hider.js +40 -0
  40. package/components/text-hider.js.map +1 -0
  41. package/dist/cjs/extension-D8YKlAu4.js +110 -0
  42. package/dist/cjs/extension-D8YKlAu4.js.map +1 -0
  43. package/dist/cjs/index.cjs.js +4 -4
  44. package/dist/cjs/loader.cjs.js +1 -1
  45. package/dist/cjs/{miscellaneous-DeBEwLDy.js → miscellaneous-DvVSM5KJ.js} +187 -186
  46. package/dist/cjs/{miscellaneous-DeBEwLDy.js.map → miscellaneous-DvVSM5KJ.js.map} +1 -1
  47. package/dist/cjs/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.cjs.js.map +1 -0
  48. package/dist/cjs/{peculiar-attribute-certificate-viewer_4.cjs.entry.js → peculiar-attribute-certificate-viewer_5.cjs.entry.js} +240 -38
  49. package/dist/cjs/peculiar-attribute-certificate-viewer_5.cjs.entry.js.map +1 -0
  50. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +25 -20
  51. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -1
  52. package/dist/cjs/peculiar-certificate-decoder.entry.cjs.js.map +1 -1
  53. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +4 -3
  54. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js.map +1 -1
  55. package/dist/cjs/peculiar-certificate-viewer.entry.cjs.js.map +1 -1
  56. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +23 -22
  57. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +1 -1
  58. package/dist/cjs/peculiar-certificates-viewer.entry.cjs.js.map +1 -1
  59. package/dist/cjs/peculiar.cjs.js +1 -1
  60. package/dist/cjs/pkcs10_certificate_request-BoHhadiA.js +146 -0
  61. package/dist/cjs/pkcs10_certificate_request-BoHhadiA.js.map +1 -0
  62. package/dist/cjs/{certification_request-CxHe71zR.js → ssh_certificate-s3-rwdMT.js} +1734 -126
  63. package/dist/cjs/ssh_certificate-s3-rwdMT.js.map +1 -0
  64. package/dist/cjs/{x509_certificate-CzplJQ0X.js → x509_certificate-DfXuxxZp.js} +29 -28
  65. package/dist/cjs/{x509_certificate-CzplJQ0X.js.map → x509_certificate-DfXuxxZp.js.map} +1 -1
  66. package/dist/cjs/{x509_crl-B7kFbLDV.js → x509_crl-CxJ2lyGX.js} +32 -31
  67. package/dist/cjs/{x509_crl-B7kFbLDV.js.map → x509_crl-CxJ2lyGX.js.map} +1 -1
  68. package/dist/collection/collection-manifest.json +1 -0
  69. package/dist/collection/components/certificate-decoder/certificate-decoder.js +10 -6
  70. package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
  71. package/dist/collection/components/certificate-details-parts/attributes/extension_request_attribute.js +25 -0
  72. package/dist/collection/components/certificate-details-parts/attributes/extension_request_attribute.js.map +1 -0
  73. package/dist/collection/components/certificate-details-parts/attributes/index.js +10 -1
  74. package/dist/collection/components/certificate-details-parts/attributes/index.js.map +1 -1
  75. package/dist/collection/components/certificate-details-parts/attributes/private_key_possession_statement_attribute.js +27 -0
  76. package/dist/collection/components/certificate-details-parts/attributes/private_key_possession_statement_attribute.js.map +1 -0
  77. package/dist/collection/components/csr-viewer/csr-viewer.js +2 -2
  78. package/dist/collection/components/csr-viewer/csr-viewer.js.map +1 -1
  79. package/dist/collection/components/ssh-certificate-viewer/-components/basic_information.js +29 -0
  80. package/dist/collection/components/ssh-certificate-viewer/-components/basic_information.js.map +1 -0
  81. package/dist/collection/components/ssh-certificate-viewer/-components/public_key.js +26 -0
  82. package/dist/collection/components/ssh-certificate-viewer/-components/public_key.js.map +1 -0
  83. package/dist/collection/components/ssh-certificate-viewer/-components/signature_key.js +26 -0
  84. package/dist/collection/components/ssh-certificate-viewer/-components/signature_key.js.map +1 -0
  85. package/dist/collection/components/ssh-certificate-viewer/ssh-certificate-viewer.js +193 -0
  86. package/dist/collection/components/ssh-certificate-viewer/ssh-certificate-viewer.js.map +1 -0
  87. package/dist/collection/constants/oids.js +2 -0
  88. package/dist/collection/constants/oids.js.map +1 -1
  89. package/dist/collection/crypto/attribute.js +2 -0
  90. package/dist/collection/crypto/attribute.js.map +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/pkcs10_certificate_request.js +0 -7
  94. package/dist/collection/crypto/pkcs10_certificate_request.js.map +1 -1
  95. package/dist/collection/crypto/ssh_certificate.js +68 -0
  96. package/dist/collection/crypto/ssh_certificate.js.map +1 -0
  97. package/dist/collection/locales/en.json +5 -1
  98. package/dist/esm/extension-oK2qpCU6.js +107 -0
  99. package/dist/esm/extension-oK2qpCU6.js.map +1 -0
  100. package/dist/esm/index.js +2 -2
  101. package/dist/esm/loader.js +1 -1
  102. package/dist/esm/{miscellaneous-bVeJt-6m.js → miscellaneous-DrmTXljc.js} +4 -3
  103. package/dist/{esm-es5/miscellaneous-bVeJt-6m.js.map → esm/miscellaneous-DrmTXljc.js.map} +1 -1
  104. package/dist/esm/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -0
  105. package/dist/esm/{peculiar-attribute-certificate-viewer_4.entry.js → peculiar-attribute-certificate-viewer_5.entry.js} +215 -14
  106. package/dist/esm/peculiar-attribute-certificate-viewer_5.entry.js.map +1 -0
  107. package/dist/esm/peculiar-certificate-decoder.entry.js +14 -9
  108. package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
  109. package/dist/esm/peculiar-certificate-viewer.entry.js +4 -3
  110. package/dist/esm/peculiar-certificate-viewer.entry.js.map +1 -1
  111. package/dist/esm/peculiar-certificates-viewer.entry.js +3 -2
  112. package/dist/esm/peculiar-certificates-viewer.entry.js.map +1 -1
  113. package/dist/esm/peculiar.js +1 -1
  114. package/dist/esm/{pkcs10_certificate_request-CK8FH47X.js → pkcs10_certificate_request-Bdt_qA_g.js} +4 -8
  115. package/dist/esm/pkcs10_certificate_request-Bdt_qA_g.js.map +1 -0
  116. package/dist/esm/{certification_request-PeMaLTUD.js → ssh_certificate-Ct-r021h.js} +1682 -115
  117. package/dist/esm/ssh_certificate-Ct-r021h.js.map +1 -0
  118. package/dist/esm/{x509_certificate-CEEWtU_T.js → x509_certificate-5DEbrOA7.js} +4 -3
  119. package/dist/{esm-es5/x509_certificate-CEEWtU_T.js.map → esm/x509_certificate-5DEbrOA7.js.map} +1 -1
  120. package/dist/esm/{x509_crl-BcZd9KVn.js → x509_crl-CPgNUkh7.js} +5 -4
  121. package/dist/{esm-es5/x509_crl-BcZd9KVn.js.map → esm/x509_crl-CPgNUkh7.js.map} +1 -1
  122. package/dist/esm-es5/extension-oK2qpCU6.js +12 -0
  123. package/dist/esm-es5/extension-oK2qpCU6.js.map +1 -0
  124. package/dist/esm-es5/index.js +1 -1
  125. package/dist/esm-es5/loader.js +2 -2
  126. package/dist/esm-es5/{miscellaneous-bVeJt-6m.js → miscellaneous-DrmTXljc.js} +2 -2
  127. package/dist/{esm/miscellaneous-bVeJt-6m.js.map → esm-es5/miscellaneous-DrmTXljc.js.map} +1 -1
  128. package/dist/esm-es5/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -0
  129. package/dist/esm-es5/{peculiar-attribute-certificate-viewer_4.entry.js → peculiar-attribute-certificate-viewer_5.entry.js} +39 -4
  130. package/dist/esm-es5/peculiar-attribute-certificate-viewer_5.entry.js.map +1 -0
  131. package/dist/esm-es5/peculiar-certificate-decoder.entry.js +1 -1
  132. package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -1
  133. package/dist/esm-es5/peculiar-certificate-viewer.entry.js +1 -1
  134. package/dist/esm-es5/peculiar-certificate-viewer.entry.js.map +1 -1
  135. package/dist/esm-es5/peculiar-certificates-viewer.entry.js +1 -1
  136. package/dist/esm-es5/peculiar-certificates-viewer.entry.js.map +1 -1
  137. package/dist/esm-es5/peculiar.js +1 -1
  138. package/dist/esm-es5/pkcs10_certificate_request-Bdt_qA_g.js +19 -0
  139. package/dist/esm-es5/pkcs10_certificate_request-Bdt_qA_g.js.map +1 -0
  140. package/dist/esm-es5/{certification_request-PeMaLTUD.js → ssh_certificate-Ct-r021h.js} +7 -14
  141. package/dist/esm-es5/ssh_certificate-Ct-r021h.js.map +1 -0
  142. package/dist/esm-es5/{x509_certificate-CEEWtU_T.js → x509_certificate-5DEbrOA7.js} +4 -4
  143. package/dist/{esm/x509_certificate-CEEWtU_T.js.map → esm-es5/x509_certificate-5DEbrOA7.js.map} +1 -1
  144. package/dist/esm-es5/{x509_crl-BcZd9KVn.js → x509_crl-CPgNUkh7.js} +2 -2
  145. package/dist/{esm/x509_crl-BcZd9KVn.js.map → esm-es5/x509_crl-CPgNUkh7.js.map} +1 -1
  146. package/dist/peculiar/index.esm.js +1 -1
  147. package/dist/peculiar/locales/en.json +5 -1
  148. package/dist/peculiar/{p-5479a530.entry.js → p-0b895a8e.entry.js} +2 -2
  149. package/dist/peculiar/{p-84f69023.system.entry.js → p-11434880.system.entry.js} +2 -2
  150. package/dist/peculiar/{p-C9sY8yng.system.js → p-2GQYAR0v.system.js} +3 -3
  151. package/dist/peculiar/{p-C9sY8yng.system.js.map → p-2GQYAR0v.system.js.map} +1 -1
  152. package/dist/peculiar/p-364fd32b.system.entry.js +5 -0
  153. package/dist/peculiar/{p-14fcbc5c.system.entry.js.map → p-364fd32b.system.entry.js.map} +1 -1
  154. package/dist/peculiar/p-5df0f22b.system.entry.js +146 -0
  155. package/dist/peculiar/p-5df0f22b.system.entry.js.map +1 -0
  156. package/dist/peculiar/p-62b723f6.entry.js +145 -0
  157. package/dist/peculiar/p-62b723f6.entry.js.map +1 -0
  158. package/dist/peculiar/p-83a53b4f.entry.js +5 -0
  159. package/dist/peculiar/{p-0de4837d.entry.js.map → p-83a53b4f.entry.js.map} +1 -1
  160. package/dist/peculiar/p-B2G7qjfV.js +369 -0
  161. package/dist/peculiar/{p-CGRNSrHk.js.map → p-B2G7qjfV.js.map} +1 -1
  162. package/dist/peculiar/{p-BypepohK.system.js.map → p-BCsPspKr.system.js.map} +1 -1
  163. package/dist/peculiar/p-BGASC3UX.system.js +1 -1
  164. package/dist/peculiar/p-BGIWeG8l.js +12 -0
  165. package/dist/peculiar/p-BGIWeG8l.js.map +1 -0
  166. package/dist/peculiar/{p-DRvp86xt.system.js → p-BQiABBi1.system.js} +5 -5
  167. package/dist/peculiar/{p-DRvp86xt.system.js.map → p-BQiABBi1.system.js.map} +1 -1
  168. package/dist/peculiar/{p-CezfC5i1.system.js → p-BeVuAzsd.system.js} +42 -42
  169. package/dist/peculiar/{p-CezfC5i1.system.js.map → p-BeVuAzsd.system.js.map} +1 -1
  170. package/dist/peculiar/{p-CZwhKPgb.system.js → p-C31rbtuG.system.js} +2 -2
  171. package/dist/peculiar/p-C31rbtuG.system.js.map +1 -0
  172. package/dist/peculiar/p-Ce-IF7_R.system.js.map +1 -0
  173. package/dist/peculiar/p-ClkgAXnd.system.js +135 -0
  174. package/dist/peculiar/p-ClkgAXnd.system.js.map +1 -0
  175. package/dist/peculiar/p-Ct-r021h.js +135 -0
  176. package/dist/peculiar/p-Ct-r021h.js.map +1 -0
  177. package/dist/peculiar/{p-BaebEpW0.system.js.map → p-CxtUQdcj.system.js.map} +1 -1
  178. package/dist/peculiar/{p-DrmgUhyv.js → p-D9qq15zG.js} +4 -4
  179. package/dist/peculiar/{p-DrmgUhyv.js.map → p-D9qq15zG.js.map} +1 -1
  180. package/dist/peculiar/{p-CjWRKsN-.js → p-DOpiv0-8.js} +3 -3
  181. package/dist/peculiar/{p-CjWRKsN-.js.map → p-DOpiv0-8.js.map} +1 -1
  182. package/dist/peculiar/p-IOtHTzYC.system.js +12 -0
  183. package/dist/peculiar/p-IOtHTzYC.system.js.map +1 -0
  184. package/dist/peculiar/p-LmKU8Smy.system.js.map +1 -0
  185. package/dist/peculiar/p-RWPI76Dh.js +19 -0
  186. package/dist/peculiar/p-RWPI76Dh.js.map +1 -0
  187. package/dist/peculiar/p-da9eb1e7.entry.js +5 -0
  188. package/dist/peculiar/p-da9eb1e7.entry.js.map +1 -0
  189. package/dist/peculiar/p-fd98bb82.system.entry.js +5 -0
  190. package/dist/peculiar/p-fd98bb82.system.entry.js.map +1 -0
  191. package/dist/peculiar/{p-J1t5v5N3.system.js → p-zQwWLfga.system.js} +4 -4
  192. package/dist/peculiar/p-zQwWLfga.system.js.map +1 -0
  193. package/dist/peculiar/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.esm.js.map +1 -0
  194. package/dist/peculiar/peculiar-certificate-decoder.entry.esm.js.map +1 -1
  195. package/dist/peculiar/peculiar-certificate-viewer.entry.esm.js.map +1 -1
  196. package/dist/peculiar/peculiar-certificates-viewer.entry.esm.js.map +1 -1
  197. package/dist/peculiar/peculiar.esm.js +1 -1
  198. package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +4 -4
  199. package/dist/types/components/certificate-details-parts/attributes/extension_request_attribute.d.ts +15 -0
  200. package/dist/types/components/certificate-details-parts/attributes/private_key_possession_statement_attribute.d.ts +15 -0
  201. package/dist/types/components/ssh-certificate-viewer/-components/basic_information.d.ts +21 -0
  202. package/dist/types/components/ssh-certificate-viewer/-components/public_key.d.ts +14 -0
  203. package/dist/types/components/ssh-certificate-viewer/-components/signature_key.d.ts +14 -0
  204. package/dist/types/components/ssh-certificate-viewer/ssh-certificate-viewer.d.ts +43 -0
  205. package/dist/types/components.d.ts +43 -0
  206. package/dist/types/constants/oids.d.ts +2 -0
  207. package/dist/types/crypto/attribute.d.ts +2 -0
  208. package/dist/types/crypto/index.d.ts +1 -0
  209. package/dist/types/crypto/pkcs10_certificate_request.d.ts +0 -2
  210. package/dist/types/crypto/ssh_certificate.d.ts +28 -0
  211. package/dist/types/utils/l10n.d.ts +4 -0
  212. package/hydrate/index.js +1908 -33
  213. package/hydrate/index.mjs +1908 -33
  214. package/package.json +4 -2
  215. package/dist/cjs/certification_request-CxHe71zR.js.map +0 -1
  216. package/dist/cjs/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.cjs.js.map +0 -1
  217. package/dist/cjs/peculiar-attribute-certificate-viewer_4.cjs.entry.js.map +0 -1
  218. package/dist/cjs/pkcs10_certificate_request-CHMDxe2Z.js +0 -150
  219. package/dist/cjs/pkcs10_certificate_request-CHMDxe2Z.js.map +0 -1
  220. package/dist/esm/certification_request-PeMaLTUD.js.map +0 -1
  221. package/dist/esm/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.js.map +0 -1
  222. package/dist/esm/peculiar-attribute-certificate-viewer_4.entry.js.map +0 -1
  223. package/dist/esm/pkcs10_certificate_request-CK8FH47X.js.map +0 -1
  224. package/dist/esm-es5/certification_request-PeMaLTUD.js.map +0 -1
  225. package/dist/esm-es5/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.js.map +0 -1
  226. package/dist/esm-es5/peculiar-attribute-certificate-viewer_4.entry.js.map +0 -1
  227. package/dist/esm-es5/pkcs10_certificate_request-CK8FH47X.js +0 -19
  228. package/dist/esm-es5/pkcs10_certificate_request-CK8FH47X.js.map +0 -1
  229. package/dist/peculiar/p-00d6f11f.system.entry.js +0 -111
  230. package/dist/peculiar/p-00d6f11f.system.entry.js.map +0 -1
  231. package/dist/peculiar/p-0de4837d.entry.js +0 -5
  232. package/dist/peculiar/p-14fcbc5c.system.entry.js +0 -5
  233. package/dist/peculiar/p-315805ce.entry.js +0 -5
  234. package/dist/peculiar/p-315805ce.entry.js.map +0 -1
  235. package/dist/peculiar/p-591a9019.system.entry.js +0 -5
  236. package/dist/peculiar/p-591a9019.system.entry.js.map +0 -1
  237. package/dist/peculiar/p-BipKYW6e.system.js +0 -142
  238. package/dist/peculiar/p-BipKYW6e.system.js.map +0 -1
  239. package/dist/peculiar/p-BloT0Xj9.system.js.map +0 -1
  240. package/dist/peculiar/p-CGRNSrHk.js +0 -369
  241. package/dist/peculiar/p-CZwhKPgb.system.js.map +0 -1
  242. package/dist/peculiar/p-D1eNnGDF.js +0 -19
  243. package/dist/peculiar/p-D1eNnGDF.js.map +0 -1
  244. package/dist/peculiar/p-ITVWR0oT.system.js.map +0 -1
  245. package/dist/peculiar/p-J1t5v5N3.system.js.map +0 -1
  246. package/dist/peculiar/p-PeMaLTUD.js +0 -142
  247. package/dist/peculiar/p-PeMaLTUD.js.map +0 -1
  248. package/dist/peculiar/p-c8b3766a.entry.js +0 -110
  249. package/dist/peculiar/p-c8b3766a.entry.js.map +0 -1
  250. package/dist/peculiar/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.esm.js.map +0 -1
  251. /package/dist/peculiar/{p-5479a530.entry.js.map → p-0b895a8e.entry.js.map} +0 -0
  252. /package/dist/peculiar/{p-84f69023.system.entry.js.map → p-11434880.system.entry.js.map} +0 -0
@@ -6765,6 +6765,10 @@ const crlEntryExtensions = "CRL Entry Extensions";
6765
6765
  const previewCertificate = "Preview certificate";
6766
6766
  const viewDetails = "View details";
6767
6767
  const downloadOptions = "Download options";
6768
+ const keyId = "Key ID";
6769
+ const principals = "Principals";
6770
+ const criticalOptions = "Critical Options";
6771
+ const signingCA = "Signing CA";
6768
6772
  var en = {
6769
6773
  basicInformation: basicInformation,
6770
6774
  subjectName: subjectName,
@@ -6812,7 +6816,11 @@ var en = {
6812
6816
  crlEntryExtensions: crlEntryExtensions,
6813
6817
  previewCertificate: previewCertificate,
6814
6818
  viewDetails: viewDetails,
6815
- downloadOptions: downloadOptions
6819
+ downloadOptions: downloadOptions,
6820
+ keyId: keyId,
6821
+ principals: principals,
6822
+ criticalOptions: criticalOptions,
6823
+ signingCA: signingCA
6816
6824
  };
6817
6825
 
6818
6826
  /**
@@ -8087,6 +8095,7 @@ const OIDs = {
8087
8095
  '1.3.6.1.4.1.16334.509.2.3': 'Ngc Class3',
8088
8096
  '1.3.6.1.4.1.17326.10.8.12.1.2': 'Camerfirma EV policy',
8089
8097
  '1.3.6.1.4.1.17326.10.14.2.1.2': 'Camerfirma EV policy',
8098
+ '1.3.6.1.4.1.22112.2.1': 'Private Key Possession Statement',
8090
8099
  '1.3.6.1.4.1.22234.2.5.2.3.1': 'Cert Plus EV policy',
8091
8100
  '1.3.6.1.4.1.23223.1.1.1': 'Start Com EV policy',
8092
8101
  '1.3.6.1.4.1.23629.1.4.2.1.1': 'Safenet Usage Limit',
@@ -8480,6 +8489,7 @@ const OIDs = {
8480
8489
  '1.3.132.0.37': 'Sect409r1',
8481
8490
  '1.3.132.0.38': 'Sect571k1',
8482
8491
  '1.3.132.0.39': 'Sect571r1',
8492
+ '1.3.132.1.12': 'ECDH',
8483
8493
  '1.3.133.16.840.9.84': 'x984',
8484
8494
  '1.3.133.16.840.9.84.0': 'x984 Module',
8485
8495
  '1.3.133.16.840.9.84.0.1': 'x984 Biometrics',
@@ -9230,13 +9240,13 @@ const OIDs = {
9230
9240
  * This source code is licensed under the MIT license found in the
9231
9241
  * LICENSE file in the root directory of this source tree.
9232
9242
  */
9233
- var __classPrivateFieldSet$1 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9243
+ var __classPrivateFieldSet$2 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9234
9244
  if (kind === "m") throw new TypeError("Private method is not writable");
9235
9245
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9236
9246
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
9237
9247
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
9238
9248
  };
9239
- var __classPrivateFieldGet$1 = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9249
+ var __classPrivateFieldGet$2 = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9240
9250
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9241
9251
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
9242
9252
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -9246,15 +9256,15 @@ class Name {
9246
9256
  constructor(data) {
9247
9257
  _Name_asn.set(this, new Name$1());
9248
9258
  if (buildExports.BufferSourceConverter.isBufferSource(data)) {
9249
- __classPrivateFieldSet$1(this, _Name_asn, AsnParser.parse(data, Name$1), "f");
9259
+ __classPrivateFieldSet$2(this, _Name_asn, AsnParser.parse(data, Name$1), "f");
9250
9260
  }
9251
9261
  else {
9252
- __classPrivateFieldSet$1(this, _Name_asn, data, "f");
9262
+ __classPrivateFieldSet$2(this, _Name_asn, data, "f");
9253
9263
  }
9254
9264
  }
9255
9265
  toJSON() {
9256
9266
  const res = [];
9257
- __classPrivateFieldGet$1(this, _Name_asn, "f").forEach((o) => (o.forEach((a) => {
9267
+ __classPrivateFieldGet$2(this, _Name_asn, "f").forEach((o) => (o.forEach((a) => {
9258
9268
  res.push({
9259
9269
  type: a.type,
9260
9270
  name: OIDs[a.type],
@@ -9969,27 +9979,6 @@ class SignedCertificateTimestamp extends Structure {
9969
9979
  }
9970
9980
  }
9971
9981
 
9972
- const id_certificateTransparency = "1.3.6.1.4.1.11129.2.4.2";
9973
- class CertificateTransparency extends OctetString {
9974
- constructor() {
9975
- super(...arguments);
9976
- this.items = [];
9977
- }
9978
- fromASN(asn) {
9979
- super.fromASN(asn);
9980
- const stream = new ByteStream(this.buffer);
9981
- const len = stream.readNumber(2);
9982
- this.items = [];
9983
- while (stream.position < len) {
9984
- this.items.push(new SignedCertificateTimestamp(stream));
9985
- }
9986
- return this;
9987
- }
9988
- toJSON() {
9989
- return this.items.map((o) => o.toJSON());
9990
- }
9991
- }
9992
-
9993
9982
  var Version$1;
9994
9983
  (function (Version) {
9995
9984
  Version[Version["v1"] = 1] = "v1";
@@ -10239,8 +10228,6 @@ __decorate$1([
10239
10228
  AsnProp({ type: OtherLogotypeInfo, context: 3, repeated: "sequence", optional: true })
10240
10229
  ], LogotypeExtn.prototype, "otherLogos", void 0);
10241
10230
 
10242
- const id_pe_logotype = "1.3.6.1.5.5.7.1.12";
10243
-
10244
10231
  var JWTClaimNames_1, JWTClaimPermittedValuesList_1, TNAuthorizationList_1;
10245
10232
  const id_pkix = "1.3.6.1.5.5.7";
10246
10233
  const id_pe = `${id_pkix}.1`;
@@ -10818,13 +10805,13 @@ __decorate([
10818
10805
  * This source code is licensed under the MIT license found in the
10819
10806
  * LICENSE file in the root directory of this source tree.
10820
10807
  */
10821
- var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
10808
+ var __classPrivateFieldSet$1 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
10822
10809
  if (kind === "m") throw new TypeError("Private method is not writable");
10823
10810
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10824
10811
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10825
10812
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
10826
10813
  };
10827
- var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
10814
+ var __classPrivateFieldGet$1 = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
10828
10815
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10829
10816
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10830
10817
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -10837,99 +10824,24 @@ class AsnData {
10837
10824
  _AsnData_raw.set(this, void 0);
10838
10825
  if (args.length === 1) {
10839
10826
  // asn
10840
- __classPrivateFieldSet(this, _AsnData_asn, args[0], "f");
10841
- __classPrivateFieldSet(this, _AsnData_raw, AsnConvert.serialize(__classPrivateFieldGet(this, _AsnData_asn, "f")), "f");
10827
+ __classPrivateFieldSet$1(this, _AsnData_asn, args[0], "f");
10828
+ __classPrivateFieldSet$1(this, _AsnData_raw, AsnConvert.serialize(__classPrivateFieldGet$1(this, _AsnData_asn, "f")), "f");
10842
10829
  }
10843
10830
  else {
10844
10831
  // raw, type
10845
- __classPrivateFieldSet(this, _AsnData_asn, AsnConvert.parse(args[0], args[1]), "f");
10846
- __classPrivateFieldSet(this, _AsnData_raw, buildExports.BufferSourceConverter.toArrayBuffer(args[0]), "f");
10832
+ __classPrivateFieldSet$1(this, _AsnData_asn, AsnConvert.parse(args[0], args[1]), "f");
10833
+ __classPrivateFieldSet$1(this, _AsnData_raw, buildExports.BufferSourceConverter.toArrayBuffer(args[0]), "f");
10847
10834
  }
10848
10835
  }
10849
10836
  get asn() {
10850
- return __classPrivateFieldGet(this, _AsnData_asn, "f");
10837
+ return __classPrivateFieldGet$1(this, _AsnData_asn, "f");
10851
10838
  }
10852
10839
  get raw() {
10853
- return __classPrivateFieldGet(this, _AsnData_raw, "f");
10840
+ return __classPrivateFieldGet$1(this, _AsnData_raw, "f");
10854
10841
  }
10855
10842
  }
10856
10843
  _AsnData_asn = new WeakMap(), _AsnData_raw = new WeakMap();
10857
10844
 
10858
- /**
10859
- * @license
10860
- * Copyright (c) Peculiar Ventures, LLC.
10861
- *
10862
- * This source code is licensed under the MIT license found in the
10863
- * LICENSE file in the root directory of this source tree.
10864
- */
10865
- const extensionParsers = {
10866
- [id_pe_authorityInfoAccess]: AuthorityInfoAccessSyntax,
10867
- [id_ce_authorityKeyIdentifier]: AuthorityKeyIdentifier,
10868
- [id_ce_basicConstraints]: BasicConstraints,
10869
- [id_ce_certificateIssuer]: CertificateIssuer,
10870
- [id_ce_certificatePolicies]: CertificatePolicies,
10871
- [id_ce_cRLDistributionPoints]: CRLDistributionPoints,
10872
- '2.5.29.46': CRLDistributionPoints,
10873
- [id_ce_issuingDistributionPoint]: IssuingDistributionPoint,
10874
- [id_ce_cRLReasons]: CRLReason,
10875
- [id_ce_extKeyUsage]: ExtendedKeyUsage,
10876
- [id_ce_inhibitAnyPolicy]: InhibitAnyPolicy,
10877
- [id_ce_invalidityDate]: InvalidityDate,
10878
- [id_ce_issuerAltName]: IssueAlternativeName,
10879
- [id_ce_keyUsage]: KeyUsage,
10880
- [id_ce_nameConstraints]: NameConstraints,
10881
- [id_ce_policyConstraints]: PolicyConstraints,
10882
- [id_ce_policyMappings]: PolicyMappings,
10883
- [id_ce_subjectAltName]: SubjectAlternativeName,
10884
- [id_ce_subjectDirectoryAttributes]: SubjectDirectoryAttributes,
10885
- [id_ce_subjectKeyIdentifier]: SubjectKeyIdentifier,
10886
- [id_pe_qcStatements]: QCStatements,
10887
- [id_certificateTemplate]: CertificateTemplate,
10888
- [id_enrollCertType]: EnrollCertTypeChoice,
10889
- [id_netscapeComment]: NetscapeComment,
10890
- [id_netscapeCertType]: NetscapeCertType,
10891
- [id_caVersion]: CaVersion,
10892
- [id_certificateTransparency]: CertificateTransparency,
10893
- [id_lei]: LeiChoice,
10894
- [id_role]: LeiRole,
10895
- [id_adbe_timestamp]: Timestamp,
10896
- [id_adbe_archiveRevInfo]: ArchiveRevInfo,
10897
- [id_ce_privateKeyUsagePeriod]: PrivateKeyUsagePeriod,
10898
- [id_entrust_entrustVersInfo]: EntrustVersionInfo,
10899
- '2.16.724.1.2.2.4.1': BiometricSyntax,
10900
- [id_pe_biometricInfo]: BiometricSyntax,
10901
- [id_pe_logotype]: LogotypeExtn,
10902
- [id_pe_TNAuthList]: TNAuthorizationList,
10903
- [id_pe_subjectInfoAccess]: SubjectInfoAccessSyntax,
10904
- [id_ce_cRLNumber]: CRLNumber,
10905
- [id_ce_deltaCRLIndicator]: BaseCRLNumber,
10906
- [id_ce_keyDescription]: NonStandardKeyDescription,
10907
- [id_cabforganizationIdentifier]: CabforganizationIdentifier,
10908
- };
10909
- class Extension extends AsnData {
10910
- getAsnExtnValue() {
10911
- return this.asn.extnValue.buffer;
10912
- }
10913
- constructor(raw) {
10914
- super(raw, Extension$1);
10915
- const asnExtnValue = this.getAsnExtnValue();
10916
- try {
10917
- const target = extensionParsers[this.asn.extnID];
10918
- if (target) {
10919
- this.value = AsnParser.parse(asnExtnValue, target);
10920
- }
10921
- else {
10922
- console.warn(`Didn't detect parser for "${this.asn.extnID}" extension.`);
10923
- this.value = buildExports.Convert.ToHex(asnExtnValue);
10924
- }
10925
- }
10926
- catch (error) {
10927
- console.error(`Error parse "${this.asn.extnID}" extension:`, error.message);
10928
- this.value = buildExports.Convert.ToHex(asnExtnValue);
10929
- }
10930
- }
10931
- }
10932
-
10933
10845
  /**
10934
10846
  * @license
10935
10847
  * Copyright (c) Peculiar Ventures, LLC.
@@ -12724,6 +12636,22 @@ SMIMECapabilities = SMIMECapabilities_1 = __decorate$1([
12724
12636
  AsnType({ type: AsnTypeTypes.Sequence, itemType: SMIMECapability })
12725
12637
  ], SMIMECapabilities);
12726
12638
 
12639
+ const id_at_statementOfPossession = "1.3.6.1.4.1.22112.2.1";
12640
+ let PrivateKeyPossessionStatement = class PrivateKeyPossessionStatement {
12641
+ constructor(params = {}) {
12642
+ Object.assign(this, params);
12643
+ }
12644
+ };
12645
+ __decorate$1([
12646
+ AsnProp({ type: IssuerAndSerialNumber })
12647
+ ], PrivateKeyPossessionStatement.prototype, "signer", void 0);
12648
+ __decorate$1([
12649
+ AsnProp({ type: Certificate, optional: true })
12650
+ ], PrivateKeyPossessionStatement.prototype, "cert", void 0);
12651
+ PrivateKeyPossessionStatement = __decorate$1([
12652
+ AsnType({ type: AsnTypeTypes.Sequence })
12653
+ ], PrivateKeyPossessionStatement);
12654
+
12727
12655
  var Attributes_1;
12728
12656
  let Attributes = Attributes_1 = class Attributes extends AsnArray {
12729
12657
  constructor(items) {
@@ -12775,7 +12703,1646 @@ __decorate$1([
12775
12703
  AsnProp({ type: AsnPropTypes.BitString })
12776
12704
  ], CertificationRequest.prototype, "signature", void 0);
12777
12705
 
12778
- export { SignedData as $, AsnData as A, id_pkcs9_at_unstructuredName as B, Certificate as C, Download as D, Extension as E, id_pkcs9_at_challengePassword as F, id_ValuationRanking as G, id_InsuranceValue as H, InsuranceValue as I, id_WebGDPR as J, id_ActivityDescription as K, id_TypeRelationship as L, id_DomainNameTechnicalOperator as M, Name as N, id_DomainNameOwner as O, PemConverter as P, id_DomainNameLegalRepresentative as Q, RSAPublicKey as R, id_DomainNameBeneficiary as S, TypeRelationship as T, UnstructuredName as U, ValuationRanking as V, WebGDPR as W, CertificationRequest as X, l10n as Y, dateShort as Z, OIDs as _, dateDiff as a, EncapsulatedContent as a0, OctetString as a1, CertificateSet as a2, CertificateChoices as a3, ContentInfo as a4, Name$1 as a5, CRLReason as a6, InvalidityDate as a7, CertificateIssuer as a8, OtherName as a9, NameConstraints as aA, CertificateTemplate as aB, EnrollCertTypeChoice as aC, CaVersion as aD, QCStatements as aE, NetscapeComment as aF, NetscapeCertType as aG, LeiRole as aH, LeiChoice as aI, Timestamp as aJ, ArchiveRevInfo as aK, SubjectDirectoryAttributes as aL, PrivateKeyUsagePeriod as aM, EntrustVersionInfo as aN, BiometricSyntax as aO, LogotypeExtn as aP, TNAuthorizationList as aQ, PolicyConstraints as aR, PolicyMappings as aS, CRLNumber as aT, IssuingDistributionPoint as aU, NonStandardKeyDescription as aV, CabforganizationIdentifier as aW, DisplayText as aa, UserNotice as ab, EDIPartyName as ac, __decorate$1 as ad, AsnProp as ae, AsnPropTypes as af, AsnType as ag, AsnTypeTypes as ah, AsnArray as ai, id_qcs_pkixQCSyntax_v2 as aj, SemanticsInformation as ak, AsnIntegerArrayBufferConverter as al, AttestationApplicationId as am, RootOfTrust as an, IntegerSet as ao, KeyUsage as ap, BasicConstraints as aq, ExtendedKeyUsage as ar, SubjectKeyIdentifier as as, AuthorityKeyIdentifier as at, CRLDistributionPoints as au, AuthorityInfoAccessSyntax as av, SubjectInfoAccessSyntax as aw, SubjectAlternativeName as ax, CertificatePolicies as ay, CertificateTransparency as az, buildExports as b, certificateRawToBuffer as c, downloadFromBuffer as d, AsnConvert as e, ECParameters as f, id_rsaEncryption as g, id_composite_key as h, id_ecPublicKey as i, CompositePublicKey as j, id_alg_composite as k, CompositeSignatureValue as l, CompositeParams as m, getCertificateThumbprint as n, AttributeCertificate as o, CertificateList as p, Attribute$1 as q, AsnParser as r, ExtensionRequest as s, ChallengePassword as t, ActivityDescription as u, DomainNameTechnicalOperator as v, DomainNameOwner as w, DomainNameLegalRepresentative as x, DomainNameBeneficiary as y, id_pkcs9_at_extensionRequest as z };
12779
- //# sourceMappingURL=certification_request-PeMaLTUD.js.map
12706
+ let globalCrypto = globalThis.crypto;
12707
+ function getCrypto() {
12708
+ return globalCrypto;
12709
+ }
12710
+
12711
+ class SshError extends Error {
12712
+ code;
12713
+ constructor(message, code) {
12714
+ super(message);
12715
+ this.code = code;
12716
+ this.name = this.constructor.name;
12717
+ if (Error.captureStackTrace) {
12718
+ Error.captureStackTrace(this, this.constructor);
12719
+ }
12720
+ }
12721
+ }
12722
+ class UnsupportedAlgorithmError extends SshError {
12723
+ constructor(algorithm, supportedAlgorithms) {
12724
+ const supported = supportedAlgorithms ? ` Supported: ${supportedAlgorithms.join(', ')}` : '';
12725
+ super(`Unsupported algorithm: ${algorithm}.${supported}`, 'UNSUPPORTED_ALGORITHM');
12726
+ }
12727
+ }
12728
+ class InvalidFormatError extends SshError {
12729
+ constructor(format, expectedFormat) {
12730
+ const expected = expectedFormat ? ` Expected: ${expectedFormat}` : '';
12731
+ super(`Invalid format: ${format}.${expected}`, 'INVALID_FORMAT');
12732
+ }
12733
+ }
12734
+ class UnsupportedKeyTypeError extends SshError {
12735
+ constructor(keyType, supportedTypes) {
12736
+ const supported = supportedTypes ? ` Supported: ${supportedTypes.join(', ')}` : '';
12737
+ super(`Unsupported key type: ${keyType}.${supported}`, 'UNSUPPORTED_KEY_TYPE');
12738
+ }
12739
+ }
12740
+ class InvalidPrivateKeyFormatError extends SshError {
12741
+ constructor(details) {
12742
+ const message = details
12743
+ ? `Invalid SSH private key format: ${details}`
12744
+ : 'Invalid SSH private key format';
12745
+ super(message, 'INVALID_PRIVATE_KEY_FORMAT');
12746
+ }
12747
+ }
12748
+ class EncryptedKeyNotSupportedError extends SshError {
12749
+ constructor(cipher) {
12750
+ const message = cipher
12751
+ ? `Encrypted SSH private keys are not supported (cipher: ${cipher})`
12752
+ : 'Encrypted SSH private keys are not supported';
12753
+ super(message, 'ENCRYPTED_KEY_NOT_SUPPORTED');
12754
+ }
12755
+ }
12756
+ class InvalidKeyDataError extends SshError {
12757
+ constructor(details) {
12758
+ const message = details ? `Invalid key data: ${details}` : 'Invalid key data';
12759
+ super(message, 'INVALID_KEY_DATA');
12760
+ }
12761
+ }
12762
+ class UnexpectedEOFError extends SshError {
12763
+ constructor(expected, actual) {
12764
+ const details = expected !== undefined && actual !== undefined
12765
+ ? ` Expected ${expected} bytes, got ${actual}`
12766
+ : '';
12767
+ super(`Unexpected end of data${details}`, 'UNEXPECTED_EOF');
12768
+ }
12769
+ }
12770
+
12771
+ const encoder = new TextEncoder();
12772
+ const decoder = new TextDecoder();
12773
+
12774
+ class SshReader {
12775
+ buffer;
12776
+ offset;
12777
+ constructor(data) {
12778
+ this.buffer = data;
12779
+ this.offset = 0;
12780
+ }
12781
+ readUint8() {
12782
+ if (this.offset >= this.buffer.length) {
12783
+ throw new UnexpectedEOFError(1, 0);
12784
+ }
12785
+ return this.buffer[this.offset++];
12786
+ }
12787
+ readUint32() {
12788
+ const value = (this.readUint8() << 24) |
12789
+ (this.readUint8() << 16) |
12790
+ (this.readUint8() << 8) |
12791
+ this.readUint8();
12792
+ return value >>> 0;
12793
+ }
12794
+ readUint64() {
12795
+ const high = this.readUint32();
12796
+ const low = this.readUint32();
12797
+ return (BigInt(high) << 32n) | BigInt(low);
12798
+ }
12799
+ readBytes(length) {
12800
+ if (length < 0) {
12801
+ throw new InvalidFormatError(`Invalid length: ${length}`);
12802
+ }
12803
+ if (this.offset + length > this.buffer.length) {
12804
+ throw new UnexpectedEOFError(length, this.buffer.length - this.offset);
12805
+ }
12806
+ const result = this.buffer.subarray(this.offset, this.offset + length);
12807
+ this.offset += length;
12808
+ return result;
12809
+ }
12810
+ readString() {
12811
+ const length = this.readUint32();
12812
+ const bytes = this.readBytes(length);
12813
+ return decoder.decode(bytes);
12814
+ }
12815
+ peekString(length) {
12816
+ if (this.offset + length > this.buffer.length) {
12817
+ throw new UnexpectedEOFError(length, this.buffer.length - this.offset);
12818
+ }
12819
+ const bytes = this.buffer.subarray(this.offset, this.offset + length);
12820
+ return decoder.decode(bytes);
12821
+ }
12822
+ readMpInt(sshEncoding = false) {
12823
+ const length = this.readUint32();
12824
+ const bytes = this.readBytes(length);
12825
+ if (sshEncoding && bytes.length > 1 && bytes[0] === 0x00) {
12826
+ return bytes.subarray(1);
12827
+ }
12828
+ return bytes;
12829
+ }
12830
+ readMpIntSsh() {
12831
+ return this.readMpInt(true);
12832
+ }
12833
+ remaining() {
12834
+ return this.buffer.length - this.offset;
12835
+ }
12836
+ getOffset() {
12837
+ return this.offset;
12838
+ }
12839
+ seek(offset) {
12840
+ if (offset < 0 || offset > this.buffer.length) {
12841
+ throw new InvalidFormatError(`Invalid offset: ${offset}. Buffer length: ${this.buffer.length}`);
12842
+ }
12843
+ this.offset = offset;
12844
+ }
12845
+ }
12846
+
12847
+ class SshWriter {
12848
+ buffer;
12849
+ offset;
12850
+ constructor(initialSize = 1024) {
12851
+ this.buffer = new Uint8Array(initialSize);
12852
+ this.offset = 0;
12853
+ }
12854
+ ensureCapacity(additional) {
12855
+ const required = this.offset + additional;
12856
+ if (required > this.buffer.length) {
12857
+ const newSize = Math.max(required, this.buffer.length * 2);
12858
+ const newBuffer = new Uint8Array(newSize);
12859
+ newBuffer.set(this.buffer.subarray(0, this.offset));
12860
+ this.buffer = newBuffer;
12861
+ }
12862
+ }
12863
+ reserve(minCapacity) {
12864
+ if (minCapacity > this.buffer.length) {
12865
+ const newBuffer = new Uint8Array(minCapacity);
12866
+ newBuffer.set(this.buffer.subarray(0, this.offset));
12867
+ this.buffer = newBuffer;
12868
+ }
12869
+ }
12870
+ writeUint8(value) {
12871
+ this.ensureCapacity(1);
12872
+ this.buffer[this.offset++] = value & 0xff;
12873
+ }
12874
+ writeUint32(value) {
12875
+ this.ensureCapacity(4);
12876
+ this.buffer[this.offset++] = (value >>> 24) & 0xff;
12877
+ this.buffer[this.offset++] = (value >>> 16) & 0xff;
12878
+ this.buffer[this.offset++] = (value >>> 8) & 0xff;
12879
+ this.buffer[this.offset++] = value & 0xff;
12880
+ }
12881
+ writeUint64(value) {
12882
+ this.ensureCapacity(8);
12883
+ const high = Number(value >> 32n);
12884
+ const low = Number(value & 0xffffffffn);
12885
+ this.writeUint32(high);
12886
+ this.writeUint32(low);
12887
+ }
12888
+ writeBytes(data) {
12889
+ this.ensureCapacity(data.length);
12890
+ this.buffer.set(data, this.offset);
12891
+ this.offset += data.length;
12892
+ }
12893
+ writeString(value) {
12894
+ const bytes = encoder.encode(value);
12895
+ this.writeUint32(bytes.length);
12896
+ this.writeBytes(bytes);
12897
+ }
12898
+ writeMpInt(value, sshEncoding = false) {
12899
+ if (sshEncoding && value.length > 0 && (value[0] & 0x80) !== 0) {
12900
+ const paddedBytes = new Uint8Array(value.length + 1);
12901
+ paddedBytes[0] = 0x00;
12902
+ paddedBytes.set(value, 1);
12903
+ this.writeUint32(paddedBytes.length);
12904
+ this.writeBytes(paddedBytes);
12905
+ }
12906
+ else {
12907
+ this.writeUint32(value.length);
12908
+ this.writeBytes(value);
12909
+ }
12910
+ }
12911
+ writeMpIntSsh(value) {
12912
+ this.writeMpInt(value, true);
12913
+ }
12914
+ toUint8Array() {
12915
+ return this.buffer.subarray(0, this.offset);
12916
+ }
12917
+ getOffset() {
12918
+ return this.offset;
12919
+ }
12920
+ seek(offset) {
12921
+ if (offset < 0 || offset > this.buffer.length) {
12922
+ throw new InvalidFormatError('Invalid offset');
12923
+ }
12924
+ this.offset = offset;
12925
+ }
12926
+ }
12927
+
12928
+ class RsaBinding {
12929
+ hash = 'SHA-256';
12930
+ constructor(hash = 'SHA-256') {
12931
+ this.hash = hash;
12932
+ }
12933
+ async importPublicSsh(params) {
12934
+ const { blob, crypto } = params;
12935
+ const reader = new SshReader(blob);
12936
+ reader.readString();
12937
+ const e = reader.readMpInt(true);
12938
+ const n = reader.readMpInt(true);
12939
+ const jwk = {
12940
+ kty: 'RSA',
12941
+ n: buildExports.Convert.ToBase64Url(n),
12942
+ e: buildExports.Convert.ToBase64Url(e),
12943
+ };
12944
+ return crypto.subtle.importKey('jwk', jwk, {
12945
+ name: 'RSASSA-PKCS1-v1_5',
12946
+ hash: this.hash,
12947
+ }, true, ['verify']);
12948
+ }
12949
+ async exportPublicSsh(params) {
12950
+ const { publicKey, crypto } = params;
12951
+ const jwk = await crypto.subtle.exportKey('jwk', publicKey);
12952
+ if (!jwk.n || !jwk.e) {
12953
+ throw new InvalidKeyDataError('RSA JWK missing required parameters (n, e)');
12954
+ }
12955
+ const n = buildExports.BufferSourceConverter.toUint8Array(buildExports.Convert.FromBase64Url(jwk.n));
12956
+ const e = buildExports.BufferSourceConverter.toUint8Array(buildExports.Convert.FromBase64Url(jwk.e));
12957
+ const writer = new SshWriter();
12958
+ writer.writeString('ssh-rsa');
12959
+ writer.writeMpInt(e, true);
12960
+ writer.writeMpInt(n, true);
12961
+ return writer.toUint8Array();
12962
+ }
12963
+ async importPublicSpki(params) {
12964
+ const { spki, crypto } = params;
12965
+ return crypto.subtle.importKey('spki', spki, {
12966
+ name: 'RSASSA-PKCS1-v1_5',
12967
+ hash: this.hash,
12968
+ }, true, ['verify']);
12969
+ }
12970
+ async exportPublicSpki(params) {
12971
+ const { publicKey, crypto } = params;
12972
+ const spki = await crypto.subtle.exportKey('spki', publicKey);
12973
+ return buildExports.BufferSourceConverter.toUint8Array(spki);
12974
+ }
12975
+ async importPrivatePkcs8(params) {
12976
+ const { pkcs8, crypto } = params;
12977
+ return crypto.subtle.importKey('pkcs8', pkcs8, {
12978
+ name: 'RSASSA-PKCS1-v1_5',
12979
+ hash: this.hash,
12980
+ }, true, ['sign']);
12981
+ }
12982
+ async exportPrivatePkcs8(params) {
12983
+ const { privateKey, crypto } = params;
12984
+ const pkcs8 = await crypto.subtle.exportKey('pkcs8', privateKey);
12985
+ return buildExports.BufferSourceConverter.toUint8Array(pkcs8);
12986
+ }
12987
+ async importPrivateSsh(params) {
12988
+ const { sshKey, crypto } = params;
12989
+ const base64Data = sshKey
12990
+ .replace(/-----BEGIN OPENSSH PRIVATE KEY-----/, '')
12991
+ .replace(/-----END OPENSSH PRIVATE KEY-----/, '')
12992
+ .replace(/\s/g, '');
12993
+ const binaryData = buildExports.Convert.FromBase64(base64Data);
12994
+ const reader = new SshReader(buildExports.BufferSourceConverter.toUint8Array(binaryData));
12995
+ const magic = reader.readBytes(15);
12996
+ if (buildExports.Convert.ToHex(magic) !== '6f70656e7373682d6b65792d763100') {
12997
+ throw new InvalidPrivateKeyFormatError('invalid magic string');
12998
+ }
12999
+ const _cipherName = reader.readString();
13000
+ reader.readString();
13001
+ reader.readString();
13002
+ if (_cipherName !== 'none') {
13003
+ throw new EncryptedKeyNotSupportedError(_cipherName);
13004
+ }
13005
+ const numKeys = reader.readUint32();
13006
+ if (numKeys !== 1) {
13007
+ throw new InvalidPrivateKeyFormatError('multiple keys not supported');
13008
+ }
13009
+ const publicKeyLength = reader.readUint32();
13010
+ reader.readBytes(publicKeyLength);
13011
+ const privateKeyLength = reader.readUint32();
13012
+ const privateKeyData = reader.readBytes(privateKeyLength);
13013
+ const privateReader = new SshReader(privateKeyData);
13014
+ const checkint1 = privateReader.readUint32();
13015
+ const checkint2 = privateReader.readUint32();
13016
+ if (checkint1 !== checkint2) {
13017
+ throw new InvalidPrivateKeyFormatError('invalid checkints');
13018
+ }
13019
+ privateReader.readString();
13020
+ const n = privateReader.readMpInt(true);
13021
+ const e = privateReader.readMpInt(true);
13022
+ const d = privateReader.readMpInt(true);
13023
+ const iqmp = privateReader.readMpInt(true);
13024
+ const p = privateReader.readMpInt(true);
13025
+ const q = privateReader.readMpInt(true);
13026
+ privateReader.readString();
13027
+ const dBig = BigInt('0x' + buildExports.Convert.ToHex(d));
13028
+ const pBig = BigInt('0x' + buildExports.Convert.ToHex(p));
13029
+ const qBig = BigInt('0x' + buildExports.Convert.ToHex(q));
13030
+ const dpBig = dBig % (pBig - 1n);
13031
+ const dqBig = dBig % (qBig - 1n);
13032
+ const dpBytes = buildExports.Convert.FromHex(dpBig.toString(16).padStart(p.length * 2, '0'));
13033
+ const dqBytes = buildExports.Convert.FromHex(dqBig.toString(16).padStart(q.length * 2, '0'));
13034
+ const jwk = {
13035
+ kty: 'RSA',
13036
+ n: buildExports.Convert.ToBase64Url(n),
13037
+ e: buildExports.Convert.ToBase64Url(e),
13038
+ d: buildExports.Convert.ToBase64Url(d),
13039
+ p: buildExports.Convert.ToBase64Url(p),
13040
+ q: buildExports.Convert.ToBase64Url(q),
13041
+ dp: buildExports.Convert.ToBase64Url(dpBytes),
13042
+ dq: buildExports.Convert.ToBase64Url(dqBytes),
13043
+ qi: buildExports.Convert.ToBase64Url(iqmp),
13044
+ };
13045
+ return crypto.subtle.importKey('jwk', jwk, {
13046
+ name: 'RSASSA-PKCS1-v1_5',
13047
+ hash: this.hash,
13048
+ }, true, ['sign']);
13049
+ }
13050
+ async exportPrivateSsh(params) {
13051
+ const { privateKey, crypto, jwk: providedJwk } = params;
13052
+ const jwk = providedJwk || (await crypto.subtle.exportKey('jwk', privateKey));
13053
+ if (!jwk.n || !jwk.e || !jwk.d || !jwk.p || !jwk.q) {
13054
+ throw new InvalidKeyDataError('RSA JWK missing required parameters');
13055
+ }
13056
+ const n = new Uint8Array(buildExports.Convert.FromBase64Url(jwk.n));
13057
+ const e = new Uint8Array(buildExports.Convert.FromBase64Url(jwk.e));
13058
+ const d = new Uint8Array(buildExports.Convert.FromBase64Url(jwk.d));
13059
+ const p = new Uint8Array(buildExports.Convert.FromBase64Url(jwk.p));
13060
+ const q = new Uint8Array(buildExports.Convert.FromBase64Url(jwk.q));
13061
+ const qi = jwk.qi ? new Uint8Array(buildExports.Convert.FromBase64Url(jwk.qi)) : new Uint8Array();
13062
+ const writer = new SshWriter();
13063
+ writer.writeString('ssh-rsa');
13064
+ writer.writeMpInt(n, true);
13065
+ writer.writeMpInt(e, true);
13066
+ writer.writeMpInt(d, true);
13067
+ writer.writeMpInt(qi, true);
13068
+ writer.writeMpInt(p, true);
13069
+ writer.writeMpInt(q, true);
13070
+ return writer.toUint8Array();
13071
+ }
13072
+ async sign(params) {
13073
+ const { privateKey, data, crypto, hash } = params;
13074
+ if (hash && hash !== this.hash) {
13075
+ throw new InvalidKeyDataError(`Hash ${hash} not supported for this RSA algorithm`);
13076
+ }
13077
+ if (!privateKey.extractable) {
13078
+ throw new InvalidKeyDataError('Private key is not extractable');
13079
+ }
13080
+ const pkcs8 = await this.exportPrivatePkcs8({ privateKey, crypto });
13081
+ const keyToUse = await this.importPrivatePkcs8({ pkcs8: new Uint8Array(pkcs8), crypto });
13082
+ const signature = await crypto.subtle.sign('RSASSA-PKCS1-v1_5', keyToUse, data);
13083
+ return buildExports.BufferSourceConverter.toUint8Array(signature);
13084
+ }
13085
+ async verify(params) {
13086
+ const { publicKey, signature, data, crypto, hash } = params;
13087
+ if (hash && hash !== this.hash) {
13088
+ return false;
13089
+ }
13090
+ if (!publicKey.extractable) {
13091
+ throw new InvalidKeyDataError('Public key is not extractable');
13092
+ }
13093
+ const spki = await this.exportPublicSpki({ publicKey, crypto });
13094
+ const keyToUse = await this.importPublicSpki({ spki: new Uint8Array(spki), crypto });
13095
+ return crypto.subtle.verify('RSASSA-PKCS1-v1_5', keyToUse, signature, data);
13096
+ }
13097
+ encodeSignature(params) {
13098
+ const { signature, algo } = params;
13099
+ const writer = new SshWriter();
13100
+ writer.writeString(algo);
13101
+ writer.writeUint32(signature.byteLength);
13102
+ writer.writeBytes(signature);
13103
+ return writer.toUint8Array();
13104
+ }
13105
+ decodeSignature(params) {
13106
+ const { signature } = params;
13107
+ const reader = new SshReader(signature);
13108
+ const algo = reader.readString();
13109
+ const sigLength = reader.readUint32();
13110
+ const sig = reader.readBytes(sigLength);
13111
+ return { signature: sig, algo };
13112
+ }
13113
+ supportsCryptoKey(cryptoKey) {
13114
+ return cryptoKey.algorithm.name === 'RSASSA-PKCS1-v1_5';
13115
+ }
13116
+ parsePublicKey(reader) {
13117
+ const publicKeyExponent = reader.readBytes(reader.readUint32());
13118
+ const publicKeyModulus = reader.readBytes(reader.readUint32());
13119
+ const writer = new SshWriter();
13120
+ writer.writeString('ssh-rsa');
13121
+ writer.writeMpInt(publicKeyExponent);
13122
+ writer.writeMpInt(publicKeyModulus);
13123
+ return {
13124
+ type: 'ssh-rsa',
13125
+ keyData: writer.toUint8Array(),
13126
+ };
13127
+ }
13128
+ writePublicKey(writer, publicKey) {
13129
+ const publicKeyReader = new SshReader(publicKey.keyData);
13130
+ publicKeyReader.readString();
13131
+ const e = publicKeyReader.readMpInt();
13132
+ const n = publicKeyReader.readMpInt();
13133
+ writer.writeUint32(e.length);
13134
+ writer.writeBytes(e);
13135
+ writer.writeUint32(n.length);
13136
+ writer.writeBytes(n);
13137
+ }
13138
+ getCertificateType() {
13139
+ return 'ssh-rsa-cert-v01@openssh.com';
13140
+ }
13141
+ getSignatureAlgo() {
13142
+ return this.hash === 'SHA-256' ? 'rsa-sha2-256' : 'rsa-sha2-512';
13143
+ }
13144
+ }
13145
+
13146
+ class EcdsaBinding {
13147
+ curveName;
13148
+ sshType;
13149
+ namedCurve;
13150
+ constructor(curveName, sshType, namedCurve) {
13151
+ this.curveName = curveName;
13152
+ this.sshType = sshType;
13153
+ this.namedCurve = namedCurve;
13154
+ }
13155
+ getHashAlgorithm() {
13156
+ switch (this.namedCurve) {
13157
+ case 'P-256':
13158
+ return 'SHA-256';
13159
+ case 'P-384':
13160
+ return 'SHA-384';
13161
+ case 'P-521':
13162
+ return 'SHA-512';
13163
+ default:
13164
+ return 'SHA-256';
13165
+ }
13166
+ }
13167
+ getExpectedLength() {
13168
+ switch (this.namedCurve) {
13169
+ case 'P-256':
13170
+ return 32;
13171
+ case 'P-384':
13172
+ return 48;
13173
+ case 'P-521':
13174
+ return 66;
13175
+ default:
13176
+ return 32;
13177
+ }
13178
+ }
13179
+ getSignatureCoordLength() {
13180
+ return this.getExpectedLength();
13181
+ }
13182
+ async importPublicSsh(params) {
13183
+ const { blob, crypto } = params;
13184
+ const reader = new SshReader(blob);
13185
+ reader.readString();
13186
+ const curve = reader.readString();
13187
+ if (curve !== this.curveName) {
13188
+ throw new InvalidKeyDataError(`ECDSA curve name ${curve}, expected ${this.curveName}`);
13189
+ }
13190
+ const q = reader.readMpInt();
13191
+ const coordLength = Math.floor((q.length - 1) / 2);
13192
+ const jwk = {
13193
+ kty: 'EC',
13194
+ crv: this.namedCurve,
13195
+ x: buildExports.Convert.ToBase64Url(q.slice(1, 1 + coordLength)),
13196
+ y: buildExports.Convert.ToBase64Url(q.slice(1 + coordLength)),
13197
+ };
13198
+ return crypto.subtle.importKey('jwk', jwk, {
13199
+ name: 'ECDSA',
13200
+ namedCurve: this.namedCurve,
13201
+ }, true, ['verify']);
13202
+ }
13203
+ async exportPublicSsh(params) {
13204
+ const { publicKey, crypto } = params;
13205
+ const jwk = await crypto.subtle.exportKey('jwk', publicKey);
13206
+ if (!jwk.x || !jwk.y) {
13207
+ throw new InvalidKeyDataError('ECDSA JWK missing x or y parameters');
13208
+ }
13209
+ const x = new Uint8Array(buildExports.Convert.FromBase64Url(jwk.x));
13210
+ const y = new Uint8Array(buildExports.Convert.FromBase64Url(jwk.y));
13211
+ const q = new Uint8Array(1 + x.length + y.length);
13212
+ q[0] = 0x04;
13213
+ q.set(x, 1);
13214
+ q.set(y, 1 + x.length);
13215
+ const writer = new SshWriter();
13216
+ writer.writeString(this.sshType);
13217
+ writer.writeString(this.curveName);
13218
+ writer.writeMpInt(q);
13219
+ return writer.toUint8Array();
13220
+ }
13221
+ async importPublicSpki(params) {
13222
+ const { spki, crypto } = params;
13223
+ return crypto.subtle.importKey('spki', spki, {
13224
+ name: 'ECDSA',
13225
+ namedCurve: this.namedCurve,
13226
+ }, true, ['verify']);
13227
+ }
13228
+ async exportPublicSpki(params) {
13229
+ const { publicKey, crypto } = params;
13230
+ const spki = await crypto.subtle.exportKey('spki', publicKey);
13231
+ return buildExports.BufferSourceConverter.toUint8Array(spki);
13232
+ }
13233
+ async importPrivatePkcs8(params) {
13234
+ const { pkcs8, crypto } = params;
13235
+ return crypto.subtle.importKey('pkcs8', pkcs8, {
13236
+ name: 'ECDSA',
13237
+ namedCurve: this.namedCurve,
13238
+ }, true, ['sign']);
13239
+ }
13240
+ async exportPrivatePkcs8(params) {
13241
+ const { privateKey, crypto } = params;
13242
+ const pkcs8 = await crypto.subtle.exportKey('pkcs8', privateKey);
13243
+ return buildExports.BufferSourceConverter.toUint8Array(pkcs8);
13244
+ }
13245
+ async exportPrivateSsh(params) {
13246
+ const { privateKey, crypto, jwk: providedJwk } = params;
13247
+ const jwk = providedJwk || (await crypto.subtle.exportKey('jwk', privateKey));
13248
+ if (!jwk.d || !jwk.x || !jwk.y) {
13249
+ throw new InvalidKeyDataError('ECDSA private key JWK missing required parameters');
13250
+ }
13251
+ const x = new Uint8Array(buildExports.Convert.FromBase64Url(jwk.x));
13252
+ const y = new Uint8Array(buildExports.Convert.FromBase64Url(jwk.y));
13253
+ const d = new Uint8Array(buildExports.Convert.FromBase64Url(jwk.d));
13254
+ const publicPoint = new Uint8Array(1 + x.length + y.length);
13255
+ publicPoint[0] = 0x04;
13256
+ publicPoint.set(x, 1);
13257
+ publicPoint.set(y, 1 + x.length);
13258
+ const writer = new SshWriter();
13259
+ writer.writeString(this.sshType);
13260
+ writer.writeString(this.curveName);
13261
+ writer.writeMpInt(publicPoint);
13262
+ writer.writeMpInt(d);
13263
+ return writer.toUint8Array();
13264
+ }
13265
+ async importPrivateSsh(params) {
13266
+ const { sshKey, crypto } = params;
13267
+ const base64Data = sshKey
13268
+ .replace(/-----BEGIN OPENSSH PRIVATE KEY-----/, '')
13269
+ .replace(/-----END OPENSSH PRIVATE KEY-----/, '')
13270
+ .replace(/\s/g, '');
13271
+ const binaryData = buildExports.Convert.FromBase64(base64Data);
13272
+ const reader = new SshReader(buildExports.BufferSourceConverter.toUint8Array(binaryData));
13273
+ const magic = reader.readBytes(15);
13274
+ if (buildExports.Convert.ToHex(magic) !== '6f70656e7373682d6b65792d763100') {
13275
+ throw new InvalidPrivateKeyFormatError('invalid magic string');
13276
+ }
13277
+ const _cipherName = reader.readString();
13278
+ reader.readString();
13279
+ reader.readString();
13280
+ if (_cipherName !== 'none') {
13281
+ throw new EncryptedKeyNotSupportedError(_cipherName);
13282
+ }
13283
+ const numKeys = reader.readUint32();
13284
+ if (numKeys !== 1) {
13285
+ throw new InvalidPrivateKeyFormatError('multiple keys not supported');
13286
+ }
13287
+ const publicKeyLength = reader.readUint32();
13288
+ reader.readBytes(publicKeyLength);
13289
+ const privateKeyLength = reader.readUint32();
13290
+ const privateKeyData = reader.readBytes(privateKeyLength);
13291
+ const privateReader = new SshReader(privateKeyData);
13292
+ const checkint1 = privateReader.readUint32();
13293
+ const checkint2 = privateReader.readUint32();
13294
+ if (checkint1 !== checkint2) {
13295
+ throw new InvalidPrivateKeyFormatError('invalid checkints');
13296
+ }
13297
+ privateReader.readString();
13298
+ privateReader.readString();
13299
+ const publicKeyPoint = privateReader.readMpInt();
13300
+ const privateKeyValue = privateReader.readMpInt();
13301
+ privateReader.readString();
13302
+ if (publicKeyPoint[0] !== 0x04) {
13303
+ throw new InvalidKeyDataError('invalid ECDSA public key point format');
13304
+ }
13305
+ const coordLength = Math.floor((publicKeyPoint.length - 1) / 2);
13306
+ const x = publicKeyPoint.slice(1, 1 + coordLength);
13307
+ const y = publicKeyPoint.slice(1 + coordLength);
13308
+ const jwk = {
13309
+ kty: 'EC',
13310
+ crv: this.namedCurve,
13311
+ x: buildExports.Convert.ToBase64Url(x),
13312
+ y: buildExports.Convert.ToBase64Url(y),
13313
+ d: buildExports.Convert.ToBase64Url(privateKeyValue),
13314
+ };
13315
+ return crypto.subtle.importKey('jwk', jwk, {
13316
+ name: 'ECDSA',
13317
+ namedCurve: this.namedCurve,
13318
+ }, true, ['sign']);
13319
+ }
13320
+ async sign(params) {
13321
+ const { privateKey, data, crypto, hash } = params;
13322
+ const expectedHash = this.getHashAlgorithm();
13323
+ if (hash && hash !== expectedHash) {
13324
+ throw new InvalidKeyDataError(`ECDSA ${this.namedCurve} requires ${expectedHash}, got ${hash}`);
13325
+ }
13326
+ const signature = await crypto.subtle.sign({
13327
+ name: 'ECDSA',
13328
+ hash: expectedHash,
13329
+ }, privateKey, data);
13330
+ return buildExports.BufferSourceConverter.toUint8Array(signature);
13331
+ }
13332
+ async verify(params) {
13333
+ const { publicKey, signature, data, crypto, hash } = params;
13334
+ const expectedHash = this.getHashAlgorithm();
13335
+ if (hash && hash !== expectedHash) {
13336
+ throw new InvalidKeyDataError(`ECDSA ${this.namedCurve} requires ${expectedHash}, got ${hash}`);
13337
+ }
13338
+ return crypto.subtle.verify({
13339
+ name: 'ECDSA',
13340
+ hash: expectedHash,
13341
+ }, publicKey, signature, data);
13342
+ }
13343
+ encodeSignature(params) {
13344
+ const { signature, algo } = params;
13345
+ if (algo.startsWith('ecdsa-sha2-')) {
13346
+ const coordLength = this.getSignatureCoordLength();
13347
+ const r = signature.subarray(0, coordLength);
13348
+ const s = signature.subarray(coordLength);
13349
+ const writer = new SshWriter();
13350
+ writer.writeString(algo);
13351
+ const sigWriter = new SshWriter();
13352
+ sigWriter.writeMpInt(r, true);
13353
+ sigWriter.writeMpInt(s, true);
13354
+ const sigData = sigWriter.toUint8Array();
13355
+ writer.writeUint32(sigData.length);
13356
+ writer.writeBytes(sigData);
13357
+ return writer.toUint8Array();
13358
+ }
13359
+ const writer = new SshWriter();
13360
+ writer.writeString(algo);
13361
+ writer.writeUint32(signature.byteLength);
13362
+ writer.writeBytes(signature);
13363
+ return writer.toUint8Array();
13364
+ }
13365
+ decodeSignature(params) {
13366
+ const { signature } = params;
13367
+ const reader = new SshReader(signature);
13368
+ const algo = reader.readString();
13369
+ const sigLength = reader.readUint32();
13370
+ const sig = reader.readBytes(sigLength);
13371
+ if (algo.startsWith('ecdsa-sha2-')) {
13372
+ const sigReader = new SshReader(sig);
13373
+ let r = sigReader.readMpInt();
13374
+ let s = sigReader.readMpInt();
13375
+ if (r[0] === 0x00 && r.length > 1 && (r[1] & 0x80) === 0) {
13376
+ r = r.slice(1);
13377
+ }
13378
+ if (s[0] === 0x00 && s.length > 1 && (s[1] & 0x80) === 0) {
13379
+ s = s.slice(1);
13380
+ }
13381
+ const expectedLength = this.getExpectedLength();
13382
+ const rPadded = new Uint8Array(expectedLength);
13383
+ const sPadded = new Uint8Array(expectedLength);
13384
+ if (r.length <= expectedLength) {
13385
+ rPadded.set(r, expectedLength - r.length);
13386
+ }
13387
+ else {
13388
+ rPadded.set(r.slice(r.length - expectedLength), 0);
13389
+ }
13390
+ if (s.length <= expectedLength) {
13391
+ sPadded.set(s, expectedLength - s.length);
13392
+ }
13393
+ else {
13394
+ sPadded.set(s.slice(s.length - expectedLength), 0);
13395
+ }
13396
+ const rawSignature = new Uint8Array([...rPadded, ...sPadded]);
13397
+ return { signature: rawSignature, algo };
13398
+ }
13399
+ return { signature: sig, algo };
13400
+ }
13401
+ supportsCryptoKey(cryptoKey) {
13402
+ return (cryptoKey.algorithm.name === 'ECDSA' &&
13403
+ cryptoKey.algorithm.namedCurve === this.namedCurve);
13404
+ }
13405
+ parsePublicKey(reader) {
13406
+ const curveName = reader.readString();
13407
+ if (curveName !== this.curveName) {
13408
+ throw new InvalidKeyDataError(`ECDSA certificate curve name ${curveName}, expected ${this.curveName}`);
13409
+ }
13410
+ const publicKeyPoint = reader.readBytes(reader.readUint32());
13411
+ const writer = new SshWriter();
13412
+ writer.writeString(this.sshType);
13413
+ writer.writeString(curveName);
13414
+ writer.writeMpInt(publicKeyPoint);
13415
+ return {
13416
+ type: this.sshType,
13417
+ keyData: writer.toUint8Array(),
13418
+ };
13419
+ }
13420
+ writePublicKey(writer, publicKey) {
13421
+ const publicKeyReader = new SshReader(publicKey.keyData);
13422
+ publicKeyReader.readString();
13423
+ const curveName = publicKeyReader.readString();
13424
+ const publicPoint = publicKeyReader.readMpInt();
13425
+ writer.writeString(curveName);
13426
+ writer.writeUint32(publicPoint.length);
13427
+ writer.writeBytes(publicPoint);
13428
+ }
13429
+ getCertificateType() {
13430
+ return `${this.sshType}-cert-v01@openssh.com`;
13431
+ }
13432
+ getSignatureAlgo() {
13433
+ return this.sshType;
13434
+ }
13435
+ }
13436
+ const EcdsaP256Binding = new EcdsaBinding('nistp256', 'ecdsa-sha2-nistp256', 'P-256');
13437
+ const EcdsaP384Binding = new EcdsaBinding('nistp384', 'ecdsa-sha2-nistp384', 'P-384');
13438
+ const EcdsaP521Binding = new EcdsaBinding('nistp521', 'ecdsa-sha2-nistp521', 'P-521');
13439
+
13440
+ class Ed25519Binding {
13441
+ async importPublicSsh(params) {
13442
+ const { blob, crypto } = params;
13443
+ const reader = new SshReader(blob);
13444
+ reader.readString();
13445
+ const keyLength = reader.readUint32();
13446
+ if (keyLength !== 32) {
13447
+ throw new InvalidKeyDataError(`Ed25519 key length ${keyLength}, expected 32`);
13448
+ }
13449
+ const publicKeyBytes = reader.readBytes(keyLength);
13450
+ return crypto.subtle.importKey('raw', publicKeyBytes, 'Ed25519', true, [
13451
+ 'verify',
13452
+ ]);
13453
+ }
13454
+ async exportPublicSsh(params) {
13455
+ const { publicKey, crypto } = params;
13456
+ const jwk = await crypto.subtle.exportKey('jwk', publicKey);
13457
+ if (!jwk.x) {
13458
+ throw new InvalidKeyDataError('Ed25519 JWK missing x parameter');
13459
+ }
13460
+ const keyBytes = new Uint8Array(buildExports.Convert.FromBase64Url(jwk.x));
13461
+ const writer = new SshWriter();
13462
+ writer.writeString('ssh-ed25519');
13463
+ writer.writeUint32(keyBytes.length);
13464
+ writer.writeBytes(keyBytes);
13465
+ return writer.toUint8Array();
13466
+ }
13467
+ async importPublicSpki(params) {
13468
+ const { spki, crypto } = params;
13469
+ return crypto.subtle.importKey('spki', spki, 'Ed25519', true, ['verify']);
13470
+ }
13471
+ async exportPublicSpki(params) {
13472
+ const { publicKey, crypto } = params;
13473
+ const spki = await crypto.subtle.exportKey('spki', publicKey);
13474
+ return buildExports.BufferSourceConverter.toUint8Array(spki);
13475
+ }
13476
+ async importPrivatePkcs8(params) {
13477
+ const { pkcs8, crypto } = params;
13478
+ return crypto.subtle.importKey('pkcs8', pkcs8, 'Ed25519', true, ['sign']);
13479
+ }
13480
+ async exportPrivatePkcs8(params) {
13481
+ const { privateKey, crypto } = params;
13482
+ const pkcs8 = await crypto.subtle.exportKey('pkcs8', privateKey);
13483
+ return buildExports.BufferSourceConverter.toUint8Array(pkcs8);
13484
+ }
13485
+ async exportPrivateSsh(params) {
13486
+ const { privateKey, crypto, jwk: providedJwk } = params;
13487
+ const jwk = providedJwk || (await crypto.subtle.exportKey('jwk', privateKey));
13488
+ if (!jwk.d || !jwk.x) {
13489
+ throw new InvalidKeyDataError('Ed25519 private key JWK missing required parameters');
13490
+ }
13491
+ const privateBytes = new Uint8Array(buildExports.Convert.FromBase64Url(jwk.d));
13492
+ const publicBytes = new Uint8Array(buildExports.Convert.FromBase64Url(jwk.x));
13493
+ const writer = new SshWriter();
13494
+ writer.writeString('ssh-ed25519');
13495
+ writer.writeUint32(publicBytes.length);
13496
+ writer.writeBytes(publicBytes);
13497
+ const privKeyPart = new Uint8Array(64);
13498
+ privKeyPart.set(privateBytes, 0);
13499
+ privKeyPart.set(publicBytes, 32);
13500
+ writer.writeUint32(privKeyPart.length);
13501
+ writer.writeBytes(privKeyPart);
13502
+ return writer.toUint8Array();
13503
+ }
13504
+ async importPrivateSsh(params) {
13505
+ const { sshKey, crypto } = params;
13506
+ const base64Data = sshKey
13507
+ .replace(/-----BEGIN OPENSSH PRIVATE KEY-----/, '')
13508
+ .replace(/-----END OPENSSH PRIVATE KEY-----/, '')
13509
+ .replace(/\s/g, '');
13510
+ const binaryData = buildExports.Convert.FromBase64(base64Data);
13511
+ const reader = new SshReader(buildExports.BufferSourceConverter.toUint8Array(binaryData));
13512
+ const magic = reader.readBytes(15);
13513
+ if (buildExports.Convert.ToHex(magic) !== '6f70656e7373682d6b65792d763100') {
13514
+ throw new InvalidPrivateKeyFormatError('invalid magic string');
13515
+ }
13516
+ const _cipherName = reader.readString();
13517
+ reader.readString();
13518
+ reader.readString();
13519
+ if (_cipherName !== 'none') {
13520
+ throw new EncryptedKeyNotSupportedError(_cipherName);
13521
+ }
13522
+ const numKeys = reader.readUint32();
13523
+ if (numKeys !== 1) {
13524
+ throw new InvalidPrivateKeyFormatError('multiple keys not supported');
13525
+ }
13526
+ const publicKeyLength = reader.readUint32();
13527
+ reader.readBytes(publicKeyLength);
13528
+ const privateKeyLength = reader.readUint32();
13529
+ const privateKeyData = reader.readBytes(privateKeyLength);
13530
+ const privateReader = new SshReader(privateKeyData);
13531
+ const checkint1 = privateReader.readUint32();
13532
+ const checkint2 = privateReader.readUint32();
13533
+ if (checkint1 !== checkint2) {
13534
+ throw new InvalidPrivateKeyFormatError('invalid checkints');
13535
+ }
13536
+ privateReader.readString();
13537
+ const pubKeyLength = privateReader.readUint32();
13538
+ const _publicKeyBytes = privateReader.readBytes(pubKeyLength);
13539
+ const privKeyLength = privateReader.readUint32();
13540
+ const privateKeyBytes = privateReader.readBytes(privKeyLength);
13541
+ privateReader.readString();
13542
+ const privateKey = privateKeyBytes.slice(0, 32);
13543
+ const jwk = {
13544
+ kty: 'OKP',
13545
+ crv: 'Ed25519',
13546
+ d: buildExports.Convert.ToBase64Url(privateKey),
13547
+ x: buildExports.Convert.ToBase64Url(_publicKeyBytes),
13548
+ };
13549
+ return crypto.subtle.importKey('jwk', jwk, 'Ed25519', true, ['sign']);
13550
+ }
13551
+ async sign(params) {
13552
+ const { privateKey, data, crypto } = params;
13553
+ const signature = await crypto.subtle.sign('Ed25519', privateKey, data);
13554
+ return buildExports.BufferSourceConverter.toUint8Array(signature);
13555
+ }
13556
+ async verify(params) {
13557
+ const { publicKey, signature, data, crypto } = params;
13558
+ return crypto.subtle.verify('Ed25519', publicKey, signature, data);
13559
+ }
13560
+ encodeSignature(params) {
13561
+ const { signature, algo } = params;
13562
+ const sigBytes = new Uint8Array(signature);
13563
+ const writer = new SshWriter();
13564
+ writer.writeString(algo);
13565
+ writer.writeUint32(sigBytes.length);
13566
+ writer.writeBytes(sigBytes);
13567
+ return writer.toUint8Array();
13568
+ }
13569
+ decodeSignature(params) {
13570
+ const { signature } = params;
13571
+ const reader = new SshReader(signature);
13572
+ const algo = reader.readString();
13573
+ const sigLength = reader.readUint32();
13574
+ const sigBytes = reader.readBytes(sigLength);
13575
+ return {
13576
+ signature: sigBytes,
13577
+ algo,
13578
+ };
13579
+ }
13580
+ supportsCryptoKey(cryptoKey) {
13581
+ return cryptoKey.algorithm.name === 'Ed25519';
13582
+ }
13583
+ parsePublicKey(reader) {
13584
+ const publicKeyData = reader.readBytes(reader.readUint32());
13585
+ const writer = new SshWriter();
13586
+ writer.writeString('ssh-ed25519');
13587
+ writer.writeUint32(publicKeyData.length);
13588
+ writer.writeBytes(publicKeyData);
13589
+ return {
13590
+ type: 'ssh-ed25519',
13591
+ keyData: writer.toUint8Array(),
13592
+ };
13593
+ }
13594
+ writePublicKey(writer, publicKey) {
13595
+ const publicKeyReader = new SshReader(publicKey.keyData);
13596
+ publicKeyReader.readString();
13597
+ const keyLength = publicKeyReader.readUint32();
13598
+ const rawKeyData = publicKeyReader.readBytes(keyLength);
13599
+ writer.writeUint32(rawKeyData.length);
13600
+ writer.writeBytes(rawKeyData);
13601
+ }
13602
+ getCertificateType() {
13603
+ return 'ssh-ed25519-cert-v01@openssh.com';
13604
+ }
13605
+ getSignatureAlgo() {
13606
+ return 'ssh-ed25519';
13607
+ }
13608
+ }
13609
+
13610
+ const registry = new Map();
13611
+ class AlgorithmRegistry {
13612
+ static get(name) {
13613
+ const binding = registry.get(name);
13614
+ if (!binding) {
13615
+ throw new UnsupportedKeyTypeError(name, Array.from(registry.keys()));
13616
+ }
13617
+ return binding;
13618
+ }
13619
+ static register(name, binding) {
13620
+ registry.set(name, binding);
13621
+ }
13622
+ static getSshTypeFromCryptoKey(cryptoKey) {
13623
+ for (const [sshType, binding] of registry.entries()) {
13624
+ if (binding.supportsCryptoKey(cryptoKey)) {
13625
+ return sshType;
13626
+ }
13627
+ }
13628
+ throw new UnsupportedKeyTypeError(cryptoKey.algorithm.name, Array.from(registry.keys()));
13629
+ }
13630
+ static certTypeToKeyType(certType) {
13631
+ const mapping = {
13632
+ 'ssh-rsa-cert-v01@openssh.com': 'ssh-rsa',
13633
+ 'ssh-ed25519-cert-v01@openssh.com': 'ssh-ed25519',
13634
+ 'ecdsa-sha2-nistp256-cert-v01@openssh.com': 'ecdsa-sha2-nistp256',
13635
+ 'ecdsa-sha2-nistp384-cert-v01@openssh.com': 'ecdsa-sha2-nistp384',
13636
+ 'ecdsa-sha2-nistp521-cert-v01@openssh.com': 'ecdsa-sha2-nistp521',
13637
+ };
13638
+ return mapping[certType];
13639
+ }
13640
+ static getSupportedCertTypes() {
13641
+ return Object.keys({
13642
+ 'ssh-rsa-cert-v01@openssh.com': 'ssh-rsa',
13643
+ 'ssh-ed25519-cert-v01@openssh.com': 'ssh-ed25519',
13644
+ 'ecdsa-sha2-nistp256-cert-v01@openssh.com': 'ecdsa-sha2-nistp256',
13645
+ 'ecdsa-sha2-nistp384-cert-v01@openssh.com': 'ecdsa-sha2-nistp384',
13646
+ 'ecdsa-sha2-nistp521-cert-v01@openssh.com': 'ecdsa-sha2-nistp521',
13647
+ });
13648
+ }
13649
+ }
13650
+ AlgorithmRegistry.register('ssh-ed25519', new Ed25519Binding());
13651
+ AlgorithmRegistry.register('ssh-rsa', new RsaBinding('SHA-256'));
13652
+ AlgorithmRegistry.register('rsa-sha2-256', new RsaBinding('SHA-256'));
13653
+ AlgorithmRegistry.register('rsa-sha2-512', new RsaBinding('SHA-512'));
13654
+ AlgorithmRegistry.register('ecdsa-sha2-nistp256', EcdsaP256Binding);
13655
+ AlgorithmRegistry.register('ecdsa-sha2-nistp384', EcdsaP384Binding);
13656
+ AlgorithmRegistry.register('ecdsa-sha2-nistp521', EcdsaP521Binding);
13657
+
13658
+ function parsePublicKey(input) {
13659
+ const parts = typeof input === 'string' ? input.trim().split(/\s+/) : null;
13660
+ if (!parts || parts.length < 2) {
13661
+ throw new InvalidFormatError('Invalid SSH public key format');
13662
+ }
13663
+ const type = parts[0];
13664
+ const blob = new Uint8Array(buildExports.Convert.FromBase64(parts[1]));
13665
+ const comment = parts.length > 2 ? parts.slice(2).join(' ') : undefined;
13666
+ const reader = new SshReader(blob);
13667
+ const blobType = reader.readString();
13668
+ if (blobType !== type) {
13669
+ throw new InvalidFormatError('Key type mismatch');
13670
+ }
13671
+ return {
13672
+ type,
13673
+ keyData: blob,
13674
+ comment,
13675
+ };
13676
+ }
13677
+ function serializePublicKey(blob) {
13678
+ const base64 = buildExports.Convert.ToBase64(blob.keyData);
13679
+ const parts = [blob.type, base64];
13680
+ if (blob.comment) {
13681
+ parts.push(blob.comment);
13682
+ }
13683
+ return parts.join(' ');
13684
+ }
13685
+
13686
+ function parse(input) {
13687
+ if (typeof input === 'string') {
13688
+ const parts = input.trim().split(/\s+/);
13689
+ if (parts.length < 2) {
13690
+ throw new InvalidFormatError('SSH certificate string', 'type base64 [comment]');
13691
+ }
13692
+ const type = parts[0];
13693
+ const blob = new Uint8Array(buildExports.Convert.FromBase64(parts[1]));
13694
+ const comment = parts.length > 2 ? parts.slice(2).join(' ') : undefined;
13695
+ const reader = new SshReader(blob);
13696
+ const blobType = reader.readString();
13697
+ if (blobType !== type) {
13698
+ throw new InvalidFormatError(`certificate blob type ${blobType}`, `expected ${type}`);
13699
+ }
13700
+ return {
13701
+ type,
13702
+ keyData: blob,
13703
+ comment,
13704
+ };
13705
+ }
13706
+ else {
13707
+ const reader = new SshReader(input);
13708
+ const type = reader.readString();
13709
+ const keyData = input.slice(reader.getOffset());
13710
+ return {
13711
+ type,
13712
+ keyData,
13713
+ };
13714
+ }
13715
+ }
13716
+ function parseCertificateData(keyData) {
13717
+ const reader = new SshReader(keyData);
13718
+ const certType = reader.readString();
13719
+ const nonce = reader.readBytes(reader.readUint32());
13720
+ const mappedKeyType = AlgorithmRegistry.certTypeToKeyType(certType);
13721
+ if (!mappedKeyType) {
13722
+ throw new UnsupportedAlgorithmError(certType, AlgorithmRegistry.getSupportedCertTypes());
13723
+ }
13724
+ const binding = AlgorithmRegistry.get(mappedKeyType);
13725
+ const publicKey = binding.parsePublicKey(reader);
13726
+ const keyType = mappedKeyType;
13727
+ const serial = reader.readUint64();
13728
+ const typeValue = reader.readUint32();
13729
+ const type = typeValue === 1 ? 'user' : 'host';
13730
+ const keyId = reader.readString();
13731
+ const principalsLength = reader.readUint32();
13732
+ const principalsData = reader.readBytes(principalsLength);
13733
+ const validPrincipals = [];
13734
+ if (principalsData.length > 0) {
13735
+ const principalsReader = new SshReader(principalsData);
13736
+ while (principalsReader.getOffset() < principalsData.length) {
13737
+ try {
13738
+ const principal = principalsReader.readString();
13739
+ validPrincipals.push(principal);
13740
+ }
13741
+ catch {
13742
+ break;
13743
+ }
13744
+ }
13745
+ }
13746
+ const validAfter = reader.readUint64();
13747
+ const validBefore = reader.readUint64();
13748
+ const criticalOptions = {};
13749
+ const criticalLength = reader.readUint32();
13750
+ const criticalData = reader.readBytes(criticalLength);
13751
+ if (criticalData.length > 0) {
13752
+ const optionsReader = new SshReader(criticalData);
13753
+ while (optionsReader.getOffset() < criticalData.length) {
13754
+ try {
13755
+ const name = optionsReader.readString();
13756
+ const valueData = optionsReader.readBytes(optionsReader.readUint32());
13757
+ const value = valueData.length === 0 ? '' : decoder.decode(valueData);
13758
+ criticalOptions[name] = value;
13759
+ }
13760
+ catch {
13761
+ break;
13762
+ }
13763
+ }
13764
+ }
13765
+ const extensions = {};
13766
+ const extensionsLength = reader.readUint32();
13767
+ const extensionsData = reader.readBytes(extensionsLength);
13768
+ if (extensionsData.length > 0) {
13769
+ const extReader = new SshReader(extensionsData);
13770
+ while (extReader.getOffset() < extensionsData.length) {
13771
+ try {
13772
+ const name = extReader.readString();
13773
+ const valueData = extReader.readBytes(extReader.readUint32());
13774
+ const value = valueData.length === 0 ? '' : decoder.decode(valueData);
13775
+ extensions[name] = value;
13776
+ }
13777
+ catch {
13778
+ break;
13779
+ }
13780
+ }
13781
+ }
13782
+ const reservedLength = reader.readUint32();
13783
+ const reserved = reader.readBytes(reservedLength);
13784
+ const signatureKeyLength = reader.readUint32();
13785
+ const signatureKeyData = reader.readBytes(signatureKeyLength);
13786
+ const signatureKeyReader = new SshReader(signatureKeyData);
13787
+ const signatureKeyType = signatureKeyReader.readString();
13788
+ const signatureKey = {
13789
+ type: signatureKeyType,
13790
+ keyData: signatureKeyData,
13791
+ };
13792
+ const signatureLength = reader.readUint32();
13793
+ const signature = reader.readBytes(signatureLength);
13794
+ return {
13795
+ nonce,
13796
+ keyType,
13797
+ publicKey,
13798
+ serial,
13799
+ type,
13800
+ keyId,
13801
+ validPrincipals,
13802
+ validAfter,
13803
+ validBefore,
13804
+ criticalOptions,
13805
+ extensions,
13806
+ reserved,
13807
+ signatureKey,
13808
+ signature,
13809
+ };
13810
+ }
13811
+ function serialize(cert) {
13812
+ const base64 = buildExports.Convert.ToBase64(cert.keyData);
13813
+ const parts = [cert.type, base64];
13814
+ if (cert.comment) {
13815
+ parts.push(cert.comment);
13816
+ }
13817
+ return parts.join(' ');
13818
+ }
13819
+
13820
+ function parseSignature(data) {
13821
+ const reader = new SshReader(data);
13822
+ if (data.length >= 6 && new TextDecoder().decode(data.subarray(0, 6)) === 'SSHSIG') {
13823
+ return parseSshSignatureFormat(reader);
13824
+ }
13825
+ else {
13826
+ return parseLegacyFormat(reader);
13827
+ }
13828
+ }
13829
+ function parseSshSignatureFormat(reader) {
13830
+ const magicBytes = reader.readBytes(6);
13831
+ const magic = new TextDecoder().decode(magicBytes);
13832
+ if (magic !== 'SSHSIG') {
13833
+ throw new InvalidFormatError(magic, 'SSHSIG');
13834
+ }
13835
+ const version = reader.readUint32();
13836
+ const publicKeyLength = reader.readUint32();
13837
+ const publicKey = reader.readBytes(publicKeyLength);
13838
+ const namespace = reader.readString();
13839
+ const reserved = reader.readString();
13840
+ const hashAlgorithm = reader.readString();
13841
+ const signatureLength = reader.readUint32();
13842
+ const signatureData = reader.readBytes(signatureLength);
13843
+ const sigReader = new SshReader(signatureData);
13844
+ const algorithm = sigReader.readString();
13845
+ const signatureLength2 = sigReader.readUint32();
13846
+ const signature = sigReader.readBytes(signatureLength2);
13847
+ return {
13848
+ format: 'ssh-signature',
13849
+ algorithm,
13850
+ signature,
13851
+ version,
13852
+ publicKey,
13853
+ namespace,
13854
+ reserved,
13855
+ hashAlgorithm,
13856
+ };
13857
+ }
13858
+ function parseLegacyFormat(reader) {
13859
+ const algorithm = reader.readString();
13860
+ const signatureLength = reader.readUint32();
13861
+ const signature = reader.readBytes(signatureLength);
13862
+ return {
13863
+ format: 'legacy',
13864
+ algorithm,
13865
+ signature,
13866
+ };
13867
+ }
13868
+ function serializeSignature(blob) {
13869
+ if (blob.format === 'ssh-signature') {
13870
+ return serializeSshSignatureFormat(blob);
13871
+ }
13872
+ else {
13873
+ return serializeLegacyFormat(blob);
13874
+ }
13875
+ }
13876
+ function serializeSshSignatureFormat(blob) {
13877
+ const writer = new SshWriter();
13878
+ writer.writeBytes(new TextEncoder().encode('SSHSIG'));
13879
+ writer.writeUint32(blob.version || 1);
13880
+ if (blob.publicKey) {
13881
+ writer.writeUint32(blob.publicKey.length);
13882
+ writer.writeBytes(blob.publicKey);
13883
+ }
13884
+ else {
13885
+ writer.writeUint32(0);
13886
+ }
13887
+ writer.writeString(blob.namespace || 'file');
13888
+ writer.writeString(blob.reserved || '');
13889
+ writer.writeString(blob.hashAlgorithm || 'sha512');
13890
+ const sigWriter = new SshWriter();
13891
+ sigWriter.writeString(blob.algorithm);
13892
+ sigWriter.writeUint32(blob.signature.length);
13893
+ sigWriter.writeBytes(blob.signature);
13894
+ const sigData = sigWriter.toUint8Array();
13895
+ writer.writeUint32(sigData.length);
13896
+ writer.writeBytes(sigData);
13897
+ return writer.toUint8Array();
13898
+ }
13899
+ function serializeLegacyFormat(blob) {
13900
+ const writer = new SshWriter();
13901
+ writer.writeString(blob.algorithm);
13902
+ writer.writeUint32(blob.signature.length);
13903
+ writer.writeBytes(blob.signature);
13904
+ return writer.toUint8Array();
13905
+ }
13906
+
13907
+ class SshObject {
13908
+ }
13909
+
13910
+ class SshPublicKey extends SshObject {
13911
+ static TYPE = 'public-key';
13912
+ type = SshPublicKey.TYPE;
13913
+ blob;
13914
+ cachedCryptoKey;
13915
+ constructor(blob) {
13916
+ super();
13917
+ this.blob = blob;
13918
+ }
13919
+ async getCryptoKey(crypto = getCrypto()) {
13920
+ if (!this.cachedCryptoKey) {
13921
+ const binding = AlgorithmRegistry.get(this.blob.type);
13922
+ this.cachedCryptoKey = await binding.importPublicSsh({ blob: this.blob.keyData, crypto });
13923
+ }
13924
+ return this.cachedCryptoKey;
13925
+ }
13926
+ static async fromSSH(sshKey, crypto = getCrypto()) {
13927
+ const blob = parsePublicKey(sshKey);
13928
+ const binding = AlgorithmRegistry.get(blob.type);
13929
+ await binding.importPublicSsh({ blob: blob.keyData, crypto });
13930
+ return new SshPublicKey(blob);
13931
+ }
13932
+ static async fromSPKI(spki, type, crypto = getCrypto()) {
13933
+ const binding = AlgorithmRegistry.get(type);
13934
+ const cryptoKey = await binding.importPublicSpki({ spki, crypto });
13935
+ const exported = await binding.exportPublicSsh({ publicKey: cryptoKey, crypto });
13936
+ const blob = {
13937
+ type,
13938
+ keyData: exported,
13939
+ };
13940
+ return new SshPublicKey(blob);
13941
+ }
13942
+ static async fromWebCrypto(cryptoKey, type, crypto = getCrypto()) {
13943
+ const sshType = type || AlgorithmRegistry.getSshTypeFromCryptoKey(cryptoKey);
13944
+ const binding = AlgorithmRegistry.get(sshType);
13945
+ const exported = await binding.exportPublicSsh({ publicKey: cryptoKey, crypto });
13946
+ const blob = {
13947
+ type: sshType,
13948
+ keyData: exported,
13949
+ };
13950
+ return new SshPublicKey(blob);
13951
+ }
13952
+ async export(format = 'ssh', crypto = getCrypto()) {
13953
+ if (format === 'ssh') {
13954
+ return serializePublicKey(this.blob);
13955
+ }
13956
+ else if (format === 'spki') {
13957
+ const cryptoKey = await this.getCryptoKey(crypto);
13958
+ const binding = AlgorithmRegistry.get(this.blob.type);
13959
+ const spki = await binding.exportPublicSpki({ publicKey: cryptoKey, crypto });
13960
+ return new Uint8Array(spki);
13961
+ }
13962
+ throw new UnsupportedKeyTypeError(`Unsupported export format: ${format}`);
13963
+ }
13964
+ async toSSH() {
13965
+ const result = await this.export('ssh');
13966
+ return result;
13967
+ }
13968
+ async toSPKI() {
13969
+ const result = await this.export('spki');
13970
+ return result;
13971
+ }
13972
+ async toWebCrypto(crypto = getCrypto()) {
13973
+ return this.getCryptoKey(crypto);
13974
+ }
13975
+ async verify(algorithm, signature, data, crypto = getCrypto()) {
13976
+ const binding = AlgorithmRegistry.get(algorithm);
13977
+ const cryptoKey = await this.toWebCrypto(crypto);
13978
+ return binding.verify({
13979
+ publicKey: cryptoKey,
13980
+ signature,
13981
+ data,
13982
+ crypto,
13983
+ });
13984
+ }
13985
+ get keyType() {
13986
+ return this.blob.type;
13987
+ }
13988
+ get comment() {
13989
+ return this.blob.comment;
13990
+ }
13991
+ getBlob() {
13992
+ return { ...this.blob };
13993
+ }
13994
+ async thumbprint(algorithm = 'sha256', crypto = getCrypto()) {
13995
+ const hashAlgorithm = algorithm === 'sha256' ? 'SHA-256' : 'SHA-512';
13996
+ const data = this.blob.keyData;
13997
+ const hash = await crypto.subtle.digest(hashAlgorithm, data);
13998
+ return new Uint8Array(hash);
13999
+ }
14000
+ }
14001
+
14002
+ class SshSignature extends SshObject {
14003
+ static TYPE = 'signature';
14004
+ type = SshSignature.TYPE;
14005
+ blob;
14006
+ format;
14007
+ algorithm;
14008
+ signature;
14009
+ version;
14010
+ publicKey;
14011
+ namespace;
14012
+ reserved;
14013
+ hashAlgorithm;
14014
+ constructor(blob) {
14015
+ super();
14016
+ this.blob = blob;
14017
+ this.format = blob.format;
14018
+ this.algorithm = blob.algorithm;
14019
+ this.signature = blob.signature;
14020
+ this.version = blob.version;
14021
+ this.namespace = blob.namespace;
14022
+ this.reserved = blob.reserved;
14023
+ this.hashAlgorithm = blob.hashAlgorithm;
14024
+ if (blob.publicKey) {
14025
+ const reader = new SshReader(blob.publicKey);
14026
+ const type = reader.readString();
14027
+ this.publicKey = new SshPublicKey({ type, keyData: blob.publicKey });
14028
+ }
14029
+ }
14030
+ static parse(data) {
14031
+ const blob = parseSignature(data);
14032
+ return new SshSignature(blob);
14033
+ }
14034
+ static fromBlob(blob) {
14035
+ return new SshSignature(blob);
14036
+ }
14037
+ static fromBase64(base64) {
14038
+ const data = new Uint8Array(buildExports.Convert.FromBase64(base64));
14039
+ return SshSignature.parse(data);
14040
+ }
14041
+ static fromText(text) {
14042
+ const base64 = text
14043
+ .replace(/-----BEGIN SSH SIGNATURE-----/, '')
14044
+ .replace(/-----END SSH SIGNATURE-----/, '')
14045
+ .replace(/[\r\n\s]/g, '');
14046
+ return SshSignature.fromBase64(base64);
14047
+ }
14048
+ serialize() {
14049
+ return serializeSignature(this.blob);
14050
+ }
14051
+ toBase64() {
14052
+ return buildExports.Convert.ToBase64(this.serialize());
14053
+ }
14054
+ toText() {
14055
+ const base64 = this.toBase64();
14056
+ const lines = [];
14057
+ for (let i = 0; i < base64.length; i += 70) {
14058
+ lines.push(base64.substring(i, i + 70));
14059
+ }
14060
+ return ['-----BEGIN SSH SIGNATURE-----', ...lines, '-----END SSH SIGNATURE-----'].join('\n');
14061
+ }
14062
+ async toSSH() {
14063
+ return this.toText();
14064
+ }
14065
+ async verify(data, publicKey) {
14066
+ const binding = AlgorithmRegistry.get(this.algorithm);
14067
+ const cryptoKey = await publicKey['getCryptoKey']();
14068
+ const crypto = getCrypto();
14069
+ let dataToVerify = data;
14070
+ if (this.format === 'ssh-signature') {
14071
+ const hashAlg = this.hashAlgorithm || 'sha512';
14072
+ const namespace = this.namespace || 'file';
14073
+ const reserved = this.reserved || '';
14074
+ const hashAlgorithm = hashAlg === 'sha256' ? 'SHA-256' : 'SHA-512';
14075
+ const messageHash = await crypto.subtle.digest(hashAlgorithm, data);
14076
+ const messageHashBytes = new Uint8Array(messageHash);
14077
+ const writer = new SshWriter();
14078
+ writer.writeBytes(new TextEncoder().encode('SSHSIG'));
14079
+ writer.writeString(namespace);
14080
+ writer.writeString(reserved);
14081
+ writer.writeString(hashAlg);
14082
+ writer.writeUint32(messageHashBytes.length);
14083
+ writer.writeBytes(messageHashBytes);
14084
+ dataToVerify = writer.toUint8Array();
14085
+ }
14086
+ let hashAlgorithm;
14087
+ if (this.algorithm === 'rsa-sha2-256') {
14088
+ hashAlgorithm = 'SHA-256';
14089
+ }
14090
+ else if (this.algorithm === 'rsa-sha2-512') {
14091
+ hashAlgorithm = 'SHA-512';
14092
+ }
14093
+ let signatureToVerify;
14094
+ if (this.format === 'legacy' || this.format === 'ssh-signature') {
14095
+ const sigWriter = new SshWriter();
14096
+ sigWriter.writeString(this.algorithm);
14097
+ sigWriter.writeUint32(this.signature.length);
14098
+ sigWriter.writeBytes(this.signature);
14099
+ const wireFormatSignature = sigWriter.toUint8Array();
14100
+ const decodedSig = binding.decodeSignature({
14101
+ signature: wireFormatSignature,
14102
+ });
14103
+ signatureToVerify = decodedSig.signature;
14104
+ }
14105
+ else {
14106
+ signatureToVerify = this.signature;
14107
+ }
14108
+ return binding.verify({
14109
+ publicKey: cryptoKey,
14110
+ signature: signatureToVerify,
14111
+ data: dataToVerify,
14112
+ crypto,
14113
+ hash: hashAlgorithm,
14114
+ });
14115
+ }
14116
+ static fromLegacy(algorithm, signature) {
14117
+ const binding = AlgorithmRegistry.get(algorithm);
14118
+ const encodedSignature = binding.encodeSignature({
14119
+ signature,
14120
+ algo: algorithm,
14121
+ });
14122
+ const sigReader = new SshReader(encodedSignature);
14123
+ sigReader.readString();
14124
+ const sigLength = sigReader.readUint32();
14125
+ const signatureData = sigReader.readBytes(sigLength);
14126
+ return new SshSignature({
14127
+ format: 'legacy',
14128
+ algorithm,
14129
+ signature: signatureData,
14130
+ });
14131
+ }
14132
+ static fromSshSignature(algorithm, signature, options = {}) {
14133
+ const blob = {
14134
+ format: 'ssh-signature',
14135
+ algorithm,
14136
+ signature,
14137
+ version: options.version || 1,
14138
+ publicKey: options.publicKey ? options.publicKey.getBlob().keyData : undefined,
14139
+ namespace: options.namespace || 'file',
14140
+ reserved: options.reserved || '',
14141
+ hashAlgorithm: options.hashAlgorithm || 'sha512',
14142
+ };
14143
+ return new SshSignature(blob);
14144
+ }
14145
+ static async sign(algorithm, privateKey, data, options = {}) {
14146
+ const { format = 'legacy', namespace = 'file' } = options;
14147
+ if (format === 'legacy') {
14148
+ const rawSignature = await privateKey.sign(algorithm, data);
14149
+ const algorithmUsed = algorithm || privateKey.keyType;
14150
+ return SshSignature.fromLegacy(algorithmUsed, rawSignature);
14151
+ }
14152
+ else {
14153
+ const signatureAlgorithm = algorithm;
14154
+ const binding = AlgorithmRegistry.get(signatureAlgorithm);
14155
+ const hashAlgorithm = algorithm === 'rsa-sha2-256' ? 'sha256' : 'sha512';
14156
+ const publicKey = await privateKey.getPublicKey();
14157
+ const crypto = getCrypto();
14158
+ const webCryptoHashAlg = hashAlgorithm === 'sha256' ? 'SHA-256' : 'SHA-512';
14159
+ const messageHash = await crypto.subtle.digest(webCryptoHashAlg, data);
14160
+ const messageHashBytes = new Uint8Array(messageHash);
14161
+ const writer = new SshWriter();
14162
+ writer.writeBytes(new TextEncoder().encode('SSHSIG'));
14163
+ writer.writeString(namespace);
14164
+ writer.writeString('');
14165
+ writer.writeString(hashAlgorithm);
14166
+ writer.writeUint32(messageHashBytes.length);
14167
+ writer.writeBytes(messageHashBytes);
14168
+ const dataToSign = writer.toUint8Array();
14169
+ const rawSignature = await privateKey.sign(signatureAlgorithm, dataToSign);
14170
+ const encodedSignature = binding.encodeSignature({
14171
+ signature: rawSignature,
14172
+ algo: signatureAlgorithm,
14173
+ });
14174
+ const sigReader = new SshReader(encodedSignature);
14175
+ sigReader.readString();
14176
+ const sigLength = sigReader.readUint32();
14177
+ const signatureData = sigReader.readBytes(sigLength);
14178
+ return SshSignature.fromSshSignature(signatureAlgorithm, signatureData, {
14179
+ namespace,
14180
+ hashAlgorithm,
14181
+ publicKey,
14182
+ });
14183
+ }
14184
+ }
14185
+ }
14186
+
14187
+ let SshCertificate$1 = class SshCertificate extends SshObject {
14188
+ static TYPE = 'certificate';
14189
+ type = SshCertificate.TYPE;
14190
+ _blob;
14191
+ data;
14192
+ _validAfter;
14193
+ _validBefore;
14194
+ keyId;
14195
+ principals;
14196
+ certType;
14197
+ serial;
14198
+ validAfter;
14199
+ validBefore;
14200
+ publicKey;
14201
+ signatureKey;
14202
+ criticalOptions;
14203
+ extensions;
14204
+ constructor(blob) {
14205
+ super();
14206
+ this._blob = blob;
14207
+ this.data = parseCertificateData(blob.keyData);
14208
+ this._validAfter = this.data.validAfter;
14209
+ this._validBefore = this.data.validBefore;
14210
+ this.keyId = this.data.keyId;
14211
+ this.principals = this.data.validPrincipals;
14212
+ this.certType = this.data.type;
14213
+ this.serial = this.data.serial;
14214
+ this.validAfter = new Date(Number(this.data.validAfter) * 1000);
14215
+ this.validBefore = new Date(Number(this.data.validBefore) * 1000);
14216
+ this.publicKey = new SshPublicKey(this.data.publicKey);
14217
+ this.signatureKey = new SshPublicKey(this.data.signatureKey);
14218
+ this.criticalOptions = { ...this.data.criticalOptions };
14219
+ this.extensions = { ...this.data.extensions };
14220
+ }
14221
+ static async fromSSH(text) {
14222
+ const blob = parse(text);
14223
+ return new SshCertificate(blob);
14224
+ }
14225
+ static async fromBlob(blob) {
14226
+ return new SshCertificate(blob);
14227
+ }
14228
+ async toSSH() {
14229
+ return serialize(this._blob);
14230
+ }
14231
+ toBlob() {
14232
+ return { ...this._blob };
14233
+ }
14234
+ get blob() {
14235
+ return this.toBlob();
14236
+ }
14237
+ validate(date = new Date()) {
14238
+ const ts = BigInt(Math.floor(date.getTime() / 1000));
14239
+ const after = this._validAfter;
14240
+ const before = this._validBefore;
14241
+ const INFINITY = 0xffffffffffffffffn;
14242
+ const upper = before === INFINITY ? ts : before;
14243
+ return ts >= after && ts <= upper;
14244
+ }
14245
+ async verify(caPublicKey, crypto = getCrypto()) {
14246
+ const verifyKey = caPublicKey || this.signatureKey;
14247
+ const signedData = this.getSignedData();
14248
+ const sshSignature = SshSignature.parse(this.data.signature);
14249
+ const binding = AlgorithmRegistry.get(sshSignature.algorithm);
14250
+ const cryptoKey = await verifyKey.toWebCrypto(crypto);
14251
+ return binding.verify({
14252
+ publicKey: cryptoKey,
14253
+ signature: sshSignature.signature,
14254
+ data: signedData,
14255
+ crypto,
14256
+ });
14257
+ }
14258
+ getSignedData() {
14259
+ const reader = new SshReader(this._blob.keyData);
14260
+ reader.readString();
14261
+ reader.readBytes(reader.readUint32());
14262
+ if (this.data.keyType === 'ssh-ed25519') {
14263
+ reader.readBytes(reader.readUint32());
14264
+ }
14265
+ else if (this.data.keyType === 'ssh-rsa') {
14266
+ reader.readBytes(reader.readUint32());
14267
+ reader.readBytes(reader.readUint32());
14268
+ }
14269
+ else if (this.data.keyType.startsWith('ecdsa-sha2-')) {
14270
+ reader.readString();
14271
+ reader.readBytes(reader.readUint32());
14272
+ }
14273
+ reader.readUint64();
14274
+ reader.readUint32();
14275
+ reader.readBytes(reader.readUint32());
14276
+ reader.readBytes(reader.readUint32());
14277
+ reader.readUint64();
14278
+ reader.readUint64();
14279
+ reader.readBytes(reader.readUint32());
14280
+ reader.readBytes(reader.readUint32());
14281
+ reader.readBytes(reader.readUint32());
14282
+ reader.readBytes(reader.readUint32());
14283
+ const signedDataEnd = reader.getOffset();
14284
+ return this._blob.keyData.slice(0, signedDataEnd);
14285
+ }
14286
+ };
14287
+
14288
+ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
14289
+ if (kind === "m") throw new TypeError("Private method is not writable");
14290
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
14291
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
14292
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
14293
+ };
14294
+ var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
14295
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
14296
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14297
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
14298
+ };
14299
+ var _SshCertificate_cert;
14300
+ class SshCertificate {
14301
+ constructor(raw) {
14302
+ _SshCertificate_cert.set(this, void 0);
14303
+ const blob = parse(raw.trim());
14304
+ // @ts-expect-error - SshCertificateType is not a constructor
14305
+ __classPrivateFieldSet(this, _SshCertificate_cert, new SshCertificate$1(blob), "f");
14306
+ this.notBefore = __classPrivateFieldGet(this, _SshCertificate_cert, "f").validAfter;
14307
+ this.notAfter = __classPrivateFieldGet(this, _SshCertificate_cert, "f").validBefore;
14308
+ this.validity = dateDiff(this.notBefore, this.notAfter);
14309
+ this.type = [__classPrivateFieldGet(this, _SshCertificate_cert, "f").blob.type, __classPrivateFieldGet(this, _SshCertificate_cert, "f").certType, __classPrivateFieldGet(this, _SshCertificate_cert, "f").type].join(' ');
14310
+ this.serialNumber = __classPrivateFieldGet(this, _SshCertificate_cert, "f").serial.toString();
14311
+ this.keyId = __classPrivateFieldGet(this, _SshCertificate_cert, "f").keyId;
14312
+ this.principals = __classPrivateFieldGet(this, _SshCertificate_cert, "f").principals;
14313
+ this.extensions = __classPrivateFieldGet(this, _SshCertificate_cert, "f").extensions;
14314
+ this.criticalOptions = __classPrivateFieldGet(this, _SshCertificate_cert, "f").criticalOptions;
14315
+ }
14316
+ async parseSignatureKey() {
14317
+ const key = await __classPrivateFieldGet(this, _SshCertificate_cert, "f").signatureKey.toWebCrypto();
14318
+ const blob = __classPrivateFieldGet(this, _SshCertificate_cert, "f").signatureKey.getBlob();
14319
+ const thumbprint = await __classPrivateFieldGet(this, _SshCertificate_cert, "f").signatureKey.thumbprint('sha256');
14320
+ this.signatureKey = {
14321
+ algorithm: key.algorithm.name,
14322
+ type: blob.type,
14323
+ value: await __classPrivateFieldGet(this, _SshCertificate_cert, "f").signatureKey.toSSH(),
14324
+ thumbprint: buildExports.Convert.ToBase64(thumbprint),
14325
+ };
14326
+ }
14327
+ async parsePublicKey() {
14328
+ const key = await __classPrivateFieldGet(this, _SshCertificate_cert, "f").publicKey.toWebCrypto();
14329
+ const blob = __classPrivateFieldGet(this, _SshCertificate_cert, "f").publicKey.getBlob();
14330
+ const thumbprint = await __classPrivateFieldGet(this, _SshCertificate_cert, "f").publicKey.thumbprint('sha256');
14331
+ this.publicKey = {
14332
+ algorithm: key.algorithm.name,
14333
+ type: blob.type,
14334
+ value: await __classPrivateFieldGet(this, _SshCertificate_cert, "f").publicKey.toSSH(),
14335
+ thumbprint: buildExports.Convert.ToBase64(thumbprint),
14336
+ };
14337
+ }
14338
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14339
+ async toString(_format = 'pem') {
14340
+ return __classPrivateFieldGet(this, _SshCertificate_cert, "f").toSSH();
14341
+ }
14342
+ }
14343
+ _SshCertificate_cert = new WeakMap();
14344
+
14345
+ export { OIDs as $, AsnData as A, id_pkcs9_at_extensionRequest as B, Certificate as C, Download as D, ECParameters as E, id_pkcs9_at_unstructuredName as F, id_pkcs9_at_challengePassword as G, id_ValuationRanking as H, InsuranceValue as I, id_InsuranceValue as J, id_WebGDPR as K, id_ActivityDescription as L, id_TypeRelationship as M, Name as N, id_DomainNameTechnicalOperator as O, PemConverter as P, id_DomainNameOwner as Q, RSAPublicKey as R, id_DomainNameLegalRepresentative as S, TypeRelationship as T, UnstructuredName as U, ValuationRanking as V, WebGDPR as W, id_DomainNameBeneficiary as X, CertificationRequest as Y, l10n as Z, dateShort as _, dateDiff as a, id_ce_subjectDirectoryAttributes as a$, OctetString as a0, ByteStream as a1, SignedCertificateTimestamp as a2, Extension$1 as a3, CabforganizationIdentifier as a4, NonStandardKeyDescription as a5, BaseCRLNumber as a6, CRLNumber as a7, SubjectInfoAccessSyntax as a8, TNAuthorizationList as a9, IssuingDistributionPoint as aA, CRLDistributionPoints as aB, CertificatePolicies as aC, CertificateIssuer as aD, BasicConstraints as aE, AuthorityKeyIdentifier as aF, AuthorityInfoAccessSyntax as aG, id_cabforganizationIdentifier as aH, id_ce_keyDescription as aI, id_ce_deltaCRLIndicator as aJ, id_ce_cRLNumber as aK, id_pe_subjectInfoAccess as aL, id_pe_TNAuthList as aM, id_pe_biometricInfo as aN, id_entrust_entrustVersInfo as aO, id_ce_privateKeyUsagePeriod as aP, id_adbe_archiveRevInfo as aQ, id_adbe_timestamp as aR, id_role as aS, id_lei as aT, id_caVersion as aU, id_netscapeCertType as aV, id_netscapeComment as aW, id_enrollCertType as aX, id_certificateTemplate as aY, id_pe_qcStatements as aZ, id_ce_subjectKeyIdentifier as a_, LogotypeExtn as aa, BiometricSyntax as ab, EntrustVersionInfo as ac, PrivateKeyUsagePeriod as ad, ArchiveRevInfo as ae, Timestamp as af, LeiRole as ag, LeiChoice as ah, CaVersion as ai, NetscapeCertType as aj, NetscapeComment as ak, EnrollCertTypeChoice as al, CertificateTemplate as am, QCStatements as an, SubjectKeyIdentifier as ao, SubjectDirectoryAttributes as ap, SubjectAlternativeName as aq, PolicyMappings as ar, PolicyConstraints as as, NameConstraints as at, KeyUsage as au, IssueAlternativeName as av, InvalidityDate as aw, InhibitAnyPolicy as ax, ExtendedKeyUsage as ay, CRLReason as az, buildExports as b, id_ce_subjectAltName as b0, id_ce_policyMappings as b1, id_ce_policyConstraints as b2, id_ce_nameConstraints as b3, id_ce_keyUsage as b4, id_ce_issuerAltName as b5, id_ce_invalidityDate as b6, id_ce_inhibitAnyPolicy as b7, id_ce_extKeyUsage as b8, id_ce_cRLReasons as b9, AsnIntegerArrayBufferConverter as bA, AttestationApplicationId as bB, RootOfTrust as bC, IntegerSet as bD, id_ce_issuingDistributionPoint as ba, id_ce_cRLDistributionPoints as bb, id_ce_certificatePolicies as bc, id_ce_certificateIssuer as bd, id_ce_basicConstraints as be, id_ce_authorityKeyIdentifier as bf, id_pe_authorityInfoAccess as bg, SignedData as bh, EncapsulatedContent as bi, CertificateSet as bj, CertificateChoices as bk, ContentInfo as bl, SshCertificate as bm, Name$1 as bn, OtherName as bo, DisplayText as bp, UserNotice as bq, EDIPartyName as br, __decorate$1 as bs, AsnProp as bt, AsnPropTypes as bu, AsnType as bv, AsnTypeTypes as bw, AsnArray as bx, id_qcs_pkixQCSyntax_v2 as by, SemanticsInformation as bz, certificateRawToBuffer as c, downloadFromBuffer as d, AsnConvert as e, id_rsaEncryption as f, id_composite_key as g, CompositePublicKey as h, id_ecPublicKey as i, id_alg_composite as j, CompositeSignatureValue as k, CompositeParams as l, getCertificateThumbprint as m, AttributeCertificate as n, CertificateList as o, Attribute$1 as p, AsnParser as q, PrivateKeyPossessionStatement as r, ExtensionRequest as s, ChallengePassword as t, ActivityDescription as u, DomainNameTechnicalOperator as v, DomainNameOwner as w, DomainNameLegalRepresentative as x, DomainNameBeneficiary as y, id_at_statementOfPossession as z };
14346
+ //# sourceMappingURL=ssh_certificate-Ct-r021h.js.map
12780
14347
 
12781
- //# sourceMappingURL=certification_request-PeMaLTUD.js.map
14348
+ //# sourceMappingURL=ssh_certificate-Ct-r021h.js.map