@peculiar/certificates-viewer 3.10.1 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (589) hide show
  1. package/README.md +40 -64
  2. package/components/actions.js +21 -0
  3. package/components/actions.js.map +1 -0
  4. package/components/arrow_top.js +34 -0
  5. package/components/arrow_top.js.map +1 -0
  6. package/components/attribute-certificate-viewer.js +281 -0
  7. package/components/attribute-certificate-viewer.js.map +1 -0
  8. package/components/button-menu.js +52 -0
  9. package/components/button-menu.js.map +1 -0
  10. package/components/button.js +74 -0
  11. package/components/button.js.map +1 -0
  12. package/components/certificate-viewer.js +300 -0
  13. package/components/certificate-viewer.js.map +1 -0
  14. package/components/circular-progress.js +48 -0
  15. package/components/circular-progress.js.map +1 -0
  16. package/components/crl-viewer.js +263 -0
  17. package/components/crl-viewer.js.map +1 -0
  18. package/components/cross.js +47 -0
  19. package/components/cross.js.map +1 -0
  20. package/components/csr-viewer.js +233 -0
  21. package/components/csr-viewer.js.map +1 -0
  22. package/components/custom-elements.d.ts +2 -0
  23. package/components/download.js +500 -0
  24. package/components/download.js.map +1 -0
  25. package/components/highlight-words.js +60 -0
  26. package/components/highlight-words.js.map +1 -0
  27. package/components/index.d.ts +33 -0
  28. package/components/index.js +11 -0
  29. package/components/index.js.map +1 -0
  30. package/components/index2.js +299 -0
  31. package/components/index2.js.map +1 -0
  32. package/components/issuer_name.js +26 -0
  33. package/components/issuer_name.js.map +1 -0
  34. package/components/miscellaneous.js +13393 -0
  35. package/components/miscellaneous.js.map +1 -0
  36. package/components/package.json +9 -0
  37. package/components/peculiar-attribute-certificate-viewer.d.ts +11 -0
  38. package/components/peculiar-attribute-certificate-viewer.js +11 -0
  39. package/components/peculiar-attribute-certificate-viewer.js.map +1 -0
  40. package/components/peculiar-button-menu.d.ts +11 -0
  41. package/components/peculiar-button-menu.js +11 -0
  42. package/components/peculiar-button-menu.js.map +1 -0
  43. package/components/peculiar-certificate-decoder.d.ts +11 -0
  44. package/components/peculiar-certificate-decoder.js +234 -0
  45. package/components/peculiar-certificate-decoder.js.map +1 -0
  46. package/components/peculiar-certificate-viewer.d.ts +11 -0
  47. package/components/peculiar-certificate-viewer.js +11 -0
  48. package/components/peculiar-certificate-viewer.js.map +1 -0
  49. package/components/peculiar-certificates-viewer.d.ts +11 -0
  50. package/components/peculiar-certificates-viewer.js +344 -0
  51. package/components/peculiar-certificates-viewer.js.map +1 -0
  52. package/components/peculiar-circular-progress.d.ts +11 -0
  53. package/components/peculiar-circular-progress.js +11 -0
  54. package/components/peculiar-circular-progress.js.map +1 -0
  55. package/components/peculiar-crl-viewer.d.ts +11 -0
  56. package/components/peculiar-crl-viewer.js +11 -0
  57. package/components/peculiar-crl-viewer.js.map +1 -0
  58. package/components/peculiar-csr-viewer.d.ts +11 -0
  59. package/components/peculiar-csr-viewer.js +11 -0
  60. package/components/peculiar-csr-viewer.js.map +1 -0
  61. package/components/peculiar-highlight-words.d.ts +11 -0
  62. package/components/peculiar-highlight-words.js +11 -0
  63. package/components/peculiar-highlight-words.js.map +1 -0
  64. package/components/peculiar-text-hider.d.ts +11 -0
  65. package/components/peculiar-text-hider.js +42 -0
  66. package/components/peculiar-text-hider.js.map +1 -0
  67. package/components/subject_name.js +71 -0
  68. package/components/subject_name.js.map +1 -0
  69. package/dist/cjs/actions-19013d4a.js +23 -0
  70. package/dist/cjs/actions-19013d4a.js.map +1 -0
  71. package/dist/cjs/arrow_top-834fb7ec.js +37 -0
  72. package/dist/cjs/arrow_top-834fb7ec.js.map +1 -0
  73. package/dist/cjs/button-14e2b73f.js +77 -0
  74. package/dist/cjs/button-14e2b73f.js.map +1 -0
  75. package/dist/cjs/{certification_request-d5c6e32d.js → certification_request-c0cafa72.js} +236 -71
  76. package/dist/cjs/certification_request-c0cafa72.js.map +1 -0
  77. package/dist/cjs/{crl-5bce64c4.js → crl-b4322166.js} +8 -7
  78. package/dist/cjs/crl-b4322166.js.map +1 -0
  79. package/dist/cjs/cross-9872c473.js +51 -0
  80. package/dist/cjs/cross-9872c473.js.map +1 -0
  81. package/dist/cjs/download-254ddc57.js +23 -0
  82. package/dist/cjs/download-254ddc57.js.map +1 -0
  83. package/dist/cjs/{download-93f7b773.js → download-972dda8a.js} +2 -0
  84. package/dist/cjs/download-972dda8a.js.map +1 -0
  85. package/dist/cjs/index-efd561e9.js +2477 -0
  86. package/dist/cjs/index-efd561e9.js.map +1 -0
  87. package/dist/cjs/index.cjs.js +20 -1
  88. package/dist/cjs/index.cjs.js.map +1 -0
  89. package/dist/cjs/link-6aea0be4.js +25 -0
  90. package/dist/cjs/link-6aea0be4.js.map +1 -0
  91. package/dist/cjs/loader.cjs.js +6 -12
  92. package/dist/cjs/loader.cjs.js.map +1 -0
  93. package/dist/cjs/{miscellaneous-cac1cd8b.js → miscellaneous-e43aaae5.js} +73 -70
  94. package/dist/cjs/miscellaneous-e43aaae5.js.map +1 -0
  95. package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +93 -35
  96. package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js.map +1 -0
  97. package/dist/cjs/peculiar-button-menu_3.cjs.entry.js +98 -0
  98. package/dist/cjs/peculiar-button-menu_3.cjs.entry.js.map +1 -0
  99. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +30 -19
  100. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -0
  101. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +35 -11
  102. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js.map +1 -0
  103. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +145 -85
  104. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +1 -0
  105. package/dist/cjs/peculiar-text-hider.cjs.entry.js +7 -13
  106. package/dist/cjs/peculiar-text-hider.cjs.entry.js.map +1 -0
  107. package/dist/cjs/peculiar.cjs.js +10 -57
  108. package/dist/cjs/peculiar.cjs.js.map +1 -0
  109. package/dist/cjs/{x509_certificate-3760e0a8.js → x509_certificate-989b1435.js} +5 -4
  110. package/dist/cjs/x509_certificate-989b1435.js.map +1 -0
  111. package/dist/collection/collection-manifest.json +12 -16
  112. package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +189 -145
  113. package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js.map +1 -0
  114. package/dist/collection/components/button/button.js +14 -126
  115. package/dist/collection/components/button/button.js.map +1 -0
  116. package/dist/collection/components/button/index.js +5 -0
  117. package/dist/collection/components/button/index.js.map +1 -0
  118. package/dist/collection/components/button-menu/button-menu.css +46 -0
  119. package/dist/collection/components/button-menu/button-menu.js +78 -0
  120. package/dist/collection/components/button-menu/button-menu.js.map +1 -0
  121. package/dist/collection/components/certificate-decoder/certificate-decoder.css +456 -44
  122. package/dist/collection/components/certificate-decoder/certificate-decoder.js +109 -101
  123. package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -0
  124. package/dist/collection/components/certificate-details-parts/attributes/activity_description_attribute.js +6 -11
  125. package/dist/collection/components/certificate-details-parts/attributes/activity_description_attribute.js.map +1 -0
  126. package/dist/collection/components/certificate-details-parts/attributes/as_string_attribute.js +5 -5
  127. package/dist/collection/components/certificate-details-parts/attributes/as_string_attribute.js.map +1 -0
  128. package/dist/collection/components/certificate-details-parts/attributes/basic_attribute.js +5 -6
  129. package/dist/collection/components/certificate-details-parts/attributes/basic_attribute.js.map +1 -0
  130. package/dist/collection/components/certificate-details-parts/attributes/challenge_password_attribute.js +5 -5
  131. package/dist/collection/components/certificate-details-parts/attributes/challenge_password_attribute.js.map +1 -0
  132. package/dist/collection/components/certificate-details-parts/attributes/index.js +16 -15
  133. package/dist/collection/components/certificate-details-parts/attributes/index.js.map +1 -0
  134. package/dist/collection/components/certificate-details-parts/attributes/insurance_value_attribute.js +5 -5
  135. package/dist/collection/components/certificate-details-parts/attributes/insurance_value_attribute.js.map +1 -0
  136. package/dist/collection/components/certificate-details-parts/attributes/name_attribute.js +5 -5
  137. package/dist/collection/components/certificate-details-parts/attributes/name_attribute.js.map +1 -0
  138. package/dist/collection/components/certificate-details-parts/attributes/name_part.js +4 -3
  139. package/dist/collection/components/certificate-details-parts/attributes/name_part.js.map +1 -0
  140. package/dist/collection/components/certificate-details-parts/attributes/type_relationship_attribute.js +5 -4
  141. package/dist/collection/components/certificate-details-parts/attributes/type_relationship_attribute.js.map +1 -0
  142. package/dist/collection/components/certificate-details-parts/attributes/unstructured_name_attribute.js +5 -5
  143. package/dist/collection/components/certificate-details-parts/attributes/unstructured_name_attribute.js.map +1 -0
  144. package/dist/collection/components/certificate-details-parts/attributes/valuation_ranking_attribute.js +5 -5
  145. package/dist/collection/components/certificate-details-parts/attributes/valuation_ranking_attribute.js.map +1 -0
  146. package/dist/collection/components/certificate-details-parts/attributes/web_gdpr_attribute.js +6 -13
  147. package/dist/collection/components/certificate-details-parts/attributes/web_gdpr_attribute.js.map +1 -0
  148. package/dist/collection/components/certificate-details-parts/basic_information.js +4 -3
  149. package/dist/collection/components/certificate-details-parts/basic_information.js.map +1 -0
  150. package/dist/collection/components/certificate-details-parts/extensions/archive_rev_info_extension.js +5 -5
  151. package/dist/collection/components/certificate-details-parts/extensions/archive_rev_info_extension.js.map +1 -0
  152. package/dist/collection/components/certificate-details-parts/extensions/as_string_extension.js +5 -5
  153. package/dist/collection/components/certificate-details-parts/extensions/as_string_extension.js.map +1 -0
  154. package/dist/collection/components/certificate-details-parts/extensions/attribute_value.js +2 -1
  155. package/dist/collection/components/certificate-details-parts/extensions/attribute_value.js.map +1 -0
  156. package/dist/collection/components/certificate-details-parts/extensions/authority_key_identifier_extension.js +10 -15
  157. package/dist/collection/components/certificate-details-parts/extensions/authority_key_identifier_extension.js.map +1 -0
  158. package/dist/collection/components/certificate-details-parts/extensions/basic_constraints_extension.js +6 -7
  159. package/dist/collection/components/certificate-details-parts/extensions/basic_constraints_extension.js.map +1 -0
  160. package/dist/collection/components/certificate-details-parts/extensions/basic_extension.js +5 -6
  161. package/dist/collection/components/certificate-details-parts/extensions/basic_extension.js.map +1 -0
  162. package/dist/collection/components/certificate-details-parts/extensions/biometric_syntax_extension.js +8 -12
  163. package/dist/collection/components/certificate-details-parts/extensions/biometric_syntax_extension.js.map +1 -0
  164. package/dist/collection/components/certificate-details-parts/extensions/ca_version_extension.js +5 -6
  165. package/dist/collection/components/certificate-details-parts/extensions/ca_version_extension.js.map +1 -0
  166. package/dist/collection/components/certificate-details-parts/extensions/certificate_policies_extension.js +26 -27
  167. package/dist/collection/components/certificate-details-parts/extensions/certificate_policies_extension.js.map +1 -0
  168. package/dist/collection/components/certificate-details-parts/extensions/certificate_template_extension.js +5 -7
  169. package/dist/collection/components/certificate-details-parts/extensions/certificate_template_extension.js.map +1 -0
  170. package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js +8 -13
  171. package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js.map +1 -0
  172. package/dist/collection/components/certificate-details-parts/extensions/crl_distribution_points_extension.js +4 -3
  173. package/dist/collection/components/certificate-details-parts/extensions/crl_distribution_points_extension.js.map +1 -0
  174. package/dist/collection/components/certificate-details-parts/extensions/crl_number_extension.js +6 -6
  175. package/dist/collection/components/certificate-details-parts/extensions/crl_number_extension.js.map +1 -0
  176. package/dist/collection/components/certificate-details-parts/extensions/crl_reason_extension.js +5 -5
  177. package/dist/collection/components/certificate-details-parts/extensions/crl_reason_extension.js.map +1 -0
  178. package/dist/collection/components/certificate-details-parts/extensions/enroll_cert_type_extension.js +5 -5
  179. package/dist/collection/components/certificate-details-parts/extensions/enroll_cert_type_extension.js.map +1 -0
  180. package/dist/collection/components/certificate-details-parts/extensions/entrust_version_info_extension.js +5 -6
  181. package/dist/collection/components/certificate-details-parts/extensions/entrust_version_info_extension.js.map +1 -0
  182. package/dist/collection/components/certificate-details-parts/extensions/extended_key_usage_extension.js +7 -7
  183. package/dist/collection/components/certificate-details-parts/extensions/extended_key_usage_extension.js.map +1 -0
  184. package/dist/collection/components/certificate-details-parts/extensions/general_name_part.js +7 -6
  185. package/dist/collection/components/certificate-details-parts/extensions/general_name_part.js.map +1 -0
  186. package/dist/collection/components/certificate-details-parts/extensions/index.js +46 -45
  187. package/dist/collection/components/certificate-details-parts/extensions/index.js.map +1 -0
  188. package/dist/collection/components/certificate-details-parts/extensions/info_access_syntax_extension.js +8 -9
  189. package/dist/collection/components/certificate-details-parts/extensions/info_access_syntax_extension.js.map +1 -0
  190. package/dist/collection/components/certificate-details-parts/extensions/issuing_distribution_point_extension.js +7 -11
  191. package/dist/collection/components/certificate-details-parts/extensions/issuing_distribution_point_extension.js.map +1 -0
  192. package/dist/collection/components/certificate-details-parts/extensions/key_usage_extension.js +5 -5
  193. package/dist/collection/components/certificate-details-parts/extensions/key_usage_extension.js.map +1 -0
  194. package/dist/collection/components/certificate-details-parts/extensions/lei_extension.js +5 -5
  195. package/dist/collection/components/certificate-details-parts/extensions/lei_extension.js.map +1 -0
  196. package/dist/collection/components/certificate-details-parts/extensions/lei_role_extennsion.js +5 -5
  197. package/dist/collection/components/certificate-details-parts/extensions/lei_role_extennsion.js.map +1 -0
  198. package/dist/collection/components/certificate-details-parts/extensions/logotype_extension.js +8 -11
  199. package/dist/collection/components/certificate-details-parts/extensions/logotype_extension.js.map +1 -0
  200. package/dist/collection/components/certificate-details-parts/extensions/name_constraints_extension.js +4 -3
  201. package/dist/collection/components/certificate-details-parts/extensions/name_constraints_extension.js.map +1 -0
  202. package/dist/collection/components/certificate-details-parts/extensions/netscape_cert_type_extension.js +5 -5
  203. package/dist/collection/components/certificate-details-parts/extensions/netscape_cert_type_extension.js.map +1 -0
  204. package/dist/collection/components/certificate-details-parts/extensions/netscape_comment_extension.js +5 -5
  205. package/dist/collection/components/certificate-details-parts/extensions/netscape_comment_extension.js.map +1 -0
  206. package/dist/collection/components/certificate-details-parts/extensions/policy_constraints_extension.js +6 -7
  207. package/dist/collection/components/certificate-details-parts/extensions/policy_constraints_extension.js.map +1 -0
  208. package/dist/collection/components/certificate-details-parts/extensions/policy_mappings_extension.js +5 -4
  209. package/dist/collection/components/certificate-details-parts/extensions/policy_mappings_extension.js.map +1 -0
  210. package/dist/collection/components/certificate-details-parts/extensions/private_key_usage_period_extension.js +6 -7
  211. package/dist/collection/components/certificate-details-parts/extensions/private_key_usage_period_extension.js.map +1 -0
  212. package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js +13 -16
  213. package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js.map +1 -0
  214. package/dist/collection/components/certificate-details-parts/extensions/subject_alternative_name_extension.js +4 -3
  215. package/dist/collection/components/certificate-details-parts/extensions/subject_alternative_name_extension.js.map +1 -0
  216. package/dist/collection/components/certificate-details-parts/extensions/subject_directory_attributes_extension.js +8 -9
  217. package/dist/collection/components/certificate-details-parts/extensions/subject_directory_attributes_extension.js.map +1 -0
  218. package/dist/collection/components/certificate-details-parts/extensions/subject_key_identifier_extension.js +10 -15
  219. package/dist/collection/components/certificate-details-parts/extensions/subject_key_identifier_extension.js.map +1 -0
  220. package/dist/collection/components/certificate-details-parts/extensions/timestamp_extension.js +7 -9
  221. package/dist/collection/components/certificate-details-parts/extensions/timestamp_extension.js.map +1 -0
  222. package/dist/collection/components/certificate-details-parts/extensions/tn_auth_list_extension.js +4 -3
  223. package/dist/collection/components/certificate-details-parts/extensions/tn_auth_list_extension.js.map +1 -0
  224. package/dist/collection/components/certificate-details-parts/holder.js +8 -11
  225. package/dist/collection/components/certificate-details-parts/holder.js.map +1 -0
  226. package/dist/collection/components/certificate-details-parts/index.js +1 -0
  227. package/dist/collection/components/certificate-details-parts/index.js.map +1 -0
  228. package/dist/collection/components/certificate-details-parts/issuer.js +5 -4
  229. package/dist/collection/components/certificate-details-parts/issuer.js.map +1 -0
  230. package/dist/collection/components/certificate-details-parts/issuer_name.js +6 -4
  231. package/dist/collection/components/certificate-details-parts/issuer_name.js.map +1 -0
  232. package/dist/collection/components/certificate-details-parts/miscellaneous.js +8 -13
  233. package/dist/collection/components/certificate-details-parts/miscellaneous.js.map +1 -0
  234. package/dist/collection/components/certificate-details-parts/public_key.js +8 -7
  235. package/dist/collection/components/certificate-details-parts/public_key.js.map +1 -0
  236. package/dist/collection/components/certificate-details-parts/revoked_certificates.js +9 -11
  237. package/dist/collection/components/certificate-details-parts/revoked_certificates.js.map +1 -0
  238. package/dist/collection/components/certificate-details-parts/row.js +13 -18
  239. package/dist/collection/components/certificate-details-parts/row.js.map +1 -0
  240. package/dist/collection/components/certificate-details-parts/signature.js +5 -4
  241. package/dist/collection/components/certificate-details-parts/signature.js.map +1 -0
  242. package/dist/collection/components/certificate-details-parts/subject_name.js +4 -3
  243. package/dist/collection/components/certificate-details-parts/subject_name.js.map +1 -0
  244. package/dist/collection/components/certificate-details-parts/thumbprints.js +4 -3
  245. package/dist/collection/components/certificate-details-parts/thumbprints.js.map +1 -0
  246. package/dist/collection/components/certificate-summary/certificate-summary.js +9 -77
  247. package/dist/collection/components/certificate-summary/certificate-summary.js.map +1 -0
  248. package/dist/collection/components/certificate-summary/index.js +5 -0
  249. package/dist/collection/components/certificate-summary/index.js.map +1 -0
  250. package/dist/collection/components/certificate-viewer/certificate-viewer.css +471 -104
  251. package/dist/collection/components/certificate-viewer/certificate-viewer.js +206 -178
  252. package/dist/collection/components/certificate-viewer/certificate-viewer.js.map +1 -0
  253. package/dist/collection/components/certificates-viewer/certificates-viewer.css +540 -267
  254. package/dist/collection/components/certificates-viewer/certificates-viewer.js +261 -266
  255. package/dist/collection/components/certificates-viewer/certificates-viewer.js.map +1 -0
  256. package/dist/collection/components/circular-progress/circular-progress.css +2 -11
  257. package/dist/collection/components/circular-progress/circular-progress.js +60 -63
  258. package/dist/collection/components/circular-progress/circular-progress.js.map +1 -0
  259. package/dist/collection/components/crl-viewer/crl-viewer.js +166 -139
  260. package/dist/collection/components/crl-viewer/crl-viewer.js.map +1 -0
  261. package/dist/collection/components/csr-viewer/csr-viewer.js +149 -124
  262. package/dist/collection/components/csr-viewer/csr-viewer.js.map +1 -0
  263. package/dist/collection/components/highlight-words/highlight-words.css +1 -9
  264. package/dist/collection/components/highlight-words/highlight-words.js +35 -28
  265. package/dist/collection/components/highlight-words/highlight-words.js.map +1 -0
  266. package/dist/collection/components/icons/actions.js +16 -0
  267. package/dist/collection/components/icons/actions.js.map +1 -0
  268. package/dist/collection/components/icons/arrow_bottom.js +16 -0
  269. package/dist/collection/components/icons/arrow_bottom.js.map +1 -0
  270. package/dist/collection/components/icons/arrow_top.js +16 -0
  271. package/dist/collection/components/icons/arrow_top.js.map +1 -0
  272. package/dist/collection/components/icons/cross.js +16 -0
  273. package/dist/collection/components/icons/cross.js.map +1 -0
  274. package/dist/collection/components/icons/details.js +16 -0
  275. package/dist/collection/components/icons/details.js.map +1 -0
  276. package/dist/collection/components/icons/download.js +16 -0
  277. package/dist/collection/components/icons/download.js.map +1 -0
  278. package/dist/collection/components/icons/index.js +11 -0
  279. package/dist/collection/components/icons/index.js.map +1 -0
  280. package/dist/collection/components/icons/link.js +16 -0
  281. package/dist/collection/components/icons/link.js.map +1 -0
  282. package/dist/collection/components/link/index.js +5 -0
  283. package/dist/collection/components/link/index.js.map +1 -0
  284. package/dist/collection/components/link/link.js +9 -61
  285. package/dist/collection/components/link/link.js.map +1 -0
  286. package/dist/collection/components/text-hider/text-hider.css +9 -36
  287. package/dist/collection/components/text-hider/text-hider.js +21 -68
  288. package/dist/collection/components/text-hider/text-hider.js.map +1 -0
  289. package/dist/collection/components/typography/index.js +5 -0
  290. package/dist/collection/components/typography/index.js.map +1 -0
  291. package/dist/collection/components/typography/typography.js +39 -126
  292. package/dist/collection/components/typography/typography.js.map +1 -0
  293. package/dist/collection/constants/logs.js +1 -0
  294. package/dist/collection/constants/logs.js.map +1 -0
  295. package/dist/collection/constants/oids.js +1 -0
  296. package/dist/collection/constants/oids.js.map +1 -0
  297. package/dist/collection/crypto/asn_data.js +13 -7
  298. package/dist/collection/crypto/asn_data.js.map +1 -0
  299. package/dist/collection/crypto/attribute.js +11 -10
  300. package/dist/collection/crypto/attribute.js.map +1 -0
  301. package/dist/collection/crypto/crl.js +9 -8
  302. package/dist/collection/crypto/crl.js.map +1 -0
  303. package/dist/collection/crypto/csr.js +11 -10
  304. package/dist/collection/crypto/csr.js.map +1 -0
  305. package/dist/collection/crypto/extension.js +16 -15
  306. package/dist/collection/crypto/extension.js.map +1 -0
  307. package/dist/collection/crypto/index.js +1 -0
  308. package/dist/collection/crypto/index.js.map +1 -0
  309. package/dist/collection/crypto/name.js +15 -9
  310. package/dist/collection/crypto/name.js.map +1 -0
  311. package/dist/collection/crypto/provider.js +4 -3
  312. package/dist/collection/crypto/provider.js.map +1 -0
  313. package/dist/collection/crypto/utils.js +4 -3
  314. package/dist/collection/crypto/utils.js.map +1 -0
  315. package/dist/collection/crypto/x509_attribute_certificate.js +9 -8
  316. package/dist/collection/crypto/x509_attribute_certificate.js.map +1 -0
  317. package/dist/collection/crypto/x509_certificate.js +12 -11
  318. package/dist/collection/crypto/x509_certificate.js.map +1 -0
  319. package/dist/collection/index.js +5 -0
  320. package/dist/collection/index.js.map +1 -0
  321. package/dist/collection/locales/en.json +4 -3
  322. package/dist/collection/utils/date_formatter.js +3 -2
  323. package/dist/collection/utils/date_formatter.js.map +1 -0
  324. package/dist/collection/utils/download.js +3 -2
  325. package/dist/collection/utils/download.js.map +1 -0
  326. package/dist/collection/utils/download_from_buffer.js +1 -0
  327. package/dist/collection/utils/download_from_buffer.js.map +1 -0
  328. package/dist/collection/utils/get_string_by_oid.js +2 -1
  329. package/dist/collection/utils/get_string_by_oid.js.map +1 -0
  330. package/dist/collection/utils/index.js +2 -1
  331. package/dist/collection/utils/index.js.map +1 -0
  332. package/dist/collection/utils/is_link.js +1 -0
  333. package/dist/collection/utils/is_link.js.map +1 -0
  334. package/dist/collection/utils/l10n.js +2 -1
  335. package/dist/collection/utils/l10n.js.map +1 -0
  336. package/dist/collection/utils/read_file.js +1 -0
  337. package/dist/collection/utils/read_file.js.map +1 -0
  338. package/dist/collection/utils/third_party_links.js +1 -0
  339. package/dist/collection/utils/third_party_links.js.map +1 -0
  340. package/dist/collection/utils/validator.js +1 -0
  341. package/dist/collection/utils/validator.js.map +1 -0
  342. package/dist/collection/www-copy/index.js +138 -32
  343. package/dist/esm/actions-8d745b2a.js +21 -0
  344. package/dist/esm/actions-8d745b2a.js.map +1 -0
  345. package/dist/esm/arrow_top-fc298828.js +34 -0
  346. package/dist/esm/arrow_top-fc298828.js.map +1 -0
  347. package/dist/esm/button-35146bdd.js +74 -0
  348. package/dist/esm/button-35146bdd.js.map +1 -0
  349. package/dist/esm/{certification_request-23cd5124.js → certification_request-5cadde9f.js} +171 -9
  350. package/dist/esm/certification_request-5cadde9f.js.map +1 -0
  351. package/dist/esm/{crl-7f23c111.js → crl-11670c3e.js} +7 -6
  352. package/dist/esm/crl-11670c3e.js.map +1 -0
  353. package/dist/esm/cross-9ec9a759.js +47 -0
  354. package/dist/esm/cross-9ec9a759.js.map +1 -0
  355. package/dist/esm/download-0cc3077a.js +21 -0
  356. package/dist/esm/download-0cc3077a.js.map +1 -0
  357. package/dist/esm/{download-91511aeb.js → download-57c5bf8f.js} +2 -0
  358. package/dist/esm/download-57c5bf8f.js.map +1 -0
  359. package/dist/esm/index-4079bbb5.js +2448 -0
  360. package/dist/esm/index-4079bbb5.js.map +1 -0
  361. package/dist/esm/index.js +10 -1
  362. package/dist/esm/index.js.map +1 -0
  363. package/dist/esm/link-ad24c3be.js +23 -0
  364. package/dist/esm/link-ad24c3be.js.map +1 -0
  365. package/dist/esm/loader.js +6 -12
  366. package/dist/esm/loader.js.map +1 -0
  367. package/dist/esm/{miscellaneous-c7c0d04a.js → miscellaneous-7793a310.js} +40 -37
  368. package/dist/esm/miscellaneous-7793a310.js.map +1 -0
  369. package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +81 -23
  370. package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -0
  371. package/dist/esm/peculiar-button-menu_3.entry.js +92 -0
  372. package/dist/esm/peculiar-button-menu_3.entry.js.map +1 -0
  373. package/dist/esm/peculiar-certificate-decoder.entry.js +30 -19
  374. package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -0
  375. package/dist/esm/peculiar-certificate-viewer.entry.js +35 -11
  376. package/dist/esm/peculiar-certificate-viewer.entry.js.map +1 -0
  377. package/dist/esm/peculiar-certificates-viewer.entry.js +145 -85
  378. package/dist/esm/peculiar-certificates-viewer.entry.js.map +1 -0
  379. package/dist/esm/peculiar-text-hider.entry.js +7 -13
  380. package/dist/esm/peculiar-text-hider.entry.js.map +1 -0
  381. package/dist/esm/peculiar.js +8 -58
  382. package/dist/esm/peculiar.js.map +1 -0
  383. package/dist/esm/{x509_certificate-d8e0af2d.js → x509_certificate-dfae6999.js} +4 -3
  384. package/dist/esm/x509_certificate-dfae6999.js.map +1 -0
  385. package/dist/esm-es5/actions-8d745b2a.js +12 -0
  386. package/dist/esm-es5/actions-8d745b2a.js.map +1 -0
  387. package/dist/esm-es5/arrow_top-fc298828.js +19 -0
  388. package/dist/esm-es5/arrow_top-fc298828.js.map +1 -0
  389. package/dist/esm-es5/button-35146bdd.js +19 -0
  390. package/dist/esm-es5/button-35146bdd.js.map +1 -0
  391. package/dist/esm-es5/certification_request-5cadde9f.js +97 -0
  392. package/dist/esm-es5/certification_request-5cadde9f.js.map +1 -0
  393. package/dist/esm-es5/crl-11670c3e.js +33 -0
  394. package/dist/esm-es5/crl-11670c3e.js.map +1 -0
  395. package/dist/esm-es5/cross-9ec9a759.js +26 -0
  396. package/dist/esm-es5/cross-9ec9a759.js.map +1 -0
  397. package/dist/esm-es5/download-0cc3077a.js +12 -0
  398. package/dist/esm-es5/download-0cc3077a.js.map +1 -0
  399. package/dist/esm-es5/download-57c5bf8f.js +19 -0
  400. package/dist/esm-es5/download-57c5bf8f.js.map +1 -0
  401. package/dist/esm-es5/index-4079bbb5.js +6 -0
  402. package/dist/esm-es5/index-4079bbb5.js.map +1 -0
  403. package/dist/esm-es5/index.js +5 -0
  404. package/dist/esm-es5/index.js.map +1 -0
  405. package/dist/esm-es5/link-ad24c3be.js +12 -0
  406. package/dist/esm-es5/link-ad24c3be.js.map +1 -0
  407. package/dist/esm-es5/loader.js +5 -0
  408. package/dist/esm-es5/loader.js.map +1 -0
  409. package/dist/esm-es5/miscellaneous-7793a310.js +348 -0
  410. package/dist/esm-es5/miscellaneous-7793a310.js.map +1 -0
  411. package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +110 -0
  412. package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -0
  413. package/dist/esm-es5/peculiar-button-menu_3.entry.js +5 -0
  414. package/dist/esm-es5/peculiar-button-menu_3.entry.js.map +1 -0
  415. package/dist/esm-es5/peculiar-certificate-decoder.entry.js +12 -0
  416. package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -0
  417. package/dist/esm-es5/peculiar-certificate-viewer.entry.js +5 -0
  418. package/dist/esm-es5/peculiar-certificate-viewer.entry.js.map +1 -0
  419. package/dist/esm-es5/peculiar-certificates-viewer.entry.js +12 -0
  420. package/dist/esm-es5/peculiar-certificates-viewer.entry.js.map +1 -0
  421. package/dist/esm-es5/peculiar-text-hider.entry.js +5 -0
  422. package/dist/esm-es5/peculiar-text-hider.entry.js.map +1 -0
  423. package/dist/esm-es5/peculiar.js +5 -0
  424. package/dist/esm-es5/peculiar.js.map +1 -0
  425. package/dist/esm-es5/x509_certificate-dfae6999.js +12 -0
  426. package/dist/esm-es5/x509_certificate-dfae6999.js.map +1 -0
  427. package/dist/index.js +1 -1
  428. package/dist/peculiar/index.esm.js +2 -1
  429. package/dist/peculiar/index.esm.js.map +1 -0
  430. package/dist/peculiar/locales/en.json +4 -3
  431. package/dist/peculiar/p-0b356bb5.js +6 -0
  432. package/dist/peculiar/p-0b356bb5.js.map +1 -0
  433. package/dist/peculiar/p-0b475f2a.system.entry.js +111 -0
  434. package/dist/peculiar/p-0b475f2a.system.entry.js.map +1 -0
  435. package/dist/peculiar/p-0fc2e2b4.js +19 -0
  436. package/dist/peculiar/p-0fc2e2b4.js.map +1 -0
  437. package/dist/peculiar/p-17e3c47b.js +12 -0
  438. package/dist/peculiar/p-17e3c47b.js.map +1 -0
  439. package/dist/peculiar/p-1844b807.system.entry.js +5 -0
  440. package/dist/peculiar/p-1844b807.system.entry.js.map +1 -0
  441. package/dist/peculiar/p-1ceb0fe3.js +12 -0
  442. package/dist/peculiar/p-1ceb0fe3.js.map +1 -0
  443. package/dist/peculiar/p-1de0381c.system.js +5 -0
  444. package/dist/peculiar/p-1de0381c.system.js.map +1 -0
  445. package/dist/peculiar/p-2fcad8cb.system.js +20 -0
  446. package/dist/peculiar/p-2fcad8cb.system.js.map +1 -0
  447. package/dist/peculiar/p-31586b23.system.js +13 -0
  448. package/dist/peculiar/p-31586b23.system.js.map +1 -0
  449. package/dist/peculiar/p-33196289.entry.js +5 -0
  450. package/dist/peculiar/p-33196289.entry.js.map +1 -0
  451. package/dist/peculiar/p-370cee20.js +26 -0
  452. package/dist/peculiar/p-370cee20.js.map +1 -0
  453. package/dist/peculiar/p-43eb3721.js +33 -0
  454. package/dist/peculiar/p-43eb3721.js.map +1 -0
  455. package/dist/peculiar/p-441109db.system.entry.js +13 -0
  456. package/dist/peculiar/p-441109db.system.entry.js.map +1 -0
  457. package/dist/peculiar/p-5151cb6f.system.entry.js +5 -0
  458. package/dist/peculiar/p-5151cb6f.system.entry.js.map +1 -0
  459. package/dist/peculiar/p-53784f15.system.entry.js +5 -0
  460. package/dist/peculiar/p-53784f15.system.entry.js.map +1 -0
  461. package/dist/peculiar/p-5aabeba7.system.js +6 -0
  462. package/dist/peculiar/p-5aabeba7.system.js.map +1 -0
  463. package/dist/peculiar/p-5ab007e9.entry.js +5 -0
  464. package/dist/peculiar/p-5ab007e9.entry.js.map +1 -0
  465. package/dist/peculiar/p-6667fe6e.system.js +34 -0
  466. package/dist/peculiar/p-6667fe6e.system.js.map +1 -0
  467. package/dist/peculiar/p-673336cf.entry.js +110 -0
  468. package/dist/peculiar/p-673336cf.entry.js.map +1 -0
  469. package/dist/peculiar/p-6cb88fd6.system.js +13 -0
  470. package/dist/peculiar/p-6cb88fd6.system.js.map +1 -0
  471. package/dist/peculiar/p-6e79b9c8.js +12 -0
  472. package/dist/peculiar/p-6e79b9c8.js.map +1 -0
  473. package/dist/peculiar/p-74c241e7.js +97 -0
  474. package/dist/peculiar/p-74c241e7.js.map +1 -0
  475. package/dist/peculiar/p-7f9beaa8.js +19 -0
  476. package/dist/peculiar/p-7f9beaa8.js.map +1 -0
  477. package/dist/peculiar/p-7f9fef87.entry.js +5 -0
  478. package/dist/peculiar/p-7f9fef87.entry.js.map +1 -0
  479. package/dist/peculiar/p-80832207.system.js +5 -0
  480. package/dist/peculiar/p-80832207.system.js.map +1 -0
  481. package/dist/peculiar/p-882e1281.entry.js +12 -0
  482. package/dist/peculiar/p-882e1281.entry.js.map +1 -0
  483. package/dist/peculiar/p-94a453d7.js +12 -0
  484. package/dist/peculiar/p-94a453d7.js.map +1 -0
  485. package/dist/peculiar/p-a053c132.js +19 -0
  486. package/dist/peculiar/p-a053c132.js.map +1 -0
  487. package/dist/peculiar/p-a6e2e335.js +348 -0
  488. package/dist/peculiar/p-a6e2e335.js.map +1 -0
  489. package/dist/peculiar/p-ae9189f6.system.js +19 -0
  490. package/dist/peculiar/p-ae9189f6.system.js.map +1 -0
  491. package/dist/peculiar/p-b313be9e.system.js +13 -0
  492. package/dist/peculiar/p-b313be9e.system.js.map +1 -0
  493. package/dist/peculiar/p-bcc86979.entry.js +12 -0
  494. package/dist/peculiar/p-bcc86979.entry.js.map +1 -0
  495. package/dist/peculiar/p-c0a298fd.system.js +97 -0
  496. package/dist/peculiar/p-c0a298fd.system.js.map +1 -0
  497. package/dist/peculiar/p-c362dc5e.system.js +348 -0
  498. package/dist/peculiar/p-c362dc5e.system.js.map +1 -0
  499. package/dist/peculiar/p-c99507d4.system.js +20 -0
  500. package/dist/peculiar/p-c99507d4.system.js.map +1 -0
  501. package/dist/peculiar/p-ddae2f8e.system.js +27 -0
  502. package/dist/peculiar/p-ddae2f8e.system.js.map +1 -0
  503. package/dist/peculiar/p-e39de121.system.entry.js +13 -0
  504. package/dist/peculiar/p-e39de121.system.entry.js.map +1 -0
  505. package/dist/peculiar/p-e6a3b4d4.system.js +13 -0
  506. package/dist/peculiar/p-e6a3b4d4.system.js.map +1 -0
  507. package/dist/peculiar/peculiar.css +1 -1
  508. package/dist/peculiar/peculiar.esm.js +2 -1
  509. package/dist/peculiar/peculiar.esm.js.map +1 -0
  510. package/dist/peculiar/peculiar.js +127 -0
  511. package/dist/types/components/attribute-certificate-viewer/attribute-certificate-viewer.d.ts +15 -3
  512. package/dist/types/components/button/button.d.ts +5 -16
  513. package/dist/types/components/button/index.d.ts +2 -0
  514. package/dist/types/components/button-menu/button-menu.d.ts +21 -0
  515. package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +9 -6
  516. package/dist/types/components/certificate-details-parts/miscellaneous.d.ts +1 -1
  517. package/dist/types/components/certificate-summary/certificate-summary.d.ts +4 -3
  518. package/dist/types/components/certificate-summary/index.d.ts +1 -0
  519. package/dist/types/components/certificate-viewer/certificate-viewer.d.ts +13 -5
  520. package/dist/types/components/certificates-viewer/certificates-viewer.d.ts +22 -11
  521. package/dist/types/components/crl-viewer/crl-viewer.d.ts +13 -5
  522. package/dist/types/components/csr-viewer/csr-viewer.d.ts +13 -5
  523. package/dist/types/components/icons/actions.d.ts +12 -0
  524. package/dist/types/components/icons/arrow_bottom.d.ts +12 -0
  525. package/dist/types/components/icons/arrow_top.d.ts +12 -0
  526. package/dist/types/components/icons/cross.d.ts +12 -0
  527. package/dist/types/components/icons/details.d.ts +12 -0
  528. package/dist/types/components/icons/download.d.ts +12 -0
  529. package/dist/types/components/icons/index.d.ts +7 -0
  530. package/dist/types/components/icons/link.d.ts +12 -0
  531. package/dist/types/components/link/index.d.ts +1 -0
  532. package/dist/types/components/link/link.d.ts +6 -6
  533. package/dist/types/components/text-hider/text-hider.d.ts +0 -3
  534. package/dist/types/components/typography/index.d.ts +1 -0
  535. package/dist/types/components/typography/typography.d.ts +10 -20
  536. package/dist/types/components.d.ts +74 -175
  537. package/dist/types/crypto/attribute.d.ts +1 -1
  538. package/dist/types/crypto/extension.d.ts +1 -1
  539. package/dist/types/index.d.ts +4 -0
  540. package/dist/types/interface.d.ts +98 -6
  541. package/dist/types/stencil-public-runtime.d.ts +110 -23
  542. package/dist/types/utils/l10n.d.ts +5 -4
  543. package/dist/types/utils/read_file.d.ts +1 -1
  544. package/hydrate/index.d.ts +218 -0
  545. package/hydrate/index.js +22549 -0
  546. package/hydrate/package.json +6 -0
  547. package/loader/index.d.ts +10 -1
  548. package/loader/index.js +1 -1
  549. package/loader/package.json +1 -0
  550. package/package.json +6 -4
  551. package/dist/cjs/dom-f57e260e.js +0 -78
  552. package/dist/cjs/index-064e95c7.js +0 -1486
  553. package/dist/cjs/l10n-ddc7cff9.js +0 -169
  554. package/dist/cjs/peculiar-button-split_4.cjs.entry.js +0 -128
  555. package/dist/cjs/peculiar-button.cjs.entry.js +0 -40
  556. package/dist/cjs/peculiar-link.cjs.entry.js +0 -29
  557. package/dist/cjs/peculiar-typography.cjs.entry.js +0 -38
  558. package/dist/collection/components/button/button.css +0 -81
  559. package/dist/collection/components/button-split/button-split.css +0 -57
  560. package/dist/collection/components/button-split/button-split.js +0 -116
  561. package/dist/collection/components/certificate-summary/certificate-summary.css +0 -49
  562. package/dist/collection/components/link/link.css +0 -59
  563. package/dist/collection/components/typography/typography.css +0 -95
  564. package/dist/esm/dom-f1b08a97.js +0 -76
  565. package/dist/esm/index-bbd484d9.js +0 -1455
  566. package/dist/esm/l10n-d48f35ff.js +0 -165
  567. package/dist/esm/peculiar-button-split_4.entry.js +0 -121
  568. package/dist/esm/peculiar-button.entry.js +0 -36
  569. package/dist/esm/peculiar-link.entry.js +0 -25
  570. package/dist/esm/peculiar-typography.entry.js +0 -34
  571. package/dist/esm/polyfills/css-shim.js +0 -1
  572. package/dist/peculiar/p-01cea5c0.entry.js +0 -11
  573. package/dist/peculiar/p-3bfefa4a.entry.js +0 -18
  574. package/dist/peculiar/p-4e8169cb.entry.js +0 -4
  575. package/dist/peculiar/p-57b89412.entry.js +0 -4
  576. package/dist/peculiar/p-5b4eed12.entry.js +0 -4
  577. package/dist/peculiar/p-610b85e3.entry.js +0 -4
  578. package/dist/peculiar/p-6d37c8b5.entry.js +0 -4
  579. package/dist/peculiar/p-711b4e1e.js +0 -18
  580. package/dist/peculiar/p-81a88a33.js +0 -11
  581. package/dist/peculiar/p-918aeee4.entry.js +0 -4
  582. package/dist/peculiar/p-9f4ee110.js +0 -22
  583. package/dist/peculiar/p-a050e184.js +0 -69
  584. package/dist/peculiar/p-c24c26c2.js +0 -32
  585. package/dist/peculiar/p-df53fbcc.entry.js +0 -4
  586. package/dist/peculiar/p-ec250cc4.js +0 -12
  587. package/dist/peculiar/p-f7683ba5.js +0 -5
  588. package/dist/peculiar/p-fe05f51e.js +0 -79
  589. package/dist/types/components/button-split/button-split.d.ts +0 -21
