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

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 (163) hide show
  1. package/components/attribute-certificate-viewer.js +2 -2
  2. package/components/attribute.js +1 -1
  3. package/components/certificate-chain-viewer.js +1 -1
  4. package/components/certificate-viewer.js +2 -2
  5. package/components/crl-viewer.js +2 -2
  6. package/components/csr-viewer.js +1 -1
  7. package/components/download.js +14324 -17
  8. package/components/download.js.map +1 -1
  9. package/components/index.js +1 -2
  10. package/components/index.js.map +1 -1
  11. package/components/index2.js +1 -1
  12. package/components/issuer_name.js +1 -1
  13. package/components/miscellaneous.js +1 -2
  14. package/components/miscellaneous.js.map +1 -1
  15. package/components/peculiar-certificate-decoder.js +1 -1
  16. package/components/peculiar-certificates-viewer.js +1 -2
  17. package/components/peculiar-certificates-viewer.js.map +1 -1
  18. package/components/pkcs10_certificate_request.js +2 -2
  19. package/components/row.js +1 -1
  20. package/components/ssh-certificate-viewer.js +23 -6
  21. package/components/ssh-certificate-viewer.js.map +1 -1
  22. package/components/subject_name.js +1 -1
  23. package/components/utils.js +39 -0
  24. package/components/utils.js.map +1 -0
  25. package/dist/cjs/{extension-D8YKlAu4.js → extension-DTtJlxk8.js} +3 -3
  26. package/dist/cjs/{extension-D8YKlAu4.js.map → extension-DTtJlxk8.js.map} +1 -1
  27. package/dist/cjs/index.cjs.js +2 -2
  28. package/dist/cjs/{miscellaneous-DvVSM5KJ.js → miscellaneous-DCeacaAw.js} +4 -4
  29. package/dist/cjs/{miscellaneous-DvVSM5KJ.js.map → miscellaneous-DCeacaAw.js.map} +1 -1
  30. 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
  31. package/dist/cjs/peculiar-attribute-certificate-viewer_5.cjs.entry.js +27 -10
  32. package/dist/cjs/peculiar-attribute-certificate-viewer_5.cjs.entry.js.map +1 -1
  33. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +5 -5
  34. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +4 -4
  35. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +3 -3
  36. package/dist/cjs/{pkcs10_certificate_request-BoHhadiA.js → pkcs10_certificate_request-DE-0eDXE.js} +3 -3
  37. package/dist/cjs/{pkcs10_certificate_request-BoHhadiA.js.map → pkcs10_certificate_request-DE-0eDXE.js.map} +1 -1
  38. package/dist/cjs/{ssh_certificate-s3-rwdMT.js → ssh_certificate-D2q_p49O.js} +14 -2
  39. package/dist/cjs/ssh_certificate-D2q_p49O.js.map +1 -0
  40. package/dist/cjs/{x509_certificate-DfXuxxZp.js → x509_certificate-Cto1q-eu.js} +4 -4
  41. package/dist/cjs/{x509_certificate-DfXuxxZp.js.map → x509_certificate-Cto1q-eu.js.map} +1 -1
  42. package/dist/cjs/{x509_crl-CxJ2lyGX.js → x509_crl-CgixMZrh.js} +5 -5
  43. package/dist/cjs/{x509_crl-CxJ2lyGX.js.map → x509_crl-CgixMZrh.js.map} +1 -1
  44. package/dist/collection/components/ssh-certificate-viewer/-components/basic_information.js +3 -3
  45. package/dist/collection/components/ssh-certificate-viewer/-components/basic_information.js.map +1 -1
  46. package/dist/collection/components/ssh-certificate-viewer/-components/miscellaneous.js +23 -0
  47. package/dist/collection/components/ssh-certificate-viewer/-components/miscellaneous.js.map +1 -0
  48. package/dist/collection/components/ssh-certificate-viewer/ssh-certificate-viewer.js +2 -1
  49. package/dist/collection/components/ssh-certificate-viewer/ssh-certificate-viewer.js.map +1 -1
  50. package/dist/collection/crypto/ssh_certificate.js +7 -1
  51. package/dist/collection/crypto/ssh_certificate.js.map +1 -1
  52. package/dist/collection/locales/en.json +1 -0
  53. package/dist/collection/utils/download.js +5 -0
  54. package/dist/collection/utils/download.js.map +1 -1
  55. package/dist/esm/{extension-oK2qpCU6.js → extension-DmlhftES.js} +3 -3
  56. package/dist/esm/{extension-oK2qpCU6.js.map → extension-DmlhftES.js.map} +1 -1
  57. package/dist/esm/index.js +2 -2
  58. package/dist/esm/{miscellaneous-DrmTXljc.js → miscellaneous-BTlqwN5_.js} +4 -4
  59. package/dist/esm/{miscellaneous-DrmTXljc.js.map → miscellaneous-BTlqwN5_.js.map} +1 -1
  60. 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
  61. package/dist/esm/peculiar-attribute-certificate-viewer_5.entry.js +28 -11
  62. package/dist/esm/peculiar-attribute-certificate-viewer_5.entry.js.map +1 -1
  63. package/dist/esm/peculiar-certificate-decoder.entry.js +5 -5
  64. package/dist/esm/peculiar-certificate-viewer.entry.js +4 -4
  65. package/dist/esm/peculiar-certificates-viewer.entry.js +3 -3
  66. package/dist/esm/{pkcs10_certificate_request-Bdt_qA_g.js → pkcs10_certificate_request-B5C1NYFc.js} +3 -3
  67. package/dist/esm/{pkcs10_certificate_request-Bdt_qA_g.js.map → pkcs10_certificate_request-B5C1NYFc.js.map} +1 -1
  68. package/dist/esm/{ssh_certificate-Ct-r021h.js → ssh_certificate-PCn0WXhQ.js} +14 -2
  69. package/dist/esm/ssh_certificate-PCn0WXhQ.js.map +1 -0
  70. package/dist/esm/{x509_certificate-5DEbrOA7.js → x509_certificate-BiAmXJ4S.js} +4 -4
  71. package/dist/{esm-es5/x509_certificate-5DEbrOA7.js.map → esm/x509_certificate-BiAmXJ4S.js.map} +1 -1
  72. package/dist/esm/{x509_crl-CPgNUkh7.js → x509_crl-CCeoLLUZ.js} +5 -5
  73. package/dist/esm/{x509_crl-CPgNUkh7.js.map → x509_crl-CCeoLLUZ.js.map} +1 -1
  74. package/dist/esm-es5/{extension-oK2qpCU6.js → extension-DmlhftES.js} +2 -2
  75. package/dist/esm-es5/{extension-oK2qpCU6.js.map → extension-DmlhftES.js.map} +1 -1
  76. package/dist/esm-es5/index.js +1 -1
  77. package/dist/esm-es5/{miscellaneous-DrmTXljc.js → miscellaneous-BTlqwN5_.js} +2 -2
  78. package/dist/esm-es5/{miscellaneous-DrmTXljc.js.map → miscellaneous-BTlqwN5_.js.map} +1 -1
  79. 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
  80. package/dist/esm-es5/peculiar-attribute-certificate-viewer_5.entry.js +10 -3
  81. package/dist/esm-es5/peculiar-attribute-certificate-viewer_5.entry.js.map +1 -1
  82. package/dist/esm-es5/peculiar-certificate-decoder.entry.js +1 -1
  83. package/dist/esm-es5/peculiar-certificate-viewer.entry.js +1 -1
  84. package/dist/esm-es5/peculiar-certificates-viewer.entry.js +1 -1
  85. package/dist/esm-es5/{pkcs10_certificate_request-Bdt_qA_g.js → pkcs10_certificate_request-B5C1NYFc.js} +2 -2
  86. package/dist/esm-es5/{pkcs10_certificate_request-Bdt_qA_g.js.map → pkcs10_certificate_request-B5C1NYFc.js.map} +1 -1
  87. package/dist/esm-es5/{ssh_certificate-Ct-r021h.js → ssh_certificate-PCn0WXhQ.js} +4 -4
  88. package/dist/esm-es5/ssh_certificate-PCn0WXhQ.js.map +1 -0
  89. package/dist/esm-es5/{x509_certificate-5DEbrOA7.js → x509_certificate-BiAmXJ4S.js} +4 -4
  90. package/dist/{esm/x509_certificate-5DEbrOA7.js.map → esm-es5/x509_certificate-BiAmXJ4S.js.map} +1 -1
  91. package/dist/esm-es5/{x509_crl-CPgNUkh7.js → x509_crl-CCeoLLUZ.js} +2 -2
  92. package/dist/esm-es5/{x509_crl-CPgNUkh7.js.map → x509_crl-CCeoLLUZ.js.map} +1 -1
  93. package/dist/peculiar/index.esm.js +1 -1
  94. package/dist/peculiar/locales/en.json +1 -0
  95. package/dist/peculiar/{p-364fd32b.system.entry.js → p-24861cf6.system.entry.js} +2 -2
  96. package/dist/peculiar/{p-11434880.system.entry.js → p-46c17c8d.system.entry.js} +2 -2
  97. package/dist/peculiar/{p-62b723f6.entry.js → p-71cb31c6.entry.js} +29 -22
  98. package/dist/peculiar/p-71cb31c6.entry.js.map +1 -0
  99. package/dist/peculiar/{p-0b895a8e.entry.js → p-71eab586.entry.js} +2 -2
  100. package/dist/peculiar/{p-da9eb1e7.entry.js → p-7273601a.entry.js} +2 -2
  101. package/dist/peculiar/{p-fd98bb82.system.entry.js → p-83bfd8e5.system.entry.js} +2 -2
  102. package/dist/peculiar/{p-83a53b4f.entry.js → p-98219569.entry.js} +2 -2
  103. package/dist/peculiar/{p-LmKU8Smy.system.js.map → p-9MJeDspO.system.js.map} +1 -1
  104. package/dist/peculiar/p-AjXipXSl.system.js +12 -0
  105. package/dist/peculiar/{p-IOtHTzYC.system.js.map → p-AjXipXSl.system.js.map} +1 -1
  106. package/dist/peculiar/{p-BQiABBi1.system.js → p-B2FH4Pv2.system.js} +4 -4
  107. package/dist/peculiar/{p-BQiABBi1.system.js.map → p-B2FH4Pv2.system.js.map} +1 -1
  108. package/dist/peculiar/{p-BeVuAzsd.system.js → p-B5GO6_Ut.system.js} +43 -43
  109. package/dist/peculiar/{p-BeVuAzsd.system.js.map → p-B5GO6_Ut.system.js.map} +1 -1
  110. package/dist/peculiar/{p-CxtUQdcj.system.js.map → p-B82-c-xr.system.js.map} +1 -1
  111. package/dist/peculiar/p-BGASC3UX.system.js +1 -1
  112. package/dist/peculiar/p-BHpSDBz_.system.js.map +1 -0
  113. package/dist/peculiar/p-BwlcJAh0.js +12 -0
  114. package/dist/peculiar/{p-BGIWeG8l.js.map → p-BwlcJAh0.js.map} +1 -1
  115. package/dist/peculiar/{p-BCsPspKr.system.js.map → p-CSz5liuX.system.js.map} +1 -1
  116. package/dist/peculiar/{p-D9qq15zG.js → p-CstRxc9v.js} +2 -2
  117. package/dist/peculiar/{p-D9qq15zG.js.map → p-CstRxc9v.js.map} +1 -1
  118. package/dist/peculiar/{p-ClkgAXnd.system.js → p-DMDALRLP.system.js} +4 -4
  119. package/dist/peculiar/p-DMDALRLP.system.js.map +1 -0
  120. package/dist/peculiar/{p-2GQYAR0v.system.js → p-DPbpwYQ8.system.js} +3 -3
  121. package/dist/peculiar/{p-2GQYAR0v.system.js.map → p-DPbpwYQ8.system.js.map} +1 -1
  122. package/dist/peculiar/{p-RWPI76Dh.js → p-Db41gPxb.js} +4 -4
  123. package/dist/peculiar/{p-RWPI76Dh.js.map → p-Db41gPxb.js.map} +1 -1
  124. package/dist/peculiar/{p-B2G7qjfV.js → p-DnOLjFJP.js} +40 -40
  125. package/dist/peculiar/{p-B2G7qjfV.js.map → p-DnOLjFJP.js.map} +1 -1
  126. package/dist/peculiar/{p-Ct-r021h.js → p-PCn0WXhQ.js} +4 -4
  127. package/dist/peculiar/p-PCn0WXhQ.js.map +1 -0
  128. package/dist/peculiar/{p-zQwWLfga.system.js → p-SjVQtfgD.system.js} +4 -4
  129. package/dist/peculiar/{p-zQwWLfga.system.js.map → p-SjVQtfgD.system.js.map} +1 -1
  130. package/dist/peculiar/{p-5df0f22b.system.entry.js → p-cc01a2da.system.entry.js} +29 -22
  131. package/dist/peculiar/p-cc01a2da.system.entry.js.map +1 -0
  132. package/dist/peculiar/{p-C31rbtuG.system.js → p-dOkqMp-O.system.js} +2 -2
  133. package/dist/peculiar/p-dOkqMp-O.system.js.map +1 -0
  134. package/dist/peculiar/{p-DOpiv0-8.js → p-h7XP7otl.js} +2 -2
  135. package/dist/peculiar/{p-DOpiv0-8.js.map → p-h7XP7otl.js.map} +1 -1
  136. 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
  137. package/dist/peculiar/peculiar.esm.js +1 -1
  138. package/dist/types/components/ssh-certificate-viewer/-components/miscellaneous.d.ts +14 -0
  139. package/dist/types/crypto/ssh_certificate.d.ts +2 -0
  140. package/dist/types/utils/download.d.ts +3 -0
  141. package/dist/types/utils/l10n.d.ts +1 -0
  142. package/hydrate/index.js +33 -4
  143. package/hydrate/index.mjs +33 -4
  144. package/package.json +2 -2
  145. package/components/link.js +0 -14335
  146. package/components/link.js.map +0 -1
  147. package/dist/cjs/ssh_certificate-s3-rwdMT.js.map +0 -1
  148. package/dist/esm/ssh_certificate-Ct-r021h.js.map +0 -1
  149. package/dist/esm-es5/ssh_certificate-Ct-r021h.js.map +0 -1
  150. package/dist/peculiar/p-5df0f22b.system.entry.js.map +0 -1
  151. package/dist/peculiar/p-62b723f6.entry.js.map +0 -1
  152. package/dist/peculiar/p-BGIWeG8l.js +0 -12
  153. package/dist/peculiar/p-C31rbtuG.system.js.map +0 -1
  154. package/dist/peculiar/p-Ce-IF7_R.system.js.map +0 -1
  155. package/dist/peculiar/p-ClkgAXnd.system.js.map +0 -1
  156. package/dist/peculiar/p-Ct-r021h.js.map +0 -1
  157. package/dist/peculiar/p-IOtHTzYC.system.js +0 -12
  158. /package/dist/peculiar/{p-364fd32b.system.entry.js.map → p-24861cf6.system.entry.js.map} +0 -0
  159. /package/dist/peculiar/{p-11434880.system.entry.js.map → p-46c17c8d.system.entry.js.map} +0 -0
  160. /package/dist/peculiar/{p-0b895a8e.entry.js.map → p-71eab586.entry.js.map} +0 -0
  161. /package/dist/peculiar/{p-da9eb1e7.entry.js.map → p-7273601a.entry.js.map} +0 -0
  162. /package/dist/peculiar/{p-fd98bb82.system.entry.js.map → p-83bfd8e5.system.entry.js.map} +0 -0
  163. /package/dist/peculiar/{p-83a53b4f.entry.js.map → p-98219569.entry.js.map} +0 -0
