@peculiar/certificates-viewer 4.7.1-alpha.4 → 4.7.1-alpha.5

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 (141) hide show
  1. package/components/download.js +4 -5
  2. package/components/download.js.map +1 -1
  3. package/components/peculiar-certificate-decoder.js +1 -1
  4. package/components/peculiar-certificate-decoder.js.map +1 -1
  5. package/components/ssh-certificate-viewer.js +1 -1
  6. package/components/ssh-certificate-viewer.js.map +1 -1
  7. package/dist/cjs/{extension-DTtJlxk8.js → extension-CjXYQXbF.js} +3 -3
  8. package/dist/cjs/{extension-DTtJlxk8.js.map → extension-CjXYQXbF.js.map} +1 -1
  9. package/dist/cjs/index.cjs.js +2 -2
  10. package/dist/cjs/{miscellaneous-DCeacaAw.js → miscellaneous-7gtHz795.js} +4 -4
  11. package/dist/cjs/{miscellaneous-DCeacaAw.js.map → miscellaneous-7gtHz795.js.map} +1 -1
  12. package/dist/cjs/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.cjs.js.map +1 -1
  13. package/dist/cjs/peculiar-attribute-certificate-viewer_5.cjs.entry.js +6 -6
  14. package/dist/cjs/peculiar-attribute-certificate-viewer_5.cjs.entry.js.map +1 -1
  15. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +6 -6
  16. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -1
  17. package/dist/cjs/peculiar-certificate-decoder.entry.cjs.js.map +1 -1
  18. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +4 -4
  19. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +3 -3
  20. package/dist/cjs/{pkcs10_certificate_request-DE-0eDXE.js → pkcs10_certificate_request-CIOxDu_Z.js} +3 -3
  21. package/dist/cjs/{pkcs10_certificate_request-DE-0eDXE.js.map → pkcs10_certificate_request-CIOxDu_Z.js.map} +1 -1
  22. package/dist/cjs/{ssh_certificate-D2q_p49O.js → ssh_certificate-DnXj2sM0.js} +6 -7
  23. package/dist/cjs/ssh_certificate-DnXj2sM0.js.map +1 -0
  24. package/dist/cjs/{x509_certificate-Cto1q-eu.js → x509_certificate-DPgu-mwG.js} +4 -4
  25. package/dist/cjs/{x509_certificate-Cto1q-eu.js.map → x509_certificate-DPgu-mwG.js.map} +1 -1
  26. package/dist/cjs/{x509_crl-CgixMZrh.js → x509_crl-D_DKkGcn.js} +5 -5
  27. package/dist/cjs/{x509_crl-CgixMZrh.js.map → x509_crl-D_DKkGcn.js.map} +1 -1
  28. package/dist/collection/components/certificate-decoder/certificate-decoder.js +1 -1
  29. package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
  30. package/dist/collection/components/ssh-certificate-viewer/-components/miscellaneous.js +1 -1
  31. package/dist/collection/components/ssh-certificate-viewer/-components/miscellaneous.js.map +1 -1
  32. package/dist/collection/crypto/ssh_certificate.js +2 -2
  33. package/dist/collection/crypto/ssh_certificate.js.map +1 -1
  34. package/dist/collection/locales/en.json +0 -1
  35. package/dist/collection/utils/download.js +2 -2
  36. package/dist/collection/utils/download.js.map +1 -1
  37. package/dist/esm/{extension-DmlhftES.js → extension-B3br1_Py.js} +3 -3
  38. package/dist/esm/{extension-DmlhftES.js.map → extension-B3br1_Py.js.map} +1 -1
  39. package/dist/esm/index.js +2 -2
  40. package/dist/esm/{miscellaneous-BTlqwN5_.js → miscellaneous-phHcBJWR.js} +4 -4
  41. package/dist/esm/{miscellaneous-BTlqwN5_.js.map → miscellaneous-phHcBJWR.js.map} +1 -1
  42. package/dist/esm/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -1
  43. package/dist/esm/peculiar-attribute-certificate-viewer_5.entry.js +6 -6
  44. package/dist/esm/peculiar-attribute-certificate-viewer_5.entry.js.map +1 -1
  45. package/dist/esm/peculiar-certificate-decoder.entry.js +6 -6
  46. package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
  47. package/dist/esm/peculiar-certificate-viewer.entry.js +4 -4
  48. package/dist/esm/peculiar-certificates-viewer.entry.js +3 -3
  49. package/dist/esm/{pkcs10_certificate_request-B5C1NYFc.js → pkcs10_certificate_request-HIoLPXGQ.js} +3 -3
  50. package/dist/esm/{pkcs10_certificate_request-B5C1NYFc.js.map → pkcs10_certificate_request-HIoLPXGQ.js.map} +1 -1
  51. package/dist/esm/{ssh_certificate-PCn0WXhQ.js → ssh_certificate-rmToyzuK.js} +6 -7
  52. package/dist/esm/ssh_certificate-rmToyzuK.js.map +1 -0
  53. package/dist/esm/{x509_certificate-BiAmXJ4S.js → x509_certificate-C1VvfHQ5.js} +4 -4
  54. package/dist/{esm-es5/x509_certificate-BiAmXJ4S.js.map → esm/x509_certificate-C1VvfHQ5.js.map} +1 -1
  55. package/dist/esm/{x509_crl-CCeoLLUZ.js → x509_crl-rfnWQkGD.js} +5 -5
  56. package/dist/esm/{x509_crl-CCeoLLUZ.js.map → x509_crl-rfnWQkGD.js.map} +1 -1
  57. package/dist/esm-es5/{extension-DmlhftES.js → extension-B3br1_Py.js} +2 -2
  58. package/dist/esm-es5/{extension-DmlhftES.js.map → extension-B3br1_Py.js.map} +1 -1
  59. package/dist/esm-es5/index.js +1 -1
  60. package/dist/esm-es5/{miscellaneous-BTlqwN5_.js → miscellaneous-phHcBJWR.js} +2 -2
  61. package/dist/esm-es5/{miscellaneous-BTlqwN5_.js.map → miscellaneous-phHcBJWR.js.map} +1 -1
  62. package/dist/esm-es5/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -1
  63. package/dist/esm-es5/peculiar-attribute-certificate-viewer_5.entry.js +2 -2
  64. package/dist/esm-es5/peculiar-attribute-certificate-viewer_5.entry.js.map +1 -1
  65. package/dist/esm-es5/peculiar-certificate-decoder.entry.js +1 -1
  66. package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -1
  67. package/dist/esm-es5/peculiar-certificate-viewer.entry.js +1 -1
  68. package/dist/esm-es5/peculiar-certificates-viewer.entry.js +1 -1
  69. package/dist/esm-es5/{pkcs10_certificate_request-B5C1NYFc.js → pkcs10_certificate_request-HIoLPXGQ.js} +2 -2
  70. package/dist/esm-es5/{pkcs10_certificate_request-B5C1NYFc.js.map → pkcs10_certificate_request-HIoLPXGQ.js.map} +1 -1
  71. package/dist/esm-es5/{ssh_certificate-PCn0WXhQ.js → ssh_certificate-rmToyzuK.js} +4 -4
  72. package/dist/esm-es5/ssh_certificate-rmToyzuK.js.map +1 -0
  73. package/dist/esm-es5/{x509_certificate-BiAmXJ4S.js → x509_certificate-C1VvfHQ5.js} +4 -4
  74. package/dist/{esm/x509_certificate-BiAmXJ4S.js.map → esm-es5/x509_certificate-C1VvfHQ5.js.map} +1 -1
  75. package/dist/esm-es5/{x509_crl-CCeoLLUZ.js → x509_crl-rfnWQkGD.js} +2 -2
  76. package/dist/esm-es5/{x509_crl-CCeoLLUZ.js.map → x509_crl-rfnWQkGD.js.map} +1 -1
  77. package/dist/peculiar/index.esm.js +1 -1
  78. package/dist/peculiar/locales/en.json +0 -1
  79. package/dist/peculiar/{p-98219569.entry.js → p-019339d6.entry.js} +2 -2
  80. package/dist/peculiar/{p-71eab586.entry.js → p-04422929.entry.js} +2 -2
  81. package/dist/peculiar/{p-7273601a.entry.js → p-154dd0da.entry.js} +2 -2
  82. package/dist/peculiar/{p-7273601a.entry.js.map → p-154dd0da.entry.js.map} +1 -1
  83. package/dist/peculiar/{p-46c17c8d.system.entry.js → p-3685975d.system.entry.js} +2 -2
  84. package/dist/peculiar/{p-83bfd8e5.system.entry.js → p-6f0f2749.system.entry.js} +3 -3
  85. package/dist/peculiar/{p-83bfd8e5.system.entry.js.map → p-6f0f2749.system.entry.js.map} +1 -1
  86. package/dist/peculiar/{p-71cb31c6.entry.js → p-7385d0bb.entry.js} +11 -11
  87. package/dist/peculiar/{p-71cb31c6.entry.js.map → p-7385d0bb.entry.js.map} +1 -1
  88. package/dist/peculiar/{p-cc01a2da.system.entry.js → p-872f7312.system.entry.js} +18 -18
  89. package/dist/peculiar/{p-cc01a2da.system.entry.js.map → p-872f7312.system.entry.js.map} +1 -1
  90. package/dist/peculiar/{p-h7XP7otl.js → p-B1eGYq5U.js} +3 -3
  91. package/dist/peculiar/{p-h7XP7otl.js.map → p-B1eGYq5U.js.map} +1 -1
  92. package/dist/peculiar/{p-dOkqMp-O.system.js → p-B2GW-g6v.system.js} +2 -2
  93. package/dist/peculiar/p-B2GW-g6v.system.js.map +1 -0
  94. package/dist/peculiar/{p-DnOLjFJP.js → p-B8_0p5ke.js} +5 -5
  95. package/dist/peculiar/{p-DnOLjFJP.js.map → p-B8_0p5ke.js.map} +1 -1
  96. package/dist/peculiar/p-BGASC3UX.system.js +1 -1
  97. package/dist/peculiar/{p-CSz5liuX.system.js.map → p-BdfvItQB.system.js.map} +1 -1
  98. package/dist/peculiar/p-BtqN4pgo.js +12 -0
  99. package/dist/peculiar/{p-BwlcJAh0.js.map → p-BtqN4pgo.js.map} +1 -1
  100. package/dist/peculiar/{p-DPbpwYQ8.system.js → p-CTksa0ml.system.js} +3 -3
  101. package/dist/peculiar/{p-DPbpwYQ8.system.js.map → p-CTksa0ml.system.js.map} +1 -1
  102. package/dist/peculiar/{p-Db41gPxb.js → p-CYFfXlCT.js} +4 -4
  103. package/dist/peculiar/{p-Db41gPxb.js.map → p-CYFfXlCT.js.map} +1 -1
  104. package/dist/peculiar/{p-CstRxc9v.js → p-CkePJXWQ.js} +4 -4
  105. package/dist/peculiar/{p-CstRxc9v.js.map → p-CkePJXWQ.js.map} +1 -1
  106. package/dist/peculiar/{p-9MJeDspO.system.js.map → p-CuX3t1Hg.system.js.map} +1 -1
  107. package/dist/peculiar/{p-B82-c-xr.system.js.map → p-Cv-b9S6H.system.js.map} +1 -1
  108. package/dist/peculiar/{p-AjXipXSl.system.js → p-D0w6miI2.system.js} +3 -3
  109. package/dist/peculiar/{p-AjXipXSl.system.js.map → p-D0w6miI2.system.js.map} +1 -1
  110. package/dist/peculiar/{p-BHpSDBz_.system.js.map → p-DOFJd-ye.system.js.map} +1 -1
  111. package/dist/peculiar/{p-SjVQtfgD.system.js → p-DkshB-5z.system.js} +4 -4
  112. package/dist/peculiar/{p-SjVQtfgD.system.js.map → p-DkshB-5z.system.js.map} +1 -1
  113. package/dist/peculiar/{p-B5GO6_Ut.system.js → p-DorRvFf7.system.js} +18 -18
  114. package/dist/peculiar/{p-B5GO6_Ut.system.js.map → p-DorRvFf7.system.js.map} +1 -1
  115. package/dist/peculiar/{p-B2FH4Pv2.system.js → p-ZxTK29QB.system.js} +4 -4
  116. package/dist/peculiar/{p-B2FH4Pv2.system.js.map → p-ZxTK29QB.system.js.map} +1 -1
  117. package/dist/peculiar/{p-24861cf6.system.entry.js → p-a4454e2d.system.entry.js} +2 -2
  118. package/dist/peculiar/{p-DMDALRLP.system.js → p-kq9wAWxW.system.js} +4 -4
  119. package/dist/peculiar/p-kq9wAWxW.system.js.map +1 -0
  120. package/dist/peculiar/{p-PCn0WXhQ.js → p-rmToyzuK.js} +4 -4
  121. package/dist/peculiar/p-rmToyzuK.js.map +1 -0
  122. package/dist/peculiar/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.esm.js.map +1 -1
  123. package/dist/peculiar/peculiar-certificate-decoder.entry.esm.js.map +1 -1
  124. package/dist/peculiar/peculiar.esm.js +1 -1
  125. package/dist/types/crypto/ssh_certificate.d.ts +1 -1
  126. package/dist/types/utils/download.d.ts +1 -1
  127. package/dist/types/utils/l10n.d.ts +0 -1
  128. package/hydrate/index.js +6 -7
  129. package/hydrate/index.mjs +6 -7
  130. package/package.json +2 -2
  131. package/dist/cjs/ssh_certificate-D2q_p49O.js.map +0 -1
  132. package/dist/esm/ssh_certificate-PCn0WXhQ.js.map +0 -1
  133. package/dist/esm-es5/ssh_certificate-PCn0WXhQ.js.map +0 -1
  134. package/dist/peculiar/p-BwlcJAh0.js +0 -12
  135. package/dist/peculiar/p-DMDALRLP.system.js.map +0 -1
  136. package/dist/peculiar/p-PCn0WXhQ.js.map +0 -1
  137. package/dist/peculiar/p-dOkqMp-O.system.js.map +0 -1
  138. /package/dist/peculiar/{p-98219569.entry.js.map → p-019339d6.entry.js.map} +0 -0
  139. /package/dist/peculiar/{p-71eab586.entry.js.map → p-04422929.entry.js.map} +0 -0
  140. /package/dist/peculiar/{p-46c17c8d.system.entry.js.map → p-3685975d.system.entry.js.map} +0 -0
  141. /package/dist/peculiar/{p-24861cf6.system.entry.js.map → p-a4454e2d.system.entry.js.map} +0 -0