@@ -0,0 +1,263 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
+ */
4
+ import { h, proxyCustomElement, HTMLElement, Build, Host } from '@stencil/core/internal/client';
5
+ import { A as AsnData, c as certificateRawToBuffer, ad as CertificateList, a2 as Name, E as Extension, b as AsnConvert, g as getCertificateThumbprint, h as hexFormat, e as base64Format, R as RowTitle, l as l10n, f as RowValue, ae as dateShort, af as TableRowTable, ag as CRLReason, i as getStringByOID, ah as InvalidityDate, ai as CertificateIssuer, G as GeneralNamePart, B as BasicInformation, S as Signature, T as Thumbprints, n as Extensions, j as getLEILink, k as getDNSNameLink, m as getIPAddressLink, M as Miscellaneous } from './miscellaneous.js';
6
+ import { b as build, D as Download } from './download.js';
7
+ import { T as Typography } from './button.js';
8
+ import { I as IssuerName } from './issuer_name.js';
9
+
10
+ /**
11
+ * @license
12
+ * Copyright (c) Peculiar Ventures, LLC.
13
+ *
14
+ * This source code is licensed under the MIT license found in the
15
+ * LICENSE file in the root directory of this source tree.
16
+ */
17
+ class CRL extends AsnData {
18
+ constructor(raw) {
19
+ super(certificateRawToBuffer(raw), CertificateList);
20
+ this.thumbprints = {};
21
+ this.type = 'X.509 Certificate Revocation List';
22
+ const { tbsCertList } = this.asn;
23
+ this.issuer = new Name(tbsCertList.issuer).toJSON();
24
+ this.version = tbsCertList.version + 1;
25
+ this.lastUpdate = tbsCertList.thisUpdate.getTime();
26
+ this.nextUpdate = tbsCertList.nextUpdate.getTime();
27
+ this.revokedCertificates = (tbsCertList.revokedCertificates || [])
28
+ .map((revokedCertificate) => {
29
+ var _a;
30
+ return ({
31
+ revocationDate: revokedCertificate.revocationDate,
32
+ userCertificate: revokedCertificate.userCertificate,
33
+ crlEntryExtensions: (_a = revokedCertificate.crlEntryExtensions) === null || _a === void 0 ? void 0 : _a.map((e) => new Extension(AsnConvert.serialize(e))),
34
+ });
35
+ });
36
+ }
37
+ async getThumbprint(algorithm = 'SHA-1') {
38
+ try {
39
+ const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
40
+ if (thumbprint) {
41
+ this.thumbprints[algorithm] = build.Convert.ToHex(thumbprint);
42
+ }
43
+ }
44
+ catch (error) {
45
+ console.error('Error thumbprint get:', error);
46
+ }
47
+ }
48
+ get signature() {
49
+ const { signature, signatureAlgorithm } = this.asn;
50
+ return {
51
+ value: signature,
52
+ algorithm: signatureAlgorithm.algorithm,
53
+ };
54
+ }
55
+ get commonName() {
56
+ if (!this.issuer) {
57
+ return '';
58
+ }
59
+ for (let i = 0; i < this.issuer.length; i += 1) {
60
+ const name = this.issuer[i];
61
+ if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {
62
+ return name.value;
63
+ }
64
+ }
65
+ return '';
66
+ }
67
+ parseExtensions() {
68
+ const { tbsCertList } = this.asn;
69
+ if (tbsCertList.crlExtensions) {
70
+ this.extensions = tbsCertList.crlExtensions
71
+ .map((e) => new Extension(AsnConvert.serialize(e)));
72
+ }
73
+ }
74
+ exportAsBase64() {
75
+ return build.Convert.ToBase64(this.raw);
76
+ }
77
+ exportAsHexFormatted() {
78
+ return hexFormat(build.Convert.ToHex(this.raw));
79
+ }
80
+ exportAsPemFormatted() {
81
+ return `-----BEGIN X509 CRL-----\n${base64Format(this.exportAsBase64())}\n-----END X509 CRL-----`;
82
+ }
83
+ downloadAsPEM(name) {
84
+ Download.crl.asPEM(this.exportAsPemFormatted(), name || this.commonName);
85
+ }
86
+ downloadAsDER(name) {
87
+ Download.crl.asDER(this.exportAsHexFormatted(), name || this.commonName);
88
+ }
89
+ }
90
+
91
+ /**
92
+ * @license
93
+ * Copyright (c) Peculiar Ventures, LLC.
94
+ *
95
+ * This source code is licensed under the MIT license found in the
96
+ * LICENSE file in the root directory of this source tree.
97
+ */
98
+ const RevokedCertificates = (props) => {
99
+ const { revokedCertificates, getDNSNameLink, getIPAddressLink, } = props;
100
+ if (!revokedCertificates || !revokedCertificates.length) {
101
+ return null;
102
+ }
103
+ return [
104
+ h(RowTitle, { value: l10n.getString('revokedCertificates') }),
105
+ revokedCertificates.map((certificate) => ([
106
+ h(RowValue, { name: l10n.getString('serialNumber'), value: build.Convert.ToHex(certificate.userCertificate), monospace: true }),
107
+ h(RowValue, { name: l10n.getString('revocationDate'), value: dateShort(certificate.revocationDate.getTime()) }),
108
+ (certificate.crlEntryExtensions && certificate.crlEntryExtensions.length && ([
109
+ h(RowValue, { name: `${l10n.getString('crlEntryExtensions')}:`, value: "" }),
110
+ h(TableRowTable, null, certificate.crlEntryExtensions.map((extension) => {
111
+ if (extension.value instanceof CRLReason) {
112
+ return (h(RowValue, { name: getStringByOID(extension.asn.extnID), value: extension.value.toJSON() || extension.value.reason }));
113
+ }
114
+ if (extension.value instanceof InvalidityDate) {
115
+ return (h(RowValue, { name: getStringByOID(extension.asn.extnID), value: extension.value.value.getTime() }));
116
+ }
117
+ if (extension.value instanceof CertificateIssuer && extension.value.length) {
118
+ return ([
119
+ h(RowValue, { name: `${getStringByOID(extension.asn.extnID)}:`, value: "" }),
120
+ extension.value.map((gn) => (h(TableRowTable, null,
121
+ h(GeneralNamePart, { generalName: gn, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink })))),
122
+ ]);
123
+ }
124
+ return (h(RowValue, { name: getStringByOID(extension.asn.extnID), value: build.Convert.ToHex(extension.asn.extnValue), monospace: true }));
125
+ })),
126
+ ])),
127
+ h("tr", null,
128
+ h("td", { colSpan: 2, class: "divider" },
129
+ h("span", null))),
130
+ ])),
131
+ ];
132
+ };
133
+
134
+ const certificateViewerCss = "*{-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 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}";
135
+
136
+ const CrlViewer = /*@__PURE__*/ proxyCustomElement(class CrlViewer extends HTMLElement {
137
+ constructor() {
138
+ super();
139
+ this.__registerHost();
140
+ this.__attachShadow();
141
+ this.getAuthKeyIdParentLink = (value) => {
142
+ var _a;
143
+ return (_a = this.authKeyIdParentLink) === null || _a === void 0 ? void 0 : _a.replace('{{authKeyId}}', value);
144
+ };
145
+ this.getAuthKeyIdSiblingsLink = (value) => {
146
+ var _a;
147
+ return (_a = this.authKeyIdSiblingsLink) === null || _a === void 0 ? void 0 : _a.replace('{{authKeyId}}', value);
148
+ };
149
+ this.certificate = undefined;
150
+ this.download = undefined;
151
+ this.authKeyIdParentLink = undefined;
152
+ this.authKeyIdSiblingsLink = undefined;
153
+ this.issuerDnLink = undefined;
154
+ this.mobileMediaQueryString = '(max-width: 900px)';
155
+ this.mobileScreenView = false;
156
+ this.isDecodeInProcess = true;
157
+ }
158
+ handleMediaQueryChange(event) {
159
+ this.mobileScreenView = event.matches;
160
+ }
161
+ componentWillLoad() {
162
+ this.decodeCertificate(this.certificate);
163
+ if (Build.isBrowser) {
164
+ this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);
165
+ this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));
166
+ this.mobileScreenView = this.mobileMediaQuery.matches;
167
+ }
168
+ }
169
+ disconnectedCallback() {
170
+ this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));
171
+ }
172
+ async decodeCertificate(certificate) {
173
+ this.isDecodeInProcess = true;
174
+ try {
175
+ if (certificate instanceof CRL) {
176
+ this.certificateDecoded = certificate;
177
+ }
178
+ else if (typeof certificate === 'string') {
179
+ this.certificateDecoded = new CRL(certificate);
180
+ }
181
+ else {
182
+ return;
183
+ }
184
+ this.certificateDecoded.parseExtensions();
185
+ await this.certificateDecoded.getThumbprint('SHA-1');
186
+ await this.certificateDecoded.getThumbprint('SHA-256');
187
+ }
188
+ catch (error) {
189
+ this.certificateDecodeError = error;
190
+ console.error('Error certificate parse:', error);
191
+ }
192
+ this.isDecodeInProcess = false;
193
+ }
194
+ getIssuerDnLink() {
195
+ return this.issuerDnLink;
196
+ }
197
+ /**
198
+ * Rerun decodeCertificate if previuos value not equal current value
199
+ */
200
+ watchCertificateAndDecode(newValue, oldValue) {
201
+ if (typeof newValue === 'string' && typeof oldValue === 'string') {
202
+ if (newValue !== oldValue) {
203
+ this.decodeCertificate(newValue);
204
+ }
205
+ return;
206
+ }
207
+ if (newValue instanceof CRL
208
+ && oldValue instanceof CRL) {
209
+ if (newValue.commonName !== oldValue.commonName) {
210
+ this.decodeCertificate(newValue);
211
+ }
212
+ }
213
+ }
214
+ // eslint-disable-next-line class-methods-use-this
215
+ renderErrorState() {
216
+ return (h("div", { class: "status_wrapper" }, h(Typography, null, "There was an error decoding this certificate revocation list.")));
217
+ }
218
+ // eslint-disable-next-line class-methods-use-this
219
+ renderEmptyState() {
220
+ return (h("div", { class: "status_wrapper" }, h(Typography, null, "There is no certificate revocation list available.")));
221
+ }
222
+ render() {
223
+ if (this.certificateDecodeError) {
224
+ return this.renderErrorState();
225
+ }
226
+ if (!this.certificateDecoded) {
227
+ return this.renderEmptyState();
228
+ }
229
+ return (h(Host, { "data-mobile-screen-view": String(this.mobileScreenView) }, h("table", null, h(BasicInformation, Object.assign({}, this.certificateDecoded)), h(IssuerName, { name: this.certificateDecoded.issuer, issuerDnLink: this.getIssuerDnLink() }), h(Signature, { signature: this.certificateDecoded.signature }), h(Thumbprints, { thumbprints: this.certificateDecoded.thumbprints }), h(Extensions, { extensions: this.certificateDecoded.extensions, getLEILink: getLEILink, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink, getAuthKeyIdParentLink: this.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink: this.getAuthKeyIdSiblingsLink }), h(RevokedCertificates, { revokedCertificates: this.certificateDecoded.revokedCertificates, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink }), this.download && (h(Miscellaneous, { certificate: this.certificateDecoded })))));
230
+ }
231
+ static get watchers() { return {
232
+ "certificate": ["watchCertificateAndDecode"]
233
+ }; }
234
+ static get style() { return certificateViewerCss; }
235
+ }, [1, "peculiar-crl-viewer", {
236
+ "certificate": [513],
237
+ "download": [4],
238
+ "authKeyIdParentLink": [513, "auth-key-id-parent-link"],
239
+ "authKeyIdSiblingsLink": [513, "auth-key-id-siblings-link"],
240
+ "issuerDnLink": [513, "issuer-dn-link"],
241
+ "mobileMediaQueryString": [1, "mobile-media-query-string"],
242
+ "mobileScreenView": [32],
243
+ "isDecodeInProcess": [32]
244
+ }, undefined, {
245
+ "certificate": ["watchCertificateAndDecode"]
246
+ }]);
247
+ function defineCustomElement() {
248
+ if (typeof customElements === "undefined") {
249
+ return;
250
+ }
251
+ const components = ["peculiar-crl-viewer"];
252
+ components.forEach(tagName => { switch (tagName) {
253
+ case "peculiar-crl-viewer":
254
+ if (!customElements.get(tagName)) {
255
+ customElements.define(tagName, CrlViewer);
256
+ }
257
+ break;
258
+ } });
259
+ }
260
+
261
+ export { CRL as C, CrlViewer as a, defineCustomElement as d };
262
+
263
+ //# sourceMappingURL=crl-viewer.js.map
@@ -0,0 +1 @@
1
+ {"file":"crl-viewer.js","mappings":";;;;;;;;;AAAA;;;;;;;MAkCa,GAAI,SAAQ,OAAwB;EAiB/C,YAAY,GAAW;IACrB,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,EAAE,eAAe,CAAC,CAAC;IAL/C,gBAAW,GAA2B,EAAE,CAAC;IAEzC,SAAI,GAAW,mCAAmC,CAAC;IAKxD,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;IAEjC,IAAI,CAAC,MAAM,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;IACpD,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,GAAG,CAAC,CAAC;IACvC,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC,UAAU,CAA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,CAAC,kBAAkB,CAAC,SAAS,GAC5C,EAEF,EAAC,WAAW,IACV,WAAW,EAAE,IAAI,CAAC,kBAAkB,CAAC,WAAW,GAChD,EAEF,EAAC,UAAU,IACT,UAAU,EAAE,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAC9C,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,EACnD,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,GACvD,EAEF,EAAC,mBAAmB,IAClB,mBAAmB,EAAE,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,EAChE,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,GAClC,EAED,IAAI,CAAC,QAAQ,KACZ,EAAC,aAAa,IACZ,WAAW,EAAE,IAAI,CAAC,kBAAkB,GACpC,CACH,CACK,CACH,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["Convert"],"sources":["src/crypto/crl.ts","src/components/certificate-details-parts/revoked_certificates.tsx","src/components/certificate-viewer/certificate-viewer.scss?tag=peculiar-crl-viewer&encapsulation=shadow","src/components/crl-viewer/crl-viewer.tsx"],"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 */\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { CertificateList, Time } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\n\nimport { Download } from '../utils';\n\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport { Name, INameJSON } from './name';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\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 CRL 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 type: string = 'X.509 Certificate Revocation List';\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: string = '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 exportAsBase64() {\n return Convert.ToBase64(this.raw);\n }\n\n public exportAsHexFormatted() {\n return hexFormat(Convert.ToHex(this.raw));\n }\n\n public exportAsPemFormatted() {\n return `-----BEGIN X509 CRL-----\\n${base64Format(this.exportAsBase64())}\\n-----END X509 CRL-----`;\n }\n\n public downloadAsPEM(name?: string) {\n Download.crl.asPEM(\n this.exportAsPemFormatted(),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.crl.asDER(\n this.exportAsHexFormatted(),\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 */\n\nimport { h, FunctionalComponent } from '@stencil/core';\nimport { CRLReason, InvalidityDate, CertificateIssuer } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\n\nimport { dateShort, l10n, getStringByOID } from '../../utils';\nimport { IRevokedCertificate } from '../../crypto';\nimport { GeneralNamePart } from './extensions/general_name_part';\nimport { RowTitle, RowValue, TableRowTable } from './row';\n\ninterface IRevokedCertificatesProps extends IGeneralNameOptions {\n revokedCertificates: IRevokedCertificate[];\n}\n\nexport const RevokedCertificates: FunctionalComponent<IRevokedCertificatesProps> = (props) => {\n const {\n revokedCertificates,\n getDNSNameLink,\n getIPAddressLink,\n } = props;\n\n if (!revokedCertificates || !revokedCertificates.length) {\n return null;\n }\n\n return [\n <RowTitle\n value={l10n.getString('revokedCertificates')}\n />,\n revokedCertificates.map((certificate) => ([\n <RowValue\n name={l10n.getString('serialNumber')}\n value={Convert.ToHex(certificate.userCertificate)}\n monospace\n />,\n <RowValue\n name={l10n.getString('revocationDate')}\n value={dateShort(certificate.revocationDate.getTime())}\n />,\n (certificate.crlEntryExtensions && certificate.crlEntryExtensions.length && ([\n <RowValue\n name={`${l10n.getString('crlEntryExtensions')}:`}\n value=\"\"\n />,\n <TableRowTable>\n {\n certificate.crlEntryExtensions.map((extension) => {\n if (extension.value instanceof CRLReason) {\n return (\n <RowValue\n name={getStringByOID(extension.asn.extnID)}\n value={extension.value.toJSON() || extension.value.reason}\n />\n );\n }\n\n if (extension.value instanceof InvalidityDate) {\n return (\n <RowValue\n name={getStringByOID(extension.asn.extnID)}\n value={extension.value.value.getTime()}\n />\n );\n }\n\n if (extension.value instanceof CertificateIssuer && extension.value.length) {\n return ([\n <RowValue\n name={`${getStringByOID(extension.asn.extnID)}:`}\n value=\"\"\n />,\n extension.value.map((gn) => (\n <TableRowTable>\n <GeneralNamePart\n generalName={gn}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n />\n </TableRowTable>\n )),\n ]);\n }\n\n return (\n <RowValue\n name={getStringByOID(extension.asn.extnID)}\n value={Convert.ToHex(extension.asn.extnValue)}\n monospace\n />\n );\n })\n }\n </TableRowTable>,\n ])),\n <tr>\n <td colSpan={2} class=\"divider\">\n <span />\n </td>\n </tr>,\n ])),\n ];\n};\n","@import '../../css/base.scss';\n\n:host {\n display: block;\n width: 100%;\n position: relative;\n min-width: 280px;\n min-height: 300px;\n word-wrap: break-word;\n word-break: break-word;\n}\n\nth, td {\n border: none;\n}\n\ntable {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n\n td {\n padding: var(--pv-size-base-2) var(--pv-size-base-4);\n vertical-align: top;\n\n &:first-child {\n width: 220px;\n }\n\n &:last-child {\n width: calc(100% - 220px)\n }\n\n &.monospace {\n max-width: 0;\n }\n\n &.divider {\n padding: var(--pv-size-base-2) 0;\n\n span {\n height: 1px;\n display: block;\n background-color: var(--pv-color-gray-4);\n }\n }\n }\n\n .title td {\n padding-top: var(--pv-size-base-6);\n padding-bottom: var(--pv-size-base-2);\n }\n\n table {\n border-left: 1px solid var(--pv-color-gray-5);\n }\n}\n\n.status_wrapper {\n min-height: inherit;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n:host([data-mobile-screen-view=\"true\"]) {\n table, tr, td {\n display: block;\n }\n\n table {\n tr {\n padding: var(--pv-size-base-2) 0;\n\n &.title {\n padding-top: var(--pv-size-base-6);\n\n td {\n padding: 0 var(--pv-size-base-4);\n }\n }\n }\n\n td {\n padding: 0 var(--pv-size-base-4);\n width: 100% !important;\n max-width: 100% !important;\n\n &.divider {\n padding: 0;\n }\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 */\n\nimport {\n Component,\n Host,\n h,\n Prop,\n State,\n Watch,\n Build,\n} from '@stencil/core';\n\nimport { CRL } from '../../crypto';\nimport { getDNSNameLink, getIPAddressLink, getLEILink } from '../../utils/third_party_links';\nimport {\n BasicInformation,\n IssuerName,\n Signature,\n Thumbprints,\n Extensions,\n Miscellaneous,\n RevokedCertificates,\n} from '../certificate-details-parts';\nimport { Typography } from '../typography';\n\nexport type CrlProp = string | CRL;\n\n@Component({\n tag: 'peculiar-crl-viewer',\n styleUrl: '../certificate-viewer/certificate-viewer.scss',\n shadow: true,\n})\nexport class CrlViewer {\n private certificateDecoded: CRL;\n\n private certificateDecodeError: Error;\n\n private mobileMediaQuery: MediaQueryList;\n\n /**\n * The certificate value for decode and show details. Use PEM or DER.\n */\n @Prop({ reflect: true }) certificate: CrlProp;\n\n /**\n * If `true` - component will show split-button to download certificate as PEM or DER.\n */\n @Prop() download?: boolean;\n\n /**\n * Authority Key Identifier extension parent link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.subject_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdParentLink?: string;\n\n /**\n * Authority Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdSiblingsLink?: string;\n\n /**\n * Issuer DN link.\n * **NOTE**: HTML component attribute must be `issuer-dn-link`.\n */\n @Prop({ reflect: true }) issuerDnLink?: string;\n\n /**\n * Mobile media query string to control screen view change.\n * <br />\n * **NOTE**: Based on https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia.\n * @example\n * (max-width: 900px)\n */\n @Prop({ reflect: false }) mobileMediaQueryString?: string = '(max-width: 900px)';\n\n @State() mobileScreenView: boolean = false;\n\n @State() isDecodeInProcess: boolean = true;\n\n private handleMediaQueryChange(event: MediaQueryListEvent) {\n this.mobileScreenView = event.matches;\n }\n\n componentWillLoad() {\n this.decodeCertificate(this.certificate);\n\n if (Build.isBrowser) {\n this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);\n this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));\n this.mobileScreenView = this.mobileMediaQuery.matches;\n }\n }\n\n disconnectedCallback() {\n this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));\n }\n\n private async decodeCertificate(certificate: CrlProp) {\n this.isDecodeInProcess = true;\n\n try {\n if (certificate instanceof CRL) {\n this.certificateDecoded = certificate;\n } else if (typeof certificate === 'string') {\n this.certificateDecoded = new CRL(certificate);\n } else {\n return;\n }\n\n this.certificateDecoded.parseExtensions();\n await this.certificateDecoded.getThumbprint('SHA-1');\n await this.certificateDecoded.getThumbprint('SHA-256');\n } catch (error) {\n this.certificateDecodeError = error;\n\n console.error('Error certificate parse:', error);\n }\n\n this.isDecodeInProcess = false;\n }\n\n private getAuthKeyIdParentLink = (value: string) => this.authKeyIdParentLink\n ?.replace('{{authKeyId}}', value);\n\n private getAuthKeyIdSiblingsLink = (value: string) => this.authKeyIdSiblingsLink\n ?.replace('{{authKeyId}}', value);\n\n private getIssuerDnLink() {\n return this.issuerDnLink;\n }\n\n /**\n * Rerun decodeCertificate if previuos value not equal current value\n */\n @Watch('certificate')\n watchCertificateAndDecode(\n newValue: CrlProp,\n oldValue: CrlProp,\n ) {\n if (typeof newValue === 'string' && typeof oldValue === 'string') {\n if (newValue !== oldValue) {\n this.decodeCertificate(newValue);\n }\n\n return;\n }\n\n if (\n newValue instanceof CRL\n && oldValue instanceof CRL\n ) {\n if (newValue.commonName !== oldValue.commonName) {\n this.decodeCertificate(newValue);\n }\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderErrorState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There was an error decoding this certificate revocation list.\n </Typography>\n </div>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderEmptyState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There is no certificate revocation list available.\n </Typography>\n </div>\n );\n }\n\n render() {\n if (this.certificateDecodeError) {\n return this.renderErrorState();\n }\n\n if (!this.certificateDecoded) {\n return this.renderEmptyState();\n }\n\n return (\n <Host\n data-mobile-screen-view={String(this.mobileScreenView)}\n >\n <table>\n <BasicInformation\n {...this.certificateDecoded}\n />\n\n <IssuerName\n name={this.certificateDecoded.issuer}\n issuerDnLink={this.getIssuerDnLink()}\n />\n\n <Signature\n signature={this.certificateDecoded.signature}\n />\n\n <Thumbprints\n thumbprints={this.certificateDecoded.thumbprints}\n />\n\n <Extensions\n extensions={this.certificateDecoded.extensions}\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n />\n\n <RevokedCertificates\n revokedCertificates={this.certificateDecoded.revokedCertificates}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n />\n\n {this.download && (\n <Miscellaneous\n certificate={this.certificateDecoded}\n />\n )}\n </table>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,47 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
+ */
4
+ import { h } from '@stencil/core/internal/client';
5
+
6
+ /**
7
+ * @license
8
+ * Copyright (c) Peculiar Ventures, LLC.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ const DetailsIcon = (props) => {
14
+ const { color = 'secondary' } = props;
15
+ return (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "31", fill: "none" },
16
+ h("path", { fill: `var(--pv-color-${color})`, d: "M6.71 19.79a1 1 0 0 0-.33-.21 1 1 0 0 0-.76 0 1 1 0 0 0-.33.21 1 1 0 0 0-.21.33 1 1 0 0 0 .21 1.09c.097.088.209.16.33.21a.94.94 0 0 0 .76 0 1.15 1.15 0 0 0 .33-.21 1 1 0 0 0 .21-1.09 1 1 0 0 0-.21-.33ZM10 11.5h14a1 1 0 0 0 0-2H10a1 1 0 0 0 0 2Zm-3.29 3.29a1 1 0 0 0-1.09-.21 1.15 1.15 0 0 0-.33.21 1 1 0 0 0-.21.33.94.94 0 0 0 0 .76c.05.121.122.233.21.33.097.088.209.16.33.21a.94.94 0 0 0 .76 0 1.15 1.15 0 0 0 .33-.21 1.15 1.15 0 0 0 .21-.33.94.94 0 0 0 0-.76 1 1 0 0 0-.21-.33ZM24 14.5H10a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2ZM6.71 9.79a1 1 0 0 0-.33-.21 1 1 0 0 0-1.09.21 1.15 1.15 0 0 0-.21.33.94.94 0 0 0 0 .76c.05.121.122.233.21.33.097.088.209.16.33.21a1 1 0 0 0 1.09-.21 1.15 1.15 0 0 0 .21-.33.94.94 0 0 0 0-.76 1.15 1.15 0 0 0-.21-.33ZM24 19.5H10a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2Z" })));
17
+ };
18
+
19
+ /**
20
+ * @license
21
+ * Copyright (c) Peculiar Ventures, LLC.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */
26
+ const LinkIcon = (props) => {
27
+ const { color = 'secondary' } = props;
28
+ return (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "31", fill: "none" },
29
+ h("path", { fill: `var(--pv-color-${color})`, d: "M21 14.32a1 1 0 0 0-1 1v7.18a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1v-11a1 1 0 0 1 1-1h7.18a1 1 0 0 0 0-2H8a3 3 0 0 0-3 3v11a3 3 0 0 0 3 3h11a3 3 0 0 0 3-3v-7.18a1 1 0 0 0-1-1Zm3.92-8.2a1 1 0 0 0-.54-.54A1 1 0 0 0 24 5.5h-6a1 1 0 1 0 0 2h3.59l-10.3 10.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219L23 8.91v3.59a1 1 0 0 0 2 0v-6a1.001 1.001 0 0 0-.08-.38Z" })));
30
+ };
31
+
32
+ /**
33
+ * @license
34
+ * Copyright (c) Peculiar Ventures, LLC.
35
+ *
36
+ * This source code is licensed under the MIT license found in the
37
+ * LICENSE file in the root directory of this source tree.
38
+ */
39
+ const CrossIcon = (props) => {
40
+ const { color = 'gray-9' } = props;
41
+ return (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", fill: "none" },
42
+ h("path", { fill: `var(--pv-color-${color})`, "fill-rule": "evenodd", d: "m16.37 15 5.442 5.44c.25.252.25.663 0 .914l-.459.457a.646.646 0 0 1-.913 0L15 16.371l-5.44 5.44a.648.648 0 0 1-.915 0l-.457-.457a.649.649 0 0 1 0-.913L13.63 15 8.188 9.56a.649.649 0 0 1 0-.914l.457-.457a.648.648 0 0 1 .915 0l5.44 5.44 5.44-5.44a.646.646 0 0 1 .913 0l.46.457c.25.25.25.662 0 .913L16.37 15Z", "clip-rule": "evenodd" })));
43
+ };
44
+
45
+ export { CrossIcon as C, DetailsIcon as D, LinkIcon as L };
46
+
47
+ //# sourceMappingURL=cross.js.map
@@ -0,0 +1 @@
1
+ {"file":"cross.js","mappings":";;;;;AAAA;;;;;;;MAWa,WAAW,GAA+C,CAAC,KAAK;EAC3E,MAAM,EAAE,KAAK,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;EAEtC,QACE,WACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,IAAI,EAAC,MAAM;IAEX,YACE,IAAI,EAAE,kBAAkB,KAAK,GAAG,EAChC,CAAC,EAAC,+wBAA+wB,GACjxB,CACE,EACN;AACJ;;AC3BA;;;;;;;MAWa,QAAQ,GAA+C,CAAC,KAAK;EACxE,MAAM,EAAE,KAAK,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;EAEtC,QACE,WACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,IAAI,EAAC,MAAM;IAEX,YACE,IAAI,EAAE,kBAAkB,KAAK,GAAG,EAChC,CAAC,EAAC,iWAAiW,GACnW,CACE,EACN;AACJ;;AC3BA;;;;;;;MAWa,SAAS,GAA+C,CAAC,KAAK;EACzE,MAAM,EAAE,KAAK,GAAG,QAAQ,EAAE,GAAG,KAAK,CAAC;EAEnC,QACE,WACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,IAAI,EAAC,MAAM;IAEX,YACE,IAAI,EAAE,kBAAkB,KAAK,GAAG,eACtB,SAAS,EACnB,CAAC,EAAC,mTAAmT,eAC3S,SAAS,GACnB,CACE,EACN;AACJ;;;;","names":[],"sources":["src/components/icons/details.tsx","src/components/icons/link.tsx","src/components/icons/cross.tsx"],"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 { FunctionalComponent, h } from '@stencil/core';\nimport type { ColorType } from '../../interface';\n\nexport const DetailsIcon: FunctionalComponent<{ color?: ColorType }> = (props) => {\n const { color = 'secondary' } = props;\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"30\"\n height=\"31\"\n fill=\"none\"\n >\n <path\n fill={`var(--pv-color-${color})`}\n d=\"M6.71 19.79a1 1 0 0 0-.33-.21 1 1 0 0 0-.76 0 1 1 0 0 0-.33.21 1 1 0 0 0-.21.33 1 1 0 0 0 .21 1.09c.097.088.209.16.33.21a.94.94 0 0 0 .76 0 1.15 1.15 0 0 0 .33-.21 1 1 0 0 0 .21-1.09 1 1 0 0 0-.21-.33ZM10 11.5h14a1 1 0 0 0 0-2H10a1 1 0 0 0 0 2Zm-3.29 3.29a1 1 0 0 0-1.09-.21 1.15 1.15 0 0 0-.33.21 1 1 0 0 0-.21.33.94.94 0 0 0 0 .76c.05.121.122.233.21.33.097.088.209.16.33.21a.94.94 0 0 0 .76 0 1.15 1.15 0 0 0 .33-.21 1.15 1.15 0 0 0 .21-.33.94.94 0 0 0 0-.76 1 1 0 0 0-.21-.33ZM24 14.5H10a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2ZM6.71 9.79a1 1 0 0 0-.33-.21 1 1 0 0 0-1.09.21 1.15 1.15 0 0 0-.21.33.94.94 0 0 0 0 .76c.05.121.122.233.21.33.097.088.209.16.33.21a1 1 0 0 0 1.09-.21 1.15 1.15 0 0 0 .21-.33.94.94 0 0 0 0-.76 1.15 1.15 0 0 0-.21-.33ZM24 19.5H10a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2Z\"\n />\n </svg>\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 */\n\nimport { FunctionalComponent, h } from '@stencil/core';\nimport type { ColorType } from '../../interface';\n\nexport const LinkIcon: FunctionalComponent<{ color?: ColorType }> = (props) => {\n const { color = 'secondary' } = props;\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"30\"\n height=\"31\"\n fill=\"none\"\n >\n <path\n fill={`var(--pv-color-${color})`}\n d=\"M21 14.32a1 1 0 0 0-1 1v7.18a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1v-11a1 1 0 0 1 1-1h7.18a1 1 0 0 0 0-2H8a3 3 0 0 0-3 3v11a3 3 0 0 0 3 3h11a3 3 0 0 0 3-3v-7.18a1 1 0 0 0-1-1Zm3.92-8.2a1 1 0 0 0-.54-.54A1 1 0 0 0 24 5.5h-6a1 1 0 1 0 0 2h3.59l-10.3 10.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219L23 8.91v3.59a1 1 0 0 0 2 0v-6a1.001 1.001 0 0 0-.08-.38Z\"\n />\n </svg>\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 */\n\nimport { FunctionalComponent, h } from '@stencil/core';\nimport type { ColorType } from '../../interface';\n\nexport const CrossIcon: FunctionalComponent<{ color?: ColorType }> = (props) => {\n const { color = 'gray-9' } = props;\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"30\"\n height=\"30\"\n fill=\"none\"\n >\n <path\n fill={`var(--pv-color-${color})`}\n fill-rule=\"evenodd\"\n d=\"m16.37 15 5.442 5.44c.25.252.25.663 0 .914l-.459.457a.646.646 0 0 1-.913 0L15 16.371l-5.44 5.44a.648.648 0 0 1-.915 0l-.457-.457a.649.649 0 0 1 0-.913L13.63 15 8.188 9.56a.649.649 0 0 1 0-.914l.457-.457a.648.648 0 0 1 .915 0l5.44 5.44 5.44-5.44a.646.646 0 0 1 .913 0l.46.457c.25.25.25.662 0 .913L16.37 15Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n );\n};\n"],"version":3}
@@ -0,0 +1,233 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
+ */
4
+ import { proxyCustomElement, HTMLElement, Build, h, Host } from '@stencil/core/internal/client';
5
+ import { A as AsnData, c as certificateRawToBuffer, ac as CertificationRequest, a2 as Name, a3 as id_ecPublicKey, b as AsnConvert, a4 as ECParameters, a5 as id_rsaEncryption, a6 as RSAPublicKey, g as getCertificateThumbprint, h as hexFormat, e as base64Format, B as BasicInformation, S as Signature, T as Thumbprints, j as getLEILink, k as getDNSNameLink, m as getIPAddressLink, n as Extensions, M as Miscellaneous } from './miscellaneous.js';
6
+ import { b as build, D as Download } from './download.js';
7
+ import { A as Attribute, a as Attributes } from './index2.js';
8
+ import { S as SubjectName, P as PublicKey } from './subject_name.js';
9
+ import { T as Typography } from './button.js';
10
+
11
+ /**
12
+ * @license
13
+ * Copyright (c) Peculiar Ventures, LLC.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */
18
+ class CSR extends AsnData {
19
+ constructor(raw) {
20
+ super(certificateRawToBuffer(raw), CertificationRequest);
21
+ this.thumbprints = {};
22
+ this.type = 'PKCS#10 Certificate Request';
23
+ const { certificationRequestInfo } = this.asn;
24
+ this.subject = new Name(certificationRequestInfo.subject).toJSON();
25
+ this.version = certificationRequestInfo.version;
26
+ }
27
+ get publicKey() {
28
+ const { subjectPublicKey, algorithm } = this.asn.certificationRequestInfo.subjectPKInfo;
29
+ let params;
30
+ if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {
31
+ params = AsnConvert.parse(algorithm.parameters, ECParameters);
32
+ }
33
+ if (algorithm.algorithm === id_rsaEncryption) {
34
+ params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);
35
+ }
36
+ const spki = AsnConvert.serialize(this.asn.certificationRequestInfo.subjectPKInfo);
37
+ return {
38
+ params,
39
+ value: spki,
40
+ algorithm: algorithm.algorithm,
41
+ };
42
+ }
43
+ get signature() {
44
+ const { signature, signatureAlgorithm } = this.asn;
45
+ return {
46
+ value: signature,
47
+ algorithm: signatureAlgorithm.algorithm,
48
+ };
49
+ }
50
+ get commonName() {
51
+ if (!this.subject) {
52
+ return '';
53
+ }
54
+ for (let i = 0; i < this.subject.length; i += 1) {
55
+ const name = this.subject[i];
56
+ if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {
57
+ return name.value;
58
+ }
59
+ }
60
+ return '';
61
+ }
62
+ async getThumbprint(algorithm = 'SHA-1') {
63
+ try {
64
+ const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
65
+ if (thumbprint) {
66
+ this.thumbprints[algorithm] = build.Convert.ToHex(thumbprint);
67
+ }
68
+ }
69
+ catch (error) {
70
+ console.error('Error thumbprint get:', error);
71
+ }
72
+ }
73
+ parseAttributes() {
74
+ const { certificationRequestInfo } = this.asn;
75
+ if (certificationRequestInfo.attributes) {
76
+ this.attributes = certificationRequestInfo.attributes
77
+ .map((e) => new Attribute(AsnConvert.serialize(e)));
78
+ }
79
+ }
80
+ exportAsBase64() {
81
+ return build.Convert.ToBase64(this.raw);
82
+ }
83
+ exportAsHexFormatted() {
84
+ return hexFormat(build.Convert.ToHex(this.raw));
85
+ }
86
+ exportAsPemFormatted() {
87
+ return `-----BEGIN CERTIFICATE REQUEST-----\n${base64Format(this.exportAsBase64())}\n-----END CERTIFICATE REQUEST-----`;
88
+ }
89
+ downloadAsPEM(name) {
90
+ Download.csr.asPEM(this.exportAsPemFormatted(), name || this.commonName);
91
+ }
92
+ downloadAsDER(name) {
93
+ Download.csr.asDER(this.exportAsHexFormatted(), name || this.commonName);
94
+ }
95
+ }
96
+
97
+ const certificateViewerCss = "*{-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 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}";
98
+
99
+ const CsrViewer = /*@__PURE__*/ proxyCustomElement(class CsrViewer extends HTMLElement {
100
+ constructor() {
101
+ super();
102
+ this.__registerHost();
103
+ this.__attachShadow();
104
+ // eslint-disable-next-line class-methods-use-this
105
+ this.getAuthKeyIdParentLink = (value) => value;
106
+ // eslint-disable-next-line class-methods-use-this
107
+ this.getAuthKeyIdSiblingsLink = (value) => value;
108
+ this.getSubjectKeyIdChildrenLink = (value) => {
109
+ var _a;
110
+ return (_a = this.subjectKeyIdChildrenLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
111
+ };
112
+ this.getSubjectKeyIdSiblingsLink = (value) => {
113
+ var _a;
114
+ return (_a = this.subjectKeyIdSiblingsLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
115
+ };
116
+ this.certificate = undefined;
117
+ this.download = undefined;
118
+ this.subjectKeyIdChildrenLink = undefined;
119
+ this.subjectKeyIdSiblingsLink = undefined;
120
+ this.mobileMediaQueryString = '(max-width: 900px)';
121
+ this.mobileScreenView = false;
122
+ this.isDecodeInProcess = true;
123
+ }
124
+ handleMediaQueryChange(event) {
125
+ this.mobileScreenView = event.matches;
126
+ }
127
+ componentWillLoad() {
128
+ this.decodeCertificate(this.certificate);
129
+ if (Build.isBrowser) {
130
+ this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);
131
+ this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));
132
+ this.mobileScreenView = this.mobileMediaQuery.matches;
133
+ }
134
+ }
135
+ disconnectedCallback() {
136
+ this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));
137
+ }
138
+ async decodeCertificate(certificate) {
139
+ this.isDecodeInProcess = true;
140
+ try {
141
+ if (certificate instanceof CSR) {
142
+ this.certificateDecoded = certificate;
143
+ }
144
+ else if (typeof certificate === 'string') {
145
+ this.certificateDecoded = new CSR(certificate);
146
+ }
147
+ else {
148
+ return;
149
+ }
150
+ this.certificateDecoded.parseAttributes();
151
+ await this.certificateDecoded.getThumbprint('SHA-1');
152
+ await this.certificateDecoded.getThumbprint('SHA-256');
153
+ }
154
+ catch (error) {
155
+ this.certificateDecodeError = error;
156
+ console.error('Error certificate parse:', error);
157
+ }
158
+ this.isDecodeInProcess = false;
159
+ }
160
+ /**
161
+ * Rerun decodeCertificate if previuos value not equal current value
162
+ */
163
+ watchCertificateAndDecode(newValue, oldValue) {
164
+ if (typeof newValue === 'string' && typeof oldValue === 'string') {
165
+ if (newValue !== oldValue) {
166
+ this.decodeCertificate(newValue);
167
+ }
168
+ return;
169
+ }
170
+ if (newValue instanceof CSR
171
+ && oldValue instanceof CSR) {
172
+ if (newValue.commonName !== oldValue.commonName) {
173
+ this.decodeCertificate(newValue);
174
+ }
175
+ }
176
+ }
177
+ // eslint-disable-next-line class-methods-use-this
178
+ renderErrorState() {
179
+ return (h("div", { class: "status_wrapper" }, h(Typography, null, "There was an error decoding this certificate request.")));
180
+ }
181
+ // eslint-disable-next-line class-methods-use-this
182
+ renderEmptyState() {
183
+ return (h("div", { class: "status_wrapper" }, h(Typography, null, "There is no certificate request available.")));
184
+ }
185
+ getExtensionRequestAttribute() {
186
+ if (!this.certificateDecoded) {
187
+ return undefined;
188
+ }
189
+ return this.certificateDecoded.attributes
190
+ .find((attribute) => attribute.asn.type === '1.2.840.113549.1.9.14');
191
+ }
192
+ render() {
193
+ if (this.certificateDecodeError) {
194
+ return this.renderErrorState();
195
+ }
196
+ if (!this.certificateDecoded) {
197
+ return this.renderEmptyState();
198
+ }
199
+ const extensionRequestAttribute = this.getExtensionRequestAttribute();
200
+ return (h(Host, { "data-mobile-screen-view": String(this.mobileScreenView) }, h("table", null, h(BasicInformation, Object.assign({}, this.certificateDecoded)), h(SubjectName, { name: this.certificateDecoded.subject }), h(PublicKey, { publicKey: this.certificateDecoded.publicKey }), h(Signature, { signature: this.certificateDecoded.signature }), h(Thumbprints, { thumbprints: this.certificateDecoded.thumbprints }), h(Attributes, { attributes: this.certificateDecoded.attributes, getLEILink: getLEILink, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink, getAuthKeyIdParentLink: this.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink: this.getAuthKeyIdSiblingsLink, getSubjectKeyIdChildrenLink: this.getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink: this.getSubjectKeyIdSiblingsLink }), h(Extensions, { extensions: extensionRequestAttribute === null || extensionRequestAttribute === void 0 ? void 0 : extensionRequestAttribute.value, title: "Extension Request", getLEILink: getLEILink, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink, getAuthKeyIdParentLink: this.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink: this.getAuthKeyIdSiblingsLink, getSubjectKeyIdChildrenLink: this.getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink: this.getSubjectKeyIdSiblingsLink }), this.download && (h(Miscellaneous, { certificate: this.certificateDecoded })))));
201
+ }
202
+ static get watchers() { return {
203
+ "certificate": ["watchCertificateAndDecode"]
204
+ }; }
205
+ static get style() { return certificateViewerCss; }
206
+ }, [1, "peculiar-csr-viewer", {
207
+ "certificate": [513],
208
+ "download": [4],
209
+ "subjectKeyIdChildrenLink": [513, "subject-key-id-children-link"],
210
+ "subjectKeyIdSiblingsLink": [513, "subject-key-id-siblings-link"],
211
+ "mobileMediaQueryString": [1, "mobile-media-query-string"],
212
+ "mobileScreenView": [32],
213
+ "isDecodeInProcess": [32]
214
+ }, undefined, {
215
+ "certificate": ["watchCertificateAndDecode"]
216
+ }]);
217
+ function defineCustomElement() {
218
+ if (typeof customElements === "undefined") {
219
+ return;
220
+ }
221
+ const components = ["peculiar-csr-viewer"];
222
+ components.forEach(tagName => { switch (tagName) {
223
+ case "peculiar-csr-viewer":
224
+ if (!customElements.get(tagName)) {
225
+ customElements.define(tagName, CsrViewer);
226
+ }
227
+ break;
228
+ } });
229
+ }
230
+
231
+ export { CSR as C, CsrViewer as a, defineCustomElement as d };
232
+
233
+ //# sourceMappingURL=csr-viewer.js.map