@@ -1,12 +1,12 @@
1
- var __extends=this&&this.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]};return t(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(t,e,r,n){function i(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function a(t){try{s(n.next(t))}catch(t){o(t)}}function u(t){try{s(n["throw"](t))}catch(t){o(t)}}function s(t){t.done?r(t.value):i(t.value).then(a,u)}s((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(t){return function(e){return s([t,e])}}function s(u){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(r=0)),r)try{if(n=1,i&&(o=u[0]&2?i["return"]:u[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;if(i=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:r.label++;return{value:u[1],done:false};case 5:r.label++;i=u[1];u=[0];continue;case 7:u=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1];o=u;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(u);break}if(o[2])r.ops.pop();r.trys.pop();continue}u=e.call(t,r)}catch(t){u=[6,t];i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};
1
+ var __extends=this&&this.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]};return t(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(t,e,r,n){function i(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,a){function o(t){try{s(n.next(t))}catch(t){a(t)}}function u(t){try{s(n["throw"](t))}catch(t){a(t)}}function s(t){t.done?r(t.value):i(t.value).then(o,u)}s((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(t){return function(e){return s([t,e])}}function s(u){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,u[0]&&(r=0)),r)try{if(n=1,i&&(a=u[0]&2?i["return"]:u[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;if(i=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:r.label++;return{value:u[1],done:false};case 5:r.label++;i=u[1];u=[0];continue;case 7:u=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1];a=u;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(u);break}if(a[2])r.ops.pop();r.trys.pop();continue}u=e.call(t,r)}catch(t){u=[6,t];i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
4
- */import{A as AsnData,c as certificateRawToBuffer,C as Certificate,P as PemConverter,b as buildExports,N as Name,a as dateDiff,e as AsnConvert,i as id_ecPublicKey,E as ECParameters,f as id_rsaEncryption,R as RSAPublicKey,g as id_composite_key,h as CompositePublicKey,j as id_alg_composite,k as CompositeSignatureValue,l as CompositeParams,m as getCertificateThumbprint,D as Download}from"./ssh_certificate-Ct-r021h.js";import{E as Extension}from"./extension-oK2qpCU6.js";
4
+ */import{A as AsnData,c as certificateRawToBuffer,C as Certificate,P as PemConverter,b as buildExports,N as Name,a as dateDiff,e as AsnConvert,i as id_ecPublicKey,E as ECParameters,f as id_rsaEncryption,R as RSAPublicKey,g as id_composite_key,h as CompositePublicKey,j as id_alg_composite,k as CompositeSignatureValue,l as CompositeParams,m as getCertificateThumbprint,D as Download}from"./ssh_certificate-PCn0WXhQ.js";import{E as Extension}from"./extension-DmlhftES.js";
5
5
  /**
6
6
  * @license
7
7
  * Copyright (c) Peculiar Ventures, LLC.
8
8
  *
9
9
  * This source code is licensed under the MIT license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
- */var X509Certificate=function(t){__extends(e,t);function e(e){var r=t.call(this,certificateRawToBuffer(e),Certificate)||this;r.thumbprints={};r.type="X.509 Certificate";r.tag=PemConverter.CertificateTag;var n=r.asn.tbsCertificate;r.serialNumber=buildExports.Convert.ToHex(n.serialNumber);r.subject=new Name(n.subject).toJSON();r.issuer=new Name(n.issuer).toJSON();r.version=n.version+1;var i=n.validity.notBefore.utcTime||n.validity.notBefore.generalTime;if(!i){throw new Error("Cannot get 'notBefore' value")}r.notBefore=i;var o=n.validity.notAfter.utcTime||n.validity.notAfter.generalTime;if(!o){throw new Error("Cannot get 'notAfter' value")}r.notAfter=o;r.validity=dateDiff(r.notBefore,r.notAfter);return r}e.prototype.parseExtensions=function(){var t=this.asn.tbsCertificate;if(t.extensions){this.extensions=t.extensions.map((function(t){return new Extension(AsnConvert.serialize(t))}))}};e.prototype.getPublicKeyInfo=function(t){var e=this;var r=t.subjectPublicKey,n=t.algorithm;var i;if(n.algorithm===id_ecPublicKey&&n.parameters){i=AsnConvert.parse(n.parameters,ECParameters)}if(n.algorithm===id_rsaEncryption){i=AsnConvert.parse(r,RSAPublicKey)}if(n.algorithm===id_composite_key){i=AsnConvert.parse(r,CompositePublicKey);i=i.map((function(t){return e.getPublicKeyInfo(t)}))}var o=AsnConvert.serialize(t);return{params:i,value:o,algorithm:n.algorithm}};Object.defineProperty(e.prototype,"publicKey",{get:function(){return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"signature",{get:function(){var t=this.asn,e=t.signatureValue,r=t.signatureAlgorithm;var n;if(r.algorithm===id_alg_composite){var i=AsnConvert.parse(e,CompositeSignatureValue);var o=AsnConvert.parse(r.parameters,CompositeParams);n=o.map((function(t,e){return Object.assign(Object.assign({},t),{value:i[e]})}))}return{params:n,value:e,algorithm:r.algorithm}},enumerable:false,configurable:true});e.prototype.getThumbprint=function(){return __awaiter(this,arguments,void 0,(function(t){var e,r;if(t===void 0){t="SHA-1"}return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,getCertificateThumbprint(t,this.raw)];case 1:e=n.sent();if(e){this.thumbprints[t]=buildExports.Convert.ToHex(e)}return[3,3];case 2:r=n.sent();console.error("Error thumbprint get:",r);return[3,3];case 3:return[2]}}))}))};Object.defineProperty(e.prototype,"commonName",{get:function(){if(!this.subject){return""}for(var t=0;t<this.subject.length;t+=1){var e=this.subject[t];if(e.shortName==="CN"||e.shortName==="E"||e.shortName==="O"){return e.value}}return""},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"issuerCommonName",{get:function(){if(!this.issuer){return""}for(var t=0;t<this.issuer.length;t+=1){var e=this.issuer[t];if(e.shortName==="CN"||e.shortName==="E"||e.shortName==="O"){return e.value}}return""},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isRoot",{get:function(){return JSON.stringify(this.issuer)===JSON.stringify(this.subject)},enumerable:false,configurable:true});e.prototype.subjectToString=function(){if(!this.subject){return""}return this.subject.map((function(t){return"".concat(t.shortName,"=").concat(t.value)})).join(", ")};e.prototype.issuerToString=function(){if(!this.issuer){return""}return this.issuer.map((function(t){return"".concat(t.shortName,"=").concat(t.value)})).join(", ")};e.prototype.toString=function(t){if(t===void 0){t="pem"}switch(t){case"pem":return PemConverter.encode(this.raw,this.tag);case"base64url":return buildExports.Convert.ToBase64Url(this.raw);default:return buildExports.Convert.ToBase64(this.raw)}};e.prototype.downloadAsPEM=function(t){Download.cert.asPEM(this.toString("pem"),t||this.commonName)};e.prototype.downloadAsDER=function(t){Download.cert.asDER(this.raw,t||this.commonName)};return e}(AsnData);export{X509Certificate as X};
12
- //# sourceMappingURL=x509_certificate-5DEbrOA7.js.map
11
+ */var X509Certificate=function(t){__extends(e,t);function e(e){var r=t.call(this,certificateRawToBuffer(e),Certificate)||this;r.thumbprints={};r.type="X.509 Certificate";r.tag=PemConverter.CertificateTag;var n=r.asn.tbsCertificate;r.serialNumber=buildExports.Convert.ToHex(n.serialNumber);r.subject=new Name(n.subject).toJSON();r.issuer=new Name(n.issuer).toJSON();r.version=n.version+1;var i=n.validity.notBefore.utcTime||n.validity.notBefore.generalTime;if(!i){throw new Error("Cannot get 'notBefore' value")}r.notBefore=i;var a=n.validity.notAfter.utcTime||n.validity.notAfter.generalTime;if(!a){throw new Error("Cannot get 'notAfter' value")}r.notAfter=a;r.validity=dateDiff(r.notBefore,r.notAfter);return r}e.prototype.parseExtensions=function(){var t=this.asn.tbsCertificate;if(t.extensions){this.extensions=t.extensions.map((function(t){return new Extension(AsnConvert.serialize(t))}))}};e.prototype.getPublicKeyInfo=function(t){var e=this;var r=t.subjectPublicKey,n=t.algorithm;var i;if(n.algorithm===id_ecPublicKey&&n.parameters){i=AsnConvert.parse(n.parameters,ECParameters)}if(n.algorithm===id_rsaEncryption){i=AsnConvert.parse(r,RSAPublicKey)}if(n.algorithm===id_composite_key){i=AsnConvert.parse(r,CompositePublicKey);i=i.map((function(t){return e.getPublicKeyInfo(t)}))}var a=AsnConvert.serialize(t);return{params:i,value:a,algorithm:n.algorithm}};Object.defineProperty(e.prototype,"publicKey",{get:function(){return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"signature",{get:function(){var t=this.asn,e=t.signatureValue,r=t.signatureAlgorithm;var n;if(r.algorithm===id_alg_composite){var i=AsnConvert.parse(e,CompositeSignatureValue);var a=AsnConvert.parse(r.parameters,CompositeParams);n=a.map((function(t,e){return Object.assign(Object.assign({},t),{value:i[e]})}))}return{params:n,value:e,algorithm:r.algorithm}},enumerable:false,configurable:true});e.prototype.getThumbprint=function(){return __awaiter(this,arguments,void 0,(function(t){var e,r;if(t===void 0){t="SHA-1"}return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,getCertificateThumbprint(t,this.raw)];case 1:e=n.sent();if(e){this.thumbprints[t]=buildExports.Convert.ToHex(e)}return[3,3];case 2:r=n.sent();console.error("Error thumbprint get:",r);return[3,3];case 3:return[2]}}))}))};Object.defineProperty(e.prototype,"commonName",{get:function(){if(!this.subject){return""}for(var t=0;t<this.subject.length;t+=1){var e=this.subject[t];if(e.shortName==="CN"||e.shortName==="E"||e.shortName==="O"){return e.value}}return""},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"issuerCommonName",{get:function(){if(!this.issuer){return""}for(var t=0;t<this.issuer.length;t+=1){var e=this.issuer[t];if(e.shortName==="CN"||e.shortName==="E"||e.shortName==="O"){return e.value}}return""},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isRoot",{get:function(){return JSON.stringify(this.issuer)===JSON.stringify(this.subject)},enumerable:false,configurable:true});e.prototype.subjectToString=function(){if(!this.subject){return""}return this.subject.map((function(t){return"".concat(t.shortName,"=").concat(t.value)})).join(", ")};e.prototype.issuerToString=function(){if(!this.issuer){return""}return this.issuer.map((function(t){return"".concat(t.shortName,"=").concat(t.value)})).join(", ")};e.prototype.toString=function(t){if(t===void 0){t="pem"}switch(t){case"pem":return PemConverter.encode(this.raw,this.tag);case"base64url":return buildExports.Convert.ToBase64Url(this.raw);default:return buildExports.Convert.ToBase64(this.raw)}};e.prototype.downloadAsPEM=function(t){Download.cert.asPEM(this.toString("pem"),t||this.commonName)};e.prototype.downloadAsDER=function(t){Download.cert.asDER(this.raw,t||this.commonName)};return e}(AsnData);export{X509Certificate as X};
12
+ //# sourceMappingURL=x509_certificate-BiAmXJ4S.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x509_certificate-5DEbrOA7.js","sources":["src/crypto/x509_certificate.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport {\n id_composite_key,\n id_alg_composite,\n CompositePublicKey,\n CompositeSignatureValue,\n CompositeParams,\n} from '@peculiar/asn1-x509-post-quantum';\nimport { Certificate, SubjectPublicKeyInfo } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\nimport { dateDiff, Download } from '../utils';\nimport { Name, INameJSON } from './name';\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport { PemConverter } from './pem_converter';\nimport {\n certificateRawToBuffer,\n getCertificateThumbprint,\n} from './utils';\n\nexport interface ISignature {\n algorithm: string;\n value: BufferSource;\n params?: {\n algorithm: string;\n value: BufferSource;\n }[];\n}\n\nexport interface IPublicKey {\n algorithm: string;\n value: BufferSource;\n params?: ECParameters | RSAPublicKey | IPublicKey[];\n}\n\nexport class X509Certificate extends AsnData<Certificate> {\n public readonly serialNumber: string;\n\n public readonly subject: INameJSON[];\n\n public readonly issuer: INameJSON[];\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public readonly version: number;\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'X.509 Certificate';\n\n public readonly tag = PemConverter.CertificateTag;\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), Certificate);\n\n const { tbsCertificate } = this.asn;\n\n this.serialNumber = Convert.ToHex(tbsCertificate.serialNumber);\n this.subject = new Name(tbsCertificate.subject).toJSON();\n this.issuer = new Name(tbsCertificate.issuer).toJSON();\n this.version = tbsCertificate.version + 1;\n\n const notBefore = tbsCertificate.validity.notBefore.utcTime\n || tbsCertificate.validity.notBefore.generalTime;\n\n if (!notBefore) {\n throw new Error('Cannot get \\'notBefore\\' value');\n }\n\n this.notBefore = notBefore;\n\n const notAfter = tbsCertificate.validity.notAfter.utcTime\n || tbsCertificate.validity.notAfter.generalTime;\n\n if (!notAfter) {\n throw new Error('Cannot get \\'notAfter\\' value');\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n }\n\n public parseExtensions() {\n const { tbsCertificate } = this.asn;\n\n if (tbsCertificate.extensions) {\n this.extensions = tbsCertificate.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n private getPublicKeyInfo(publicKeyInfo: SubjectPublicKeyInfo) {\n const { subjectPublicKey, algorithm } = publicKeyInfo;\n let params;\n\n if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {\n params = AsnConvert.parse(algorithm.parameters, ECParameters);\n }\n\n if (algorithm.algorithm === id_rsaEncryption) {\n params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);\n }\n\n if (algorithm.algorithm === id_composite_key) {\n params = AsnConvert.parse(subjectPublicKey, CompositePublicKey);\n\n params = params.map((param) => this.getPublicKeyInfo(param));\n }\n\n const spki = AsnConvert.serialize(publicKeyInfo);\n\n return {\n params,\n value: spki,\n algorithm: algorithm.algorithm,\n };\n }\n\n public get publicKey(): IPublicKey {\n return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo);\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n let params;\n\n if (signatureAlgorithm.algorithm === id_alg_composite) {\n const compositeSignatureValues = AsnConvert.parse(signatureValue, CompositeSignatureValue);\n const compositeParams = AsnConvert.parse(signatureAlgorithm.parameters, CompositeParams);\n\n params = compositeParams.map((param, index) => ({\n ...param,\n value: compositeSignatureValues[index],\n }));\n }\n\n return {\n params,\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public async getThumbprint(\n algorithm = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get commonName(): string {\n if (!this.subject) {\n return '';\n }\n\n for (let i = 0; i < this.subject.length; i += 1) {\n const name = this.subject[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get issuerCommonName(): string {\n if (!this.issuer) {\n return '';\n }\n\n for (let i = 0; i < this.issuer.length; i += 1) {\n const name = this.issuer[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get isRoot(): boolean {\n return JSON.stringify(this.issuer) === JSON.stringify(this.subject);\n }\n\n public subjectToString() {\n if (!this.subject) {\n return '';\n }\n\n return this.subject\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public issuerToString() {\n if (!this.issuer) {\n return '';\n }\n\n return this.issuer\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public toString(format: 'pem' | 'base64' | 'base64url' = 'pem'): string {\n switch (format) {\n case 'pem':\n return PemConverter.encode(this.raw, this.tag);\n case 'base64url':\n return Convert.ToBase64Url(this.raw);\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.cert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.cert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"names":["Convert"],"mappings":";;;;;;AAAA;;;;;;AAMG;AAuCG,MAAO,eAAgB,SAAQ,OAAoB,CAAA;AAuBvD,IAAA,WAAA,CAAY,GAAW,EAAA;QACrB,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC;QAP1C,IAAW,CAAA,WAAA,GAA2B,EAAE;QAE/B,IAAI,CAAA,IAAA,GAAG,mBAAmB;AAE1B,QAAA,IAAA,CAAA,GAAG,GAAG,YAAY,CAAC,cAAc;AAK/C,QAAA,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,GAAG;QAEnC,IAAI,CAAC,YAAY,GAAGA,oBAAO,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC;AAC9D,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE;AACxD,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE;QACtD,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,GAAG,CAAC;QAEzC,MAAM,SAAS,GAAG,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC/C,eAAA,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW;QAElD,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC;;AAGnD,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;QAE1B,MAAM,QAAQ,GAAG,cAAc,CAA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/x509_certificate.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport {\n id_composite_key,\n id_alg_composite,\n CompositePublicKey,\n CompositeSignatureValue,\n CompositeParams,\n} from '@peculiar/asn1-x509-post-quantum';\nimport { Certificate, SubjectPublicKeyInfo } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\nimport { dateDiff, Download } from '../utils';\nimport { Name, INameJSON } from './name';\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport { PemConverter } from './pem_converter';\nimport {\n certificateRawToBuffer,\n getCertificateThumbprint,\n} from './utils';\n\nexport interface ISignature {\n algorithm: string;\n value: BufferSource;\n params?: {\n algorithm: string;\n value: BufferSource;\n }[];\n}\n\nexport interface IPublicKey {\n algorithm: string;\n value: BufferSource;\n params?: ECParameters | RSAPublicKey | IPublicKey[];\n}\n\nexport class X509Certificate extends AsnData<Certificate> {\n public readonly serialNumber: string;\n\n public readonly subject: INameJSON[];\n\n public readonly issuer: INameJSON[];\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public readonly version: number;\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'X.509 Certificate';\n\n public readonly tag = PemConverter.CertificateTag;\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), Certificate);\n\n const { tbsCertificate } = this.asn;\n\n this.serialNumber = Convert.ToHex(tbsCertificate.serialNumber);\n this.subject = new Name(tbsCertificate.subject).toJSON();\n this.issuer = new Name(tbsCertificate.issuer).toJSON();\n this.version = tbsCertificate.version + 1;\n\n const notBefore = tbsCertificate.validity.notBefore.utcTime\n || tbsCertificate.validity.notBefore.generalTime;\n\n if (!notBefore) {\n throw new Error('Cannot get \\'notBefore\\' value');\n }\n\n this.notBefore = notBefore;\n\n const notAfter = tbsCertificate.validity.notAfter.utcTime\n || tbsCertificate.validity.notAfter.generalTime;\n\n if (!notAfter) {\n throw new Error('Cannot get \\'notAfter\\' value');\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n }\n\n public parseExtensions() {\n const { tbsCertificate } = this.asn;\n\n if (tbsCertificate.extensions) {\n this.extensions = tbsCertificate.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n private getPublicKeyInfo(publicKeyInfo: SubjectPublicKeyInfo) {\n const { subjectPublicKey, algorithm } = publicKeyInfo;\n let params;\n\n if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {\n params = AsnConvert.parse(algorithm.parameters, ECParameters);\n }\n\n if (algorithm.algorithm === id_rsaEncryption) {\n params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);\n }\n\n if (algorithm.algorithm === id_composite_key) {\n params = AsnConvert.parse(subjectPublicKey, CompositePublicKey);\n\n params = params.map((param) => this.getPublicKeyInfo(param));\n }\n\n const spki = AsnConvert.serialize(publicKeyInfo);\n\n return {\n params,\n value: spki,\n algorithm: algorithm.algorithm,\n };\n }\n\n public get publicKey(): IPublicKey {\n return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo);\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n let params;\n\n if (signatureAlgorithm.algorithm === id_alg_composite) {\n const compositeSignatureValues = AsnConvert.parse(signatureValue, CompositeSignatureValue);\n const compositeParams = AsnConvert.parse(signatureAlgorithm.parameters, CompositeParams);\n\n params = compositeParams.map((param, index) => ({\n ...param,\n value: compositeSignatureValues[index],\n }));\n }\n\n return {\n params,\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public async getThumbprint(\n algorithm = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get commonName(): string {\n if (!this.subject) {\n return '';\n }\n\n for (let i = 0; i < this.subject.length; i += 1) {\n const name = this.subject[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get issuerCommonName(): string {\n if (!this.issuer) {\n return '';\n }\n\n for (let i = 0; i < this.issuer.length; i += 1) {\n const name = this.issuer[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get isRoot(): boolean {\n return JSON.stringify(this.issuer) === JSON.stringify(this.subject);\n }\n\n public subjectToString() {\n if (!this.subject) {\n return '';\n }\n\n return this.subject\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public issuerToString() {\n if (!this.issuer) {\n return '';\n }\n\n return this.issuer\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public toString(format: 'pem' | 'base64' | 'base64url' = 'pem'): string {\n switch (format) {\n case 'pem':\n return PemConverter.encode(this.raw, this.tag);\n case 'base64url':\n return Convert.ToBase64Url(this.raw);\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.cert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.cert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"names":["Convert"],"mappings":";;;;;;AAAA;;;;;;AAMG;AAuCG,MAAO,eAAgB,SAAQ,OAAoB,CAAA;AAuBvD,IAAA,WAAA,CAAY,GAAW,EAAA;QACrB,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,EAAE,WAAW,C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I,CAAC,SAAS,CAAI,CAAA,EAAA,IAAI,CAAC,KAAK,CAAA,CAAE,CAClC;aACA,IAAI,CAAC,IAAI,CAAC;;IAGR,QAAQ,CAAC,SAAyC,KAAK,EAAA;QAC5D,QAAQ,MAAM;AACZ,YAAA,KAAK,KAAK;AACR,gBAAA,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC;AAChD,YAAA,KAAK,WAAW;gBACd,OAAOA,oBAAO,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;AACtC,YAAA;gBACE,OAAOA,oBAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC;;;AAIhC,IAAA,aAAa,CAAC,IAAa,EAAA;AAChC,QAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CACjB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpB,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB;;AAGI,IAAA,aAAa,CAAC,IAAa,EAAA;AAChC,QAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CACjB,IAAI,CAAC,GAAG,EACR,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB;;AAEJ;;;;"}
@@ -1,7 +1,7 @@
1
1
  var __extends=this&&this.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]};return t(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(t,e,r,n){function i(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function u(t){try{s(n.next(t))}catch(t){o(t)}}function a(t){try{s(n["throw"](t))}catch(t){o(t)}}function s(t){t.done?r(t.value):i(t.value).then(u,a)}s((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,u;return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(t){return function(e){return s([t,e])}}function s(a){if(n)throw new TypeError("Generator is already executing.");while(u&&(u=0,a[0]&&(r=0)),r)try{if(n=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;i=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(a[0]===6&&r.label<o[1]){r.label=o[1];o=a;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(a);break}if(o[2])r.ops.pop();r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t];i=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
4
- */import{A as AsnData,c as certificateRawToBuffer,n as AttributeCertificate,P as PemConverter,b as buildExports,a as dateDiff,e as AsnConvert,m as getCertificateThumbprint,D as Download,o as CertificateList,N as Name}from"./ssh_certificate-Ct-r021h.js";import{E as Extension}from"./extension-oK2qpCU6.js";import{A as Attribute}from"./pkcs10_certificate_request-Bdt_qA_g.js";
4
+ */import{A as AsnData,c as certificateRawToBuffer,n as AttributeCertificate,P as PemConverter,b as buildExports,a as dateDiff,e as AsnConvert,m as getCertificateThumbprint,D as Download,o as CertificateList,N as Name}from"./ssh_certificate-PCn0WXhQ.js";import{E as Extension}from"./extension-DmlhftES.js";import{A as Attribute}from"./pkcs10_certificate_request-B5C1NYFc.js";
5
5
  /**
6
6
  * @license
7
7
  * Copyright (c) Peculiar Ventures, LLC.
@@ -16,4 +16,4 @@ var __extends=this&&this.__extends||function(){var t=function(e,r){t=Object.setP
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
18
  */var X509Crl=function(t){__extends(e,t);function e(e){var r=t.call(this,certificateRawToBuffer(e),CertificateList)||this;r.thumbprints={};r.type="X.509 Certificate Revocation List";r.tag=PemConverter.CrlTag;var n=r.asn.tbsCertList;r.issuer=new Name(n.issuer).toJSON();r.version=n.version+1;r.lastUpdate=n.thisUpdate.getTime();r.nextUpdate=n.nextUpdate.getTime();r.revokedCertificates=(n.revokedCertificates||[]).map((function(t){var e;return{revocationDate:t.revocationDate,userCertificate:t.userCertificate,crlEntryExtensions:(e=t.crlEntryExtensions)===null||e===void 0?void 0:e.map((function(t){return new Extension(AsnConvert.serialize(t))}))}}));return r}e.prototype.getThumbprint=function(){return __awaiter(this,arguments,void 0,(function(t){var e,r;if(t===void 0){t="SHA-1"}return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,getCertificateThumbprint(t,this.raw)];case 1:e=n.sent();if(e){this.thumbprints[t]=buildExports.Convert.ToHex(e)}return[3,3];case 2:r=n.sent();console.error("Error thumbprint get:",r);return[3,3];case 3:return[2]}}))}))};Object.defineProperty(e.prototype,"signature",{get:function(){var t=this.asn,e=t.signature,r=t.signatureAlgorithm;return{value:e,algorithm:r.algorithm}},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"commonName",{get:function(){if(!this.issuer){return""}for(var t=0;t<this.issuer.length;t+=1){var e=this.issuer[t];if(e.shortName==="CN"||e.shortName==="E"||e.shortName==="O"){return e.value}}return""},enumerable:false,configurable:true});e.prototype.parseExtensions=function(){var t=this.asn.tbsCertList;if(t.crlExtensions){this.extensions=t.crlExtensions.map((function(t){return new Extension(AsnConvert.serialize(t))}))}};e.prototype.toString=function(t){if(t===void 0){t="pem"}switch(t){case"pem":return PemConverter.encode(this.raw,this.tag);case"base64url":return buildExports.Convert.ToBase64Url(this.raw);default:return buildExports.Convert.ToBase64(this.raw)}};e.prototype.downloadAsPEM=function(t){Download.crl.asPEM(this.toString("pem"),t||this.commonName)};e.prototype.downloadAsDER=function(t){Download.crl.asDER(this.raw,t||this.commonName)};return e}(AsnData);export{X509AttributeCertificate as X,X509Crl as a};
19
- //# sourceMappingURL=x509_crl-CPgNUkh7.js.map
19
+ //# sourceMappingURL=x509_crl-CCeoLLUZ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x509_crl-CPgNUkh7.js","sources":["src/crypto/x509_attribute_certificate.ts","src/crypto/x509_crl.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport type { GeneralName } from '@peculiar/asn1-x509';\nimport { AttributeCertificate, Holder } from '@peculiar/asn1-x509-attr';\nimport { Convert } from 'pvtsutils';\nimport { dateDiff, Download } from '../utils';\nimport { AsnData } from './asn_data';\nimport { Extension, TExtensionValue } from './extension';\nimport { Attribute, TAttributeValue } from './attribute';\nimport { PemConverter } from './pem_converter';\nimport {\n certificateRawToBuffer,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\nexport class X509AttributeCertificate extends AsnData<AttributeCertificate> {\n public readonly serialNumber: string;\n\n public readonly version: number;\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public attributes: Attribute<TAttributeValue>[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly issuer: GeneralName[];\n\n public holder: Holder;\n\n public readonly type = 'X.509 Attribute Certificate';\n\n public readonly tag = PemConverter.AttributeCertificateTag;\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), AttributeCertificate);\n\n const { acinfo } = this.asn;\n\n this.serialNumber = Convert.ToHex(acinfo.serialNumber);\n this.version = acinfo.version;\n\n const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;\n\n if (!notBefore) {\n throw new Error('Cannot get \\'notBefore\\' value');\n }\n\n this.notBefore = notBefore;\n\n const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;\n\n if (!notAfter) {\n throw new Error('Cannot get \\'notAfter\\' value');\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n this.issuer = acinfo.issuer.v1Form || acinfo.issuer.v2Form?.issuerName;\n this.holder = acinfo.holder;\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n\n return {\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public parseExtensions() {\n const { acinfo } = this.asn;\n\n if (acinfo.extensions) {\n this.extensions = acinfo.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n public parseAttributes() {\n const { acinfo } = this.asn;\n\n if (acinfo.attributes) {\n this.attributes = acinfo.attributes\n .map((e) => new Attribute(AsnConvert.serialize(e)));\n }\n }\n\n public async getThumbprint(\n algorithm = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get commonName(): string {\n return `attribute-certificate-${this.thumbprints['SHA-1']}`;\n }\n\n public toString(format: 'pem' | 'base64' | 'base64url' = 'pem'): string {\n switch (format) {\n case 'pem':\n return PemConverter.encode(this.raw, this.tag);\n case 'base64url':\n return Convert.ToBase64Url(this.raw);\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.attrCert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.attrCert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { CertificateList, Time } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\nimport { Download } from '../utils';\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport { Name, INameJSON } from './name';\nimport { PemConverter } from './pem_converter';\nimport {\n certificateRawToBuffer,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\nexport interface IRevokedCertificate {\n userCertificate: ArrayBuffer;\n revocationDate: Time;\n crlEntryExtensions?: Extension<TExtensionValue>[];\n}\n\nexport class X509Crl extends AsnData<CertificateList> {\n public readonly issuer: INameJSON[];\n\n public readonly version: number;\n\n public readonly lastUpdate: Date;\n\n public readonly nextUpdate: Date;\n\n public extensions: Extension<TExtensionValue>[];\n\n public revokedCertificates: IRevokedCertificate[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'X.509 Certificate Revocation List';\n\n public readonly tag = PemConverter.CrlTag;\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), CertificateList);\n\n const { tbsCertList } = this.asn;\n\n this.issuer = new Name(tbsCertList.issuer).toJSON();\n this.version = tbsCertList.version + 1;\n this.lastUpdate = tbsCertList.thisUpdate.getTime();\n this.nextUpdate = tbsCertList.nextUpdate.getTime();\n\n this.revokedCertificates = (tbsCertList.revokedCertificates || [])\n .map((revokedCertificate) => ({\n revocationDate: revokedCertificate.revocationDate,\n userCertificate: revokedCertificate.userCertificate,\n crlEntryExtensions: revokedCertificate.crlEntryExtensions\n ?.map((e) => new Extension(AsnConvert.serialize(e))),\n }));\n }\n\n public async getThumbprint(\n algorithm = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get signature(): ISignature {\n const { signature, signatureAlgorithm } = this.asn;\n\n return {\n value: signature,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public get commonName(): string {\n if (!this.issuer) {\n return '';\n }\n\n for (let i = 0; i < this.issuer.length; i += 1) {\n const name = this.issuer[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public parseExtensions() {\n const { tbsCertList } = this.asn;\n\n if (tbsCertList.crlExtensions) {\n this.extensions = tbsCertList.crlExtensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n public toString(format: 'pem' | 'base64' | 'base64url' = 'pem'): string {\n switch (format) {\n case 'pem':\n return PemConverter.encode(this.raw, this.tag);\n case 'base64url':\n return Convert.ToBase64Url(this.raw);\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.crl.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.crl.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"names":["Convert"],"mappings":";;;;;;;AAAA;;;;;;AAMG;AAqBG,MAAO,wBAAyB,SAAQ,OAA6B,CAAA;AAyBzE,IAAA,WAAA,CAAY,GAAW,EAAA;;QACrB,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,EAAE,oBAAoB,CAAC;QAXnD,IAAW,CAAA,WAAA,GAA2B,EAAE;QAM/B,IAAI,CAAA,IAAA,GAAG,6BAA6B;AAEpC,QAAA,IAAA,CAAA,GAAG,GAAG,YAAY,CAAC,uBAAuB;AAKx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A,OAAO,EAAE;;IAGJ,eAAe,GAAA;AACpB,QAAA,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,GAAG;AAEhC,QAAA,IAAI,WAAW,CAAC,aAAa,EAAE;AAC7B,YAAA,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC;AAC3B,iBAAA,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;;;IAIlD,QAAQ,CAAC,SAAyC,KAAK,EAAA;QAC5D,QAAQ,MAAM;AACZ,YAAA,KAAK,KAAK;AACR,gBAAA,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC;AAChD,YAAA,KAAK,WAAW;gBACd,OAAOA,oBAAO,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;AACtC,YAAA;gBACE,OAAOA,oBAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC;;;AAIhC,IAAA,aAAa,CAAC,IAAa,EAAA;AAChC,QAAA,QAAQ,CAAC,GAAG,CAAC,KAAK,CAChB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpB,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB;;AAGI,IAAA,aAAa,CAAC,IAAa,EAAA;AAChC,QAAA,QAAQ,CAAC,GAAG,CAAC,KAAK,CAChB,IAAI,CAAC,GAAG,EACR,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB;;AAEJ;;;;"}
1
+ {"version":3,"file":"x509_crl-CCeoLLUZ.js","sources":["src/crypto/x509_attribute_certificate.ts","src/crypto/x509_crl.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport type { GeneralName } from '@peculiar/asn1-x509';\nimport { AttributeCertificate, Holder } from '@peculiar/asn1-x509-attr';\nimport { Convert } from 'pvtsutils';\nimport { dateDiff, Download } from '../utils';\nimport { AsnData } from './asn_data';\nimport { Extension, TExtensionValue } from './extension';\nimport { Attribute, TAttributeValue } from './attribute';\nimport { PemConverter } from './pem_converter';\nimport {\n certificateRawToBuffer,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\nexport class X509AttributeCertificate extends AsnData<AttributeCertificate> {\n public readonly serialNumber: string;\n\n public readonly version: number;\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public attributes: Attribute<TAttributeValue>[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly issuer: GeneralName[];\n\n public holder: Holder;\n\n public readonly type = 'X.509 Attribute Certificate';\n\n public readonly tag = PemConverter.AttributeCertificateTag;\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), AttributeCertificate);\n\n const { acinfo } = this.asn;\n\n this.serialNumber = Convert.ToHex(acinfo.serialNumber);\n this.version = acinfo.version;\n\n const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;\n\n if (!notBefore) {\n throw new Error('Cannot get \\'notBefore\\' value');\n }\n\n this.notBefore = notBefore;\n\n const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;\n\n if (!notAfter) {\n throw new Error('Cannot get \\'notAfter\\' value');\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n this.issuer = acinfo.issuer.v1Form || acinfo.issuer.v2Form?.issuerName;\n this.holder = acinfo.holder;\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n\n return {\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public parseExtensions() {\n const { acinfo } = this.asn;\n\n if (acinfo.extensions) {\n this.extensions = acinfo.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n public parseAttributes() {\n const { acinfo } = this.asn;\n\n if (acinfo.attributes) {\n this.attributes = acinfo.attributes\n .map((e) => new Attribute(AsnConvert.serialize(e)));\n }\n }\n\n public async getThumbprint(\n algorithm = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get commonName(): string {\n return `attribute-certificate-${this.thumbprints['SHA-1']}`;\n }\n\n public toString(format: 'pem' | 'base64' | 'base64url' = 'pem'): string {\n switch (format) {\n case 'pem':\n return PemConverter.encode(this.raw, this.tag);\n case 'base64url':\n return Convert.ToBase64Url(this.raw);\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.attrCert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.attrCert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { CertificateList, Time } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\nimport { Download } from '../utils';\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport { Name, INameJSON } from './name';\nimport { PemConverter } from './pem_converter';\nimport {\n certificateRawToBuffer,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\nexport interface IRevokedCertificate {\n userCertificate: ArrayBuffer;\n revocationDate: Time;\n crlEntryExtensions?: Extension<TExtensionValue>[];\n}\n\nexport class X509Crl extends AsnData<CertificateList> {\n public readonly issuer: INameJSON[];\n\n public readonly version: number;\n\n public readonly lastUpdate: Date;\n\n public readonly nextUpdate: Date;\n\n public extensions: Extension<TExtensionValue>[];\n\n public revokedCertificates: IRevokedCertificate[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'X.509 Certificate Revocation List';\n\n public readonly tag = PemConverter.CrlTag;\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), CertificateList);\n\n const { tbsCertList } = this.asn;\n\n this.issuer = new Name(tbsCertList.issuer).toJSON();\n this.version = tbsCertList.version + 1;\n this.lastUpdate = tbsCertList.thisUpdate.getTime();\n this.nextUpdate = tbsCertList.nextUpdate.getTime();\n\n this.revokedCertificates = (tbsCertList.revokedCertificates || [])\n .map((revokedCertificate) => ({\n revocationDate: revokedCertificate.revocationDate,\n userCertificate: revokedCertificate.userCertificate,\n crlEntryExtensions: revokedCertificate.crlEntryExtensions\n ?.map((e) => new Extension(AsnConvert.serialize(e))),\n }));\n }\n\n public async getThumbprint(\n algorithm = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get signature(): ISignature {\n const { signature, signatureAlgorithm } = this.asn;\n\n return {\n value: signature,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public get commonName(): string {\n if (!this.issuer) {\n return '';\n }\n\n for (let i = 0; i < this.issuer.length; i += 1) {\n const name = this.issuer[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public parseExtensions() {\n const { tbsCertList } = this.asn;\n\n if (tbsCertList.crlExtensions) {\n this.extensions = tbsCertList.crlExtensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n public toString(format: 'pem' | 'base64' | 'base64url' = 'pem'): string {\n switch (format) {\n case 'pem':\n return PemConverter.encode(this.raw, this.tag);\n case 'base64url':\n return Convert.ToBase64Url(this.raw);\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.crl.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.crl.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"names":["Convert"],"mappings":";;;;;;;AAAA;;;;;;AAMG;AAqBG,MAAO,wBAAyB,SAAQ,OAA6B,CAAA;AAyBzE,IAAA,WAAA,CAAY,GAAW,EAAA;;QACrB,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,EAAE,oBAAoB,CAAC;QAXnD,IAAW,CAAA,WAAA,GAA2B,EAAE;QAM/B,IAAI,CAAA,IAAA,GAAG,6BAA6B;AAEpC,QAAA,IAAA,CAAA,GAAG,GAAG,YAAY,CAAC,uBAAuB;AAKxD,QAAA,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG;QAE3B,IAAI,CAAC,YAAY,GAAGA,oBAAO,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC;AACtD,QAAA,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO;AAE7B,QAAA,MAAM,SAAS,GAAG,MAAM,CAAC,sBAAsB,CAAC,aAAa;QAE7D,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC;;AAGnD,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;AAE1B,QAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,sBAAsB,CAAC,YAAY;QAE3D,IAAI,CAAC,QAAQ,EAAE;AACb,YAAA,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC;;AAGlD,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ;AACxB,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC;AACvD,QAAA,IAAI,CAAC,MAAM,GAAG,MAA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KAAK,CAChB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpB,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB;;AAGI,IAAA,aAAa,CAAC,IAAa,EAAA;AAChC,QAAA,QAAQ,CAAC,GAAG,CAAC,KAAK,CAChB,IAAI,CAAC,GAAG,EACR,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB;;AAEJ;;;;"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
3
  */
4
- export{D as Download,d as downloadFromBuffer}from"./p-Ct-r021h.js";export{r as readAsArrayBuffer,a as readAsBinaryString,b as readAsDataUrl,c as readAsText}from"./p-F2F0McJX.js";export{P as Pkcs10CertificateRequest}from"./p-RWPI76Dh.js";export{B as Button,T as Typography}from"./p-CutTi-2B.js";export{L as Link}from"./p-DMZr5ztF.js";export{C as CrossIcon,D as DetailsIcon,L as LinkIcon}from"./p-DanjeXNk.js";export{D as DownloadIcon}from"./p-JyD6URnB.js";export{A as ActionsIcon}from"./p-CHnDlTqM.js";export{A as ArrowBottomIcon,a as ArrowTopIcon}from"./p-ZT6tVIen.js";import"./p-CwgZaF40.js";
4
+ export{D as Download,d as downloadFromBuffer}from"./p-PCn0WXhQ.js";export{r as readAsArrayBuffer,a as readAsBinaryString,b as readAsDataUrl,c as readAsText}from"./p-F2F0McJX.js";export{P as Pkcs10CertificateRequest}from"./p-Db41gPxb.js";export{B as Button,T as Typography}from"./p-CutTi-2B.js";export{L as Link}from"./p-DMZr5ztF.js";export{C as CrossIcon,D as DetailsIcon,L as LinkIcon}from"./p-DanjeXNk.js";export{D as DownloadIcon}from"./p-JyD6URnB.js";export{A as ActionsIcon}from"./p-CHnDlTqM.js";export{A as ArrowBottomIcon,a as ArrowTopIcon}from"./p-ZT6tVIen.js";import"./p-CwgZaF40.js";
5
5
  //# sourceMappingURL=index.esm.js.map
@@ -9,6 +9,7 @@
9
9
  "download": "Download",
10
10
  "download.pem": "Download PEM",
11
11
  "download.der": "Download DER",
12
+ "download.ssh": "Download SSH",
12
13
  "serialNumber": "Serial Number",
13
14
  "version": "Version",
14
15
  "validity": "Validity",
@@ -1,5 +1,5 @@
1
1
  var __awaiter=this&&this.__awaiter||function(t,e,r,a){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function s(t){try{c(a.next(t))}catch(t){i(t)}}function n(t){try{c(a["throw"](t))}catch(t){i(t)}}function c(t){t.done?r(t.value):o(t.value).then(s,n)}c((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,o,i,s;return s={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function n(t){return function(e){return c([t,e])}}function c(n){if(a)throw new TypeError("Generator is already executing.");while(s&&(s=0,n[0]&&(r=0)),r)try{if(a=1,o&&(i=n[0]&2?o["return"]:n[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,n[1])).done)return i;if(o=0,i)n=[n[0]&2,i.value];switch(n[0]){case 0:case 1:i=n;break;case 4:r.label++;return{value:n[1],done:false};case 5:r.label++;o=n[1];n=[0];continue;case 7:n=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(n[0]===6||n[0]===2)){r=0;continue}if(n[0]===3&&(!i||n[1]>i[0]&&n[1]<i[3])){r.label=n[1];break}if(n[0]===6&&r.label<i[1]){r.label=i[1];i=n;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(n);break}if(i[2])r.ops.pop();r.trys.pop();continue}n=e.call(t,r)}catch(t){n=[6,t];o=0}finally{a=i=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
4
- */System.register(["./p-DKl0YViA.system.js","./p-2GQYAR0v.system.js","./p-ClkgAXnd.system.js","./p-BeVuAzsd.system.js","./p-B4PdAFCr.system.js","./p-IOtHTzYC.system.js","./p-Bknpl7EO.system.js","./p-D8xU284r.system.js"],(function(t){"use strict";var e,r,a,o,i,s,n,c,v,p,l,h,d,b,g,u;return{setters:[function(t){e=t.r;r=t.h;a=t.H},function(t){o=t.X},null,function(t){i=t.B;s=t.S;n=t.I;c=t.P;v=t.a;p=t.T;l=t.E;h=t.g;d=t.b;b=t.c;g=t.M},function(t){u=t.T},null,null,null],execute:function(){var f="*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;position:relative;min-width:280px;min-height:300px;word-wrap:break-word;word-break:break-word}th,td{border:none}table{width:100%;border-spacing:0;border-collapse:collapse}table tr:last-child .divider{display:none}table td{padding:var(--pv-size-base-2) var(--pv-size-base-4);vertical-align:top}table td:first-child{width:220px}table td:last-child{width:calc(100% - 220px)}table td.monospace{max-width:0}table td.divider{padding:var(--pv-size-base-2) 0}table td.divider span{height:1px;display:block;background-color:var(--pv-color-gray-4)}table .title td{padding-top:var(--pv-size-base-6);padding-bottom:var(--pv-size-base-2)}table table{border-left:1px solid var(--pv-color-gray-5)}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table tr.title{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table tr.title td{padding:0 var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table td{padding:0 var(--pv-size-base-4);width:100% !important;max-width:100% !important}:host([data-mobile-screen-view=true]) table td.divider{padding:0}";var y=t("peculiar_certificate_viewer",function(){function t(t){var r=this;e(this,t);this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.isDecodeInProcess=true;this.getAuthKeyIdParentLink=function(t){var e;return(e=r.authKeyIdParentLink)===null||e===void 0?void 0:e.replace("{{authKeyId}}",t)};this.getAuthKeyIdSiblingsLink=function(t){var e;return(e=r.authKeyIdSiblingsLink)===null||e===void 0?void 0:e.replace("{{authKeyId}}",t)};this.getSubjectKeyIdChildrenLink=function(t){var e;return(e=r.subjectKeyIdChildrenLink)===null||e===void 0?void 0:e.replace("{{subjectKeyId}}",t)};this.getSubjectKeyIdSiblingsLink=function(t){var e;return(e=r.subjectKeyIdSiblingsLink)===null||e===void 0?void 0:e.replace("{{subjectKeyId}}",t)}}t.prototype.handleMediaQueryChange=function(t){this.mobileScreenView=t.matches};t.prototype.componentWillLoad=function(){this.decodeCertificate(this.certificate);{this.mobileMediaQuery=window.matchMedia(this.mobileMediaQueryString);this.mobileMediaQuery.addEventListener("change",this.handleMediaQueryChange.bind(this));this.mobileScreenView=this.mobileMediaQuery.matches}};t.prototype.disconnectedCallback=function(){this.mobileMediaQuery.removeEventListener("change",this.handleMediaQueryChange.bind(this))};t.prototype.decodeCertificate=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:this.isDecodeInProcess=true;r.label=1;case 1:r.trys.push([1,4,,5]);if(t instanceof o){this.certificateDecoded=t}else if(typeof t==="string"){this.certificateDecoded=new o(t)}else{return[2]}this.certificateDecoded.parseExtensions();return[4,this.certificateDecoded.getThumbprint("SHA-1")];case 2:r.sent();return[4,this.certificateDecoded.getThumbprint("SHA-256")];case 3:r.sent();return[3,5];case 4:e=r.sent();this.certificateDecodeError=e;console.error("Error certificate parse:",e);return[3,5];case 5:this.isDecodeInProcess=false;return[2]}}))}))};t.prototype.watchCertificateAndDecode=function(t,e){if(typeof t==="string"&&typeof e==="string"){if(t!==e){this.decodeCertificate(t)}return}if(t instanceof o&&e instanceof o){if(t.serialNumber!==e.serialNumber){this.decodeCertificate(t)}}};t.prototype.getIssuerDnLink=function(){return this.issuerDnLink};t.prototype.renderErrorState=function(){return r("div",{class:"status_wrapper"},r(u,null,"There was an error decoding this certificate."))};t.prototype.renderEmptyState=function(){return r("div",{class:"status_wrapper"},r(u,null,"There is no certificate available."))};t.prototype.render=function(){if(this.certificateDecodeError){return this.renderErrorState()}if(!this.certificateDecoded){return this.renderEmptyState()}return r(a,{"data-mobile-screen-view":String(this.mobileScreenView)},r("table",null,r(i,Object.assign({},this.certificateDecoded)),r(s,{name:this.certificateDecoded.subject}),r(n,{name:this.certificateDecoded.issuer,issuerDnLink:this.getIssuerDnLink()}),r(c,{publicKey:this.certificateDecoded.publicKey}),r(v,{signature:this.certificateDecoded.signature}),r(p,{thumbprints:this.certificateDecoded.thumbprints}),r(l,{extensions:this.certificateDecoded.extensions,getLEILink:b,getDNSNameLink:d,getIPAddressLink:h,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),this.download&&r(g,{certificate:this.certificateDecoded})))};Object.defineProperty(t,"watchers",{get:function(){return{certificate:["watchCertificateAndDecode"]}},enumerable:false,configurable:true});return t}());y.style=f}}}));
5
- //# sourceMappingURL=p-364fd32b.system.entry.js.map
4
+ */System.register(["./p-DKl0YViA.system.js","./p-DPbpwYQ8.system.js","./p-DMDALRLP.system.js","./p-B5GO6_Ut.system.js","./p-B4PdAFCr.system.js","./p-AjXipXSl.system.js","./p-Bknpl7EO.system.js","./p-D8xU284r.system.js"],(function(t){"use strict";var e,r,a,o,i,s,n,c,v,p,l,h,d,b,g,u;return{setters:[function(t){e=t.r;r=t.h;a=t.H},function(t){o=t.X},null,function(t){i=t.B;s=t.S;n=t.I;c=t.P;v=t.a;p=t.T;l=t.E;h=t.g;d=t.b;b=t.c;g=t.M},function(t){u=t.T},null,null,null],execute:function(){var f="*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;position:relative;min-width:280px;min-height:300px;word-wrap:break-word;word-break:break-word}th,td{border:none}table{width:100%;border-spacing:0;border-collapse:collapse}table tr:last-child .divider{display:none}table td{padding:var(--pv-size-base-2) var(--pv-size-base-4);vertical-align:top}table td:first-child{width:220px}table td:last-child{width:calc(100% - 220px)}table td.monospace{max-width:0}table td.divider{padding:var(--pv-size-base-2) 0}table td.divider span{height:1px;display:block;background-color:var(--pv-color-gray-4)}table .title td{padding-top:var(--pv-size-base-6);padding-bottom:var(--pv-size-base-2)}table table{border-left:1px solid var(--pv-color-gray-5)}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table tr.title{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table tr.title td{padding:0 var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table td{padding:0 var(--pv-size-base-4);width:100% !important;max-width:100% !important}:host([data-mobile-screen-view=true]) table td.divider{padding:0}";var y=t("peculiar_certificate_viewer",function(){function t(t){var r=this;e(this,t);this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.isDecodeInProcess=true;this.getAuthKeyIdParentLink=function(t){var e;return(e=r.authKeyIdParentLink)===null||e===void 0?void 0:e.replace("{{authKeyId}}",t)};this.getAuthKeyIdSiblingsLink=function(t){var e;return(e=r.authKeyIdSiblingsLink)===null||e===void 0?void 0:e.replace("{{authKeyId}}",t)};this.getSubjectKeyIdChildrenLink=function(t){var e;return(e=r.subjectKeyIdChildrenLink)===null||e===void 0?void 0:e.replace("{{subjectKeyId}}",t)};this.getSubjectKeyIdSiblingsLink=function(t){var e;return(e=r.subjectKeyIdSiblingsLink)===null||e===void 0?void 0:e.replace("{{subjectKeyId}}",t)}}t.prototype.handleMediaQueryChange=function(t){this.mobileScreenView=t.matches};t.prototype.componentWillLoad=function(){this.decodeCertificate(this.certificate);{this.mobileMediaQuery=window.matchMedia(this.mobileMediaQueryString);this.mobileMediaQuery.addEventListener("change",this.handleMediaQueryChange.bind(this));this.mobileScreenView=this.mobileMediaQuery.matches}};t.prototype.disconnectedCallback=function(){this.mobileMediaQuery.removeEventListener("change",this.handleMediaQueryChange.bind(this))};t.prototype.decodeCertificate=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:this.isDecodeInProcess=true;r.label=1;case 1:r.trys.push([1,4,,5]);if(t instanceof o){this.certificateDecoded=t}else if(typeof t==="string"){this.certificateDecoded=new o(t)}else{return[2]}this.certificateDecoded.parseExtensions();return[4,this.certificateDecoded.getThumbprint("SHA-1")];case 2:r.sent();return[4,this.certificateDecoded.getThumbprint("SHA-256")];case 3:r.sent();return[3,5];case 4:e=r.sent();this.certificateDecodeError=e;console.error("Error certificate parse:",e);return[3,5];case 5:this.isDecodeInProcess=false;return[2]}}))}))};t.prototype.watchCertificateAndDecode=function(t,e){if(typeof t==="string"&&typeof e==="string"){if(t!==e){this.decodeCertificate(t)}return}if(t instanceof o&&e instanceof o){if(t.serialNumber!==e.serialNumber){this.decodeCertificate(t)}}};t.prototype.getIssuerDnLink=function(){return this.issuerDnLink};t.prototype.renderErrorState=function(){return r("div",{class:"status_wrapper"},r(u,null,"There was an error decoding this certificate."))};t.prototype.renderEmptyState=function(){return r("div",{class:"status_wrapper"},r(u,null,"There is no certificate available."))};t.prototype.render=function(){if(this.certificateDecodeError){return this.renderErrorState()}if(!this.certificateDecoded){return this.renderEmptyState()}return r(a,{"data-mobile-screen-view":String(this.mobileScreenView)},r("table",null,r(i,Object.assign({},this.certificateDecoded)),r(s,{name:this.certificateDecoded.subject}),r(n,{name:this.certificateDecoded.issuer,issuerDnLink:this.getIssuerDnLink()}),r(c,{publicKey:this.certificateDecoded.publicKey}),r(v,{signature:this.certificateDecoded.signature}),r(p,{thumbprints:this.certificateDecoded.thumbprints}),r(l,{extensions:this.certificateDecoded.extensions,getLEILink:b,getDNSNameLink:d,getIPAddressLink:h,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),this.download&&r(g,{certificate:this.certificateDecoded})))};Object.defineProperty(t,"watchers",{get:function(){return{certificate:["watchCertificateAndDecode"]}},enumerable:false,configurable:true});return t}());y.style=f}}}));
5
+ //# sourceMappingURL=p-24861cf6.system.entry.js.map
@@ -1,7 +1,7 @@
1
1
  var __awaiter=this&&this.__awaiter||function(t,e,r,a){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function n(t){try{c(a.next(t))}catch(t){i(t)}}function s(t){try{c(a["throw"](t))}catch(t){i(t)}}function c(t){t.done?r(t.value):o(t.value).then(n,s)}c((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,o,i,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(t){return function(e){return c([t,e])}}function c(s){if(a)throw new TypeError("Generator is already executing.");while(n&&(n=0,s[0]&&(r=0)),r)try{if(a=1,o&&(i=s[0]&2?o["return"]:s[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;if(o=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;o=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t];o=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var a=0,o=e.length,i;a<o;a++){if(i||!(a in e)){if(!i)i=Array.prototype.slice.call(e,0,a);i[a]=e[a]}}return t.concat(i||Array.prototype.slice.call(e))};
2
2
  /*!
3
3
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
4
- */System.register(["./p-DKl0YViA.system.js","./p-2GQYAR0v.system.js","./p-ClkgAXnd.system.js","./p-B4PdAFCr.system.js","./p-CdS84qJs.system.js","./p-D8xU284r.system.js","./p-Bi5mjeeg.system.js","./p-IOtHTzYC.system.js"],(function(t){"use strict";var e,r,a,o,i,n,s,c,l,v,p,d,h,b,u,g;return{setters:[function(t){e=t.h;r=t.r;a=t.c;o=t.H},function(t){i=t.X},function(t){n=t.Z;s=t._;c=t.$},function(t){l=t.T;v=t.B},function(t){p=t.D;d=t.L;h=t.C},function(t){b=t.D},function(t){u=t.a;g=t.A},null],execute:function(){
4
+ */System.register(["./p-DKl0YViA.system.js","./p-DPbpwYQ8.system.js","./p-DMDALRLP.system.js","./p-B4PdAFCr.system.js","./p-CdS84qJs.system.js","./p-D8xU284r.system.js","./p-Bi5mjeeg.system.js","./p-AjXipXSl.system.js"],(function(t){"use strict";var e,r,a,o,i,n,s,c,l,v,p,d,h,b,u,g;return{setters:[function(t){e=t.h;r=t.r;a=t.c;o=t.H},function(t){i=t.X},function(t){n=t.Z;s=t._;c=t.$},function(t){l=t.T;v=t.B},function(t){p=t.D;d=t.L;h=t.C},function(t){b=t.D},function(t){u=t.a;g=t.A},null],execute:function(){
5
5
  /**
6
6
  * @license
7
7
  * Copyright (c) Peculiar Ventures, LLC.
@@ -10,4 +10,4 @@ var __awaiter=this&&this.__awaiter||function(t,e,r,a){function o(t){return t ins
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
  var f=function(t){var r=t.certificate,a=t.showIssuer;var o=function(t,r){return e("tr",null,e("td",null,e(l,{variant:"b2",color:"gray-9"},t)),e("td",null,e(l,{variant:"b2",color:"black"},r)))};return e("table",null,e("tbody",null,o(n.getString("subjectName"),r.subjectToString()),a&&o(n.getString("issuerName"),r.issuerToString()),o(n.getString("serialNumber"),r.serialNumber),o(n.getString("version"),r.version),o(n.getString("validity"),r.validity),o(n.getString("issued"),s(r.notBefore)),o(n.getString("expired"),s(r.notAfter))))};var y="*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;word-wrap:break-word;min-width:280px;overflow:auto;position:relative}.search_section{padding:var(--pv-size-base-4);border-bottom:1px solid var(--pv-color-gray-4)}.input_search{height:var(--pv-size-base-8);width:100%;outline:none;background-color:var(--pv-color-gray-1);padding:0 var(--pv-size-base-2);border:1px solid var(--pv-color-gray-7);border-radius:4px;-webkit-transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s;transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s}.input_search::-webkit-input-placeholder{color:var(--pv-color-gray-9)}.input_search::-moz-placeholder{color:var(--pv-color-gray-9)}.input_search:-ms-input-placeholder{color:var(--pv-color-gray-9)}.input_search::-ms-input-placeholder{color:var(--pv-color-gray-9)}.input_search::placeholder{color:var(--pv-color-gray-9)}table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}table td,table th{border-bottom:1px solid var(--pv-color-gray-4);vertical-align:top;text-align:left}table td:first-child,table th:first-child{padding-right:0;width:var(--pv-size-base-10)}table td:last-child,table th:last-child{padding-left:0;width:var(--pv-size-base-10)}table th{padding:var(--pv-size-base-2) var(--pv-size-base-4)}table th.col_action{padding:0}table td{padding:var(--pv-size-base-4)}table tr.m_expanded{background:var(--pv-color-gray-1)}table tr.m_expanded>td{border-bottom:none}table tr.expanded_summary{background:var(--pv-color-gray-1)}table tr.expanded_summary table{table-layout:initial}table tr.expanded_summary table td{border-bottom:none;padding:var(--pv-size-base-2)}table tr.expanded_summary table td:first-child{width:200px}table tr.expanded_summary table td:last-child{width:auto}.button_table_cell{margin-top:-3px}.status_wrapper{text-align:center;height:var(--pv-size-base-16);vertical-align:middle}.modal_wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;-webkit-animation:fadeIn 200ms;animation:fadeIn 200ms;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.modal_backdrop{background:var(--pv-color-black);z-index:-1;position:fixed;top:0;right:0;bottom:0;left:0;opacity:0.5}.modal_container{background:var(--pv-color-white);width:100%;display:-ms-flexbox;display:flex;max-height:calc(100% - 60px);-ms-flex-direction:column;flex-direction:column;margin:var(--pv-size-base-6);position:relative;outline:none;-webkit-box-shadow:var(--pv-shadow-dark-hight);box-shadow:var(--pv-shadow-dark-hight);overflow:hidden;border:0px;padding:0px;max-width:640px;border-radius:4px}.modal_header{padding:var(--pv-size-base-3) var(--pv-size-base-4);display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;gap:var(--pv-size-base-2);border-bottom:1px solid var(--pv-color-gray-5)}.modal_content{-ms-flex:1 1 auto;flex:1 1 auto;overflow:auto}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tbody,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block;width:100% !important;padding:0;border:none}:host([data-mobile-screen-view=true]) thead{display:none}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table .expanded_summary{padding:0}:host([data-mobile-screen-view=true]) table .certificate_row{border-bottom:1px solid var(--pv-color-gray-5);padding:var(--pv-size-base-2) var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table .certificate_row_actions{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table .certificate_row_actions td{display:-ms-flexbox;display:flex;-ms-flex-pack:right;justify-content:right;gap:var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) .button_table_cell{margin-top:0}";var m=t("peculiar_certificates_viewer",function(){function t(t){var e=this;r(this,t);this.detailsOpen=a(this,"detailsOpen");this.detailsClose=a(this,"detailsClose");this.isHasRoots=false;this.certificates=[];this.filterWithSearch=true;this.highlightWithSearch=true;this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.search="";this.certificatesDecoded=[];this.isDecodeInProcess=true;this.handleClickDetails=function(t){e.certificateSelectedForDetails=t;e.detailsOpen.emit(t)};this.handleModalClose=function(){e.certificateSelectedForDetails=undefined;e.detailsClose.emit()};this.handleSearch=function(t){var r=t.target;e.search=r.value.trim()}}t.prototype.handleMediaQueryChange=function(t){this.mobileScreenView=t.matches};t.prototype.componentWillLoad=function(){this.certificatesDecodeAndSet();{this.mobileMediaQuery=window.matchMedia(this.mobileMediaQueryString);this.mobileMediaQuery.addEventListener("change",this.handleMediaQueryChange.bind(this));this.mobileScreenView=this.mobileMediaQuery.matches}};t.prototype.disconnectedCallback=function(){this.mobileMediaQuery.removeEventListener("change",this.handleMediaQueryChange.bind(this))};t.prototype.watchCertificates=function(t,e){if(JSON.stringify(t)!==JSON.stringify(e)){this.certificatesDecodeAndSet()}};t.prototype.certificatesDecodeAndSet=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,a,o,n,s;return __generator(this,(function(c){switch(c.label){case 0:t=false;if(!Array.isArray(this.certificates)){return[2]}e=[];r=0,a=this.certificates;c.label=1;case 1:if(!(r<a.length))return[3,6];o=a[r];c.label=2;case 2:c.trys.push([2,4,,5]);n=new i(o.value);return[4,n.getThumbprint("SHA-1")];case 3:c.sent();e.push({body:n,tests:o.tests,name:o.name});if(!t&&n.isRoot){t=true}return[3,5];case 4:s=c.sent();console.error("Error certificate parse:",s);return[3,5];case 5:r++;return[3,1];case 6:this.isHasRoots=t;this.isDecodeInProcess=false;this.certificatesDecoded=e;return[2]}}))}))};t.prototype.getCertificateName=function(t){if(typeof t.name==="function"){return t.name(t.body)}return t.name||t.body.commonName};t.prototype.handleClickDownloadAsPem=function(t){t.body.downloadAsPEM(this.getCertificateName(t))};t.prototype.handleClickDownloadAsDer=function(t){t.body.downloadAsDER(this.getCertificateName(t))};t.prototype.handleClickRow=function(t){var e=this.expandedRow===t;this.expandedRow=e?undefined:t};t.prototype.getMaxColSpanValue=function(){var t=5;if(!this.isHasRoots){t+=1}return t};t.prototype.renderCertificateButtonActions=function(t){var r=this;var a,o,i;var s=t.tests&&(t.tests.expired||t.tests.revoked||t.tests.valid);return e("peculiar-button-menu",{class:"button_table_cell",groups:__spreadArray([{title:n.getString("previewCertificate"),options:[{text:n.getString("viewDetails"),startIcon:e(p,null),onClick:function(){return r.handleClickDetails(t.body)}}]},{title:n.getString("downloadOptions"),options:[{text:n.getString("download.pem"),startIcon:e(b,null),onClick:function(){return r.handleClickDownloadAsPem(t)}},{text:n.getString("download.der"),startIcon:e(b,null),onClick:function(){return r.handleClickDownloadAsDer(t)}}]}],s?[{title:n.getString("testURLs"),options:__spreadArray(__spreadArray(__spreadArray([],((a=t.tests)===null||a===void 0?void 0:a.valid)?[{text:n.getString("valid"),href:t.tests.valid,startIcon:e(d,null)}]:[],true),((o=t.tests)===null||o===void 0?void 0:o.revoked)?[{text:n.getString("revoked"),href:t.tests.revoked,startIcon:e(d,null)}]:[],true),((i=t.tests)===null||i===void 0?void 0:i.expired)?[{text:n.getString("expired"),href:t.tests.expired,startIcon:e(d,null)}]:[],true)}]:[],true)})};t.prototype.renderExpandedRow=function(t){var r=this.getMaxColSpanValue()-2;return e("tr",{class:"expanded_summary"},e("td",null),e("td",{colSpan:r},e(f,{certificate:t,showIssuer:!t.isRoot})),e("td",null))};t.prototype.renderCertificatesRows=function(){var t=this;var r=this.highlightWithSearch?this.search:"";var a=[];this.certificatesDecoded.forEach((function(o,i){var s=i===t.expandedRow;var p=c[o.body.signature.algorithm]||o.body.signature.algorithm;if(t.filterWithSearch&&t.search){var d=[p,o.body.issuerCommonName,t.getCertificateName(o),o.body.thumbprints["SHA-1"]].join(" ").toLowerCase();if(d.indexOf(t.search.toLowerCase())===-1){return}}if(t.mobileScreenView){a.push([e("tr",{class:{certificate_row:true,m_expanded:s},key:o.body.thumbprints["SHA-1"]},e("td",null,e("table",null,e("tbody",null,!t.isHasRoots&&e("tr",null,e("td",null,e(l,{variant:"b2",color:"gray-9"},n.getString("issuer"))),e("td",null,e(l,{variant:"b2",color:"black"},e("peculiar-highlight-words",{search:r},o.body.issuerCommonName)))),e("tr",null,e("td",null,e(l,{variant:"b2",color:"gray-9"},n.getString("name"))),e("td",null,e(l,{variant:"b2",color:"black"},e("peculiar-highlight-words",{search:r},t.getCertificateName(o))))),e("tr",null,e("td",null,e(l,{variant:"b2",color:"gray-9"},n.getString("publicKey"))),e("td",null,e(l,{variant:"b2",color:"black"},e("peculiar-highlight-words",{search:r},p)))),e("tr",null,e("td",null,e(l,{variant:"b2",color:"gray-9"},n.getString("fingerprint"),"  (SHA-1)")),e("td",null,e(l,{variant:"b2",color:"black"},e("peculiar-highlight-words",{search:r},o.body.thumbprints["SHA-1"])))),s&&t.renderExpandedRow(o.body),e("tr",{class:"certificate_row_actions"},e("td",null,t.renderCertificateButtonActions(o),e(v,{startIcon:s?e(u,null):e(g,null),onClick:t.handleClickRow.bind(t,i)})))))))]);return}a.push([e("tr",{class:{m_expanded:s},key:o.body.thumbprints["SHA-1"]},e("td",null,e(v,{startIcon:s?e(u,null):e(g,null),class:"button_table_cell",onClick:t.handleClickRow.bind(t,i)})),!t.isHasRoots&&e("td",null,e(l,null,e("peculiar-highlight-words",{search:r},o.body.issuerCommonName))),e("td",null,e(l,null,e("peculiar-highlight-words",{search:r},t.getCertificateName(o)))),e("td",null,e(l,null,e("peculiar-highlight-words",{search:r},p))),e("td",null,e(l,null,e("peculiar-highlight-words",{search:r},o.body.thumbprints["SHA-1"]))),e("td",null,t.renderCertificateButtonActions(o))),s&&t.renderExpandedRow(o.body)])}));return a};t.prototype.renderCertificateDetailsModal=function(){if(!this.certificateSelectedForDetails){return null}return e("div",{class:"modal_wrapper",role:"presentation","aria-hidden":"false",part:"presentation"},e("div",{class:"modal_backdrop","aria-hidden":"true",onClick:this.handleModalClose}),e("div",{class:"modal_container",role:"dialog",part:"presentation_container"},e("header",{class:"modal_header"},e(l,{variant:"h4"},n.getString("certificateDetails")),e(v,{startIcon:e(h,null),onClick:this.handleModalClose})),e("div",{class:"modal_content"},e("peculiar-certificate-viewer",{certificate:this.certificateSelectedForDetails,mobileMediaQueryString:this.mobileMediaQueryString}))))};t.prototype.renderSearch=function(){if(!this.filterWithSearch&&!this.highlightWithSearch){return null}return e("div",{class:"search_section"},e("input",{type:"search",value:"",class:"input_search t-b3 c-black",disabled:!this.certificatesDecoded.length,placeholder:"Search",onInput:this.handleSearch}))};t.prototype.renderEmptyState=function(){var t=this.getMaxColSpanValue();return e("tr",null,e("td",{class:"status_wrapper",colSpan:t},e(l,{variant:"b1"},"There are no certificates available.")))};t.prototype.renderEmptySearchState=function(){var t=this.getMaxColSpanValue();return e("tr",null,e("td",{class:"status_wrapper",colSpan:t},e(l,{variant:"b1"},"No results found for “",this.search,"“")))};t.prototype.renderLoadingState=function(){return e("div",{class:"loading_container"},e("peculiar-circular-progress",null))};t.prototype.renderTableBody=function(){if(this.isDecodeInProcess){return null}if(!this.certificatesDecoded.length){return this.renderEmptyState()}var t=this.renderCertificatesRows();if(this.search&&!t.length){return this.renderEmptySearchState()}return t};t.prototype.render=function(){return e(o,{key:"894edb33a53c1128d812c2fd7a5b230a4b13493c","data-mobile-screen-view":String(this.mobileScreenView)},this.renderSearch(),e("table",{key:"998d37ab98be6743f1564fafb4ce9fc70b79e358"},!this.mobileScreenView&&e("thead",{key:"4728e09450b6285cbc2f69cf0a0e06135910558f"},e("tr",{key:"70bf5be60e50b9d7109e27128b661044778e0ded"},e("th",{key:"cf0fef5df1b42d0bce49d3bf0af2d91b82de6d05"}),!this.isHasRoots&&e("th",{key:"59f00d345883dfb3c81a97278583821543ce6808",class:"col_issuer"},e(l,{key:"54ce8fba1ab5355ac1f82ccc3aa62945351a3632",variant:"s2"},n.getString("issuer"))),e("th",{key:"9aea7911edafca1482f31e2ca3316d2cde40fd78",class:"col_name"},e(l,{key:"2a0145b0cc56543ed4b5170a8773c3c43e5e64f9",variant:"s2"},n.getString("name"))),e("th",{key:"9eab414d9b1558d6a5b9938f55165aeca5baa54e",class:"col_public_key"},e(l,{key:"cbdcb1013bbf12ac88e63ca2d268c55854803297",variant:"s2"},n.getString("publicKey"))),e("th",{key:"06adb89146693583a0dad86644b2c8b399e25c0e",class:"col_fingerprint"},e(l,{key:"eca0440721f16953219f014edb8d3742f312f704",variant:"s2"},n.getString("fingerprint"),"  (SHA-1)")),e("th",{key:"56b7fdf83f5c45cf524a8cce81dbca584b9b5fa8"}))),e("tbody",{key:"01ccda1abfa846a8b0cdc00588b106398358ed88"},this.renderTableBody())),this.renderCertificateDetailsModal(),this.isDecodeInProcess&&this.renderLoadingState())};Object.defineProperty(t,"watchers",{get:function(){return{certificates:["watchCertificates"]}},enumerable:false,configurable:true});return t}());m.style=y}}}));
13
- //# sourceMappingURL=p-11434880.system.entry.js.map
13
+ //# sourceMappingURL=p-46c17c8d.system.entry.js.map