@@ -39,7 +39,7 @@ var __extends=this&&this.__extends||function(){var t=function(e,i){t=Object.setP
39
39
  *
40
40
  * This source code is licensed under the MIT license found in the
41
41
  * LICENSE file in the root directory of this source tree.
42
- */var c=function(){function t(){}return t}();t("D",c);c.cert={asPEM:function(t,e){r(u.Convert.FromString(t),e,"cer","application/pkix-cert")},asDER:function(t,e){r(t,e,"cer","application/pkix-cert")}};c.attrCert={asPEM:function(t,e){r(u.Convert.FromString(t),e,"cer","application/pkix-attr-cert")},asDER:function(t,e){r(t,e,"cer","application/pkix-attr-cert")}};c.csr={asPEM:function(t,e){r(u.Convert.FromString(t),e,"csr","application/pkcs10")},asDER:function(t,e){r(t,e,"csr","application/pkcs10")}};c.crl={asPEM:function(t,e){r(u.Convert.FromString(t),e,"crl","application/pkix-crl")},asDER:function(t,e){r(t,e,"crl","application/pkix-crl")}};c.certSSH={asSSH:function(t,e){r(u.Convert.FromString(t),e,"cert","application/ssh-cert")}};
42
+ */var c=function(){function t(){}return t}();t("D",c);c.cert={asPEM:function(t,e){r(u.Convert.FromString(t),e,"cer","application/pkix-cert")},asDER:function(t,e){r(t,e,"cer","application/pkix-cert")}};c.attrCert={asPEM:function(t,e){r(u.Convert.FromString(t),e,"cer","application/pkix-attr-cert")},asDER:function(t,e){r(t,e,"cer","application/pkix-attr-cert")}};c.csr={asPEM:function(t,e){r(u.Convert.FromString(t),e,"csr","application/pkcs10")},asDER:function(t,e){r(t,e,"csr","application/pkcs10")}};c.crl={asPEM:function(t,e){r(u.Convert.FromString(t),e,"crl","application/pkix-crl")},asDER:function(t,e){r(t,e,"crl","application/pkix-crl")}};c.certSSH={asPub:function(t,e){r(u.Convert.FromString(t),e,"pub","text/plain")}};
43
43
  /*!
44
44
  Copyright (c) Peculiar Ventures, LLC
45
45
  */function f(t,e){var i=0;if(t.length===1){return t[0]}for(var r=t.length-1;r>=0;r--){i+=t[t.length-1-r]*Math.pow(2,e*r)}return i}function v(t,e,i){if(i===void 0){i=-1}var r=i;var n=t;var a=0;var o=Math.pow(2,e);for(var s=1;s<8;s++){if(t<o){var u=void 0;if(r<0){u=new ArrayBuffer(s);a=s}else{if(r<s){return new ArrayBuffer(0)}u=new ArrayBuffer(r);a=r}var c=new Uint8Array(u);for(var f=s-1;f>=0;f--){var v=Math.pow(2,f*e);c[a-f-1]=Math.floor(n/v);n-=c[a-f-1]*v}return u}o*=Math.pow(2,e)}return new ArrayBuffer(0)}function h(){var t=[];for(var e=0;e<arguments.length;e++){t[e]=arguments[e]}var i=0;var r=0;for(var n=0,a=t;n<a.length;n++){var o=a[n];i+=o.length}var s=new ArrayBuffer(i);var u=new Uint8Array(s);for(var c=0,f=t;c<f.length;c++){var o=f[c];u.set(o,r);r+=o.length}return u}function d(){var t=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){var e=t[0]===255&&t[1]&128;var i=t[0]===0&&(t[1]&128)===0;if(e||i){this.warnings.push("Needlessly long format")}}var r=new ArrayBuffer(this.valueHex.byteLength);var n=new Uint8Array(r);for(var a=0;a<this.valueHex.byteLength;a++){n[a]=0}n[0]=t[0]&128;var o=f(n,8);var s=new ArrayBuffer(this.valueHex.byteLength);var u=new Uint8Array(s);for(var c=0;c<this.valueHex.byteLength;c++){u[c]=t[c]}u[0]&=127;var v=f(u,8);return v-o}function l(t){var e=t<0?t*-1:t;var i=128;for(var r=1;r<8;r++){if(e<=i){if(t<0){var n=i-e;var a=v(n,8,r);var o=new Uint8Array(a);o[0]|=128;return a}var s=v(e,8,r);var u=new Uint8Array(s);if(u[0]&128){var c=s.slice(0);var f=new Uint8Array(c);s=new ArrayBuffer(s.byteLength+1);u=new Uint8Array(s);for(var h=0;h<c.byteLength;h++){u[h+1]=f[h]}u[0]=0}return s}i*=Math.pow(2,8)}return new ArrayBuffer(0)}function p(t,e){if(t.byteLength!==e.byteLength){return false}var i=new Uint8Array(t);var r=new Uint8Array(e);for(var n=0;n<i.length;n++){if(i[n]!==r[n]){return false}}return true}function y(t,e){var i=t.toString(10);if(e<i.length){return""}var r=e-i.length;var n=new Array(r);for(var a=0;a<r;a++){n[a]="0"}var o=n.join("");return o.concat(i)}
@@ -82,7 +82,7 @@ var __extends=this&&this.__extends||function(){var t=function(e,i){t=Object.setP
82
82
  *
83
83
  * This source code is licensed under the MIT license found in the
84
84
  * LICENSE file in the root directory of this source tree.
85
- */eo.extend(so);var uo=t("_",(function(t){return new Date(t).toUTCString()}));var co=t("a",(function(t,e){if(!t||!e){return""}var i=eo(t);var r=eo(e);return i.to(r,true)}));var fo="Basic Information";var vo="Subject Name";var ho="Issuer Name";var lo="Public Key Info";var po="Signature";var yo="Extensions";var So="Miscellaneous";var Ao="Download";var Co="Serial Number";var mo="Version";var go="Validity";var wo="Issued";var _o="Expired";var bo="Last Update";var Eo="Next Update";var Po="Algorithm";var Do="Named Curve";var Io="Exponent";var Bo="Modulus";var xo="Value";var To="Valid";var Oo="Revoked";var ko="Issuer";var Mo="Name";var Ro="Public Key";var No="Fingerprint";var Ko="Fingerprints";var jo="Test URLs";var Ho="Certificate Details";var Uo="Holder";var Fo="Digest Info";var Lo="Type";var Vo="Revoked Certificates";var Go="Revocation Date";var Wo="Yes";var Qo="No";var qo="Only User Certificates";var zo="Only Attribute Certificates";var Yo="Only CA Certificates";var Zo="Indirect CRL";var $o="Only Reasons";var Xo="CRL Entry Extensions";var Jo="Preview certificate";var ts="View details";var es="Download options";var is="Key ID";var rs="Principals";var ns="Critical Options";var as="Signing CA";var os={basicInformation:fo,subjectName:vo,issuerName:ho,publicKeyInfo:lo,signature:po,extensions:yo,miscellaneous:So,download:Ao,"download.pem":"Download PEM","download.der":"Download DER","download.ssh":"Download SSH",serialNumber:Co,version:mo,validity:go,issued:wo,expired:_o,lastUpdate:bo,nextUpdate:Eo,algorithm:Po,namedCurve:Do,exponent:Io,modulus:Bo,value:xo,valid:To,revoked:Oo,issuer:ko,name:Mo,publicKey:Ro,fingerprint:No,fingerprints:Ko,testURLs:jo,certificateDetails:Ho,holder:Uo,digestInfo:Fo,type:Lo,revokedCertificates:Vo,revocationDate:Go,yes:Wo,no:Qo,onlyUserCertificates:qo,onlyAttributeCertificates:zo,onlyCACertificates:Yo,indirectCRL:Zo,onlyReasons:$o,crlEntryExtensions:Xo,previewCertificate:Jo,viewDetails:ts,downloadOptions:es,keyId:is,principals:rs,criticalOptions:ns,signingCA:as};
85
+ */eo.extend(so);var uo=t("_",(function(t){return new Date(t).toUTCString()}));var co=t("a",(function(t,e){if(!t||!e){return""}var i=eo(t);var r=eo(e);return i.to(r,true)}));var fo="Basic Information";var vo="Subject Name";var ho="Issuer Name";var lo="Public Key Info";var po="Signature";var yo="Extensions";var So="Miscellaneous";var Ao="Download";var Co="Serial Number";var mo="Version";var go="Validity";var wo="Issued";var _o="Expired";var bo="Last Update";var Eo="Next Update";var Po="Algorithm";var Do="Named Curve";var Io="Exponent";var Bo="Modulus";var xo="Value";var To="Valid";var Oo="Revoked";var ko="Issuer";var Mo="Name";var Ro="Public Key";var No="Fingerprint";var Ko="Fingerprints";var jo="Test URLs";var Ho="Certificate Details";var Uo="Holder";var Fo="Digest Info";var Lo="Type";var Vo="Revoked Certificates";var Go="Revocation Date";var Wo="Yes";var Qo="No";var qo="Only User Certificates";var zo="Only Attribute Certificates";var Yo="Only CA Certificates";var Zo="Indirect CRL";var $o="Only Reasons";var Xo="CRL Entry Extensions";var Jo="Preview certificate";var ts="View details";var es="Download options";var is="Key ID";var rs="Principals";var ns="Critical Options";var as="Signing CA";var os={basicInformation:fo,subjectName:vo,issuerName:ho,publicKeyInfo:lo,signature:po,extensions:yo,miscellaneous:So,download:Ao,"download.pem":"Download PEM","download.der":"Download DER",serialNumber:Co,version:mo,validity:go,issued:wo,expired:_o,lastUpdate:bo,nextUpdate:Eo,algorithm:Po,namedCurve:Do,exponent:Io,modulus:Bo,value:xo,valid:To,revoked:Oo,issuer:ko,name:Mo,publicKey:Ro,fingerprint:No,fingerprints:Ko,testURLs:jo,certificateDetails:Ho,holder:Uo,digestInfo:Fo,type:Lo,revokedCertificates:Vo,revocationDate:Go,yes:Wo,no:Qo,onlyUserCertificates:qo,onlyAttributeCertificates:zo,onlyCACertificates:Yo,indirectCRL:Zo,onlyReasons:$o,crlEntryExtensions:Xo,previewCertificate:Jo,viewDetails:ts,downloadOptions:es,keyId:is,principals:rs,criticalOptions:ns,signingCA:as};
86
86
  /**
87
87
  * @license
88
88
  * Copyright (c) Peculiar Ventures, LLC.
@@ -131,5 +131,5 @@ var __extends=this&&this.__extends||function(){var t=function(e,i){t=Object.setP
131
131
  *
132
132
  * This source code is licensed under the MIT license found in the
133
133
  * LICENSE file in the root directory of this source tree.
134
- */var Qc=t("c",(function(t){if(Vc.isPem(t)){return Vc.decode(t)[0]}if(u.Convert.isHex(t)){return u.Convert.FromHex(t)}if(u.Convert.isBase64(t)){return u.Convert.FromBase64(t)}if(u.Convert.isBase64Url(t)){return u.Convert.FromBase64Url(t)}return u.Convert.FromBinary(t)}));var qc=t("m",(function(t,i){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(r){e=Wc.get();if(e.subtle){return[2,e.subtle.digest(t,i)]}return[2,undefined]}))}))}));var zc=function(){function t(t){if(t===void 0){t={}}this.acIssuer=new ji;this.acSerial=0;this.attrs=[];Object.assign(this,t)}return t}();bi([Ai({type:ji})],zc.prototype,"acIssuer",void 0);bi([Ai({type:Ke.Integer})],zc.prototype,"acSerial",void 0);bi([Ai({type:rn,repeated:"sequence"})],zc.prototype,"attrs",void 0);var Yc;var Zc=Yc=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Yc.prototype);return i}return e}(wi);Zc=Yc=bi([Si({type:Ne.Sequence,itemType:Ke.ObjectIdentifier})],Zc);var $c=function(){function t(t){if(t===void 0){t={}}this.permitUnSpecified=true;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,optional:true})],$c.prototype,"pathLenConstraint",void 0);bi([Ai({type:Zc,implicit:true,context:0,optional:true})],$c.prototype,"permittedAttrs",void 0);bi([Ai({type:Zc,implicit:true,context:1,optional:true})],$c.prototype,"excludedAttrs",void 0);bi([Ai({type:Ke.Boolean,defaultValue:true})],$c.prototype,"permitUnSpecified",void 0);var Xc=function(){function t(t){if(t===void 0){t={}}this.issuer=new Xi;this.serial=new ArrayBuffer(0);this.issuerUID=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Xi})],Xc.prototype,"issuer",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Xc.prototype,"serial",void 0);bi([Ai({type:Ke.BitString,optional:true})],Xc.prototype,"issuerUID",void 0);var Jc;(function(t){t[t["publicKey"]=0]="publicKey";t[t["publicKeyCert"]=1]="publicKeyCert";t[t["otherObjectTypes"]=2]="otherObjectTypes"})(Jc||(Jc={}));var tf=function(){function t(t){if(t===void 0){t={}}this.digestedObjectType=Jc.publicKey;this.digestAlgorithm=new An;this.objectDigest=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.Enumerated})],tf.prototype,"digestedObjectType",void 0);bi([Ai({type:Ke.ObjectIdentifier,optional:true})],tf.prototype,"otherObjectTypeID",void 0);bi([Ai({type:An})],tf.prototype,"digestAlgorithm",void 0);bi([Ai({type:Ke.BitString})],tf.prototype,"objectDigest",void 0);var ef=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Xi,optional:true})],ef.prototype,"issuerName",void 0);bi([Ai({type:Xc,context:0,implicit:true,optional:true})],ef.prototype,"baseCertificateID",void 0);bi([Ai({type:tf,context:1,implicit:true,optional:true})],ef.prototype,"objectDigestInfo",void 0);var rf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:ji,repeated:"sequence"})],rf.prototype,"v1Form",void 0);bi([Ai({type:ef,context:0,implicit:true})],rf.prototype,"v2Form",void 0);rf=bi([Si({type:Ne.Choice})],rf);var nf=function(){function t(t){if(t===void 0){t={}}this.notBeforeTime=new Date;this.notAfterTime=new Date;Object.assign(this,t)}return t}();bi([Ai({type:Ke.GeneralizedTime})],nf.prototype,"notBeforeTime",void 0);bi([Ai({type:Ke.GeneralizedTime})],nf.prototype,"notAfterTime",void 0);var af=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Xc,implicit:true,context:0,optional:true})],af.prototype,"baseCertificateID",void 0);bi([Ai({type:Xi,implicit:true,context:1,optional:true})],af.prototype,"entityName",void 0);bi([Ai({type:tf,implicit:true,context:2,optional:true})],af.prototype,"objectDigestInfo",void 0);var of;(function(t){t[t["v2"]=1]="v2"})(of||(of={}));var sf=function(){function t(t){if(t===void 0){t={}}this.version=of.v2;this.holder=new af;this.issuer=new rf;this.signature=new An;this.serialNumber=new ArrayBuffer(0);this.attrCertValidityPeriod=new nf;this.attributes=[];Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],sf.prototype,"version",void 0);bi([Ai({type:af})],sf.prototype,"holder",void 0);bi([Ai({type:rf})],sf.prototype,"issuer",void 0);bi([Ai({type:An})],sf.prototype,"signature",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],sf.prototype,"serialNumber",void 0);bi([Ai({type:nf})],sf.prototype,"attrCertValidityPeriod",void 0);bi([Ai({type:rn,repeated:"sequence"})],sf.prototype,"attributes",void 0);bi([Ai({type:Ke.BitString,optional:true})],sf.prototype,"issuerUniqueID",void 0);bi([Ai({type:bn,optional:true})],sf.prototype,"extensions",void 0);var uf=function(){function t(t){if(t===void 0){t={}}this.acinfo=new sf;this.signatureAlgorithm=new An;this.signatureValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("n",uf);bi([Ai({type:sf})],uf.prototype,"acinfo",void 0);bi([Ai({type:An})],uf.prototype,"signatureAlgorithm",void 0);bi([Ai({type:Ke.BitString})],uf.prototype,"signatureValue",void 0);var cf;(function(t){t[t["unmarked"]=1]="unmarked";t[t["unclassified"]=2]="unclassified";t[t["restricted"]=4]="restricted";t[t["confidential"]=8]="confidential";t[t["secret"]=16]="secret";t[t["topSecret"]=32]="topSecret"})(cf||(cf={}));var ff=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(je);var vf=function(){function t(t){if(t===void 0){t={}}this.type="";this.value=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier,implicit:true,context:0})],vf.prototype,"type",void 0);bi([Ai({type:Ke.Any,implicit:true,context:1})],vf.prototype,"value",void 0);var hf=function(){function t(t){if(t===void 0){t={}}this.policyId="";this.classList=new ff(cf.unclassified);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],hf.prototype,"policyId",void 0);bi([Ai({type:ff,defaultValue:new ff(cf.unclassified)})],hf.prototype,"classList",void 0);bi([Ai({type:vf,repeated:"set"})],hf.prototype,"securityCategories",void 0);var df=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:He})],df.prototype,"cotets",void 0);bi([Ai({type:Ke.ObjectIdentifier})],df.prototype,"oid",void 0);bi([Ai({type:Ke.Utf8String})],df.prototype,"string",void 0);var lf=function(){function t(t){if(t===void 0){t={}}this.values=[];Object.assign(this,t)}return t}();bi([Ai({type:Xi,implicit:true,context:0,optional:true})],lf.prototype,"policyAuthority",void 0);bi([Ai({type:df,repeated:"sequence"})],lf.prototype,"values",void 0);var pf;var yf=function(){function t(t){if(t===void 0){t={}}this.targetCertificate=new Xc;Object.assign(this,t)}return t}();bi([Ai({type:Xc})],yf.prototype,"targetCertificate",void 0);bi([Ai({type:ji,optional:true})],yf.prototype,"targetName",void 0);bi([Ai({type:tf,optional:true})],yf.prototype,"certDigestInfo",void 0);var Sf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:ji,context:0,implicit:true})],Sf.prototype,"targetName",void 0);bi([Ai({type:ji,context:1,implicit:true})],Sf.prototype,"targetGroup",void 0);bi([Ai({type:yf,context:2,implicit:true})],Sf.prototype,"targetCert",void 0);Sf=bi([Si({type:Ne.Choice})],Sf);var Af=pf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,pf.prototype);return i}return e}(wi);Af=pf=bi([Si({type:Ne.Sequence,itemType:Sf})],Af);var Cf;var mf=Cf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Cf.prototype);return i}return e}(wi);mf=Cf=bi([Si({type:Ne.Sequence,itemType:Af})],mf);var gf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Xi,implicit:true,context:0,optional:true})],gf.prototype,"roleAuthority",void 0);bi([Ai({type:ji,implicit:true,context:1})],gf.prototype,"roleName",void 0);var wf=function(){function t(t){if(t===void 0){t={}}this.service=new ji;this.ident=new ji;Object.assign(this,t)}return t}();bi([Ai({type:ji})],wf.prototype,"service",void 0);bi([Ai({type:ji})],wf.prototype,"ident",void 0);bi([Ai({type:He,optional:true})],wf.prototype,"authInfo",void 0);var _f="0.4.0.9496";var bf=t("L","".concat(_f,".6"));var Ef=t("u",function(){function t(t){if(t===void 0){t={}}this.codeAuthority=new ji;this.codeId=new ji;this.shortName="";this.shortDescription="";Object.assign(this,t)}return t}());bi([Ai({type:ji,context:0})],Ef.prototype,"codeAuthority",void 0);bi([Ai({type:ji,context:1})],Ef.prototype,"codeId",void 0);bi([Ai({type:Ke.Utf8String,context:2})],Ef.prototype,"shortName",void 0);bi([Ai({type:Ke.Utf8String,context:3})],Ef.prototype,"shortDescription",void 0);t("u",Ef=bi([Si({type:Ne.Sequence})],Ef));var Pf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Mi);Pf=bi([Si({type:Ne.Sequence})],Pf);var Df=t("X","".concat(_f,".1"));var If=t("y",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("y",If=bi([Si({type:Ne.Sequence})],If));var Bf=t("S","".concat(_f,".2"));var xf=t("x",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("x",xf=bi([Si({type:Ne.Sequence})],xf));var Tf=t("Q","".concat(_f,".3"));var Of=t("w",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("w",Of=bi([Si({type:Ne.Sequence})],Of));var kf=t("O","".concat(_f,".4"));var Mf=t("v",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("v",Mf=bi([Si({type:Ne.Sequence})],Mf));var Rf=t("J","".concat(_f,".8"));var Nf=t("I",function(){function t(t){if(t===void 0){t={}}this.location="";this.base=0;this.degree=0;Object.assign(this,t)}t.prototype.toString=function(){return"".concat(this.base," x 10^").concat(this.degree," ").concat(this.location)};return t}());bi([Ai({type:Ke.PrintableString})],Nf.prototype,"location",void 0);bi([Ai({type:Ke.Integer})],Nf.prototype,"base",void 0);bi([Ai({type:Ke.Integer})],Nf.prototype,"degree",void 0);t("I",Nf=bi([Si({type:Ne.Sequence})],Nf));var Kf=t("H","".concat(_f,".9"));var jf=t("V",function(){function t(t){if(t===void 0){t={}}this.stars5=0;this.stars4=0;this.stars3=0;this.stars2=0;this.stars1=0;Object.assign(this,t)}return t}());bi([Ai({type:Ke.Integer})],jf.prototype,"stars5",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars4",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars3",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars2",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars1",void 0);t("V",jf=bi([Si({type:Ne.Sequence})],jf));var Hf=t("M","".concat(_f,".5"));var Uf=t("T",function(){function t(t){if(t===void 0){t={}}this.DNBvsDNO=new je(0);this.DNBvsDNT=new je(0);this.DNOvsDNT=new je(0);Object.assign(this,t)}return t}());bi([Ai({type:je,context:0})],Uf.prototype,"DNBvsDNO",void 0);bi([Ai({type:je,context:1})],Uf.prototype,"DNBvsDNT",void 0);bi([Ai({type:je,context:2})],Uf.prototype,"DNOvsDNT",void 0);t("T",Uf=bi([Si({type:Ne.Sequence})],Uf));var Ff=t("K","".concat(_f,".7"));var Lf=t("W",function(){function t(t){if(t===void 0){t={}}this.assessmentAuthority=new ji;this.assessmentRef=new ji;this.assessmentLocation=new ji;this.dataStorageTerritory="";this.description="";Object.assign(this,t)}return t}());bi([Ai({type:ji,context:0})],Lf.prototype,"assessmentAuthority",void 0);bi([Ai({type:ji,context:1})],Lf.prototype,"assessmentRef",void 0);bi([Ai({type:ji,context:2})],Lf.prototype,"assessmentLocation",void 0);bi([Ai({type:Ke.PrintableString,context:3})],Lf.prototype,"dataStorageTerritory",void 0);bi([Ai({type:Ke.Utf8String,context:4})],Lf.prototype,"description",void 0);t("W",Lf=bi([Si({type:Ne.Sequence})],Lf));var Vf=function(){function t(t){if(t===void 0){t={}}this.issuer=new Mi;this.serialNumber=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Mi})],Vf.prototype,"issuer",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Vf.prototype,"serialNumber",void 0);var Gf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:un,context:0,implicit:true})],Gf.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Vf})],Gf.prototype,"issuerAndSerialNumber",void 0);Gf=bi([Si({type:Ne.Choice})],Gf);var Wf;(function(t){t[t["v0"]=0]="v0";t[t["v1"]=1]="v1";t[t["v2"]=2]="v2";t[t["v3"]=3]="v3";t[t["v4"]=4]="v4";t[t["v5"]=5]="v5"})(Wf||(Wf={}));var Qf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Qf=bi([Si({type:Ne.Sequence})],Qf);var qf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);qf=bi([Si({type:Ne.Sequence})],qf);var zf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);zf=bi([Si({type:Ne.Sequence})],zf);var Yf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Yf=bi([Si({type:Ne.Sequence})],Yf);var Zf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Zf=bi([Si({type:Ne.Sequence})],Zf);var $f=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);$f=bi([Si({type:Ne.Sequence})],$f);var Xf=function(){function t(t){if(t===void 0){t={}}this.attrType="";this.attrValues=[];Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Xf.prototype,"attrType",void 0);bi([Ai({type:Ke.Any,repeated:"set"})],Xf.prototype,"attrValues",void 0);var Jf;var tv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.sid=new Gf;this.digestAlgorithm=new Qf;this.signatureAlgorithm=new qf;this.signature=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],tv.prototype,"version",void 0);bi([Ai({type:Gf})],tv.prototype,"sid",void 0);bi([Ai({type:Qf})],tv.prototype,"digestAlgorithm",void 0);bi([Ai({type:Xf,repeated:"set",context:0,implicit:true,optional:true})],tv.prototype,"signedAttrs",void 0);bi([Ai({type:qf})],tv.prototype,"signatureAlgorithm",void 0);bi([Ai({type:He})],tv.prototype,"signature",void 0);bi([Ai({type:Xf,repeated:"set",context:1,implicit:true,optional:true})],tv.prototype,"unsignedAttrs",void 0);var ev=Jf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Jf.prototype);return i}return e}(wi);ev=Jf=bi([Si({type:Ne.Set,itemType:tv})],ev);var iv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(mn);iv=bi([Si({type:Ne.Choice})],iv);var rv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(tv);rv=bi([Si({type:Ne.Sequence})],rv);var nv;var av=function(){function t(t){if(t===void 0){t={}}this.otherCertFormat="";this.otherCert=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],av.prototype,"otherCertFormat",void 0);bi([Ai({type:Ke.Any})],av.prototype,"otherCert",void 0);var ov=t("bk",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}());bi([Ai({type:Dn})],ov.prototype,"certificate",void 0);bi([Ai({type:uf,context:2,implicit:true})],ov.prototype,"v2AttrCert",void 0);bi([Ai({type:av,context:3,implicit:true})],ov.prototype,"other",void 0);t("bk",ov=bi([Si({type:Ne.Choice})],ov));var sv=t("bj",nv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,nv.prototype);return i}return e}(wi));t("bj",sv=nv=bi([Si({type:Ne.Set,itemType:ov})],sv));var uv=function(){function t(t){if(t===void 0){t={}}this.contentType="";this.content=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("bl",uv);bi([Ai({type:Ke.ObjectIdentifier})],uv.prototype,"contentType",void 0);bi([Ai({type:Ke.Any,context:0})],uv.prototype,"content",void 0);var cv=t("bi",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}());bi([Ai({type:He})],cv.prototype,"single",void 0);bi([Ai({type:Ke.Any})],cv.prototype,"any",void 0);t("bi",cv=bi([Si({type:Ne.Choice})],cv));var fv=function(){function t(t){if(t===void 0){t={}}this.eContentType="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],fv.prototype,"eContentType",void 0);bi([Ai({type:cv,context:0,optional:true})],fv.prototype,"eContent",void 0);var vv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:He,context:0,implicit:true,optional:true})],vv.prototype,"value",void 0);bi([Ai({type:He,converter:ze,context:0,implicit:true,optional:true,repeated:"sequence"})],vv.prototype,"constructedValue",void 0);vv=bi([Si({type:Ne.Choice})],vv);var hv=function(){function t(t){if(t===void 0){t={}}this.contentType="";this.contentEncryptionAlgorithm=new Yf;Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],hv.prototype,"contentType",void 0);bi([Ai({type:Yf})],hv.prototype,"contentEncryptionAlgorithm",void 0);bi([Ai({type:vv,optional:true})],hv.prototype,"encryptedContent",void 0);var dv=function(){function t(t){if(t===void 0){t={}}this.keyAttrId="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],dv.prototype,"keyAttrId",void 0);bi([Ai({type:Ke.Any,optional:true})],dv.prototype,"keyAttr",void 0);var lv;var pv=function(){function t(t){if(t===void 0){t={}}this.subjectKeyIdentifier=new un;Object.assign(this,t)}return t}();bi([Ai({type:un})],pv.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Ke.GeneralizedTime,optional:true})],pv.prototype,"date",void 0);bi([Ai({type:dv,optional:true})],pv.prototype,"other",void 0);var yv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:pv,context:0,implicit:true,optional:true})],yv.prototype,"rKeyId",void 0);bi([Ai({type:Vf,optional:true})],yv.prototype,"issuerAndSerialNumber",void 0);yv=bi([Si({type:Ne.Choice})],yv);var Sv=function(){function t(t){if(t===void 0){t={}}this.rid=new yv;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:yv})],Sv.prototype,"rid",void 0);bi([Ai({type:He})],Sv.prototype,"encryptedKey",void 0);var Av=lv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,lv.prototype);return i}return e}(wi);Av=lv=bi([Si({type:Ne.Sequence,itemType:Sv})],Av);var Cv=function(){function t(t){if(t===void 0){t={}}this.algorithm=new An;this.publicKey=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:An})],Cv.prototype,"algorithm",void 0);bi([Ai({type:Ke.BitString})],Cv.prototype,"publicKey",void 0);var mv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:un,context:0,implicit:true,optional:true})],mv.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Cv,context:1,implicit:true,optional:true})],mv.prototype,"originatorKey",void 0);bi([Ai({type:Vf,optional:true})],mv.prototype,"issuerAndSerialNumber",void 0);mv=bi([Si({type:Ne.Choice})],mv);var gv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v3;this.originator=new mv;this.keyEncryptionAlgorithm=new zf;this.recipientEncryptedKeys=new Av;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],gv.prototype,"version",void 0);bi([Ai({type:mv,context:0})],gv.prototype,"originator",void 0);bi([Ai({type:He,context:1,optional:true})],gv.prototype,"ukm",void 0);bi([Ai({type:zf})],gv.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:Av})],gv.prototype,"recipientEncryptedKeys",void 0);var wv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:un,context:0,implicit:true})],wv.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Vf})],wv.prototype,"issuerAndSerialNumber",void 0);wv=bi([Si({type:Ne.Choice})],wv);var _v=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.rid=new wv;this.keyEncryptionAlgorithm=new zf;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],_v.prototype,"version",void 0);bi([Ai({type:wv})],_v.prototype,"rid",void 0);bi([Ai({type:zf})],_v.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:He})],_v.prototype,"encryptedKey",void 0);var bv=function(){function t(t){if(t===void 0){t={}}this.keyIdentifier=new He;Object.assign(this,t)}return t}();bi([Ai({type:He})],bv.prototype,"keyIdentifier",void 0);bi([Ai({type:Ke.GeneralizedTime,optional:true})],bv.prototype,"date",void 0);bi([Ai({type:dv,optional:true})],bv.prototype,"other",void 0);var Ev=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v4;this.kekid=new bv;this.keyEncryptionAlgorithm=new zf;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Ev.prototype,"version",void 0);bi([Ai({type:bv})],Ev.prototype,"kekid",void 0);bi([Ai({type:zf})],Ev.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:He})],Ev.prototype,"encryptedKey",void 0);var Pv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.keyEncryptionAlgorithm=new zf;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Pv.prototype,"version",void 0);bi([Ai({type:$f,context:0,optional:true})],Pv.prototype,"keyDerivationAlgorithm",void 0);bi([Ai({type:zf})],Pv.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:He})],Pv.prototype,"encryptedKey",void 0);var Dv=function(){function t(t){if(t===void 0){t={}}this.oriType="";this.oriValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Dv.prototype,"oriType",void 0);bi([Ai({type:Ke.Any})],Dv.prototype,"oriValue",void 0);var Iv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:_v,optional:true})],Iv.prototype,"ktri",void 0);bi([Ai({type:gv,context:1,implicit:true,optional:true})],Iv.prototype,"kari",void 0);bi([Ai({type:Ev,context:2,implicit:true,optional:true})],Iv.prototype,"kekri",void 0);bi([Ai({type:Pv,context:3,implicit:true,optional:true})],Iv.prototype,"pwri",void 0);bi([Ai({type:Dv,context:4,implicit:true,optional:true})],Iv.prototype,"ori",void 0);Iv=bi([Si({type:Ne.Choice})],Iv);var Bv;var xv=Bv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Bv.prototype);return i}return e}(wi);xv=Bv=bi([Si({type:Ne.Set,itemType:Iv})],xv);var Tv;var Ov=function(){function t(t){if(t===void 0){t={}}this.otherRevInfoFormat="";this.otherRevInfo=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Ov.prototype,"otherRevInfoFormat",void 0);bi([Ai({type:Ke.Any})],Ov.prototype,"otherRevInfo",void 0);var kv=function(){function t(t){if(t===void 0){t={}}this.other=new Ov;Object.assign(this,t)}return t}();bi([Ai({type:Ov,context:1,implicit:true})],kv.prototype,"other",void 0);kv=bi([Si({type:Ne.Choice})],kv);var Mv=Tv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Tv.prototype);return i}return e}(wi);Mv=Tv=bi([Si({type:Ne.Set,itemType:kv})],Mv);var Rv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:sv,context:0,implicit:true,optional:true})],Rv.prototype,"certs",void 0);bi([Ai({type:Mv,context:1,implicit:true,optional:true})],Rv.prototype,"crls",void 0);var Nv;var Kv=Nv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Nv.prototype);return i}return e}(wi);Kv=Nv=bi([Si({type:Ne.Set,itemType:Xf})],Kv);var jv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.recipientInfos=new xv;this.encryptedContentInfo=new hv;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],jv.prototype,"version",void 0);bi([Ai({type:Rv,context:0,implicit:true,optional:true})],jv.prototype,"originatorInfo",void 0);bi([Ai({type:xv})],jv.prototype,"recipientInfos",void 0);bi([Ai({type:hv})],jv.prototype,"encryptedContentInfo",void 0);bi([Ai({type:Kv,context:1,implicit:true,optional:true})],jv.prototype,"unprotectedAttrs",void 0);var Hv;var Uv=Hv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Hv.prototype);return i}return e}(wi);Uv=Hv=bi([Si({type:Ne.Set,itemType:Qf})],Uv);var Fv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.digestAlgorithms=new Uv;this.encapContentInfo=new fv;this.signerInfos=new ev;Object.assign(this,t)}return t}();t("bh",Fv);bi([Ai({type:Ke.Integer})],Fv.prototype,"version",void 0);bi([Ai({type:Uv})],Fv.prototype,"digestAlgorithms",void 0);bi([Ai({type:fv})],Fv.prototype,"encapContentInfo",void 0);bi([Ai({type:sv,context:0,implicit:true,optional:true})],Fv.prototype,"certificates",void 0);bi([Ai({type:Mv,context:1,implicit:true,optional:true})],Fv.prototype,"crls",void 0);bi([Ai({type:ev})],Fv.prototype,"signerInfos",void 0);var Lv;var Vv=function(){function t(t){if(t===void 0){t={}}this.attrId="";this.attrValues=[];Object.assign(t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Vv.prototype,"attrId",void 0);bi([Ai({type:Ke.Any,repeated:"set"})],Vv.prototype,"attrValues",void 0);var Gv=Lv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Lv.prototype);return i}return e}(wi);Gv=Lv=bi([Si({type:Ne.Sequence,itemType:Vv})],Gv);var Wv;var Qv=Wv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Wv.prototype);return i}return e}(wi);Qv=Wv=bi([Si({type:Ne.Sequence,itemType:uv})],Qv);var qv=function(){function t(t){if(t===void 0){t={}}this.certId="";this.certValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],qv.prototype,"certId",void 0);bi([Ai({type:Ke.Any,context:0})],qv.prototype,"certValue",void 0);var zv=function(){function t(t){if(t===void 0){t={}}this.crlId="";this.crltValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],zv.prototype,"crlId",void 0);bi([Ai({type:Ke.Any,context:0})],zv.prototype,"crltValue",void 0);var Yv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ka);Yv=bi([Si({type:Ne.Sequence})],Yv);var Zv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Oa);Zv=bi([Si({type:Ne.Sequence})],Zv);var $v=function(){function t(t){if(t===void 0){t={}}this.secretTypeId="";this.secretValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],$v.prototype,"secretTypeId",void 0);bi([Ai({type:Ke.Any,context:0})],$v.prototype,"secretValue",void 0);var Xv=function(){function t(t){if(t===void 0){t={}}this.mac=new ma;this.macSalt=new He;this.iterations=1;Object.assign(this,t)}return t}();bi([Ai({type:ma})],Xv.prototype,"mac",void 0);bi([Ai({type:He})],Xv.prototype,"macSalt",void 0);bi([Ai({type:Ke.Integer,defaultValue:1})],Xv.prototype,"iterations",void 0);var Jv=function(){function t(t){if(t===void 0){t={}}this.version=3;this.authSafe=new uv;this.macData=new Xv;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Jv.prototype,"version",void 0);bi([Ai({type:uv})],Jv.prototype,"authSafe",void 0);bi([Ai({type:Xv,optional:true})],Jv.prototype,"macData",void 0);var th;var eh=function(){function t(t){if(t===void 0){t={}}this.bagId="";this.bagValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],eh.prototype,"bagId",void 0);bi([Ai({type:Ke.Any,context:0})],eh.prototype,"bagValue",void 0);bi([Ai({type:Vv,repeated:"set",optional:true})],eh.prototype,"bagAttributes",void 0);var ih=th=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,th.prototype);return i}return e}(wi);ih=th=bi([Si({type:Ne.Sequence,itemType:eh})],ih);var rh,nh,ah;var oh="1.2.840.113549.1.9";var sh=t("F","".concat(oh,".2"));var uh=t("G","".concat(oh,".7"));var ch=t("B","".concat(oh,".14"));var fh=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}return t.call(this,e)||this}e.prototype.toString=function(){return this.ia5String||t.prototype.toString.call(this)};return e}(Bi);bi([Ai({type:Ke.IA5String})],fh.prototype,"ia5String",void 0);fh=bi([Si({type:Ne.Choice})],fh);var vh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(uv);vh=bi([Si({type:Ne.Sequence})],vh);var hh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Jv);hh=bi([Si({type:Ne.Sequence})],hh);var dh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Oa);dh=bi([Si({type:Ne.Sequence})],dh);var lh=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.IA5String})],lh.prototype,"value",void 0);lh=bi([Si({type:Ne.Choice})],lh);var ph=t("U",function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(fh));t("U",ph=bi([Si({type:Ne.Choice})],ph));var yh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi);yh=bi([Si({type:Ne.Choice})],yh);var Sh=function(){function t(t){if(t===void 0){t=new Date}this.value=t}return t}();bi([Ai({type:Ke.GeneralizedTime})],Sh.prototype,"value",void 0);Sh=bi([Si({type:Ne.Choice})],Sh);var Ah=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi);Ah=bi([Si({type:Ne.Choice})],Ah);var Ch=function(){function t(t){if(t===void 0){t="M"}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.PrintableString})],Ch.prototype,"value",void 0);Ch=bi([Si({type:Ne.Choice})],Ch);var mh=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.PrintableString})],mh.prototype,"value",void 0);mh=bi([Si({type:Ne.Choice})],mh);var gh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(mh);gh=bi([Si({type:Ne.Choice})],gh);var wh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi);wh=bi([Si({type:Ne.Choice})],wh);var _h=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.ObjectIdentifier})],_h.prototype,"value",void 0);_h=bi([Si({type:Ne.Choice})],_h);var bh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(mn);bh=bi([Si({type:Ne.Choice})],bh);var Eh=function(){function t(t){if(t===void 0){t=0}this.value=t}t.prototype.toString=function(){return this.value.toString()};return t}();bi([Ai({type:Ke.Integer})],Eh.prototype,"value",void 0);Eh=bi([Si({type:Ne.Choice})],Eh);var Ph=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(tv);Ph=bi([Si({type:Ne.Sequence})],Ph);var Dh=t("t",function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi));t("t",Dh=bi([Si({type:Ne.Choice})],Dh));var Ih=t("s",rh=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,rh.prototype);return i}return e}(bn));t("s",Ih=rh=bi([Si({type:Ne.Sequence})],Ih));var Bh=nh=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,nh.prototype);return i}return e}(wi);Bh=nh=bi([Si({type:Ne.Set,itemType:Xf})],Bh);var xh=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.BmpString})],xh.prototype,"value",void 0);xh=bi([Si({type:Ne.Choice})],xh);var Th=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Th=bi([Si({type:Ne.Sequence})],Th);var Oh=ah=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ah.prototype);return i}return e}(wi);Oh=ah=bi([Si({type:Ne.Sequence,itemType:Th})],Oh);var kh=t("z","1.3.6.1.4.1.22112.2.1");var Mh=t("r",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}());bi([Ai({type:Vf})],Mh.prototype,"signer",void 0);bi([Ai({type:Dn,optional:true})],Mh.prototype,"cert",void 0);t("r",Mh=bi([Si({type:Ne.Sequence})],Mh));var Rh;var Nh=Rh=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Rh.prototype);return i}return e}(wi);Nh=Rh=bi([Si({type:Ne.Sequence,itemType:rn})],Nh);var Kh=function(){function t(t){if(t===void 0){t={}}this.version=0;this.subject=new Mi;this.subjectPKInfo=new Cn;this.attributes=new Nh;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Kh.prototype,"version",void 0);bi([Ai({type:Mi})],Kh.prototype,"subject",void 0);bi([Ai({type:Cn})],Kh.prototype,"subjectPKInfo",void 0);bi([Ai({type:Nh,implicit:true,context:0})],Kh.prototype,"attributes",void 0);var jh=function(){function t(t){if(t===void 0){t={}}this.certificationRequestInfo=new Kh;this.signatureAlgorithm=new An;this.signature=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("Y",jh);bi([Ai({type:Kh})],jh.prototype,"certificationRequestInfo",void 0);bi([Ai({type:An})],jh.prototype,"signatureAlgorithm",void 0);bi([Ai({type:Ke.BitString})],jh.prototype,"signature",void 0);var Hh=globalThis.crypto;function Uh(){return Hh}var Fh=function(t){__extends(e,t);function e(e,i){var r=t.call(this,e)||this;r.code=i;r.name=r.constructor.name;if(Error.captureStackTrace){Error.captureStackTrace(r,r.constructor)}return r}return e}(Error);var Lh=function(t){__extends(e,t);function e(e,i){var r=i?" Supported: ".concat(i.join(", ")):"";return t.call(this,"Unsupported algorithm: ".concat(e,".").concat(r),"UNSUPPORTED_ALGORITHM")||this}return e}(Fh);var Vh=function(t){__extends(e,t);function e(e,i){var r=i?" Expected: ".concat(i):"";return t.call(this,"Invalid format: ".concat(e,".").concat(r),"INVALID_FORMAT")||this}return e}(Fh);var Gh=function(t){__extends(e,t);function e(e,i){var r=i?" Supported: ".concat(i.join(", ")):"";return t.call(this,"Unsupported key type: ".concat(e,".").concat(r),"UNSUPPORTED_KEY_TYPE")||this}return e}(Fh);var Wh=function(t){__extends(e,t);function e(e){var i=e?"Invalid SSH private key format: ".concat(e):"Invalid SSH private key format";return t.call(this,i,"INVALID_PRIVATE_KEY_FORMAT")||this}return e}(Fh);var Qh=function(t){__extends(e,t);function e(e){var i=e?"Encrypted SSH private keys are not supported (cipher: ".concat(e,")"):"Encrypted SSH private keys are not supported";return t.call(this,i,"ENCRYPTED_KEY_NOT_SUPPORTED")||this}return e}(Fh);var qh=function(t){__extends(e,t);function e(e){var i=e?"Invalid key data: ".concat(e):"Invalid key data";return t.call(this,i,"INVALID_KEY_DATA")||this}return e}(Fh);var zh=function(t){__extends(e,t);function e(e,i){var r=e!==undefined&&i!==undefined?" Expected ".concat(e," bytes, got ").concat(i):"";return t.call(this,"Unexpected end of data".concat(r),"UNEXPECTED_EOF")||this}return e}(Fh);var Yh=new TextEncoder;var Zh=new TextDecoder;var $h=function(){function t(t){this.buffer=t;this.offset=0}t.prototype.readUint8=function(){if(this.offset>=this.buffer.length){throw new zh(1,0)}return this.buffer[this.offset++]};t.prototype.readUint32=function(){var t=this.readUint8()<<24|this.readUint8()<<16|this.readUint8()<<8|this.readUint8();return t>>>0};t.prototype.readUint64=function(){var t=this.readUint32();var e=this.readUint32();return BigInt(t)<<32n|BigInt(e)};t.prototype.readBytes=function(t){if(t<0){throw new Vh("Invalid length: ".concat(t))}if(this.offset+t>this.buffer.length){throw new zh(t,this.buffer.length-this.offset)}var e=this.buffer.subarray(this.offset,this.offset+t);this.offset+=t;return e};t.prototype.readString=function(){var t=this.readUint32();var e=this.readBytes(t);return Zh.decode(e)};t.prototype.peekString=function(t){if(this.offset+t>this.buffer.length){throw new zh(t,this.buffer.length-this.offset)}var e=this.buffer.subarray(this.offset,this.offset+t);return Zh.decode(e)};t.prototype.readMpInt=function(t){if(t===void 0){t=false}var e=this.readUint32();var i=this.readBytes(e);if(t&&i.length>1&&i[0]===0){return i.subarray(1)}return i};t.prototype.readMpIntSsh=function(){return this.readMpInt(true)};t.prototype.remaining=function(){return this.buffer.length-this.offset};t.prototype.getOffset=function(){return this.offset};t.prototype.seek=function(t){if(t<0||t>this.buffer.length){throw new Vh("Invalid offset: ".concat(t,". Buffer length: ").concat(this.buffer.length))}this.offset=t};return t}();var Xh=function(){function t(t){if(t===void 0){t=1024}this.buffer=new Uint8Array(t);this.offset=0}t.prototype.ensureCapacity=function(t){var e=this.offset+t;if(e>this.buffer.length){var i=Math.max(e,this.buffer.length*2);var r=new Uint8Array(i);r.set(this.buffer.subarray(0,this.offset));this.buffer=r}};t.prototype.reserve=function(t){if(t>this.buffer.length){var e=new Uint8Array(t);e.set(this.buffer.subarray(0,this.offset));this.buffer=e}};t.prototype.writeUint8=function(t){this.ensureCapacity(1);this.buffer[this.offset++]=t&255};t.prototype.writeUint32=function(t){this.ensureCapacity(4);this.buffer[this.offset++]=t>>>24&255;this.buffer[this.offset++]=t>>>16&255;this.buffer[this.offset++]=t>>>8&255;this.buffer[this.offset++]=t&255};t.prototype.writeUint64=function(t){this.ensureCapacity(8);var e=Number(t>>32n);var i=Number(t&0xffffffffn);this.writeUint32(e);this.writeUint32(i)};t.prototype.writeBytes=function(t){this.ensureCapacity(t.length);this.buffer.set(t,this.offset);this.offset+=t.length};t.prototype.writeString=function(t){var e=Yh.encode(t);this.writeUint32(e.length);this.writeBytes(e)};t.prototype.writeMpInt=function(t,e){if(e===void 0){e=false}if(e&&t.length>0&&(t[0]&128)!==0){var i=new Uint8Array(t.length+1);i[0]=0;i.set(t,1);this.writeUint32(i.length);this.writeBytes(i)}else{this.writeUint32(t.length);this.writeBytes(t)}};t.prototype.writeMpIntSsh=function(t){this.writeMpInt(t,true)};t.prototype.toUint8Array=function(){return this.buffer.subarray(0,this.offset)};t.prototype.getOffset=function(){return this.offset};t.prototype.seek=function(t){if(t<0||t>this.buffer.length){throw new Vh("Invalid offset")}this.offset=t};return t}();var Jh=function(){function t(t){if(t===void 0){t="SHA-256"}this.hash="SHA-256";this.hash=t}t.prototype.importPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){e=t.blob,i=t.crypto;r=new $h(e);r.readString();n=r.readMpInt(true);a=r.readMpInt(true);o={kty:"RSA",n:u.Convert.ToBase64Url(a),e:u.Convert.ToBase64Url(n)};return[2,i.subtle.importKey("jwk",o,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])]}))}))};t.prototype.exportPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){switch(s.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("jwk",e)];case 1:r=s.sent();if(!r.n||!r.e){throw new qh("RSA JWK missing required parameters (n, e)")}n=u.BufferSourceConverter.toUint8Array(u.Convert.FromBase64Url(r.n));a=u.BufferSourceConverter.toUint8Array(u.Convert.FromBase64Url(r.e));o=new Xh;o.writeString("ssh-rsa");o.writeMpInt(a,true);o.writeMpInt(n,true);return[2,o.toUint8Array()]}}))}))};t.prototype.importPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.spki,i=t.crypto;return[2,i.subtle.importKey("spki",e,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])]}))}))};t.prototype.exportPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("spki",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.pkcs8,i=t.crypto;return[2,i.subtle.importKey("pkcs8",e,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])]}))}))};t.prototype.exportPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.privateKey,i=t.crypto;return[4,i.subtle.exportKey("pkcs8",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d,l,p,y,S,A,C,m,g,w,_,b,E,P,D,I,B;return __generator(this,(function(x){e=t.sshKey,i=t.crypto;r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=u.Convert.FromBase64(r);a=new $h(u.BufferSourceConverter.toUint8Array(n));o=a.readBytes(15);if(u.Convert.ToHex(o)!=="6f70656e7373682d6b65792d763100"){throw new Wh("invalid magic string")}s=a.readString();a.readString();a.readString();if(s!=="none"){throw new Qh(s)}c=a.readUint32();if(c!==1){throw new Wh("multiple keys not supported")}f=a.readUint32();a.readBytes(f);v=a.readUint32();h=a.readBytes(v);d=new $h(h);l=d.readUint32();p=d.readUint32();if(l!==p){throw new Wh("invalid checkints")}d.readString();y=d.readMpInt(true);S=d.readMpInt(true);A=d.readMpInt(true);C=d.readMpInt(true);m=d.readMpInt(true);g=d.readMpInt(true);d.readString();w=BigInt("0x"+u.Convert.ToHex(A));_=BigInt("0x"+u.Convert.ToHex(m));b=BigInt("0x"+u.Convert.ToHex(g));E=w%(_-1n);P=w%(b-1n);D=u.Convert.FromHex(E.toString(16).padStart(m.length*2,"0"));I=u.Convert.FromHex(P.toString(16).padStart(g.length*2,"0"));B={kty:"RSA",n:u.Convert.ToBase64Url(y),e:u.Convert.ToBase64Url(S),d:u.Convert.ToBase64Url(A),p:u.Convert.ToBase64Url(m),q:u.Convert.ToBase64Url(g),dp:u.Convert.ToBase64Url(D),dq:u.Convert.ToBase64Url(I),qi:u.Convert.ToBase64Url(C)};return[2,i.subtle.importKey("jwk",B,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])]}))}))};t.prototype.exportPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d;return __generator(this,(function(l){switch(l.label){case 0:e=t.privateKey,i=t.crypto,r=t.jwk;a=r;if(a)return[3,2];return[4,i.subtle.exportKey("jwk",e)];case 1:a=l.sent();l.label=2;case 2:n=a;if(!n.n||!n.e||!n.d||!n.p||!n.q){throw new qh("RSA JWK missing required parameters")}o=new Uint8Array(u.Convert.FromBase64Url(n.n));s=new Uint8Array(u.Convert.FromBase64Url(n.e));c=new Uint8Array(u.Convert.FromBase64Url(n.d));f=new Uint8Array(u.Convert.FromBase64Url(n.p));v=new Uint8Array(u.Convert.FromBase64Url(n.q));h=n.qi?new Uint8Array(u.Convert.FromBase64Url(n.qi)):new Uint8Array;d=new Xh;d.writeString("ssh-rsa");d.writeMpInt(o,true);d.writeMpInt(s,true);d.writeMpInt(c,true);d.writeMpInt(h,true);d.writeMpInt(f,true);d.writeMpInt(v,true);return[2,d.toUint8Array()]}}))}))};t.prototype.sign=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(c){switch(c.label){case 0:e=t.privateKey,i=t.data,r=t.crypto,n=t.hash;if(n&&n!==this.hash){throw new qh("Hash ".concat(n," not supported for this RSA algorithm"))}if(!e.extractable){throw new qh("Private key is not extractable")}return[4,this.exportPrivatePkcs8({privateKey:e,crypto:r})];case 1:a=c.sent();return[4,this.importPrivatePkcs8({pkcs8:new Uint8Array(a),crypto:r})];case 2:o=c.sent();return[4,r.subtle.sign("RSASSA-PKCS1-v1_5",o,i)];case 3:s=c.sent();return[2,u.BufferSourceConverter.toUint8Array(s)]}}))}))};t.prototype.verify=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(u){switch(u.label){case 0:e=t.publicKey,i=t.signature,r=t.data,n=t.crypto,a=t.hash;if(a&&a!==this.hash){return[2,false]}if(!e.extractable){throw new qh("Public key is not extractable")}return[4,this.exportPublicSpki({publicKey:e,crypto:n})];case 1:o=u.sent();return[4,this.importPublicSpki({spki:new Uint8Array(o),crypto:n})];case 2:s=u.sent();return[2,n.subtle.verify("RSASSA-PKCS1-v1_5",s,i,r)]}}))}))};t.prototype.encodeSignature=function(t){var e=t.signature,i=t.algo;var r=new Xh;r.writeString(i);r.writeUint32(e.byteLength);r.writeBytes(e);return r.toUint8Array()};t.prototype.decodeSignature=function(t){var e=t.signature;var i=new $h(e);var r=i.readString();var n=i.readUint32();var a=i.readBytes(n);return{signature:a,algo:r}};t.prototype.supportsCryptoKey=function(t){return t.algorithm.name==="RSASSA-PKCS1-v1_5"};t.prototype.parsePublicKey=function(t){var e=t.readBytes(t.readUint32());var i=t.readBytes(t.readUint32());var r=new Xh;r.writeString("ssh-rsa");r.writeMpInt(e);r.writeMpInt(i);return{type:"ssh-rsa",keyData:r.toUint8Array()}};t.prototype.writePublicKey=function(t,e){var i=new $h(e.keyData);i.readString();var r=i.readMpInt();var n=i.readMpInt();t.writeUint32(r.length);t.writeBytes(r);t.writeUint32(n.length);t.writeBytes(n)};t.prototype.getCertificateType=function(){return"ssh-rsa-cert-v01@openssh.com"};t.prototype.getSignatureAlgo=function(){return this.hash==="SHA-256"?"rsa-sha2-256":"rsa-sha2-512"};return t}();var td=function(){function t(t,e,i){this.curveName=t;this.sshType=e;this.namedCurve=i}t.prototype.getHashAlgorithm=function(){switch(this.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:return"SHA-256"}};t.prototype.getExpectedLength=function(){switch(this.namedCurve){case"P-256":return 32;case"P-384":return 48;case"P-521":return 66;default:return 32}};t.prototype.getSignatureCoordLength=function(){return this.getExpectedLength()};t.prototype.importPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(c){e=t.blob,i=t.crypto;r=new $h(e);r.readString();n=r.readString();if(n!==this.curveName){throw new qh("ECDSA curve name ".concat(n,", expected ").concat(this.curveName))}a=r.readMpInt();o=Math.floor((a.length-1)/2);s={kty:"EC",crv:this.namedCurve,x:u.Convert.ToBase64Url(a.slice(1,1+o)),y:u.Convert.ToBase64Url(a.slice(1+o))};return[2,i.subtle.importKey("jwk",s,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])]}))}))};t.prototype.exportPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(c){switch(c.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("jwk",e)];case 1:r=c.sent();if(!r.x||!r.y){throw new qh("ECDSA JWK missing x or y parameters")}n=new Uint8Array(u.Convert.FromBase64Url(r.x));a=new Uint8Array(u.Convert.FromBase64Url(r.y));o=new Uint8Array(1+n.length+a.length);o[0]=4;o.set(n,1);o.set(a,1+n.length);s=new Xh;s.writeString(this.sshType);s.writeString(this.curveName);s.writeMpInt(o);return[2,s.toUint8Array()]}}))}))};t.prototype.importPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.spki,i=t.crypto;return[2,i.subtle.importKey("spki",e,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])]}))}))};t.prototype.exportPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("spki",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.pkcs8,i=t.crypto;return[2,i.subtle.importKey("pkcs8",e,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])]}))}))};t.prototype.exportPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.privateKey,i=t.crypto;return[4,i.subtle.exportKey("pkcs8",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.exportPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v;return __generator(this,(function(h){switch(h.label){case 0:e=t.privateKey,i=t.crypto,r=t.jwk;a=r;if(a)return[3,2];return[4,i.subtle.exportKey("jwk",e)];case 1:a=h.sent();h.label=2;case 2:n=a;if(!n.d||!n.x||!n.y){throw new qh("ECDSA private key JWK missing required parameters")}o=new Uint8Array(u.Convert.FromBase64Url(n.x));s=new Uint8Array(u.Convert.FromBase64Url(n.y));c=new Uint8Array(u.Convert.FromBase64Url(n.d));f=new Uint8Array(1+o.length+s.length);f[0]=4;f.set(o,1);f.set(s,1+o.length);v=new Xh;v.writeString(this.sshType);v.writeString(this.curveName);v.writeMpInt(f);v.writeMpInt(c);return[2,v.toUint8Array()]}}))}))};t.prototype.importPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d,l,p,y,S,A,C,m,g;return __generator(this,(function(w){e=t.sshKey,i=t.crypto;r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=u.Convert.FromBase64(r);a=new $h(u.BufferSourceConverter.toUint8Array(n));o=a.readBytes(15);if(u.Convert.ToHex(o)!=="6f70656e7373682d6b65792d763100"){throw new Wh("invalid magic string")}s=a.readString();a.readString();a.readString();if(s!=="none"){throw new Qh(s)}c=a.readUint32();if(c!==1){throw new Wh("multiple keys not supported")}f=a.readUint32();a.readBytes(f);v=a.readUint32();h=a.readBytes(v);d=new $h(h);l=d.readUint32();p=d.readUint32();if(l!==p){throw new Wh("invalid checkints")}d.readString();d.readString();y=d.readMpInt();S=d.readMpInt();d.readString();if(y[0]!==4){throw new qh("invalid ECDSA public key point format")}A=Math.floor((y.length-1)/2);C=y.slice(1,1+A);m=y.slice(1+A);g={kty:"EC",crv:this.namedCurve,x:u.Convert.ToBase64Url(C),y:u.Convert.ToBase64Url(m),d:u.Convert.ToBase64Url(S)};return[2,i.subtle.importKey("jwk",g,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])]}))}))};t.prototype.sign=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){switch(s.label){case 0:e=t.privateKey,i=t.data,r=t.crypto,n=t.hash;a=this.getHashAlgorithm();if(n&&n!==a){throw new qh("ECDSA ".concat(this.namedCurve," requires ").concat(a,", got ").concat(n))}return[4,r.subtle.sign({name:"ECDSA",hash:a},e,i)];case 1:o=s.sent();return[2,u.BufferSourceConverter.toUint8Array(o)]}}))}))};t.prototype.verify=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){e=t.publicKey,i=t.signature,r=t.data,n=t.crypto,a=t.hash;o=this.getHashAlgorithm();if(a&&a!==o){throw new qh("ECDSA ".concat(this.namedCurve," requires ").concat(o,", got ").concat(a))}return[2,n.subtle.verify({name:"ECDSA",hash:o},e,i,r)]}))}))};t.prototype.encodeSignature=function(t){var e=t.signature,i=t.algo;if(i.startsWith("ecdsa-sha2-")){var r=this.getSignatureCoordLength();var n=e.subarray(0,r);var a=e.subarray(r);var o=new Xh;o.writeString(i);var s=new Xh;s.writeMpInt(n,true);s.writeMpInt(a,true);var u=s.toUint8Array();o.writeUint32(u.length);o.writeBytes(u);return o.toUint8Array()}var c=new Xh;c.writeString(i);c.writeUint32(e.byteLength);c.writeBytes(e);return c.toUint8Array()};t.prototype.decodeSignature=function(t){var e=t.signature;var i=new $h(e);var r=i.readString();var n=i.readUint32();var a=i.readBytes(n);if(r.startsWith("ecdsa-sha2-")){var o=new $h(a);var s=o.readMpInt();var u=o.readMpInt();if(s[0]===0&&s.length>1&&(s[1]&128)===0){s=s.slice(1)}if(u[0]===0&&u.length>1&&(u[1]&128)===0){u=u.slice(1)}var c=this.getExpectedLength();var f=new Uint8Array(c);var v=new Uint8Array(c);if(s.length<=c){f.set(s,c-s.length)}else{f.set(s.slice(s.length-c),0)}if(u.length<=c){v.set(u,c-u.length)}else{v.set(u.slice(u.length-c),0)}var h=new Uint8Array(__spreadArray(__spreadArray([],f,true),v,true));return{signature:h,algo:r}}return{signature:a,algo:r}};t.prototype.supportsCryptoKey=function(t){return t.algorithm.name==="ECDSA"&&t.algorithm.namedCurve===this.namedCurve};t.prototype.parsePublicKey=function(t){var e=t.readString();if(e!==this.curveName){throw new qh("ECDSA certificate curve name ".concat(e,", expected ").concat(this.curveName))}var i=t.readBytes(t.readUint32());var r=new Xh;r.writeString(this.sshType);r.writeString(e);r.writeMpInt(i);return{type:this.sshType,keyData:r.toUint8Array()}};t.prototype.writePublicKey=function(t,e){var i=new $h(e.keyData);i.readString();var r=i.readString();var n=i.readMpInt();t.writeString(r);t.writeUint32(n.length);t.writeBytes(n)};t.prototype.getCertificateType=function(){return"".concat(this.sshType,"-cert-v01@openssh.com")};t.prototype.getSignatureAlgo=function(){return this.sshType};return t}();var ed=new td("nistp256","ecdsa-sha2-nistp256","P-256");var id=new td("nistp384","ecdsa-sha2-nistp384","P-384");var rd=new td("nistp521","ecdsa-sha2-nistp521","P-521");var nd=function(){function t(){}t.prototype.importPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a;return __generator(this,(function(o){e=t.blob,i=t.crypto;r=new $h(e);r.readString();n=r.readUint32();if(n!==32){throw new qh("Ed25519 key length ".concat(n,", expected 32"))}a=r.readBytes(n);return[2,i.subtle.importKey("raw",a,"Ed25519",true,["verify"])]}))}))};t.prototype.exportPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a;return __generator(this,(function(o){switch(o.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("jwk",e)];case 1:r=o.sent();if(!r.x){throw new qh("Ed25519 JWK missing x parameter")}n=new Uint8Array(u.Convert.FromBase64Url(r.x));a=new Xh;a.writeString("ssh-ed25519");a.writeUint32(n.length);a.writeBytes(n);return[2,a.toUint8Array()]}}))}))};t.prototype.importPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.spki,i=t.crypto;return[2,i.subtle.importKey("spki",e,"Ed25519",true,["verify"])]}))}))};t.prototype.exportPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("spki",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.pkcs8,i=t.crypto;return[2,i.subtle.importKey("pkcs8",e,"Ed25519",true,["sign"])]}))}))};t.prototype.exportPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.privateKey,i=t.crypto;return[4,i.subtle.exportKey("pkcs8",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.exportPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f;return __generator(this,(function(v){switch(v.label){case 0:e=t.privateKey,i=t.crypto,r=t.jwk;a=r;if(a)return[3,2];return[4,i.subtle.exportKey("jwk",e)];case 1:a=v.sent();v.label=2;case 2:n=a;if(!n.d||!n.x){throw new qh("Ed25519 private key JWK missing required parameters")}o=new Uint8Array(u.Convert.FromBase64Url(n.d));s=new Uint8Array(u.Convert.FromBase64Url(n.x));c=new Xh;c.writeString("ssh-ed25519");c.writeUint32(s.length);c.writeBytes(s);f=new Uint8Array(64);f.set(o,0);f.set(s,32);c.writeUint32(f.length);c.writeBytes(f);return[2,c.toUint8Array()]}}))}))};t.prototype.importPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d,l,p,y,S,A,C,m,g;return __generator(this,(function(w){e=t.sshKey,i=t.crypto;r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=u.Convert.FromBase64(r);a=new $h(u.BufferSourceConverter.toUint8Array(n));o=a.readBytes(15);if(u.Convert.ToHex(o)!=="6f70656e7373682d6b65792d763100"){throw new Wh("invalid magic string")}s=a.readString();a.readString();a.readString();if(s!=="none"){throw new Qh(s)}c=a.readUint32();if(c!==1){throw new Wh("multiple keys not supported")}f=a.readUint32();a.readBytes(f);v=a.readUint32();h=a.readBytes(v);d=new $h(h);l=d.readUint32();p=d.readUint32();if(l!==p){throw new Wh("invalid checkints")}d.readString();y=d.readUint32();S=d.readBytes(y);A=d.readUint32();C=d.readBytes(A);d.readString();m=C.slice(0,32);g={kty:"OKP",crv:"Ed25519",d:u.Convert.ToBase64Url(m),x:u.Convert.ToBase64Url(S)};return[2,i.subtle.importKey("jwk",g,"Ed25519",true,["sign"])]}))}))};t.prototype.sign=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n;return __generator(this,(function(a){switch(a.label){case 0:e=t.privateKey,i=t.data,r=t.crypto;return[4,r.subtle.sign("Ed25519",e,i)];case 1:n=a.sent();return[2,u.BufferSourceConverter.toUint8Array(n)]}}))}))};t.prototype.verify=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n;return __generator(this,(function(a){e=t.publicKey,i=t.signature,r=t.data,n=t.crypto;return[2,n.subtle.verify("Ed25519",e,i,r)]}))}))};t.prototype.encodeSignature=function(t){var e=t.signature,i=t.algo;var r=new Uint8Array(e);var n=new Xh;n.writeString(i);n.writeUint32(r.length);n.writeBytes(r);return n.toUint8Array()};t.prototype.decodeSignature=function(t){var e=t.signature;var i=new $h(e);var r=i.readString();var n=i.readUint32();var a=i.readBytes(n);return{signature:a,algo:r}};t.prototype.supportsCryptoKey=function(t){return t.algorithm.name==="Ed25519"};t.prototype.parsePublicKey=function(t){var e=t.readBytes(t.readUint32());var i=new Xh;i.writeString("ssh-ed25519");i.writeUint32(e.length);i.writeBytes(e);return{type:"ssh-ed25519",keyData:i.toUint8Array()}};t.prototype.writePublicKey=function(t,e){var i=new $h(e.keyData);i.readString();var r=i.readUint32();var n=i.readBytes(r);t.writeUint32(n.length);t.writeBytes(n)};t.prototype.getCertificateType=function(){return"ssh-ed25519-cert-v01@openssh.com"};t.prototype.getSignatureAlgo=function(){return"ssh-ed25519"};return t}();var ad=new Map;var od=function(){function t(){}t.get=function(t){var e=ad.get(t);if(!e){throw new Gh(t,Array.from(ad.keys()))}return e};t.register=function(t,e){ad.set(t,e)};t.getSshTypeFromCryptoKey=function(t){for(var e=0,i=ad.entries();e<i.length;e++){var r=i[e],n=r[0],a=r[1];if(a.supportsCryptoKey(t)){return n}}throw new Gh(t.algorithm.name,Array.from(ad.keys()))};t.certTypeToKeyType=function(t){var e={"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"};return e[t]};t.getSupportedCertTypes=function(){return Object.keys({"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"})};return t}();od.register("ssh-ed25519",new nd);od.register("ssh-rsa",new Jh("SHA-256"));od.register("rsa-sha2-256",new Jh("SHA-256"));od.register("rsa-sha2-512",new Jh("SHA-512"));od.register("ecdsa-sha2-nistp256",ed);od.register("ecdsa-sha2-nistp384",id);od.register("ecdsa-sha2-nistp521",rd);function sd(t){var e=typeof t==="string"?t.trim().split(/\s+/):null;if(!e||e.length<2){throw new Vh("Invalid SSH public key format")}var i=e[0];var r=new Uint8Array(u.Convert.FromBase64(e[1]));var n=e.length>2?e.slice(2).join(" "):undefined;var a=new $h(r);var o=a.readString();if(o!==i){throw new Vh("Key type mismatch")}return{type:i,keyData:r,comment:n}}function ud(t){var e=u.Convert.ToBase64(t.keyData);var i=[t.type,e];if(t.comment){i.push(t.comment)}return i.join(" ")}function cd(t){if(typeof t==="string"){var e=t.trim().split(/\s+/);if(e.length<2){throw new Vh("SSH certificate string","type base64 [comment]")}var i=e[0];var r=new Uint8Array(u.Convert.FromBase64(e[1]));var n=e.length>2?e.slice(2).join(" "):undefined;var a=new $h(r);var o=a.readString();if(o!==i){throw new Vh("certificate blob type ".concat(o),"expected ".concat(i))}return{type:i,keyData:r,comment:n}}else{var a=new $h(t);var s=a.readString();var c=t.slice(a.getOffset());return{type:s,keyData:c}}}function fd(t){var e=new $h(t);var i=e.readString();var r=e.readBytes(e.readUint32());var n=od.certTypeToKeyType(i);if(!n){throw new Lh(i,od.getSupportedCertTypes())}var a=od.get(n);var o=a.parsePublicKey(e);var s=n;var u=e.readUint64();var c=e.readUint32();var f=c===1?"user":"host";var v=e.readString();var h=e.readUint32();var d=e.readBytes(h);var l=[];if(d.length>0){var p=new $h(d);while(p.getOffset()<d.length){try{var y=p.readString();l.push(y)}catch(t){break}}}var S=e.readUint64();var A=e.readUint64();var C={};var m=e.readUint32();var g=e.readBytes(m);if(g.length>0){var w=new $h(g);while(w.getOffset()<g.length){try{var _=w.readString();var b=w.readBytes(w.readUint32());var E=b.length===0?"":Zh.decode(b);C[_]=E}catch(t){break}}}var P={};var D=e.readUint32();var I=e.readBytes(D);if(I.length>0){var B=new $h(I);while(B.getOffset()<I.length){try{var x=B.readString();var b=B.readBytes(B.readUint32());var T=b.length===0?"":Zh.decode(b);P[x]=T}catch(t){break}}}var O=e.readUint32();var k=e.readBytes(O);var M=e.readUint32();var R=e.readBytes(M);var N=new $h(R);var K=N.readString();var j={type:K,keyData:R};var H=e.readUint32();var U=e.readBytes(H);return{nonce:r,keyType:s,publicKey:o,serial:u,type:f,keyId:v,validPrincipals:l,validAfter:S,validBefore:A,criticalOptions:C,extensions:P,reserved:k,signatureKey:j,signature:U}}function vd(t){var e=u.Convert.ToBase64(t.keyData);var i=[t.type,e];if(t.comment){i.push(t.comment)}return i.join(" ")}function hd(t){var e=new $h(t);if(t.length>=6&&(new TextDecoder).decode(t.subarray(0,6))==="SSHSIG"){return dd(e)}else{return ld(e)}}function dd(t){var e=t.readBytes(6);var i=(new TextDecoder).decode(e);if(i!=="SSHSIG"){throw new Vh(i,"SSHSIG")}var r=t.readUint32();var n=t.readUint32();var a=t.readBytes(n);var o=t.readString();var s=t.readString();var u=t.readString();var c=t.readUint32();var f=t.readBytes(c);var v=new $h(f);var h=v.readString();var d=v.readUint32();var l=v.readBytes(d);return{format:"ssh-signature",algorithm:h,signature:l,version:r,publicKey:a,namespace:o,reserved:s,hashAlgorithm:u}}function ld(t){var e=t.readString();var i=t.readUint32();var r=t.readBytes(i);return{format:"legacy",algorithm:e,signature:r}}function pd(t){if(t.format==="ssh-signature"){return yd(t)}else{return Sd(t)}}function yd(t){var e=new Xh;e.writeBytes((new TextEncoder).encode("SSHSIG"));e.writeUint32(t.version||1);if(t.publicKey){e.writeUint32(t.publicKey.length);e.writeBytes(t.publicKey)}else{e.writeUint32(0)}e.writeString(t.namespace||"file");e.writeString(t.reserved||"");e.writeString(t.hashAlgorithm||"sha512");var i=new Xh;i.writeString(t.algorithm);i.writeUint32(t.signature.length);i.writeBytes(t.signature);var r=i.toUint8Array();e.writeUint32(r.length);e.writeBytes(r);return e.toUint8Array()}function Sd(t){var e=new Xh;e.writeString(t.algorithm);e.writeUint32(t.signature.length);e.writeBytes(t.signature);return e.toUint8Array()}var Ad=function(){function t(){}return t}();var Cd=function(t){__extends(e,t);function e(i){var r=t.call(this)||this;r.type=e.TYPE;r.blob=i;return r}e.prototype.getCryptoKey=function(){return __awaiter(this,arguments,void 0,(function(t){var e,i;if(t===void 0){t=Uh()}return __generator(this,(function(r){switch(r.label){case 0:if(!!this.cachedCryptoKey)return[3,2];e=od.get(this.blob.type);i=this;return[4,e.importPublicSsh({blob:this.blob.keyData,crypto:t})];case 1:i.cachedCryptoKey=r.sent();r.label=2;case 2:return[2,this.cachedCryptoKey]}}))}))};e.fromSSH=function(t){return __awaiter(this,arguments,void 0,(function(t,i){var r,n;if(i===void 0){i=Uh()}return __generator(this,(function(a){switch(a.label){case 0:r=sd(t);n=od.get(r.type);return[4,n.importPublicSsh({blob:r.keyData,crypto:i})];case 1:a.sent();return[2,new e(r)]}}))}))};e.fromSPKI=function(t,i){return __awaiter(this,arguments,void 0,(function(t,i,r){var n,a,o,s;if(r===void 0){r=Uh()}return __generator(this,(function(u){switch(u.label){case 0:n=od.get(i);return[4,n.importPublicSpki({spki:t,crypto:r})];case 1:a=u.sent();return[4,n.exportPublicSsh({publicKey:a,crypto:r})];case 2:o=u.sent();s={type:i,keyData:o};return[2,new e(s)]}}))}))};e.fromWebCrypto=function(t,i){return __awaiter(this,arguments,void 0,(function(t,i,r){var n,a,o,s;if(r===void 0){r=Uh()}return __generator(this,(function(u){switch(u.label){case 0:n=i||od.getSshTypeFromCryptoKey(t);a=od.get(n);return[4,a.exportPublicSsh({publicKey:t,crypto:r})];case 1:o=u.sent();s={type:n,keyData:o};return[2,new e(s)]}}))}))};e.prototype.export=function(){return __awaiter(this,arguments,void 0,(function(t,e){var i,r,n;if(t===void 0){t="ssh"}if(e===void 0){e=Uh()}return __generator(this,(function(a){switch(a.label){case 0:if(!(t==="ssh"))return[3,1];return[2,ud(this.blob)];case 1:if(!(t==="spki"))return[3,4];return[4,this.getCryptoKey(e)];case 2:i=a.sent();r=od.get(this.blob.type);return[4,r.exportPublicSpki({publicKey:i,crypto:e})];case 3:n=a.sent();return[2,new Uint8Array(n)];case 4:throw new Gh("Unsupported export format: ".concat(t))}}))}))};e.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.export("ssh")];case 1:t=e.sent();return[2,t]}}))}))};e.prototype.toSPKI=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.export("spki")];case 1:t=e.sent();return[2,t]}}))}))};e.prototype.toWebCrypto=function(){return __awaiter(this,arguments,void 0,(function(t){if(t===void 0){t=Uh()}return __generator(this,(function(e){return[2,this.getCryptoKey(t)]}))}))};e.prototype.verify=function(t,e,i){return __awaiter(this,arguments,void 0,(function(t,e,i,r){var n,a;if(r===void 0){r=Uh()}return __generator(this,(function(o){switch(o.label){case 0:n=od.get(t);return[4,this.toWebCrypto(r)];case 1:a=o.sent();return[2,n.verify({publicKey:a,signature:e,data:i,crypto:r})]}}))}))};Object.defineProperty(e.prototype,"keyType",{get:function(){return this.blob.type},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"comment",{get:function(){return this.blob.comment},enumerable:false,configurable:true});e.prototype.getBlob=function(){return __assign({},this.blob)};e.prototype.thumbprint=function(){return __awaiter(this,arguments,void 0,(function(t,e){var i,r,n;if(t===void 0){t="sha256"}if(e===void 0){e=Uh()}return __generator(this,(function(a){switch(a.label){case 0:i=t==="sha256"?"SHA-256":"SHA-512";r=this.blob.keyData;return[4,e.subtle.digest(i,r)];case 1:n=a.sent();return[2,new Uint8Array(n)]}}))}))};e.TYPE="public-key";return e}(Ad);var md=function(t){__extends(e,t);function e(i){var r=t.call(this)||this;r.type=e.TYPE;r.blob=i;r.format=i.format;r.algorithm=i.algorithm;r.signature=i.signature;r.version=i.version;r.namespace=i.namespace;r.reserved=i.reserved;r.hashAlgorithm=i.hashAlgorithm;if(i.publicKey){var n=new $h(i.publicKey);var a=n.readString();r.publicKey=new Cd({type:a,keyData:i.publicKey})}return r}e.parse=function(t){var i=hd(t);return new e(i)};e.fromBlob=function(t){return new e(t)};e.fromBase64=function(t){var i=new Uint8Array(u.Convert.FromBase64(t));return e.parse(i)};e.fromText=function(t){var i=t.replace(/-----BEGIN SSH SIGNATURE-----/,"").replace(/-----END SSH SIGNATURE-----/,"").replace(/[\r\n\s]/g,"");return e.fromBase64(i)};e.prototype.serialize=function(){return pd(this.blob)};e.prototype.toBase64=function(){return u.Convert.ToBase64(this.serialize())};e.prototype.toText=function(){var t=this.toBase64();var e=[];for(var i=0;i<t.length;i+=70){e.push(t.substring(i,i+70))}return __spreadArray(__spreadArray(["-----BEGIN SSH SIGNATURE-----"],e,true),["-----END SSH SIGNATURE-----"],false).join("\n")};e.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.toText()]}))}))};e.prototype.verify=function(t,e){return __awaiter(this,void 0,void 0,(function(){var i,r,n,a,o,s,u,c,f,v,h,d,l,p,y,S;return __generator(this,(function(A){switch(A.label){case 0:i=od.get(this.algorithm);return[4,e["getCryptoKey"]()];case 1:r=A.sent();n=Uh();a=t;if(!(this.format==="ssh-signature"))return[3,3];o=this.hashAlgorithm||"sha512";s=this.namespace||"file";u=this.reserved||"";c=o==="sha256"?"SHA-256":"SHA-512";return[4,n.subtle.digest(c,t)];case 2:f=A.sent();v=new Uint8Array(f);h=new Xh;h.writeBytes((new TextEncoder).encode("SSHSIG"));h.writeString(s);h.writeString(u);h.writeString(o);h.writeUint32(v.length);h.writeBytes(v);a=h.toUint8Array();A.label=3;case 3:if(this.algorithm==="rsa-sha2-256"){d="SHA-256"}else if(this.algorithm==="rsa-sha2-512"){d="SHA-512"}if(this.format==="legacy"||this.format==="ssh-signature"){p=new Xh;p.writeString(this.algorithm);p.writeUint32(this.signature.length);p.writeBytes(this.signature);y=p.toUint8Array();S=i.decodeSignature({signature:y});l=S.signature}else{l=this.signature}return[2,i.verify({publicKey:r,signature:l,data:a,crypto:n,hash:d})]}}))}))};e.fromLegacy=function(t,i){var r=od.get(t);var n=r.encodeSignature({signature:i,algo:t});var a=new $h(n);a.readString();var o=a.readUint32();var s=a.readBytes(o);return new e({format:"legacy",algorithm:t,signature:s})};e.fromSshSignature=function(t,i,r){if(r===void 0){r={}}var n={format:"ssh-signature",algorithm:t,signature:i,version:r.version||1,publicKey:r.publicKey?r.publicKey.getBlob().keyData:undefined,namespace:r.namespace||"file",reserved:r.reserved||"",hashAlgorithm:r.hashAlgorithm||"sha512"};return new e(n)};e.sign=function(t,i,r){return __awaiter(this,arguments,void 0,(function(t,i,r,n){var a,o,s,u,c,f,v,h,d,l,p,y,S,A,C,m,c,g,w,_,b;if(n===void 0){n={}}return __generator(this,(function(E){switch(E.label){case 0:a=n.format,o=a===void 0?"legacy":a,s=n.namespace,u=s===void 0?"file":s;if(!(o==="legacy"))return[3,2];return[4,i.sign(t,r)];case 1:c=E.sent();f=t||i.keyType;return[2,e.fromLegacy(f,c)];case 2:v=t;h=od.get(v);d=t==="rsa-sha2-256"?"sha256":"sha512";return[4,i.getPublicKey()];case 3:l=E.sent();p=Uh();y=d==="sha256"?"SHA-256":"SHA-512";return[4,p.subtle.digest(y,r)];case 4:S=E.sent();A=new Uint8Array(S);C=new Xh;C.writeBytes((new TextEncoder).encode("SSHSIG"));C.writeString(u);C.writeString("");C.writeString(d);C.writeUint32(A.length);C.writeBytes(A);m=C.toUint8Array();return[4,i.sign(v,m)];case 5:c=E.sent();g=h.encodeSignature({signature:c,algo:v});w=new $h(g);w.readString();_=w.readUint32();b=w.readBytes(_);return[2,e.fromSshSignature(v,b,{namespace:u,hashAlgorithm:d,publicKey:l})]}}))}))};e.TYPE="signature";return e}(Ad);var gd=(i=function(t){__extends(e,t);function e(e){var r=t.call(this)||this;r.type=i.TYPE;r._blob=e;r.data=fd(e.keyData);r._validAfter=r.data.validAfter;r._validBefore=r.data.validBefore;r.keyId=r.data.keyId;r.principals=r.data.validPrincipals;r.certType=r.data.type;r.serial=r.data.serial;r.validAfter=new Date(Number(r.data.validAfter)*1e3);r.validBefore=new Date(Number(r.data.validBefore)*1e3);r.publicKey=new Cd(r.data.publicKey);r.signatureKey=new Cd(r.data.signatureKey);r.criticalOptions=__assign({},r.data.criticalOptions);r.extensions=__assign({},r.data.extensions);return r}e.fromSSH=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){e=cd(t);return[2,new i(e)]}))}))};e.fromBlob=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,new i(t)]}))}))};e.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,vd(this._blob)]}))}))};e.prototype.toBlob=function(){return __assign({},this._blob)};Object.defineProperty(e.prototype,"blob",{get:function(){return this.toBlob()},enumerable:false,configurable:true});e.prototype.validate=function(t){if(t===void 0){t=new Date}var e=BigInt(Math.floor(t.getTime()/1e3));var i=this._validAfter;var r=this._validBefore;var n=0xffffffffffffffffn;var a=r===n?e:r;return e>=i&&e<=a};e.prototype.verify=function(t){return __awaiter(this,arguments,void 0,(function(t,e){var i,r,n,a,o;if(e===void 0){e=Uh()}return __generator(this,(function(s){switch(s.label){case 0:i=t||this.signatureKey;r=this.getSignedData();n=md.parse(this.data.signature);a=od.get(n.algorithm);return[4,i.toWebCrypto(e)];case 1:o=s.sent();return[2,a.verify({publicKey:o,signature:n.signature,data:r,crypto:e})]}}))}))};e.prototype.getSignedData=function(){var t=new $h(this._blob.keyData);t.readString();t.readBytes(t.readUint32());if(this.data.keyType==="ssh-ed25519"){t.readBytes(t.readUint32())}else if(this.data.keyType==="ssh-rsa"){t.readBytes(t.readUint32());t.readBytes(t.readUint32())}else if(this.data.keyType.startsWith("ecdsa-sha2-")){t.readString();t.readBytes(t.readUint32())}t.readUint64();t.readUint32();t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readUint64();t.readUint64();t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readBytes(t.readUint32());var e=t.getOffset();return this._blob.keyData.slice(0,e)};return e}(Ad),i.TYPE="certificate",i);var wd=undefined&&undefined.__classPrivateFieldSet||function(t,e,i,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(t,i):n?n.value=i:e.set(t,i),i};var _d=undefined&&undefined.__classPrivateFieldGet||function(t,e,i,r){if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?r:i==="a"?r.call(t):r?r.value:e.get(t)};var bd;var Ed=function(){function t(t){bd.set(this,void 0);var e=cd(t.trim());wd(this,bd,new gd(e),"f");this.notBefore=_d(this,bd,"f").validAfter;this.notAfter=_d(this,bd,"f").validBefore;this.validity=co(this.notBefore,this.notAfter);this.type=[_d(this,bd,"f").blob.type,_d(this,bd,"f").certType,_d(this,bd,"f").type].join(" ");this.serialNumber=_d(this,bd,"f").serial.toString();this.keyId=_d(this,bd,"f").keyId;this.principals=_d(this,bd,"f").principals;this.extensions=_d(this,bd,"f").extensions;this.criticalOptions=_d(this,bd,"f").criticalOptions}t.prototype.parseSignatureKey=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,r;var n;return __generator(this,(function(a){switch(a.label){case 0:return[4,_d(this,bd,"f").signatureKey.toWebCrypto()];case 1:t=a.sent();e=_d(this,bd,"f").signatureKey.getBlob();return[4,_d(this,bd,"f").signatureKey.thumbprint("sha256")];case 2:i=a.sent();r=this;n={algorithm:t.algorithm.name,type:e.type};return[4,_d(this,bd,"f").signatureKey.toSSH()];case 3:r.signatureKey=(n.value=a.sent(),n.thumbprint=u.Convert.ToBase64(i),n);return[2]}}))}))};t.prototype.parsePublicKey=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,r;var n;return __generator(this,(function(a){switch(a.label){case 0:return[4,_d(this,bd,"f").publicKey.toWebCrypto()];case 1:t=a.sent();e=_d(this,bd,"f").publicKey.getBlob();return[4,_d(this,bd,"f").publicKey.thumbprint("sha256")];case 2:i=a.sent();r=this;n={algorithm:t.algorithm.name,type:e.type};return[4,_d(this,bd,"f").publicKey.toSSH()];case 3:r.publicKey=(n.value=a.sent(),n.thumbprint=u.Convert.ToBase64(i),n);return[2]}}))}))};t.prototype.toString=function(){return __awaiter(this,arguments,void 0,(function(t){if(t===void 0){t="pem"}return __generator(this,(function(t){return[2,_d(this,bd,"f").toSSH()]}))}))};Object.defineProperty(t.prototype,"commonName",{get:function(){return _d(this,bd,"f").principals.join("_")||_d(this,bd,"f").keyId||_d(this,bd,"f").certType},enumerable:false,configurable:true});t.prototype.downloadAsSSH=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){switch(r.label){case 0:i=(e=c.certSSH).asSSH;return[4,this.toString()];case 1:i.apply(e,[r.sent(),t||this.commonName]);return[2]}}))}))};return t}();t("bm",Ed);bd=new WeakMap}}}));
135
- //# sourceMappingURL=p-DMDALRLP.system.js.map
134
+ */var Qc=t("c",(function(t){if(Vc.isPem(t)){return Vc.decode(t)[0]}if(u.Convert.isHex(t)){return u.Convert.FromHex(t)}if(u.Convert.isBase64(t)){return u.Convert.FromBase64(t)}if(u.Convert.isBase64Url(t)){return u.Convert.FromBase64Url(t)}return u.Convert.FromBinary(t)}));var qc=t("m",(function(t,i){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(r){e=Wc.get();if(e.subtle){return[2,e.subtle.digest(t,i)]}return[2,undefined]}))}))}));var zc=function(){function t(t){if(t===void 0){t={}}this.acIssuer=new ji;this.acSerial=0;this.attrs=[];Object.assign(this,t)}return t}();bi([Ai({type:ji})],zc.prototype,"acIssuer",void 0);bi([Ai({type:Ke.Integer})],zc.prototype,"acSerial",void 0);bi([Ai({type:rn,repeated:"sequence"})],zc.prototype,"attrs",void 0);var Yc;var Zc=Yc=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Yc.prototype);return i}return e}(wi);Zc=Yc=bi([Si({type:Ne.Sequence,itemType:Ke.ObjectIdentifier})],Zc);var $c=function(){function t(t){if(t===void 0){t={}}this.permitUnSpecified=true;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer,optional:true})],$c.prototype,"pathLenConstraint",void 0);bi([Ai({type:Zc,implicit:true,context:0,optional:true})],$c.prototype,"permittedAttrs",void 0);bi([Ai({type:Zc,implicit:true,context:1,optional:true})],$c.prototype,"excludedAttrs",void 0);bi([Ai({type:Ke.Boolean,defaultValue:true})],$c.prototype,"permitUnSpecified",void 0);var Xc=function(){function t(t){if(t===void 0){t={}}this.issuer=new Xi;this.serial=new ArrayBuffer(0);this.issuerUID=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Xi})],Xc.prototype,"issuer",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Xc.prototype,"serial",void 0);bi([Ai({type:Ke.BitString,optional:true})],Xc.prototype,"issuerUID",void 0);var Jc;(function(t){t[t["publicKey"]=0]="publicKey";t[t["publicKeyCert"]=1]="publicKeyCert";t[t["otherObjectTypes"]=2]="otherObjectTypes"})(Jc||(Jc={}));var tf=function(){function t(t){if(t===void 0){t={}}this.digestedObjectType=Jc.publicKey;this.digestAlgorithm=new An;this.objectDigest=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.Enumerated})],tf.prototype,"digestedObjectType",void 0);bi([Ai({type:Ke.ObjectIdentifier,optional:true})],tf.prototype,"otherObjectTypeID",void 0);bi([Ai({type:An})],tf.prototype,"digestAlgorithm",void 0);bi([Ai({type:Ke.BitString})],tf.prototype,"objectDigest",void 0);var ef=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Xi,optional:true})],ef.prototype,"issuerName",void 0);bi([Ai({type:Xc,context:0,implicit:true,optional:true})],ef.prototype,"baseCertificateID",void 0);bi([Ai({type:tf,context:1,implicit:true,optional:true})],ef.prototype,"objectDigestInfo",void 0);var rf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:ji,repeated:"sequence"})],rf.prototype,"v1Form",void 0);bi([Ai({type:ef,context:0,implicit:true})],rf.prototype,"v2Form",void 0);rf=bi([Si({type:Ne.Choice})],rf);var nf=function(){function t(t){if(t===void 0){t={}}this.notBeforeTime=new Date;this.notAfterTime=new Date;Object.assign(this,t)}return t}();bi([Ai({type:Ke.GeneralizedTime})],nf.prototype,"notBeforeTime",void 0);bi([Ai({type:Ke.GeneralizedTime})],nf.prototype,"notAfterTime",void 0);var af=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Xc,implicit:true,context:0,optional:true})],af.prototype,"baseCertificateID",void 0);bi([Ai({type:Xi,implicit:true,context:1,optional:true})],af.prototype,"entityName",void 0);bi([Ai({type:tf,implicit:true,context:2,optional:true})],af.prototype,"objectDigestInfo",void 0);var of;(function(t){t[t["v2"]=1]="v2"})(of||(of={}));var sf=function(){function t(t){if(t===void 0){t={}}this.version=of.v2;this.holder=new af;this.issuer=new rf;this.signature=new An;this.serialNumber=new ArrayBuffer(0);this.attrCertValidityPeriod=new nf;this.attributes=[];Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],sf.prototype,"version",void 0);bi([Ai({type:af})],sf.prototype,"holder",void 0);bi([Ai({type:rf})],sf.prototype,"issuer",void 0);bi([Ai({type:An})],sf.prototype,"signature",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],sf.prototype,"serialNumber",void 0);bi([Ai({type:nf})],sf.prototype,"attrCertValidityPeriod",void 0);bi([Ai({type:rn,repeated:"sequence"})],sf.prototype,"attributes",void 0);bi([Ai({type:Ke.BitString,optional:true})],sf.prototype,"issuerUniqueID",void 0);bi([Ai({type:bn,optional:true})],sf.prototype,"extensions",void 0);var uf=function(){function t(t){if(t===void 0){t={}}this.acinfo=new sf;this.signatureAlgorithm=new An;this.signatureValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("n",uf);bi([Ai({type:sf})],uf.prototype,"acinfo",void 0);bi([Ai({type:An})],uf.prototype,"signatureAlgorithm",void 0);bi([Ai({type:Ke.BitString})],uf.prototype,"signatureValue",void 0);var cf;(function(t){t[t["unmarked"]=1]="unmarked";t[t["unclassified"]=2]="unclassified";t[t["restricted"]=4]="restricted";t[t["confidential"]=8]="confidential";t[t["secret"]=16]="secret";t[t["topSecret"]=32]="topSecret"})(cf||(cf={}));var ff=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(je);var vf=function(){function t(t){if(t===void 0){t={}}this.type="";this.value=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier,implicit:true,context:0})],vf.prototype,"type",void 0);bi([Ai({type:Ke.Any,implicit:true,context:1})],vf.prototype,"value",void 0);var hf=function(){function t(t){if(t===void 0){t={}}this.policyId="";this.classList=new ff(cf.unclassified);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],hf.prototype,"policyId",void 0);bi([Ai({type:ff,defaultValue:new ff(cf.unclassified)})],hf.prototype,"classList",void 0);bi([Ai({type:vf,repeated:"set"})],hf.prototype,"securityCategories",void 0);var df=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:He})],df.prototype,"cotets",void 0);bi([Ai({type:Ke.ObjectIdentifier})],df.prototype,"oid",void 0);bi([Ai({type:Ke.Utf8String})],df.prototype,"string",void 0);var lf=function(){function t(t){if(t===void 0){t={}}this.values=[];Object.assign(this,t)}return t}();bi([Ai({type:Xi,implicit:true,context:0,optional:true})],lf.prototype,"policyAuthority",void 0);bi([Ai({type:df,repeated:"sequence"})],lf.prototype,"values",void 0);var pf;var yf=function(){function t(t){if(t===void 0){t={}}this.targetCertificate=new Xc;Object.assign(this,t)}return t}();bi([Ai({type:Xc})],yf.prototype,"targetCertificate",void 0);bi([Ai({type:ji,optional:true})],yf.prototype,"targetName",void 0);bi([Ai({type:tf,optional:true})],yf.prototype,"certDigestInfo",void 0);var Sf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:ji,context:0,implicit:true})],Sf.prototype,"targetName",void 0);bi([Ai({type:ji,context:1,implicit:true})],Sf.prototype,"targetGroup",void 0);bi([Ai({type:yf,context:2,implicit:true})],Sf.prototype,"targetCert",void 0);Sf=bi([Si({type:Ne.Choice})],Sf);var Af=pf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,pf.prototype);return i}return e}(wi);Af=pf=bi([Si({type:Ne.Sequence,itemType:Sf})],Af);var Cf;var mf=Cf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Cf.prototype);return i}return e}(wi);mf=Cf=bi([Si({type:Ne.Sequence,itemType:Af})],mf);var gf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:Xi,implicit:true,context:0,optional:true})],gf.prototype,"roleAuthority",void 0);bi([Ai({type:ji,implicit:true,context:1})],gf.prototype,"roleName",void 0);var wf=function(){function t(t){if(t===void 0){t={}}this.service=new ji;this.ident=new ji;Object.assign(this,t)}return t}();bi([Ai({type:ji})],wf.prototype,"service",void 0);bi([Ai({type:ji})],wf.prototype,"ident",void 0);bi([Ai({type:He,optional:true})],wf.prototype,"authInfo",void 0);var _f="0.4.0.9496";var bf=t("L","".concat(_f,".6"));var Ef=t("u",function(){function t(t){if(t===void 0){t={}}this.codeAuthority=new ji;this.codeId=new ji;this.shortName="";this.shortDescription="";Object.assign(this,t)}return t}());bi([Ai({type:ji,context:0})],Ef.prototype,"codeAuthority",void 0);bi([Ai({type:ji,context:1})],Ef.prototype,"codeId",void 0);bi([Ai({type:Ke.Utf8String,context:2})],Ef.prototype,"shortName",void 0);bi([Ai({type:Ke.Utf8String,context:3})],Ef.prototype,"shortDescription",void 0);t("u",Ef=bi([Si({type:Ne.Sequence})],Ef));var Pf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Mi);Pf=bi([Si({type:Ne.Sequence})],Pf);var Df=t("X","".concat(_f,".1"));var If=t("y",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("y",If=bi([Si({type:Ne.Sequence})],If));var Bf=t("S","".concat(_f,".2"));var xf=t("x",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("x",xf=bi([Si({type:Ne.Sequence})],xf));var Tf=t("Q","".concat(_f,".3"));var Of=t("w",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("w",Of=bi([Si({type:Ne.Sequence})],Of));var kf=t("O","".concat(_f,".4"));var Mf=t("v",function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Mi.prototype);return i}return e}(Pf));t("v",Mf=bi([Si({type:Ne.Sequence})],Mf));var Rf=t("J","".concat(_f,".8"));var Nf=t("I",function(){function t(t){if(t===void 0){t={}}this.location="";this.base=0;this.degree=0;Object.assign(this,t)}t.prototype.toString=function(){return"".concat(this.base," x 10^").concat(this.degree," ").concat(this.location)};return t}());bi([Ai({type:Ke.PrintableString})],Nf.prototype,"location",void 0);bi([Ai({type:Ke.Integer})],Nf.prototype,"base",void 0);bi([Ai({type:Ke.Integer})],Nf.prototype,"degree",void 0);t("I",Nf=bi([Si({type:Ne.Sequence})],Nf));var Kf=t("H","".concat(_f,".9"));var jf=t("V",function(){function t(t){if(t===void 0){t={}}this.stars5=0;this.stars4=0;this.stars3=0;this.stars2=0;this.stars1=0;Object.assign(this,t)}return t}());bi([Ai({type:Ke.Integer})],jf.prototype,"stars5",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars4",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars3",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars2",void 0);bi([Ai({type:Ke.Integer})],jf.prototype,"stars1",void 0);t("V",jf=bi([Si({type:Ne.Sequence})],jf));var Hf=t("M","".concat(_f,".5"));var Uf=t("T",function(){function t(t){if(t===void 0){t={}}this.DNBvsDNO=new je(0);this.DNBvsDNT=new je(0);this.DNOvsDNT=new je(0);Object.assign(this,t)}return t}());bi([Ai({type:je,context:0})],Uf.prototype,"DNBvsDNO",void 0);bi([Ai({type:je,context:1})],Uf.prototype,"DNBvsDNT",void 0);bi([Ai({type:je,context:2})],Uf.prototype,"DNOvsDNT",void 0);t("T",Uf=bi([Si({type:Ne.Sequence})],Uf));var Ff=t("K","".concat(_f,".7"));var Lf=t("W",function(){function t(t){if(t===void 0){t={}}this.assessmentAuthority=new ji;this.assessmentRef=new ji;this.assessmentLocation=new ji;this.dataStorageTerritory="";this.description="";Object.assign(this,t)}return t}());bi([Ai({type:ji,context:0})],Lf.prototype,"assessmentAuthority",void 0);bi([Ai({type:ji,context:1})],Lf.prototype,"assessmentRef",void 0);bi([Ai({type:ji,context:2})],Lf.prototype,"assessmentLocation",void 0);bi([Ai({type:Ke.PrintableString,context:3})],Lf.prototype,"dataStorageTerritory",void 0);bi([Ai({type:Ke.Utf8String,context:4})],Lf.prototype,"description",void 0);t("W",Lf=bi([Si({type:Ne.Sequence})],Lf));var Vf=function(){function t(t){if(t===void 0){t={}}this.issuer=new Mi;this.serialNumber=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Mi})],Vf.prototype,"issuer",void 0);bi([Ai({type:Ke.Integer,converter:Ve})],Vf.prototype,"serialNumber",void 0);var Gf=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:un,context:0,implicit:true})],Gf.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Vf})],Gf.prototype,"issuerAndSerialNumber",void 0);Gf=bi([Si({type:Ne.Choice})],Gf);var Wf;(function(t){t[t["v0"]=0]="v0";t[t["v1"]=1]="v1";t[t["v2"]=2]="v2";t[t["v3"]=3]="v3";t[t["v4"]=4]="v4";t[t["v5"]=5]="v5"})(Wf||(Wf={}));var Qf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Qf=bi([Si({type:Ne.Sequence})],Qf);var qf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);qf=bi([Si({type:Ne.Sequence})],qf);var zf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);zf=bi([Si({type:Ne.Sequence})],zf);var Yf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Yf=bi([Si({type:Ne.Sequence})],Yf);var Zf=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Zf=bi([Si({type:Ne.Sequence})],Zf);var $f=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);$f=bi([Si({type:Ne.Sequence})],$f);var Xf=function(){function t(t){if(t===void 0){t={}}this.attrType="";this.attrValues=[];Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Xf.prototype,"attrType",void 0);bi([Ai({type:Ke.Any,repeated:"set"})],Xf.prototype,"attrValues",void 0);var Jf;var tv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.sid=new Gf;this.digestAlgorithm=new Qf;this.signatureAlgorithm=new qf;this.signature=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],tv.prototype,"version",void 0);bi([Ai({type:Gf})],tv.prototype,"sid",void 0);bi([Ai({type:Qf})],tv.prototype,"digestAlgorithm",void 0);bi([Ai({type:Xf,repeated:"set",context:0,implicit:true,optional:true})],tv.prototype,"signedAttrs",void 0);bi([Ai({type:qf})],tv.prototype,"signatureAlgorithm",void 0);bi([Ai({type:He})],tv.prototype,"signature",void 0);bi([Ai({type:Xf,repeated:"set",context:1,implicit:true,optional:true})],tv.prototype,"unsignedAttrs",void 0);var ev=Jf=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Jf.prototype);return i}return e}(wi);ev=Jf=bi([Si({type:Ne.Set,itemType:tv})],ev);var iv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(mn);iv=bi([Si({type:Ne.Choice})],iv);var rv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(tv);rv=bi([Si({type:Ne.Sequence})],rv);var nv;var av=function(){function t(t){if(t===void 0){t={}}this.otherCertFormat="";this.otherCert=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],av.prototype,"otherCertFormat",void 0);bi([Ai({type:Ke.Any})],av.prototype,"otherCert",void 0);var ov=t("bk",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}());bi([Ai({type:Dn})],ov.prototype,"certificate",void 0);bi([Ai({type:uf,context:2,implicit:true})],ov.prototype,"v2AttrCert",void 0);bi([Ai({type:av,context:3,implicit:true})],ov.prototype,"other",void 0);t("bk",ov=bi([Si({type:Ne.Choice})],ov));var sv=t("bj",nv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,nv.prototype);return i}return e}(wi));t("bj",sv=nv=bi([Si({type:Ne.Set,itemType:ov})],sv));var uv=function(){function t(t){if(t===void 0){t={}}this.contentType="";this.content=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("bl",uv);bi([Ai({type:Ke.ObjectIdentifier})],uv.prototype,"contentType",void 0);bi([Ai({type:Ke.Any,context:0})],uv.prototype,"content",void 0);var cv=t("bi",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}());bi([Ai({type:He})],cv.prototype,"single",void 0);bi([Ai({type:Ke.Any})],cv.prototype,"any",void 0);t("bi",cv=bi([Si({type:Ne.Choice})],cv));var fv=function(){function t(t){if(t===void 0){t={}}this.eContentType="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],fv.prototype,"eContentType",void 0);bi([Ai({type:cv,context:0,optional:true})],fv.prototype,"eContent",void 0);var vv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:He,context:0,implicit:true,optional:true})],vv.prototype,"value",void 0);bi([Ai({type:He,converter:ze,context:0,implicit:true,optional:true,repeated:"sequence"})],vv.prototype,"constructedValue",void 0);vv=bi([Si({type:Ne.Choice})],vv);var hv=function(){function t(t){if(t===void 0){t={}}this.contentType="";this.contentEncryptionAlgorithm=new Yf;Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],hv.prototype,"contentType",void 0);bi([Ai({type:Yf})],hv.prototype,"contentEncryptionAlgorithm",void 0);bi([Ai({type:vv,optional:true})],hv.prototype,"encryptedContent",void 0);var dv=function(){function t(t){if(t===void 0){t={}}this.keyAttrId="";Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],dv.prototype,"keyAttrId",void 0);bi([Ai({type:Ke.Any,optional:true})],dv.prototype,"keyAttr",void 0);var lv;var pv=function(){function t(t){if(t===void 0){t={}}this.subjectKeyIdentifier=new un;Object.assign(this,t)}return t}();bi([Ai({type:un})],pv.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Ke.GeneralizedTime,optional:true})],pv.prototype,"date",void 0);bi([Ai({type:dv,optional:true})],pv.prototype,"other",void 0);var yv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:pv,context:0,implicit:true,optional:true})],yv.prototype,"rKeyId",void 0);bi([Ai({type:Vf,optional:true})],yv.prototype,"issuerAndSerialNumber",void 0);yv=bi([Si({type:Ne.Choice})],yv);var Sv=function(){function t(t){if(t===void 0){t={}}this.rid=new yv;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:yv})],Sv.prototype,"rid",void 0);bi([Ai({type:He})],Sv.prototype,"encryptedKey",void 0);var Av=lv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,lv.prototype);return i}return e}(wi);Av=lv=bi([Si({type:Ne.Sequence,itemType:Sv})],Av);var Cv=function(){function t(t){if(t===void 0){t={}}this.algorithm=new An;this.publicKey=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:An})],Cv.prototype,"algorithm",void 0);bi([Ai({type:Ke.BitString})],Cv.prototype,"publicKey",void 0);var mv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:un,context:0,implicit:true,optional:true})],mv.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Cv,context:1,implicit:true,optional:true})],mv.prototype,"originatorKey",void 0);bi([Ai({type:Vf,optional:true})],mv.prototype,"issuerAndSerialNumber",void 0);mv=bi([Si({type:Ne.Choice})],mv);var gv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v3;this.originator=new mv;this.keyEncryptionAlgorithm=new zf;this.recipientEncryptedKeys=new Av;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],gv.prototype,"version",void 0);bi([Ai({type:mv,context:0})],gv.prototype,"originator",void 0);bi([Ai({type:He,context:1,optional:true})],gv.prototype,"ukm",void 0);bi([Ai({type:zf})],gv.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:Av})],gv.prototype,"recipientEncryptedKeys",void 0);var wv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:un,context:0,implicit:true})],wv.prototype,"subjectKeyIdentifier",void 0);bi([Ai({type:Vf})],wv.prototype,"issuerAndSerialNumber",void 0);wv=bi([Si({type:Ne.Choice})],wv);var _v=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.rid=new wv;this.keyEncryptionAlgorithm=new zf;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],_v.prototype,"version",void 0);bi([Ai({type:wv})],_v.prototype,"rid",void 0);bi([Ai({type:zf})],_v.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:He})],_v.prototype,"encryptedKey",void 0);var bv=function(){function t(t){if(t===void 0){t={}}this.keyIdentifier=new He;Object.assign(this,t)}return t}();bi([Ai({type:He})],bv.prototype,"keyIdentifier",void 0);bi([Ai({type:Ke.GeneralizedTime,optional:true})],bv.prototype,"date",void 0);bi([Ai({type:dv,optional:true})],bv.prototype,"other",void 0);var Ev=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v4;this.kekid=new bv;this.keyEncryptionAlgorithm=new zf;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Ev.prototype,"version",void 0);bi([Ai({type:bv})],Ev.prototype,"kekid",void 0);bi([Ai({type:zf})],Ev.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:He})],Ev.prototype,"encryptedKey",void 0);var Pv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.keyEncryptionAlgorithm=new zf;this.encryptedKey=new He;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Pv.prototype,"version",void 0);bi([Ai({type:$f,context:0,optional:true})],Pv.prototype,"keyDerivationAlgorithm",void 0);bi([Ai({type:zf})],Pv.prototype,"keyEncryptionAlgorithm",void 0);bi([Ai({type:He})],Pv.prototype,"encryptedKey",void 0);var Dv=function(){function t(t){if(t===void 0){t={}}this.oriType="";this.oriValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Dv.prototype,"oriType",void 0);bi([Ai({type:Ke.Any})],Dv.prototype,"oriValue",void 0);var Iv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:_v,optional:true})],Iv.prototype,"ktri",void 0);bi([Ai({type:gv,context:1,implicit:true,optional:true})],Iv.prototype,"kari",void 0);bi([Ai({type:Ev,context:2,implicit:true,optional:true})],Iv.prototype,"kekri",void 0);bi([Ai({type:Pv,context:3,implicit:true,optional:true})],Iv.prototype,"pwri",void 0);bi([Ai({type:Dv,context:4,implicit:true,optional:true})],Iv.prototype,"ori",void 0);Iv=bi([Si({type:Ne.Choice})],Iv);var Bv;var xv=Bv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Bv.prototype);return i}return e}(wi);xv=Bv=bi([Si({type:Ne.Set,itemType:Iv})],xv);var Tv;var Ov=function(){function t(t){if(t===void 0){t={}}this.otherRevInfoFormat="";this.otherRevInfo=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Ov.prototype,"otherRevInfoFormat",void 0);bi([Ai({type:Ke.Any})],Ov.prototype,"otherRevInfo",void 0);var kv=function(){function t(t){if(t===void 0){t={}}this.other=new Ov;Object.assign(this,t)}return t}();bi([Ai({type:Ov,context:1,implicit:true})],kv.prototype,"other",void 0);kv=bi([Si({type:Ne.Choice})],kv);var Mv=Tv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Tv.prototype);return i}return e}(wi);Mv=Tv=bi([Si({type:Ne.Set,itemType:kv})],Mv);var Rv=function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}();bi([Ai({type:sv,context:0,implicit:true,optional:true})],Rv.prototype,"certs",void 0);bi([Ai({type:Mv,context:1,implicit:true,optional:true})],Rv.prototype,"crls",void 0);var Nv;var Kv=Nv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Nv.prototype);return i}return e}(wi);Kv=Nv=bi([Si({type:Ne.Set,itemType:Xf})],Kv);var jv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.recipientInfos=new xv;this.encryptedContentInfo=new hv;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],jv.prototype,"version",void 0);bi([Ai({type:Rv,context:0,implicit:true,optional:true})],jv.prototype,"originatorInfo",void 0);bi([Ai({type:xv})],jv.prototype,"recipientInfos",void 0);bi([Ai({type:hv})],jv.prototype,"encryptedContentInfo",void 0);bi([Ai({type:Kv,context:1,implicit:true,optional:true})],jv.prototype,"unprotectedAttrs",void 0);var Hv;var Uv=Hv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Hv.prototype);return i}return e}(wi);Uv=Hv=bi([Si({type:Ne.Set,itemType:Qf})],Uv);var Fv=function(){function t(t){if(t===void 0){t={}}this.version=Wf.v0;this.digestAlgorithms=new Uv;this.encapContentInfo=new fv;this.signerInfos=new ev;Object.assign(this,t)}return t}();t("bh",Fv);bi([Ai({type:Ke.Integer})],Fv.prototype,"version",void 0);bi([Ai({type:Uv})],Fv.prototype,"digestAlgorithms",void 0);bi([Ai({type:fv})],Fv.prototype,"encapContentInfo",void 0);bi([Ai({type:sv,context:0,implicit:true,optional:true})],Fv.prototype,"certificates",void 0);bi([Ai({type:Mv,context:1,implicit:true,optional:true})],Fv.prototype,"crls",void 0);bi([Ai({type:ev})],Fv.prototype,"signerInfos",void 0);var Lv;var Vv=function(){function t(t){if(t===void 0){t={}}this.attrId="";this.attrValues=[];Object.assign(t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],Vv.prototype,"attrId",void 0);bi([Ai({type:Ke.Any,repeated:"set"})],Vv.prototype,"attrValues",void 0);var Gv=Lv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Lv.prototype);return i}return e}(wi);Gv=Lv=bi([Si({type:Ne.Sequence,itemType:Vv})],Gv);var Wv;var Qv=Wv=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Wv.prototype);return i}return e}(wi);Qv=Wv=bi([Si({type:Ne.Sequence,itemType:uv})],Qv);var qv=function(){function t(t){if(t===void 0){t={}}this.certId="";this.certValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],qv.prototype,"certId",void 0);bi([Ai({type:Ke.Any,context:0})],qv.prototype,"certValue",void 0);var zv=function(){function t(t){if(t===void 0){t={}}this.crlId="";this.crltValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],zv.prototype,"crlId",void 0);bi([Ai({type:Ke.Any,context:0})],zv.prototype,"crltValue",void 0);var Yv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ka);Yv=bi([Si({type:Ne.Sequence})],Yv);var Zv=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Oa);Zv=bi([Si({type:Ne.Sequence})],Zv);var $v=function(){function t(t){if(t===void 0){t={}}this.secretTypeId="";this.secretValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],$v.prototype,"secretTypeId",void 0);bi([Ai({type:Ke.Any,context:0})],$v.prototype,"secretValue",void 0);var Xv=function(){function t(t){if(t===void 0){t={}}this.mac=new ma;this.macSalt=new He;this.iterations=1;Object.assign(this,t)}return t}();bi([Ai({type:ma})],Xv.prototype,"mac",void 0);bi([Ai({type:He})],Xv.prototype,"macSalt",void 0);bi([Ai({type:Ke.Integer,defaultValue:1})],Xv.prototype,"iterations",void 0);var Jv=function(){function t(t){if(t===void 0){t={}}this.version=3;this.authSafe=new uv;this.macData=new Xv;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Jv.prototype,"version",void 0);bi([Ai({type:uv})],Jv.prototype,"authSafe",void 0);bi([Ai({type:Xv,optional:true})],Jv.prototype,"macData",void 0);var th;var eh=function(){function t(t){if(t===void 0){t={}}this.bagId="";this.bagValue=new ArrayBuffer(0);Object.assign(this,t)}return t}();bi([Ai({type:Ke.ObjectIdentifier})],eh.prototype,"bagId",void 0);bi([Ai({type:Ke.Any,context:0})],eh.prototype,"bagValue",void 0);bi([Ai({type:Vv,repeated:"set",optional:true})],eh.prototype,"bagAttributes",void 0);var ih=th=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,th.prototype);return i}return e}(wi);ih=th=bi([Si({type:Ne.Sequence,itemType:eh})],ih);var rh,nh,ah;var oh="1.2.840.113549.1.9";var sh=t("F","".concat(oh,".2"));var uh=t("G","".concat(oh,".7"));var ch=t("B","".concat(oh,".14"));var fh=function(t){__extends(e,t);function e(e){if(e===void 0){e={}}return t.call(this,e)||this}e.prototype.toString=function(){return this.ia5String||t.prototype.toString.call(this)};return e}(Bi);bi([Ai({type:Ke.IA5String})],fh.prototype,"ia5String",void 0);fh=bi([Si({type:Ne.Choice})],fh);var vh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(uv);vh=bi([Si({type:Ne.Sequence})],vh);var hh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Jv);hh=bi([Si({type:Ne.Sequence})],hh);var dh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Oa);dh=bi([Si({type:Ne.Sequence})],dh);var lh=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.IA5String})],lh.prototype,"value",void 0);lh=bi([Si({type:Ne.Choice})],lh);var ph=t("U",function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(fh));t("U",ph=bi([Si({type:Ne.Choice})],ph));var yh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi);yh=bi([Si({type:Ne.Choice})],yh);var Sh=function(){function t(t){if(t===void 0){t=new Date}this.value=t}return t}();bi([Ai({type:Ke.GeneralizedTime})],Sh.prototype,"value",void 0);Sh=bi([Si({type:Ne.Choice})],Sh);var Ah=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi);Ah=bi([Si({type:Ne.Choice})],Ah);var Ch=function(){function t(t){if(t===void 0){t="M"}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.PrintableString})],Ch.prototype,"value",void 0);Ch=bi([Si({type:Ne.Choice})],Ch);var mh=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.PrintableString})],mh.prototype,"value",void 0);mh=bi([Si({type:Ne.Choice})],mh);var gh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(mh);gh=bi([Si({type:Ne.Choice})],gh);var wh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi);wh=bi([Si({type:Ne.Choice})],wh);var _h=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.ObjectIdentifier})],_h.prototype,"value",void 0);_h=bi([Si({type:Ne.Choice})],_h);var bh=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(mn);bh=bi([Si({type:Ne.Choice})],bh);var Eh=function(){function t(t){if(t===void 0){t=0}this.value=t}t.prototype.toString=function(){return this.value.toString()};return t}();bi([Ai({type:Ke.Integer})],Eh.prototype,"value",void 0);Eh=bi([Si({type:Ne.Choice})],Eh);var Ph=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(tv);Ph=bi([Si({type:Ne.Sequence})],Ph);var Dh=t("t",function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Bi));t("t",Dh=bi([Si({type:Ne.Choice})],Dh));var Ih=t("s",rh=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,rh.prototype);return i}return e}(bn));t("s",Ih=rh=bi([Si({type:Ne.Sequence})],Ih));var Bh=nh=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,nh.prototype);return i}return e}(wi);Bh=nh=bi([Si({type:Ne.Set,itemType:Xf})],Bh);var xh=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.toString=function(){return this.value};return t}();bi([Ai({type:Ke.BmpString})],xh.prototype,"value",void 0);xh=bi([Si({type:Ne.Choice})],xh);var Th=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(An);Th=bi([Si({type:Ne.Sequence})],Th);var Oh=ah=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,ah.prototype);return i}return e}(wi);Oh=ah=bi([Si({type:Ne.Sequence,itemType:Th})],Oh);var kh=t("z","1.3.6.1.4.1.22112.2.1");var Mh=t("r",function(){function t(t){if(t===void 0){t={}}Object.assign(this,t)}return t}());bi([Ai({type:Vf})],Mh.prototype,"signer",void 0);bi([Ai({type:Dn,optional:true})],Mh.prototype,"cert",void 0);t("r",Mh=bi([Si({type:Ne.Sequence})],Mh));var Rh;var Nh=Rh=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;Object.setPrototypeOf(i,Rh.prototype);return i}return e}(wi);Nh=Rh=bi([Si({type:Ne.Sequence,itemType:rn})],Nh);var Kh=function(){function t(t){if(t===void 0){t={}}this.version=0;this.subject=new Mi;this.subjectPKInfo=new Cn;this.attributes=new Nh;Object.assign(this,t)}return t}();bi([Ai({type:Ke.Integer})],Kh.prototype,"version",void 0);bi([Ai({type:Mi})],Kh.prototype,"subject",void 0);bi([Ai({type:Cn})],Kh.prototype,"subjectPKInfo",void 0);bi([Ai({type:Nh,implicit:true,context:0})],Kh.prototype,"attributes",void 0);var jh=function(){function t(t){if(t===void 0){t={}}this.certificationRequestInfo=new Kh;this.signatureAlgorithm=new An;this.signature=new ArrayBuffer(0);Object.assign(this,t)}return t}();t("Y",jh);bi([Ai({type:Kh})],jh.prototype,"certificationRequestInfo",void 0);bi([Ai({type:An})],jh.prototype,"signatureAlgorithm",void 0);bi([Ai({type:Ke.BitString})],jh.prototype,"signature",void 0);var Hh=globalThis.crypto;function Uh(){return Hh}var Fh=function(t){__extends(e,t);function e(e,i){var r=t.call(this,e)||this;r.code=i;r.name=r.constructor.name;if(Error.captureStackTrace){Error.captureStackTrace(r,r.constructor)}return r}return e}(Error);var Lh=function(t){__extends(e,t);function e(e,i){var r=i?" Supported: ".concat(i.join(", ")):"";return t.call(this,"Unsupported algorithm: ".concat(e,".").concat(r),"UNSUPPORTED_ALGORITHM")||this}return e}(Fh);var Vh=function(t){__extends(e,t);function e(e,i){var r=i?" Expected: ".concat(i):"";return t.call(this,"Invalid format: ".concat(e,".").concat(r),"INVALID_FORMAT")||this}return e}(Fh);var Gh=function(t){__extends(e,t);function e(e,i){var r=i?" Supported: ".concat(i.join(", ")):"";return t.call(this,"Unsupported key type: ".concat(e,".").concat(r),"UNSUPPORTED_KEY_TYPE")||this}return e}(Fh);var Wh=function(t){__extends(e,t);function e(e){var i=e?"Invalid SSH private key format: ".concat(e):"Invalid SSH private key format";return t.call(this,i,"INVALID_PRIVATE_KEY_FORMAT")||this}return e}(Fh);var Qh=function(t){__extends(e,t);function e(e){var i=e?"Encrypted SSH private keys are not supported (cipher: ".concat(e,")"):"Encrypted SSH private keys are not supported";return t.call(this,i,"ENCRYPTED_KEY_NOT_SUPPORTED")||this}return e}(Fh);var qh=function(t){__extends(e,t);function e(e){var i=e?"Invalid key data: ".concat(e):"Invalid key data";return t.call(this,i,"INVALID_KEY_DATA")||this}return e}(Fh);var zh=function(t){__extends(e,t);function e(e,i){var r=e!==undefined&&i!==undefined?" Expected ".concat(e," bytes, got ").concat(i):"";return t.call(this,"Unexpected end of data".concat(r),"UNEXPECTED_EOF")||this}return e}(Fh);var Yh=new TextEncoder;var Zh=new TextDecoder;var $h=function(){function t(t){this.buffer=t;this.offset=0}t.prototype.readUint8=function(){if(this.offset>=this.buffer.length){throw new zh(1,0)}return this.buffer[this.offset++]};t.prototype.readUint32=function(){var t=this.readUint8()<<24|this.readUint8()<<16|this.readUint8()<<8|this.readUint8();return t>>>0};t.prototype.readUint64=function(){var t=this.readUint32();var e=this.readUint32();return BigInt(t)<<32n|BigInt(e)};t.prototype.readBytes=function(t){if(t<0){throw new Vh("Invalid length: ".concat(t))}if(this.offset+t>this.buffer.length){throw new zh(t,this.buffer.length-this.offset)}var e=this.buffer.subarray(this.offset,this.offset+t);this.offset+=t;return e};t.prototype.readString=function(){var t=this.readUint32();var e=this.readBytes(t);return Zh.decode(e)};t.prototype.peekString=function(t){if(this.offset+t>this.buffer.length){throw new zh(t,this.buffer.length-this.offset)}var e=this.buffer.subarray(this.offset,this.offset+t);return Zh.decode(e)};t.prototype.readMpInt=function(t){if(t===void 0){t=false}var e=this.readUint32();var i=this.readBytes(e);if(t&&i.length>1&&i[0]===0){return i.subarray(1)}return i};t.prototype.readMpIntSsh=function(){return this.readMpInt(true)};t.prototype.remaining=function(){return this.buffer.length-this.offset};t.prototype.getOffset=function(){return this.offset};t.prototype.seek=function(t){if(t<0||t>this.buffer.length){throw new Vh("Invalid offset: ".concat(t,". Buffer length: ").concat(this.buffer.length))}this.offset=t};return t}();var Xh=function(){function t(t){if(t===void 0){t=1024}this.buffer=new Uint8Array(t);this.offset=0}t.prototype.ensureCapacity=function(t){var e=this.offset+t;if(e>this.buffer.length){var i=Math.max(e,this.buffer.length*2);var r=new Uint8Array(i);r.set(this.buffer.subarray(0,this.offset));this.buffer=r}};t.prototype.reserve=function(t){if(t>this.buffer.length){var e=new Uint8Array(t);e.set(this.buffer.subarray(0,this.offset));this.buffer=e}};t.prototype.writeUint8=function(t){this.ensureCapacity(1);this.buffer[this.offset++]=t&255};t.prototype.writeUint32=function(t){this.ensureCapacity(4);this.buffer[this.offset++]=t>>>24&255;this.buffer[this.offset++]=t>>>16&255;this.buffer[this.offset++]=t>>>8&255;this.buffer[this.offset++]=t&255};t.prototype.writeUint64=function(t){this.ensureCapacity(8);var e=Number(t>>32n);var i=Number(t&0xffffffffn);this.writeUint32(e);this.writeUint32(i)};t.prototype.writeBytes=function(t){this.ensureCapacity(t.length);this.buffer.set(t,this.offset);this.offset+=t.length};t.prototype.writeString=function(t){var e=Yh.encode(t);this.writeUint32(e.length);this.writeBytes(e)};t.prototype.writeMpInt=function(t,e){if(e===void 0){e=false}if(e&&t.length>0&&(t[0]&128)!==0){var i=new Uint8Array(t.length+1);i[0]=0;i.set(t,1);this.writeUint32(i.length);this.writeBytes(i)}else{this.writeUint32(t.length);this.writeBytes(t)}};t.prototype.writeMpIntSsh=function(t){this.writeMpInt(t,true)};t.prototype.toUint8Array=function(){return this.buffer.subarray(0,this.offset)};t.prototype.getOffset=function(){return this.offset};t.prototype.seek=function(t){if(t<0||t>this.buffer.length){throw new Vh("Invalid offset")}this.offset=t};return t}();var Jh=function(){function t(t){if(t===void 0){t="SHA-256"}this.hash="SHA-256";this.hash=t}t.prototype.importPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){e=t.blob,i=t.crypto;r=new $h(e);r.readString();n=r.readMpInt(true);a=r.readMpInt(true);o={kty:"RSA",n:u.Convert.ToBase64Url(a),e:u.Convert.ToBase64Url(n)};return[2,i.subtle.importKey("jwk",o,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])]}))}))};t.prototype.exportPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){switch(s.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("jwk",e)];case 1:r=s.sent();if(!r.n||!r.e){throw new qh("RSA JWK missing required parameters (n, e)")}n=u.BufferSourceConverter.toUint8Array(u.Convert.FromBase64Url(r.n));a=u.BufferSourceConverter.toUint8Array(u.Convert.FromBase64Url(r.e));o=new Xh;o.writeString("ssh-rsa");o.writeMpInt(a,true);o.writeMpInt(n,true);return[2,o.toUint8Array()]}}))}))};t.prototype.importPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.spki,i=t.crypto;return[2,i.subtle.importKey("spki",e,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])]}))}))};t.prototype.exportPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("spki",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.pkcs8,i=t.crypto;return[2,i.subtle.importKey("pkcs8",e,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])]}))}))};t.prototype.exportPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.privateKey,i=t.crypto;return[4,i.subtle.exportKey("pkcs8",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d,l,p,y,S,A,C,m,g,w,_,b,E,P,D,I,B;return __generator(this,(function(x){e=t.sshKey,i=t.crypto;r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=u.Convert.FromBase64(r);a=new $h(u.BufferSourceConverter.toUint8Array(n));o=a.readBytes(15);if(u.Convert.ToHex(o)!=="6f70656e7373682d6b65792d763100"){throw new Wh("invalid magic string")}s=a.readString();a.readString();a.readString();if(s!=="none"){throw new Qh(s)}c=a.readUint32();if(c!==1){throw new Wh("multiple keys not supported")}f=a.readUint32();a.readBytes(f);v=a.readUint32();h=a.readBytes(v);d=new $h(h);l=d.readUint32();p=d.readUint32();if(l!==p){throw new Wh("invalid checkints")}d.readString();y=d.readMpInt(true);S=d.readMpInt(true);A=d.readMpInt(true);C=d.readMpInt(true);m=d.readMpInt(true);g=d.readMpInt(true);d.readString();w=BigInt("0x"+u.Convert.ToHex(A));_=BigInt("0x"+u.Convert.ToHex(m));b=BigInt("0x"+u.Convert.ToHex(g));E=w%(_-1n);P=w%(b-1n);D=u.Convert.FromHex(E.toString(16).padStart(m.length*2,"0"));I=u.Convert.FromHex(P.toString(16).padStart(g.length*2,"0"));B={kty:"RSA",n:u.Convert.ToBase64Url(y),e:u.Convert.ToBase64Url(S),d:u.Convert.ToBase64Url(A),p:u.Convert.ToBase64Url(m),q:u.Convert.ToBase64Url(g),dp:u.Convert.ToBase64Url(D),dq:u.Convert.ToBase64Url(I),qi:u.Convert.ToBase64Url(C)};return[2,i.subtle.importKey("jwk",B,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])]}))}))};t.prototype.exportPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d;return __generator(this,(function(l){switch(l.label){case 0:e=t.privateKey,i=t.crypto,r=t.jwk;a=r;if(a)return[3,2];return[4,i.subtle.exportKey("jwk",e)];case 1:a=l.sent();l.label=2;case 2:n=a;if(!n.n||!n.e||!n.d||!n.p||!n.q){throw new qh("RSA JWK missing required parameters")}o=new Uint8Array(u.Convert.FromBase64Url(n.n));s=new Uint8Array(u.Convert.FromBase64Url(n.e));c=new Uint8Array(u.Convert.FromBase64Url(n.d));f=new Uint8Array(u.Convert.FromBase64Url(n.p));v=new Uint8Array(u.Convert.FromBase64Url(n.q));h=n.qi?new Uint8Array(u.Convert.FromBase64Url(n.qi)):new Uint8Array;d=new Xh;d.writeString("ssh-rsa");d.writeMpInt(o,true);d.writeMpInt(s,true);d.writeMpInt(c,true);d.writeMpInt(h,true);d.writeMpInt(f,true);d.writeMpInt(v,true);return[2,d.toUint8Array()]}}))}))};t.prototype.sign=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(c){switch(c.label){case 0:e=t.privateKey,i=t.data,r=t.crypto,n=t.hash;if(n&&n!==this.hash){throw new qh("Hash ".concat(n," not supported for this RSA algorithm"))}if(!e.extractable){throw new qh("Private key is not extractable")}return[4,this.exportPrivatePkcs8({privateKey:e,crypto:r})];case 1:a=c.sent();return[4,this.importPrivatePkcs8({pkcs8:new Uint8Array(a),crypto:r})];case 2:o=c.sent();return[4,r.subtle.sign("RSASSA-PKCS1-v1_5",o,i)];case 3:s=c.sent();return[2,u.BufferSourceConverter.toUint8Array(s)]}}))}))};t.prototype.verify=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(u){switch(u.label){case 0:e=t.publicKey,i=t.signature,r=t.data,n=t.crypto,a=t.hash;if(a&&a!==this.hash){return[2,false]}if(!e.extractable){throw new qh("Public key is not extractable")}return[4,this.exportPublicSpki({publicKey:e,crypto:n})];case 1:o=u.sent();return[4,this.importPublicSpki({spki:new Uint8Array(o),crypto:n})];case 2:s=u.sent();return[2,n.subtle.verify("RSASSA-PKCS1-v1_5",s,i,r)]}}))}))};t.prototype.encodeSignature=function(t){var e=t.signature,i=t.algo;var r=new Xh;r.writeString(i);r.writeUint32(e.byteLength);r.writeBytes(e);return r.toUint8Array()};t.prototype.decodeSignature=function(t){var e=t.signature;var i=new $h(e);var r=i.readString();var n=i.readUint32();var a=i.readBytes(n);return{signature:a,algo:r}};t.prototype.supportsCryptoKey=function(t){return t.algorithm.name==="RSASSA-PKCS1-v1_5"};t.prototype.parsePublicKey=function(t){var e=t.readBytes(t.readUint32());var i=t.readBytes(t.readUint32());var r=new Xh;r.writeString("ssh-rsa");r.writeMpInt(e);r.writeMpInt(i);return{type:"ssh-rsa",keyData:r.toUint8Array()}};t.prototype.writePublicKey=function(t,e){var i=new $h(e.keyData);i.readString();var r=i.readMpInt();var n=i.readMpInt();t.writeUint32(r.length);t.writeBytes(r);t.writeUint32(n.length);t.writeBytes(n)};t.prototype.getCertificateType=function(){return"ssh-rsa-cert-v01@openssh.com"};t.prototype.getSignatureAlgo=function(){return this.hash==="SHA-256"?"rsa-sha2-256":"rsa-sha2-512"};return t}();var td=function(){function t(t,e,i){this.curveName=t;this.sshType=e;this.namedCurve=i}t.prototype.getHashAlgorithm=function(){switch(this.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:return"SHA-256"}};t.prototype.getExpectedLength=function(){switch(this.namedCurve){case"P-256":return 32;case"P-384":return 48;case"P-521":return 66;default:return 32}};t.prototype.getSignatureCoordLength=function(){return this.getExpectedLength()};t.prototype.importPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(c){e=t.blob,i=t.crypto;r=new $h(e);r.readString();n=r.readString();if(n!==this.curveName){throw new qh("ECDSA curve name ".concat(n,", expected ").concat(this.curveName))}a=r.readMpInt();o=Math.floor((a.length-1)/2);s={kty:"EC",crv:this.namedCurve,x:u.Convert.ToBase64Url(a.slice(1,1+o)),y:u.Convert.ToBase64Url(a.slice(1+o))};return[2,i.subtle.importKey("jwk",s,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])]}))}))};t.prototype.exportPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s;return __generator(this,(function(c){switch(c.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("jwk",e)];case 1:r=c.sent();if(!r.x||!r.y){throw new qh("ECDSA JWK missing x or y parameters")}n=new Uint8Array(u.Convert.FromBase64Url(r.x));a=new Uint8Array(u.Convert.FromBase64Url(r.y));o=new Uint8Array(1+n.length+a.length);o[0]=4;o.set(n,1);o.set(a,1+n.length);s=new Xh;s.writeString(this.sshType);s.writeString(this.curveName);s.writeMpInt(o);return[2,s.toUint8Array()]}}))}))};t.prototype.importPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.spki,i=t.crypto;return[2,i.subtle.importKey("spki",e,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])]}))}))};t.prototype.exportPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("spki",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.pkcs8,i=t.crypto;return[2,i.subtle.importKey("pkcs8",e,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])]}))}))};t.prototype.exportPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.privateKey,i=t.crypto;return[4,i.subtle.exportKey("pkcs8",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.exportPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v;return __generator(this,(function(h){switch(h.label){case 0:e=t.privateKey,i=t.crypto,r=t.jwk;a=r;if(a)return[3,2];return[4,i.subtle.exportKey("jwk",e)];case 1:a=h.sent();h.label=2;case 2:n=a;if(!n.d||!n.x||!n.y){throw new qh("ECDSA private key JWK missing required parameters")}o=new Uint8Array(u.Convert.FromBase64Url(n.x));s=new Uint8Array(u.Convert.FromBase64Url(n.y));c=new Uint8Array(u.Convert.FromBase64Url(n.d));f=new Uint8Array(1+o.length+s.length);f[0]=4;f.set(o,1);f.set(s,1+o.length);v=new Xh;v.writeString(this.sshType);v.writeString(this.curveName);v.writeMpInt(f);v.writeMpInt(c);return[2,v.toUint8Array()]}}))}))};t.prototype.importPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d,l,p,y,S,A,C,m,g;return __generator(this,(function(w){e=t.sshKey,i=t.crypto;r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=u.Convert.FromBase64(r);a=new $h(u.BufferSourceConverter.toUint8Array(n));o=a.readBytes(15);if(u.Convert.ToHex(o)!=="6f70656e7373682d6b65792d763100"){throw new Wh("invalid magic string")}s=a.readString();a.readString();a.readString();if(s!=="none"){throw new Qh(s)}c=a.readUint32();if(c!==1){throw new Wh("multiple keys not supported")}f=a.readUint32();a.readBytes(f);v=a.readUint32();h=a.readBytes(v);d=new $h(h);l=d.readUint32();p=d.readUint32();if(l!==p){throw new Wh("invalid checkints")}d.readString();d.readString();y=d.readMpInt();S=d.readMpInt();d.readString();if(y[0]!==4){throw new qh("invalid ECDSA public key point format")}A=Math.floor((y.length-1)/2);C=y.slice(1,1+A);m=y.slice(1+A);g={kty:"EC",crv:this.namedCurve,x:u.Convert.ToBase64Url(C),y:u.Convert.ToBase64Url(m),d:u.Convert.ToBase64Url(S)};return[2,i.subtle.importKey("jwk",g,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])]}))}))};t.prototype.sign=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){switch(s.label){case 0:e=t.privateKey,i=t.data,r=t.crypto,n=t.hash;a=this.getHashAlgorithm();if(n&&n!==a){throw new qh("ECDSA ".concat(this.namedCurve," requires ").concat(a,", got ").concat(n))}return[4,r.subtle.sign({name:"ECDSA",hash:a},e,i)];case 1:o=s.sent();return[2,u.BufferSourceConverter.toUint8Array(o)]}}))}))};t.prototype.verify=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o;return __generator(this,(function(s){e=t.publicKey,i=t.signature,r=t.data,n=t.crypto,a=t.hash;o=this.getHashAlgorithm();if(a&&a!==o){throw new qh("ECDSA ".concat(this.namedCurve," requires ").concat(o,", got ").concat(a))}return[2,n.subtle.verify({name:"ECDSA",hash:o},e,i,r)]}))}))};t.prototype.encodeSignature=function(t){var e=t.signature,i=t.algo;if(i.startsWith("ecdsa-sha2-")){var r=this.getSignatureCoordLength();var n=e.subarray(0,r);var a=e.subarray(r);var o=new Xh;o.writeString(i);var s=new Xh;s.writeMpInt(n,true);s.writeMpInt(a,true);var u=s.toUint8Array();o.writeUint32(u.length);o.writeBytes(u);return o.toUint8Array()}var c=new Xh;c.writeString(i);c.writeUint32(e.byteLength);c.writeBytes(e);return c.toUint8Array()};t.prototype.decodeSignature=function(t){var e=t.signature;var i=new $h(e);var r=i.readString();var n=i.readUint32();var a=i.readBytes(n);if(r.startsWith("ecdsa-sha2-")){var o=new $h(a);var s=o.readMpInt();var u=o.readMpInt();if(s[0]===0&&s.length>1&&(s[1]&128)===0){s=s.slice(1)}if(u[0]===0&&u.length>1&&(u[1]&128)===0){u=u.slice(1)}var c=this.getExpectedLength();var f=new Uint8Array(c);var v=new Uint8Array(c);if(s.length<=c){f.set(s,c-s.length)}else{f.set(s.slice(s.length-c),0)}if(u.length<=c){v.set(u,c-u.length)}else{v.set(u.slice(u.length-c),0)}var h=new Uint8Array(__spreadArray(__spreadArray([],f,true),v,true));return{signature:h,algo:r}}return{signature:a,algo:r}};t.prototype.supportsCryptoKey=function(t){return t.algorithm.name==="ECDSA"&&t.algorithm.namedCurve===this.namedCurve};t.prototype.parsePublicKey=function(t){var e=t.readString();if(e!==this.curveName){throw new qh("ECDSA certificate curve name ".concat(e,", expected ").concat(this.curveName))}var i=t.readBytes(t.readUint32());var r=new Xh;r.writeString(this.sshType);r.writeString(e);r.writeMpInt(i);return{type:this.sshType,keyData:r.toUint8Array()}};t.prototype.writePublicKey=function(t,e){var i=new $h(e.keyData);i.readString();var r=i.readString();var n=i.readMpInt();t.writeString(r);t.writeUint32(n.length);t.writeBytes(n)};t.prototype.getCertificateType=function(){return"".concat(this.sshType,"-cert-v01@openssh.com")};t.prototype.getSignatureAlgo=function(){return this.sshType};return t}();var ed=new td("nistp256","ecdsa-sha2-nistp256","P-256");var id=new td("nistp384","ecdsa-sha2-nistp384","P-384");var rd=new td("nistp521","ecdsa-sha2-nistp521","P-521");var nd=function(){function t(){}t.prototype.importPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a;return __generator(this,(function(o){e=t.blob,i=t.crypto;r=new $h(e);r.readString();n=r.readUint32();if(n!==32){throw new qh("Ed25519 key length ".concat(n,", expected 32"))}a=r.readBytes(n);return[2,i.subtle.importKey("raw",a,"Ed25519",true,["verify"])]}))}))};t.prototype.exportPublicSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a;return __generator(this,(function(o){switch(o.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("jwk",e)];case 1:r=o.sent();if(!r.x){throw new qh("Ed25519 JWK missing x parameter")}n=new Uint8Array(u.Convert.FromBase64Url(r.x));a=new Xh;a.writeString("ssh-ed25519");a.writeUint32(n.length);a.writeBytes(n);return[2,a.toUint8Array()]}}))}))};t.prototype.importPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.spki,i=t.crypto;return[2,i.subtle.importKey("spki",e,"Ed25519",true,["verify"])]}))}))};t.prototype.exportPublicSpki=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.publicKey,i=t.crypto;return[4,i.subtle.exportKey("spki",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.importPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){e=t.pkcs8,i=t.crypto;return[2,i.subtle.importKey("pkcs8",e,"Ed25519",true,["sign"])]}))}))};t.prototype.exportPrivatePkcs8=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;return __generator(this,(function(n){switch(n.label){case 0:e=t.privateKey,i=t.crypto;return[4,i.subtle.exportKey("pkcs8",e)];case 1:r=n.sent();return[2,u.BufferSourceConverter.toUint8Array(r)]}}))}))};t.prototype.exportPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f;return __generator(this,(function(v){switch(v.label){case 0:e=t.privateKey,i=t.crypto,r=t.jwk;a=r;if(a)return[3,2];return[4,i.subtle.exportKey("jwk",e)];case 1:a=v.sent();v.label=2;case 2:n=a;if(!n.d||!n.x){throw new qh("Ed25519 private key JWK missing required parameters")}o=new Uint8Array(u.Convert.FromBase64Url(n.d));s=new Uint8Array(u.Convert.FromBase64Url(n.x));c=new Xh;c.writeString("ssh-ed25519");c.writeUint32(s.length);c.writeBytes(s);f=new Uint8Array(64);f.set(o,0);f.set(s,32);c.writeUint32(f.length);c.writeBytes(f);return[2,c.toUint8Array()]}}))}))};t.prototype.importPrivateSsh=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n,a,o,s,c,f,v,h,d,l,p,y,S,A,C,m,g;return __generator(this,(function(w){e=t.sshKey,i=t.crypto;r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");n=u.Convert.FromBase64(r);a=new $h(u.BufferSourceConverter.toUint8Array(n));o=a.readBytes(15);if(u.Convert.ToHex(o)!=="6f70656e7373682d6b65792d763100"){throw new Wh("invalid magic string")}s=a.readString();a.readString();a.readString();if(s!=="none"){throw new Qh(s)}c=a.readUint32();if(c!==1){throw new Wh("multiple keys not supported")}f=a.readUint32();a.readBytes(f);v=a.readUint32();h=a.readBytes(v);d=new $h(h);l=d.readUint32();p=d.readUint32();if(l!==p){throw new Wh("invalid checkints")}d.readString();y=d.readUint32();S=d.readBytes(y);A=d.readUint32();C=d.readBytes(A);d.readString();m=C.slice(0,32);g={kty:"OKP",crv:"Ed25519",d:u.Convert.ToBase64Url(m),x:u.Convert.ToBase64Url(S)};return[2,i.subtle.importKey("jwk",g,"Ed25519",true,["sign"])]}))}))};t.prototype.sign=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n;return __generator(this,(function(a){switch(a.label){case 0:e=t.privateKey,i=t.data,r=t.crypto;return[4,r.subtle.sign("Ed25519",e,i)];case 1:n=a.sent();return[2,u.BufferSourceConverter.toUint8Array(n)]}}))}))};t.prototype.verify=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n;return __generator(this,(function(a){e=t.publicKey,i=t.signature,r=t.data,n=t.crypto;return[2,n.subtle.verify("Ed25519",e,i,r)]}))}))};t.prototype.encodeSignature=function(t){var e=t.signature,i=t.algo;var r=new Uint8Array(e);var n=new Xh;n.writeString(i);n.writeUint32(r.length);n.writeBytes(r);return n.toUint8Array()};t.prototype.decodeSignature=function(t){var e=t.signature;var i=new $h(e);var r=i.readString();var n=i.readUint32();var a=i.readBytes(n);return{signature:a,algo:r}};t.prototype.supportsCryptoKey=function(t){return t.algorithm.name==="Ed25519"};t.prototype.parsePublicKey=function(t){var e=t.readBytes(t.readUint32());var i=new Xh;i.writeString("ssh-ed25519");i.writeUint32(e.length);i.writeBytes(e);return{type:"ssh-ed25519",keyData:i.toUint8Array()}};t.prototype.writePublicKey=function(t,e){var i=new $h(e.keyData);i.readString();var r=i.readUint32();var n=i.readBytes(r);t.writeUint32(n.length);t.writeBytes(n)};t.prototype.getCertificateType=function(){return"ssh-ed25519-cert-v01@openssh.com"};t.prototype.getSignatureAlgo=function(){return"ssh-ed25519"};return t}();var ad=new Map;var od=function(){function t(){}t.get=function(t){var e=ad.get(t);if(!e){throw new Gh(t,Array.from(ad.keys()))}return e};t.register=function(t,e){ad.set(t,e)};t.getSshTypeFromCryptoKey=function(t){for(var e=0,i=ad.entries();e<i.length;e++){var r=i[e],n=r[0],a=r[1];if(a.supportsCryptoKey(t)){return n}}throw new Gh(t.algorithm.name,Array.from(ad.keys()))};t.certTypeToKeyType=function(t){var e={"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"};return e[t]};t.getSupportedCertTypes=function(){return Object.keys({"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"})};return t}();od.register("ssh-ed25519",new nd);od.register("ssh-rsa",new Jh("SHA-256"));od.register("rsa-sha2-256",new Jh("SHA-256"));od.register("rsa-sha2-512",new Jh("SHA-512"));od.register("ecdsa-sha2-nistp256",ed);od.register("ecdsa-sha2-nistp384",id);od.register("ecdsa-sha2-nistp521",rd);function sd(t){var e=typeof t==="string"?t.trim().split(/\s+/):null;if(!e||e.length<2){throw new Vh("Invalid SSH public key format")}var i=e[0];var r=new Uint8Array(u.Convert.FromBase64(e[1]));var n=e.length>2?e.slice(2).join(" "):undefined;var a=new $h(r);var o=a.readString();if(o!==i){throw new Vh("Key type mismatch")}return{type:i,keyData:r,comment:n}}function ud(t){var e=u.Convert.ToBase64(t.keyData);var i=[t.type,e];if(t.comment){i.push(t.comment)}return i.join(" ")}function cd(t){if(typeof t==="string"){var e=t.trim().split(/\s+/);if(e.length<2){throw new Vh("SSH certificate string","type base64 [comment]")}var i=e[0];var r=new Uint8Array(u.Convert.FromBase64(e[1]));var n=e.length>2?e.slice(2).join(" "):undefined;var a=new $h(r);var o=a.readString();if(o!==i){throw new Vh("certificate blob type ".concat(o),"expected ".concat(i))}return{type:i,keyData:r,comment:n}}else{var a=new $h(t);var s=a.readString();var c=t.slice(a.getOffset());return{type:s,keyData:c}}}function fd(t){var e=new $h(t);var i=e.readString();var r=e.readBytes(e.readUint32());var n=od.certTypeToKeyType(i);if(!n){throw new Lh(i,od.getSupportedCertTypes())}var a=od.get(n);var o=a.parsePublicKey(e);var s=n;var u=e.readUint64();var c=e.readUint32();var f=c===1?"user":"host";var v=e.readString();var h=e.readUint32();var d=e.readBytes(h);var l=[];if(d.length>0){var p=new $h(d);while(p.getOffset()<d.length){try{var y=p.readString();l.push(y)}catch(t){break}}}var S=e.readUint64();var A=e.readUint64();var C={};var m=e.readUint32();var g=e.readBytes(m);if(g.length>0){var w=new $h(g);while(w.getOffset()<g.length){try{var _=w.readString();var b=w.readBytes(w.readUint32());var E=b.length===0?"":Zh.decode(b);C[_]=E}catch(t){break}}}var P={};var D=e.readUint32();var I=e.readBytes(D);if(I.length>0){var B=new $h(I);while(B.getOffset()<I.length){try{var x=B.readString();var b=B.readBytes(B.readUint32());var T=b.length===0?"":Zh.decode(b);P[x]=T}catch(t){break}}}var O=e.readUint32();var k=e.readBytes(O);var M=e.readUint32();var R=e.readBytes(M);var N=new $h(R);var K=N.readString();var j={type:K,keyData:R};var H=e.readUint32();var U=e.readBytes(H);return{nonce:r,keyType:s,publicKey:o,serial:u,type:f,keyId:v,validPrincipals:l,validAfter:S,validBefore:A,criticalOptions:C,extensions:P,reserved:k,signatureKey:j,signature:U}}function vd(t){var e=u.Convert.ToBase64(t.keyData);var i=[t.type,e];if(t.comment){i.push(t.comment)}return i.join(" ")}function hd(t){var e=new $h(t);if(t.length>=6&&(new TextDecoder).decode(t.subarray(0,6))==="SSHSIG"){return dd(e)}else{return ld(e)}}function dd(t){var e=t.readBytes(6);var i=(new TextDecoder).decode(e);if(i!=="SSHSIG"){throw new Vh(i,"SSHSIG")}var r=t.readUint32();var n=t.readUint32();var a=t.readBytes(n);var o=t.readString();var s=t.readString();var u=t.readString();var c=t.readUint32();var f=t.readBytes(c);var v=new $h(f);var h=v.readString();var d=v.readUint32();var l=v.readBytes(d);return{format:"ssh-signature",algorithm:h,signature:l,version:r,publicKey:a,namespace:o,reserved:s,hashAlgorithm:u}}function ld(t){var e=t.readString();var i=t.readUint32();var r=t.readBytes(i);return{format:"legacy",algorithm:e,signature:r}}function pd(t){if(t.format==="ssh-signature"){return yd(t)}else{return Sd(t)}}function yd(t){var e=new Xh;e.writeBytes((new TextEncoder).encode("SSHSIG"));e.writeUint32(t.version||1);if(t.publicKey){e.writeUint32(t.publicKey.length);e.writeBytes(t.publicKey)}else{e.writeUint32(0)}e.writeString(t.namespace||"file");e.writeString(t.reserved||"");e.writeString(t.hashAlgorithm||"sha512");var i=new Xh;i.writeString(t.algorithm);i.writeUint32(t.signature.length);i.writeBytes(t.signature);var r=i.toUint8Array();e.writeUint32(r.length);e.writeBytes(r);return e.toUint8Array()}function Sd(t){var e=new Xh;e.writeString(t.algorithm);e.writeUint32(t.signature.length);e.writeBytes(t.signature);return e.toUint8Array()}var Ad=function(){function t(){}return t}();var Cd=function(t){__extends(e,t);function e(i){var r=t.call(this)||this;r.type=e.TYPE;r.blob=i;return r}e.prototype.getCryptoKey=function(){return __awaiter(this,arguments,void 0,(function(t){var e,i;if(t===void 0){t=Uh()}return __generator(this,(function(r){switch(r.label){case 0:if(!!this.cachedCryptoKey)return[3,2];e=od.get(this.blob.type);i=this;return[4,e.importPublicSsh({blob:this.blob.keyData,crypto:t})];case 1:i.cachedCryptoKey=r.sent();r.label=2;case 2:return[2,this.cachedCryptoKey]}}))}))};e.fromSSH=function(t){return __awaiter(this,arguments,void 0,(function(t,i){var r,n;if(i===void 0){i=Uh()}return __generator(this,(function(a){switch(a.label){case 0:r=sd(t);n=od.get(r.type);return[4,n.importPublicSsh({blob:r.keyData,crypto:i})];case 1:a.sent();return[2,new e(r)]}}))}))};e.fromSPKI=function(t,i){return __awaiter(this,arguments,void 0,(function(t,i,r){var n,a,o,s;if(r===void 0){r=Uh()}return __generator(this,(function(u){switch(u.label){case 0:n=od.get(i);return[4,n.importPublicSpki({spki:t,crypto:r})];case 1:a=u.sent();return[4,n.exportPublicSsh({publicKey:a,crypto:r})];case 2:o=u.sent();s={type:i,keyData:o};return[2,new e(s)]}}))}))};e.fromWebCrypto=function(t,i){return __awaiter(this,arguments,void 0,(function(t,i,r){var n,a,o,s;if(r===void 0){r=Uh()}return __generator(this,(function(u){switch(u.label){case 0:n=i||od.getSshTypeFromCryptoKey(t);a=od.get(n);return[4,a.exportPublicSsh({publicKey:t,crypto:r})];case 1:o=u.sent();s={type:n,keyData:o};return[2,new e(s)]}}))}))};e.prototype.export=function(){return __awaiter(this,arguments,void 0,(function(t,e){var i,r,n;if(t===void 0){t="ssh"}if(e===void 0){e=Uh()}return __generator(this,(function(a){switch(a.label){case 0:if(!(t==="ssh"))return[3,1];return[2,ud(this.blob)];case 1:if(!(t==="spki"))return[3,4];return[4,this.getCryptoKey(e)];case 2:i=a.sent();r=od.get(this.blob.type);return[4,r.exportPublicSpki({publicKey:i,crypto:e})];case 3:n=a.sent();return[2,new Uint8Array(n)];case 4:throw new Gh("Unsupported export format: ".concat(t))}}))}))};e.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.export("ssh")];case 1:t=e.sent();return[2,t]}}))}))};e.prototype.toSPKI=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.export("spki")];case 1:t=e.sent();return[2,t]}}))}))};e.prototype.toWebCrypto=function(){return __awaiter(this,arguments,void 0,(function(t){if(t===void 0){t=Uh()}return __generator(this,(function(e){return[2,this.getCryptoKey(t)]}))}))};e.prototype.verify=function(t,e,i){return __awaiter(this,arguments,void 0,(function(t,e,i,r){var n,a;if(r===void 0){r=Uh()}return __generator(this,(function(o){switch(o.label){case 0:n=od.get(t);return[4,this.toWebCrypto(r)];case 1:a=o.sent();return[2,n.verify({publicKey:a,signature:e,data:i,crypto:r})]}}))}))};Object.defineProperty(e.prototype,"keyType",{get:function(){return this.blob.type},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"comment",{get:function(){return this.blob.comment},enumerable:false,configurable:true});e.prototype.getBlob=function(){return __assign({},this.blob)};e.prototype.thumbprint=function(){return __awaiter(this,arguments,void 0,(function(t,e){var i,r,n;if(t===void 0){t="sha256"}if(e===void 0){e=Uh()}return __generator(this,(function(a){switch(a.label){case 0:i=t==="sha256"?"SHA-256":"SHA-512";r=this.blob.keyData;return[4,e.subtle.digest(i,r)];case 1:n=a.sent();return[2,new Uint8Array(n)]}}))}))};e.TYPE="public-key";return e}(Ad);var md=function(t){__extends(e,t);function e(i){var r=t.call(this)||this;r.type=e.TYPE;r.blob=i;r.format=i.format;r.algorithm=i.algorithm;r.signature=i.signature;r.version=i.version;r.namespace=i.namespace;r.reserved=i.reserved;r.hashAlgorithm=i.hashAlgorithm;if(i.publicKey){var n=new $h(i.publicKey);var a=n.readString();r.publicKey=new Cd({type:a,keyData:i.publicKey})}return r}e.parse=function(t){var i=hd(t);return new e(i)};e.fromBlob=function(t){return new e(t)};e.fromBase64=function(t){var i=new Uint8Array(u.Convert.FromBase64(t));return e.parse(i)};e.fromText=function(t){var i=t.replace(/-----BEGIN SSH SIGNATURE-----/,"").replace(/-----END SSH SIGNATURE-----/,"").replace(/[\r\n\s]/g,"");return e.fromBase64(i)};e.prototype.serialize=function(){return pd(this.blob)};e.prototype.toBase64=function(){return u.Convert.ToBase64(this.serialize())};e.prototype.toText=function(){var t=this.toBase64();var e=[];for(var i=0;i<t.length;i+=70){e.push(t.substring(i,i+70))}return __spreadArray(__spreadArray(["-----BEGIN SSH SIGNATURE-----"],e,true),["-----END SSH SIGNATURE-----"],false).join("\n")};e.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.toText()]}))}))};e.prototype.verify=function(t,e){return __awaiter(this,void 0,void 0,(function(){var i,r,n,a,o,s,u,c,f,v,h,d,l,p,y,S;return __generator(this,(function(A){switch(A.label){case 0:i=od.get(this.algorithm);return[4,e["getCryptoKey"]()];case 1:r=A.sent();n=Uh();a=t;if(!(this.format==="ssh-signature"))return[3,3];o=this.hashAlgorithm||"sha512";s=this.namespace||"file";u=this.reserved||"";c=o==="sha256"?"SHA-256":"SHA-512";return[4,n.subtle.digest(c,t)];case 2:f=A.sent();v=new Uint8Array(f);h=new Xh;h.writeBytes((new TextEncoder).encode("SSHSIG"));h.writeString(s);h.writeString(u);h.writeString(o);h.writeUint32(v.length);h.writeBytes(v);a=h.toUint8Array();A.label=3;case 3:if(this.algorithm==="rsa-sha2-256"){d="SHA-256"}else if(this.algorithm==="rsa-sha2-512"){d="SHA-512"}if(this.format==="legacy"||this.format==="ssh-signature"){p=new Xh;p.writeString(this.algorithm);p.writeUint32(this.signature.length);p.writeBytes(this.signature);y=p.toUint8Array();S=i.decodeSignature({signature:y});l=S.signature}else{l=this.signature}return[2,i.verify({publicKey:r,signature:l,data:a,crypto:n,hash:d})]}}))}))};e.fromLegacy=function(t,i){var r=od.get(t);var n=r.encodeSignature({signature:i,algo:t});var a=new $h(n);a.readString();var o=a.readUint32();var s=a.readBytes(o);return new e({format:"legacy",algorithm:t,signature:s})};e.fromSshSignature=function(t,i,r){if(r===void 0){r={}}var n={format:"ssh-signature",algorithm:t,signature:i,version:r.version||1,publicKey:r.publicKey?r.publicKey.getBlob().keyData:undefined,namespace:r.namespace||"file",reserved:r.reserved||"",hashAlgorithm:r.hashAlgorithm||"sha512"};return new e(n)};e.sign=function(t,i,r){return __awaiter(this,arguments,void 0,(function(t,i,r,n){var a,o,s,u,c,f,v,h,d,l,p,y,S,A,C,m,c,g,w,_,b;if(n===void 0){n={}}return __generator(this,(function(E){switch(E.label){case 0:a=n.format,o=a===void 0?"legacy":a,s=n.namespace,u=s===void 0?"file":s;if(!(o==="legacy"))return[3,2];return[4,i.sign(t,r)];case 1:c=E.sent();f=t||i.keyType;return[2,e.fromLegacy(f,c)];case 2:v=t;h=od.get(v);d=t==="rsa-sha2-256"?"sha256":"sha512";return[4,i.getPublicKey()];case 3:l=E.sent();p=Uh();y=d==="sha256"?"SHA-256":"SHA-512";return[4,p.subtle.digest(y,r)];case 4:S=E.sent();A=new Uint8Array(S);C=new Xh;C.writeBytes((new TextEncoder).encode("SSHSIG"));C.writeString(u);C.writeString("");C.writeString(d);C.writeUint32(A.length);C.writeBytes(A);m=C.toUint8Array();return[4,i.sign(v,m)];case 5:c=E.sent();g=h.encodeSignature({signature:c,algo:v});w=new $h(g);w.readString();_=w.readUint32();b=w.readBytes(_);return[2,e.fromSshSignature(v,b,{namespace:u,hashAlgorithm:d,publicKey:l})]}}))}))};e.TYPE="signature";return e}(Ad);var gd=(i=function(t){__extends(e,t);function e(e){var r=t.call(this)||this;r.type=i.TYPE;r._blob=e;r.data=fd(e.keyData);r._validAfter=r.data.validAfter;r._validBefore=r.data.validBefore;r.keyId=r.data.keyId;r.principals=r.data.validPrincipals;r.certType=r.data.type;r.serial=r.data.serial;r.validAfter=new Date(Number(r.data.validAfter)*1e3);r.validBefore=new Date(Number(r.data.validBefore)*1e3);r.publicKey=new Cd(r.data.publicKey);r.signatureKey=new Cd(r.data.signatureKey);r.criticalOptions=__assign({},r.data.criticalOptions);r.extensions=__assign({},r.data.extensions);return r}e.fromSSH=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){e=cd(t);return[2,new i(e)]}))}))};e.fromBlob=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,new i(t)]}))}))};e.prototype.toSSH=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,vd(this._blob)]}))}))};e.prototype.toBlob=function(){return __assign({},this._blob)};Object.defineProperty(e.prototype,"blob",{get:function(){return this.toBlob()},enumerable:false,configurable:true});e.prototype.validate=function(t){if(t===void 0){t=new Date}var e=BigInt(Math.floor(t.getTime()/1e3));var i=this._validAfter;var r=this._validBefore;var n=0xffffffffffffffffn;var a=r===n?e:r;return e>=i&&e<=a};e.prototype.verify=function(t){return __awaiter(this,arguments,void 0,(function(t,e){var i,r,n,a,o;if(e===void 0){e=Uh()}return __generator(this,(function(s){switch(s.label){case 0:i=t||this.signatureKey;r=this.getSignedData();n=md.parse(this.data.signature);a=od.get(n.algorithm);return[4,i.toWebCrypto(e)];case 1:o=s.sent();return[2,a.verify({publicKey:o,signature:n.signature,data:r,crypto:e})]}}))}))};e.prototype.getSignedData=function(){var t=new $h(this._blob.keyData);t.readString();t.readBytes(t.readUint32());if(this.data.keyType==="ssh-ed25519"){t.readBytes(t.readUint32())}else if(this.data.keyType==="ssh-rsa"){t.readBytes(t.readUint32());t.readBytes(t.readUint32())}else if(this.data.keyType.startsWith("ecdsa-sha2-")){t.readString();t.readBytes(t.readUint32())}t.readUint64();t.readUint32();t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readUint64();t.readUint64();t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readBytes(t.readUint32());var e=t.getOffset();return this._blob.keyData.slice(0,e)};return e}(Ad),i.TYPE="certificate",i);var wd=undefined&&undefined.__classPrivateFieldSet||function(t,e,i,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(t,i):n?n.value=i:e.set(t,i),i};var _d=undefined&&undefined.__classPrivateFieldGet||function(t,e,i,r){if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?r:i==="a"?r.call(t):r?r.value:e.get(t)};var bd;var Ed=function(){function t(t){bd.set(this,void 0);var e=cd(t.trim());wd(this,bd,new gd(e),"f");this.notBefore=_d(this,bd,"f").validAfter;this.notAfter=_d(this,bd,"f").validBefore;this.validity=co(this.notBefore,this.notAfter);this.type=[_d(this,bd,"f").blob.type,_d(this,bd,"f").certType,_d(this,bd,"f").type].join(" ");this.serialNumber=_d(this,bd,"f").serial.toString();this.keyId=_d(this,bd,"f").keyId;this.principals=_d(this,bd,"f").principals;this.extensions=_d(this,bd,"f").extensions;this.criticalOptions=_d(this,bd,"f").criticalOptions}t.prototype.parseSignatureKey=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,r;var n;return __generator(this,(function(a){switch(a.label){case 0:return[4,_d(this,bd,"f").signatureKey.toWebCrypto()];case 1:t=a.sent();e=_d(this,bd,"f").signatureKey.getBlob();return[4,_d(this,bd,"f").signatureKey.thumbprint("sha256")];case 2:i=a.sent();r=this;n={algorithm:t.algorithm.name,type:e.type};return[4,_d(this,bd,"f").signatureKey.toSSH()];case 3:r.signatureKey=(n.value=a.sent(),n.thumbprint=u.Convert.ToBase64(i),n);return[2]}}))}))};t.prototype.parsePublicKey=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,r;var n;return __generator(this,(function(a){switch(a.label){case 0:return[4,_d(this,bd,"f").publicKey.toWebCrypto()];case 1:t=a.sent();e=_d(this,bd,"f").publicKey.getBlob();return[4,_d(this,bd,"f").publicKey.thumbprint("sha256")];case 2:i=a.sent();r=this;n={algorithm:t.algorithm.name,type:e.type};return[4,_d(this,bd,"f").publicKey.toSSH()];case 3:r.publicKey=(n.value=a.sent(),n.thumbprint=u.Convert.ToBase64(i),n);return[2]}}))}))};t.prototype.toString=function(){return __awaiter(this,arguments,void 0,(function(t){if(t===void 0){t="pem"}return __generator(this,(function(t){return[2,_d(this,bd,"f").toSSH()]}))}))};Object.defineProperty(t.prototype,"commonName",{get:function(){return _d(this,bd,"f").principals.join("_")||_d(this,bd,"f").keyId||_d(this,bd,"f").certType},enumerable:false,configurable:true});t.prototype.downloadAsPub=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(r){switch(r.label){case 0:i=(e=c.certSSH).asPub;return[4,this.toString()];case 1:i.apply(e,[r.sent(),t||[this.commonName,"cert"].join("-")]);return[2]}}))}))};return t}();t("bm",Ed);bd=new WeakMap}}}));
135
+ //# sourceMappingURL=p-kq9wAWxW.system.js.map