@peculiar/certificates-viewer 4.1.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (662) hide show
  1. package/components/actions.js +3 -3
  2. package/components/actions.js.map +1 -1
  3. package/components/arrow_top.js +6 -6
  4. package/components/arrow_top.js.map +1 -1
  5. package/components/attribute-certificate-viewer.js +222 -220
  6. package/components/attribute-certificate-viewer.js.map +1 -1
  7. package/components/button-menu.js +36 -35
  8. package/components/button-menu.js.map +1 -1
  9. package/components/button.js +42 -42
  10. package/components/button.js.map +1 -1
  11. package/components/certificate-viewer.js +250 -249
  12. package/components/certificate-viewer.js.map +1 -1
  13. package/components/circular-progress.js +34 -33
  14. package/components/circular-progress.js.map +1 -1
  15. package/components/crl-viewer.js +214 -213
  16. package/components/crl-viewer.js.map +1 -1
  17. package/components/cross.js +9 -9
  18. package/components/cross.js.map +1 -1
  19. package/components/csr-viewer.js +200 -202
  20. package/components/csr-viewer.js.map +1 -1
  21. package/components/download.js +56 -56
  22. package/components/download.js.map +1 -1
  23. package/components/highlight-words.js +45 -44
  24. package/components/highlight-words.js.map +1 -1
  25. package/components/index2.js +146 -156
  26. package/components/index2.js.map +1 -1
  27. package/components/issuer_name.js +6 -6
  28. package/components/issuer_name.js.map +1 -1
  29. package/components/miscellaneous.js +4049 -4037
  30. package/components/miscellaneous.js.map +1 -1
  31. package/components/peculiar-attribute-certificate-viewer.d.ts +2 -2
  32. package/components/peculiar-button-menu.d.ts +2 -2
  33. package/components/peculiar-certificate-decoder.d.ts +2 -2
  34. package/components/peculiar-certificate-decoder.js +183 -182
  35. package/components/peculiar-certificate-decoder.js.map +1 -1
  36. package/components/peculiar-certificate-viewer.d.ts +2 -2
  37. package/components/peculiar-certificates-viewer.d.ts +2 -2
  38. package/components/peculiar-certificates-viewer.js +297 -296
  39. package/components/peculiar-certificates-viewer.js.map +1 -1
  40. package/components/peculiar-circular-progress.d.ts +2 -2
  41. package/components/peculiar-crl-viewer.d.ts +2 -2
  42. package/components/peculiar-csr-viewer.d.ts +2 -2
  43. package/components/peculiar-highlight-words.d.ts +2 -2
  44. package/components/peculiar-text-hider.d.ts +2 -2
  45. package/components/peculiar-text-hider.js +23 -22
  46. package/components/peculiar-text-hider.js.map +1 -1
  47. package/components/subject_name.js +35 -35
  48. package/components/subject_name.js.map +1 -1
  49. package/dist/cjs/actions-789906f5.js +23 -0
  50. package/dist/cjs/{actions-19013d4a.js.map → actions-789906f5.js.map} +1 -1
  51. package/dist/cjs/app-globals-c20ffa41.js +10 -0
  52. package/dist/cjs/app-globals-c20ffa41.js.map +1 -0
  53. package/dist/cjs/arrow_top-76e4261e.js +37 -0
  54. package/dist/cjs/{arrow_top-834fb7ec.js.map → arrow_top-76e4261e.js.map} +1 -1
  55. package/dist/cjs/button-87086210.js +77 -0
  56. package/dist/cjs/{button-14e2b73f.js.map → button-87086210.js.map} +1 -1
  57. package/dist/cjs/{certification_request-bf416170.js → certification_request-b0d72620.js} +3326 -3331
  58. package/dist/cjs/certification_request-b0d72620.js.map +1 -0
  59. package/dist/cjs/crl-812dd7a1.js +312 -0
  60. package/dist/cjs/crl-812dd7a1.js.map +1 -0
  61. package/dist/cjs/cross-bd099933.js +51 -0
  62. package/dist/cjs/{cross-9872c473.js.map → cross-bd099933.js.map} +1 -1
  63. package/dist/cjs/{download-0fa5b33c.js → download-6f550549.js} +50 -50
  64. package/dist/cjs/download-6f550549.js.map +1 -0
  65. package/dist/cjs/download-820d66ba.js +23 -0
  66. package/dist/cjs/{download-254ddc57.js.map → download-820d66ba.js.map} +1 -1
  67. package/dist/cjs/{index-efd561e9.js → index-e2ae280a.js} +398 -145
  68. package/dist/cjs/index-e2ae280a.js.map +1 -0
  69. package/dist/cjs/index.cjs.js +8 -8
  70. package/dist/cjs/link-a3d3799d.js +25 -0
  71. package/dist/cjs/{link-6aea0be4.js.map → link-a3d3799d.js.map} +1 -1
  72. package/dist/cjs/loader.cjs.js +4 -2
  73. package/dist/cjs/loader.cjs.js.map +1 -1
  74. package/dist/cjs/miscellaneous-dcb93a5b.js +1419 -0
  75. package/dist/cjs/miscellaneous-dcb93a5b.js.map +1 -0
  76. package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +481 -480
  77. package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js.map +1 -1
  78. package/dist/cjs/peculiar-button-menu_3.cjs.entry.js +72 -69
  79. package/dist/cjs/peculiar-button-menu_3.cjs.entry.js.map +1 -1
  80. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +151 -150
  81. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -1
  82. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +107 -106
  83. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js.map +1 -1
  84. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +258 -257
  85. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +1 -1
  86. package/dist/cjs/peculiar-text-hider.cjs.entry.js +12 -11
  87. package/dist/cjs/peculiar-text-hider.cjs.entry.js.map +1 -1
  88. package/dist/cjs/peculiar.cjs.js +5 -3
  89. package/dist/cjs/peculiar.cjs.js.map +1 -1
  90. package/dist/cjs/x509_certificate-ebf4cbd4.js +160 -0
  91. package/dist/cjs/x509_certificate-ebf4cbd4.js.map +1 -0
  92. package/dist/collection/collection-manifest.json +2 -2
  93. package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +259 -259
  94. package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js.map +1 -1
  95. package/dist/collection/components/button/button.js +9 -9
  96. package/dist/collection/components/button/button.js.map +1 -1
  97. package/dist/collection/components/button-menu/button-menu.js +60 -60
  98. package/dist/collection/components/button-menu/button-menu.js.map +1 -1
  99. package/dist/collection/components/certificate-decoder/certificate-decoder.js +211 -211
  100. package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
  101. package/dist/collection/components/certificate-details-parts/attributes/activity_description_attribute.js +4 -3
  102. package/dist/collection/components/certificate-details-parts/attributes/activity_description_attribute.js.map +1 -1
  103. package/dist/collection/components/certificate-details-parts/attributes/as_string_attribute.js +2 -2
  104. package/dist/collection/components/certificate-details-parts/attributes/as_string_attribute.js.map +1 -1
  105. package/dist/collection/components/certificate-details-parts/attributes/basic_attribute.js +6 -6
  106. package/dist/collection/components/certificate-details-parts/attributes/basic_attribute.js.map +1 -1
  107. package/dist/collection/components/certificate-details-parts/attributes/challenge_password_attribute.js +2 -2
  108. package/dist/collection/components/certificate-details-parts/attributes/challenge_password_attribute.js.map +1 -1
  109. package/dist/collection/components/certificate-details-parts/attributes/index.js +42 -42
  110. package/dist/collection/components/certificate-details-parts/attributes/index.js.map +1 -1
  111. package/dist/collection/components/certificate-details-parts/attributes/insurance_value_attribute.js +3 -3
  112. package/dist/collection/components/certificate-details-parts/attributes/insurance_value_attribute.js.map +1 -1
  113. package/dist/collection/components/certificate-details-parts/attributes/name_attribute.js +2 -2
  114. package/dist/collection/components/certificate-details-parts/attributes/name_attribute.js.map +1 -1
  115. package/dist/collection/components/certificate-details-parts/attributes/name_part.js +5 -5
  116. package/dist/collection/components/certificate-details-parts/attributes/name_part.js.map +1 -1
  117. package/dist/collection/components/certificate-details-parts/attributes/type_relationship_attribute.js +2 -2
  118. package/dist/collection/components/certificate-details-parts/attributes/type_relationship_attribute.js.map +1 -1
  119. package/dist/collection/components/certificate-details-parts/attributes/unstructured_name_attribute.js +2 -2
  120. package/dist/collection/components/certificate-details-parts/attributes/unstructured_name_attribute.js.map +1 -1
  121. package/dist/collection/components/certificate-details-parts/attributes/valuation_ranking_attribute.js +14 -14
  122. package/dist/collection/components/certificate-details-parts/attributes/valuation_ranking_attribute.js.map +1 -1
  123. package/dist/collection/components/certificate-details-parts/attributes/web_gdpr_attribute.js +4 -3
  124. package/dist/collection/components/certificate-details-parts/attributes/web_gdpr_attribute.js.map +1 -1
  125. package/dist/collection/components/certificate-details-parts/basic_information.js +12 -12
  126. package/dist/collection/components/certificate-details-parts/basic_information.js.map +1 -1
  127. package/dist/collection/components/certificate-details-parts/extensions/archive_rev_info_extension.js +2 -2
  128. package/dist/collection/components/certificate-details-parts/extensions/archive_rev_info_extension.js.map +1 -1
  129. package/dist/collection/components/certificate-details-parts/extensions/as_string_extension.js +2 -2
  130. package/dist/collection/components/certificate-details-parts/extensions/as_string_extension.js.map +1 -1
  131. package/dist/collection/components/certificate-details-parts/extensions/attribute_value.js +1 -1
  132. package/dist/collection/components/certificate-details-parts/extensions/attribute_value.js.map +1 -1
  133. package/dist/collection/components/certificate-details-parts/extensions/authority_key_identifier_extension.js +8 -8
  134. package/dist/collection/components/certificate-details-parts/extensions/authority_key_identifier_extension.js.map +1 -1
  135. package/dist/collection/components/certificate-details-parts/extensions/basic_constraints_extension.js +2 -2
  136. package/dist/collection/components/certificate-details-parts/extensions/basic_constraints_extension.js.map +1 -1
  137. package/dist/collection/components/certificate-details-parts/extensions/basic_extension.js +7 -7
  138. package/dist/collection/components/certificate-details-parts/extensions/basic_extension.js.map +1 -1
  139. package/dist/collection/components/certificate-details-parts/extensions/biometric_syntax_extension.js +5 -5
  140. package/dist/collection/components/certificate-details-parts/extensions/biometric_syntax_extension.js.map +1 -1
  141. package/dist/collection/components/certificate-details-parts/extensions/ca_version_extension.js +3 -3
  142. package/dist/collection/components/certificate-details-parts/extensions/ca_version_extension.js.map +1 -1
  143. package/dist/collection/components/certificate-details-parts/extensions/cabforganization_identifier_extension.js +19 -0
  144. package/dist/collection/components/certificate-details-parts/extensions/cabforganization_identifier_extension.js.map +1 -0
  145. package/dist/collection/components/certificate-details-parts/extensions/certificate_policies_extension.js +23 -23
  146. package/dist/collection/components/certificate-details-parts/extensions/certificate_policies_extension.js.map +1 -1
  147. package/dist/collection/components/certificate-details-parts/extensions/certificate_template_extension.js +2 -2
  148. package/dist/collection/components/certificate-details-parts/extensions/certificate_template_extension.js.map +1 -1
  149. package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js +5 -5
  150. package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js.map +1 -1
  151. package/dist/collection/components/certificate-details-parts/extensions/crl_distribution_points_extension.js +8 -8
  152. package/dist/collection/components/certificate-details-parts/extensions/crl_distribution_points_extension.js.map +1 -1
  153. package/dist/collection/components/certificate-details-parts/extensions/crl_number_extension.js +2 -2
  154. package/dist/collection/components/certificate-details-parts/extensions/crl_number_extension.js.map +1 -1
  155. package/dist/collection/components/certificate-details-parts/extensions/crl_reason_extension.js +2 -2
  156. package/dist/collection/components/certificate-details-parts/extensions/crl_reason_extension.js.map +1 -1
  157. package/dist/collection/components/certificate-details-parts/extensions/enroll_cert_type_extension.js +2 -2
  158. package/dist/collection/components/certificate-details-parts/extensions/enroll_cert_type_extension.js.map +1 -1
  159. package/dist/collection/components/certificate-details-parts/extensions/entrust_version_info_extension.js +2 -2
  160. package/dist/collection/components/certificate-details-parts/extensions/entrust_version_info_extension.js.map +1 -1
  161. package/dist/collection/components/certificate-details-parts/extensions/extended_key_usage_extension.js +5 -5
  162. package/dist/collection/components/certificate-details-parts/extensions/extended_key_usage_extension.js.map +1 -1
  163. package/dist/collection/components/certificate-details-parts/extensions/general_name_part.js +52 -52
  164. package/dist/collection/components/certificate-details-parts/extensions/general_name_part.js.map +1 -1
  165. package/dist/collection/components/certificate-details-parts/extensions/index.js +123 -118
  166. package/dist/collection/components/certificate-details-parts/extensions/index.js.map +1 -1
  167. package/dist/collection/components/certificate-details-parts/extensions/info_access_syntax_extension.js +5 -5
  168. package/dist/collection/components/certificate-details-parts/extensions/info_access_syntax_extension.js.map +1 -1
  169. package/dist/collection/components/certificate-details-parts/extensions/issuing_distribution_point_extension.js +4 -4
  170. package/dist/collection/components/certificate-details-parts/extensions/issuing_distribution_point_extension.js.map +1 -1
  171. package/dist/collection/components/certificate-details-parts/extensions/key_description_extension.js +58 -58
  172. package/dist/collection/components/certificate-details-parts/extensions/key_description_extension.js.map +1 -1
  173. package/dist/collection/components/certificate-details-parts/extensions/key_usage_extension.js +2 -2
  174. package/dist/collection/components/certificate-details-parts/extensions/key_usage_extension.js.map +1 -1
  175. package/dist/collection/components/certificate-details-parts/extensions/lei_extension.js +2 -2
  176. package/dist/collection/components/certificate-details-parts/extensions/lei_extension.js.map +1 -1
  177. package/dist/collection/components/certificate-details-parts/extensions/lei_role_extennsion.js +2 -2
  178. package/dist/collection/components/certificate-details-parts/extensions/lei_role_extennsion.js.map +1 -1
  179. package/dist/collection/components/certificate-details-parts/extensions/logotype_extension.js +42 -42
  180. package/dist/collection/components/certificate-details-parts/extensions/logotype_extension.js.map +1 -1
  181. package/dist/collection/components/certificate-details-parts/extensions/name_constraints_extension.js +5 -5
  182. package/dist/collection/components/certificate-details-parts/extensions/name_constraints_extension.js.map +1 -1
  183. package/dist/collection/components/certificate-details-parts/extensions/netscape_cert_type_extension.js +2 -2
  184. package/dist/collection/components/certificate-details-parts/extensions/netscape_cert_type_extension.js.map +1 -1
  185. package/dist/collection/components/certificate-details-parts/extensions/netscape_comment_extension.js +2 -2
  186. package/dist/collection/components/certificate-details-parts/extensions/netscape_comment_extension.js.map +1 -1
  187. package/dist/collection/components/certificate-details-parts/extensions/policy_constraints_extension.js +2 -2
  188. package/dist/collection/components/certificate-details-parts/extensions/policy_constraints_extension.js.map +1 -1
  189. package/dist/collection/components/certificate-details-parts/extensions/policy_mappings_extension.js +6 -7
  190. package/dist/collection/components/certificate-details-parts/extensions/policy_mappings_extension.js.map +1 -1
  191. package/dist/collection/components/certificate-details-parts/extensions/private_key_usage_period_extension.js +2 -2
  192. package/dist/collection/components/certificate-details-parts/extensions/private_key_usage_period_extension.js.map +1 -1
  193. package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js +29 -29
  194. package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js.map +1 -1
  195. package/dist/collection/components/certificate-details-parts/extensions/subject_alternative_name_extension.js +2 -2
  196. package/dist/collection/components/certificate-details-parts/extensions/subject_alternative_name_extension.js.map +1 -1
  197. package/dist/collection/components/certificate-details-parts/extensions/subject_directory_attributes_extension.js +5 -5
  198. package/dist/collection/components/certificate-details-parts/extensions/subject_directory_attributes_extension.js.map +1 -1
  199. package/dist/collection/components/certificate-details-parts/extensions/subject_key_identifier_extension.js +8 -8
  200. package/dist/collection/components/certificate-details-parts/extensions/subject_key_identifier_extension.js.map +1 -1
  201. package/dist/collection/components/certificate-details-parts/extensions/timestamp_extension.js +2 -2
  202. package/dist/collection/components/certificate-details-parts/extensions/timestamp_extension.js.map +1 -1
  203. package/dist/collection/components/certificate-details-parts/extensions/tn_auth_list_extension.js +6 -8
  204. package/dist/collection/components/certificate-details-parts/extensions/tn_auth_list_extension.js.map +1 -1
  205. package/dist/collection/components/certificate-details-parts/holder.js +19 -21
  206. package/dist/collection/components/certificate-details-parts/holder.js.map +1 -1
  207. package/dist/collection/components/certificate-details-parts/issuer.js +8 -8
  208. package/dist/collection/components/certificate-details-parts/issuer.js.map +1 -1
  209. package/dist/collection/components/certificate-details-parts/issuer_name.js +6 -6
  210. package/dist/collection/components/certificate-details-parts/issuer_name.js.map +1 -1
  211. package/dist/collection/components/certificate-details-parts/miscellaneous.js +6 -6
  212. package/dist/collection/components/certificate-details-parts/miscellaneous.js.map +1 -1
  213. package/dist/collection/components/certificate-details-parts/public_key.js +29 -29
  214. package/dist/collection/components/certificate-details-parts/public_key.js.map +1 -1
  215. package/dist/collection/components/certificate-details-parts/revoked_certificates.js +30 -30
  216. package/dist/collection/components/certificate-details-parts/revoked_certificates.js.map +1 -1
  217. package/dist/collection/components/certificate-details-parts/row.js +26 -26
  218. package/dist/collection/components/certificate-details-parts/row.js.map +1 -1
  219. package/dist/collection/components/certificate-details-parts/signature.js +13 -13
  220. package/dist/collection/components/certificate-details-parts/signature.js.map +1 -1
  221. package/dist/collection/components/certificate-details-parts/subject_name.js +5 -5
  222. package/dist/collection/components/certificate-details-parts/subject_name.js.map +1 -1
  223. package/dist/collection/components/certificate-details-parts/thumbprints.js +12 -12
  224. package/dist/collection/components/certificate-details-parts/thumbprints.js.map +1 -1
  225. package/dist/collection/components/certificate-summary/certificate-summary.js +3 -3
  226. package/dist/collection/components/certificate-summary/certificate-summary.js.map +1 -1
  227. package/dist/collection/components/certificate-viewer/certificate-viewer.js +278 -278
  228. package/dist/collection/components/certificate-viewer/certificate-viewer.js.map +1 -1
  229. package/dist/collection/components/certificates-viewer/certificates-viewer.js +374 -374
  230. package/dist/collection/components/certificates-viewer/certificates-viewer.js.map +1 -1
  231. package/dist/collection/components/circular-progress/circular-progress.js +67 -67
  232. package/dist/collection/components/circular-progress/circular-progress.js.map +1 -1
  233. package/dist/collection/components/crl-viewer/crl-viewer.js +229 -229
  234. package/dist/collection/components/crl-viewer/crl-viewer.js.map +1 -1
  235. package/dist/collection/components/csr-viewer/csr-viewer.js +211 -219
  236. package/dist/collection/components/csr-viewer/csr-viewer.js.map +1 -1
  237. package/dist/collection/components/highlight-words/highlight-words.js +60 -60
  238. package/dist/collection/components/highlight-words/highlight-words.js.map +1 -1
  239. package/dist/collection/components/icons/actions.js +2 -2
  240. package/dist/collection/components/icons/actions.js.map +1 -1
  241. package/dist/collection/components/icons/arrow_bottom.js +2 -2
  242. package/dist/collection/components/icons/arrow_bottom.js.map +1 -1
  243. package/dist/collection/components/icons/arrow_top.js +2 -2
  244. package/dist/collection/components/icons/arrow_top.js.map +1 -1
  245. package/dist/collection/components/icons/cross.js +2 -2
  246. package/dist/collection/components/icons/cross.js.map +1 -1
  247. package/dist/collection/components/icons/details.js +2 -2
  248. package/dist/collection/components/icons/details.js.map +1 -1
  249. package/dist/collection/components/icons/download.js +2 -2
  250. package/dist/collection/components/icons/download.js.map +1 -1
  251. package/dist/collection/components/icons/link.js +2 -2
  252. package/dist/collection/components/icons/link.js.map +1 -1
  253. package/dist/collection/components/link/link.js +4 -4
  254. package/dist/collection/components/link/link.js.map +1 -1
  255. package/dist/collection/components/text-hider/text-hider.js +23 -23
  256. package/dist/collection/components/text-hider/text-hider.js.map +1 -1
  257. package/dist/collection/components/typography/typography.js +32 -32
  258. package/dist/collection/components/typography/typography.js.map +1 -1
  259. package/dist/collection/constants/logs.js +77 -76
  260. package/dist/collection/constants/logs.js.map +1 -1
  261. package/dist/collection/constants/oids.js +2334 -2314
  262. package/dist/collection/constants/oids.js.map +1 -1
  263. package/dist/collection/crypto/asn_data.js +31 -31
  264. package/dist/collection/crypto/asn_data.js.map +1 -1
  265. package/dist/collection/crypto/attribute.js +35 -51
  266. package/dist/collection/crypto/attribute.js.map +1 -1
  267. package/dist/collection/crypto/crl.js +66 -66
  268. package/dist/collection/crypto/crl.js.map +1 -1
  269. package/dist/collection/crypto/csr.js +76 -69
  270. package/dist/collection/crypto/csr.js.map +1 -1
  271. package/dist/collection/crypto/extension.js +64 -135
  272. package/dist/collection/crypto/extension.js.map +1 -1
  273. package/dist/collection/crypto/extensions/cabforganization_identifier.js +54 -0
  274. package/dist/collection/crypto/extensions/cabforganization_identifier.js.map +1 -0
  275. package/dist/collection/crypto/extensions/index.js +5 -0
  276. package/dist/collection/crypto/extensions/index.js.map +1 -0
  277. package/dist/collection/crypto/name.js +31 -31
  278. package/dist/collection/crypto/name.js.map +1 -1
  279. package/dist/collection/crypto/provider.js +26 -26
  280. package/dist/collection/crypto/provider.js.map +1 -1
  281. package/dist/collection/crypto/utils.js +23 -23
  282. package/dist/collection/crypto/utils.js.map +1 -1
  283. package/dist/collection/crypto/x509_attribute_certificate.js +66 -66
  284. package/dist/collection/crypto/x509_attribute_certificate.js.map +1 -1
  285. package/dist/collection/crypto/x509_certificate.js +139 -139
  286. package/dist/collection/crypto/x509_certificate.js.map +1 -1
  287. package/dist/collection/utils/camel_case_to_words.js +2 -2
  288. package/dist/collection/utils/camel_case_to_words.js.map +1 -1
  289. package/dist/collection/utils/date_formatter.js +6 -6
  290. package/dist/collection/utils/date_formatter.js.map +1 -1
  291. package/dist/collection/utils/download.js +24 -24
  292. package/dist/collection/utils/download.js.map +1 -1
  293. package/dist/collection/utils/download_from_buffer.js +25 -25
  294. package/dist/collection/utils/download_from_buffer.js.map +1 -1
  295. package/dist/collection/utils/get_string_by_oid.js +5 -5
  296. package/dist/collection/utils/get_string_by_oid.js.map +1 -1
  297. package/dist/collection/utils/is_link.js +1 -1
  298. package/dist/collection/utils/is_link.js.map +1 -1
  299. package/dist/collection/utils/l10n.js +25 -25
  300. package/dist/collection/utils/l10n.js.map +1 -1
  301. package/dist/collection/utils/read_file.js +40 -40
  302. package/dist/collection/utils/read_file.js.map +1 -1
  303. package/dist/collection/utils/validator.js +13 -13
  304. package/dist/collection/utils/validator.js.map +1 -1
  305. package/dist/esm/actions-aebcbc9d.js +21 -0
  306. package/dist/esm/{actions-8d745b2a.js.map → actions-aebcbc9d.js.map} +1 -1
  307. package/dist/esm/app-globals-5e9b67e0.js +8 -0
  308. package/dist/esm/app-globals-5e9b67e0.js.map +1 -0
  309. package/dist/esm/arrow_top-aee1ee02.js +34 -0
  310. package/dist/esm/{arrow_top-fc298828.js.map → arrow_top-aee1ee02.js.map} +1 -1
  311. package/dist/esm/button-a2fabf9a.js +74 -0
  312. package/dist/esm/{button-35146bdd.js.map → button-a2fabf9a.js.map} +1 -1
  313. package/dist/esm/{certification_request-c9dc8e9c.js → certification_request-2c054ece.js} +3325 -3331
  314. package/dist/esm/certification_request-2c054ece.js.map +1 -0
  315. package/dist/esm/crl-a7318483.js +308 -0
  316. package/dist/esm/crl-a7318483.js.map +1 -0
  317. package/dist/esm/cross-1377606f.js +47 -0
  318. package/dist/esm/{cross-9ec9a759.js.map → cross-1377606f.js.map} +1 -1
  319. package/dist/esm/download-14dc1047.js +21 -0
  320. package/dist/esm/{download-0cc3077a.js.map → download-14dc1047.js.map} +1 -1
  321. package/dist/esm/{download-aacb6eff.js → download-8c128e2e.js} +50 -50
  322. package/dist/esm/download-8c128e2e.js.map +1 -0
  323. package/dist/esm/{index-4079bbb5.js → index-ae188432.js} +398 -145
  324. package/dist/esm/index-ae188432.js.map +1 -0
  325. package/dist/esm/index.js +8 -8
  326. package/dist/esm/link-7e4e9060.js +23 -0
  327. package/dist/esm/{link-ad24c3be.js.map → link-7e4e9060.js.map} +1 -1
  328. package/dist/esm/loader.js +5 -3
  329. package/dist/esm/loader.js.map +1 -1
  330. package/dist/esm/miscellaneous-0e98b5bc.js +1401 -0
  331. package/dist/esm/miscellaneous-0e98b5bc.js.map +1 -0
  332. package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +481 -480
  333. package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -1
  334. package/dist/esm/peculiar-button-menu_3.entry.js +72 -69
  335. package/dist/esm/peculiar-button-menu_3.entry.js.map +1 -1
  336. package/dist/esm/peculiar-certificate-decoder.entry.js +151 -150
  337. package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
  338. package/dist/esm/peculiar-certificate-viewer.entry.js +107 -106
  339. package/dist/esm/peculiar-certificate-viewer.entry.js.map +1 -1
  340. package/dist/esm/peculiar-certificates-viewer.entry.js +258 -257
  341. package/dist/esm/peculiar-certificates-viewer.entry.js.map +1 -1
  342. package/dist/esm/peculiar-text-hider.entry.js +12 -11
  343. package/dist/esm/peculiar-text-hider.entry.js.map +1 -1
  344. package/dist/esm/peculiar.js +6 -4
  345. package/dist/esm/peculiar.js.map +1 -1
  346. package/dist/esm/x509_certificate-ad568d3a.js +158 -0
  347. package/dist/esm/x509_certificate-ad568d3a.js.map +1 -0
  348. package/dist/esm-es5/{actions-8d745b2a.js → actions-aebcbc9d.js} +2 -2
  349. package/dist/esm-es5/app-globals-5e9b67e0.js +5 -0
  350. package/dist/esm-es5/app-globals-5e9b67e0.js.map +1 -0
  351. package/dist/esm-es5/{arrow_top-fc298828.js → arrow_top-aee1ee02.js} +2 -2
  352. package/dist/esm-es5/button-a2fabf9a.js +19 -0
  353. package/dist/esm-es5/certification_request-2c054ece.js +97 -0
  354. package/dist/esm-es5/certification_request-2c054ece.js.map +1 -0
  355. package/dist/esm-es5/crl-a7318483.js +33 -0
  356. package/dist/esm-es5/crl-a7318483.js.map +1 -0
  357. package/dist/esm-es5/{cross-9ec9a759.js → cross-1377606f.js} +2 -2
  358. package/dist/esm-es5/{download-0cc3077a.js → download-14dc1047.js} +2 -2
  359. package/dist/esm-es5/{download-aacb6eff.js → download-8c128e2e.js} +3 -3
  360. package/dist/esm-es5/{download-aacb6eff.js.map → download-8c128e2e.js.map} +1 -1
  361. package/dist/esm-es5/index-ae188432.js +6 -0
  362. package/dist/esm-es5/index-ae188432.js.map +1 -0
  363. package/dist/esm-es5/index.js +1 -1
  364. package/dist/esm-es5/{link-ad24c3be.js → link-7e4e9060.js} +3 -3
  365. package/dist/esm-es5/loader.js +2 -2
  366. package/dist/esm-es5/loader.js.map +1 -1
  367. package/dist/esm-es5/miscellaneous-0e98b5bc.js +369 -0
  368. package/dist/esm-es5/miscellaneous-0e98b5bc.js.map +1 -0
  369. package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +17 -17
  370. package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -1
  371. package/dist/esm-es5/peculiar-button-menu_3.entry.js +1 -1
  372. package/dist/esm-es5/peculiar-button-menu_3.entry.js.map +1 -1
  373. package/dist/esm-es5/peculiar-certificate-decoder.entry.js +3 -3
  374. package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -1
  375. package/dist/esm-es5/peculiar-certificate-viewer.entry.js +2 -2
  376. package/dist/esm-es5/peculiar-certificate-viewer.entry.js.map +1 -1
  377. package/dist/esm-es5/peculiar-certificates-viewer.entry.js +3 -3
  378. package/dist/esm-es5/peculiar-certificates-viewer.entry.js.map +1 -1
  379. package/dist/esm-es5/peculiar-text-hider.entry.js +1 -1
  380. package/dist/esm-es5/peculiar-text-hider.entry.js.map +1 -1
  381. package/dist/esm-es5/peculiar.js +2 -2
  382. package/dist/esm-es5/peculiar.js.map +1 -1
  383. package/dist/esm-es5/x509_certificate-ad568d3a.js +12 -0
  384. package/dist/esm-es5/{x509_certificate-8cf268d1.js.map → x509_certificate-ad568d3a.js.map} +1 -1
  385. package/dist/peculiar/index.esm.js +1 -1
  386. package/dist/peculiar/{p-5e49b881.system.entry.js → p-00302a20.system.entry.js} +3 -3
  387. package/dist/peculiar/p-00302a20.system.entry.js.map +1 -0
  388. package/dist/peculiar/p-0dbc8238.system.js +13 -0
  389. package/dist/peculiar/{p-cfca7dae.system.js.map → p-0dbc8238.system.js.map} +1 -1
  390. package/dist/peculiar/{p-1ef997ee.js → p-1302bd67.js} +11 -11
  391. package/dist/peculiar/p-1302bd67.js.map +1 -0
  392. package/dist/peculiar/{p-59e5ac12.js → p-1f766dd5.js} +1 -1
  393. package/dist/peculiar/p-243244af.system.js +13 -0
  394. package/dist/peculiar/{p-0fc2e2b4.js → p-27ca6743.js} +2 -2
  395. package/dist/peculiar/p-3cb79cd9.js +6 -0
  396. package/dist/peculiar/p-3cb79cd9.js.map +1 -0
  397. package/dist/peculiar/{p-72f53d81.js → p-3d44cbd2.js} +3 -3
  398. package/dist/peculiar/p-3f9af5f5.system.js +97 -0
  399. package/dist/peculiar/p-3f9af5f5.system.js.map +1 -0
  400. package/dist/peculiar/{p-0bd7c6bc.system.entry.js → p-496449cf.system.entry.js} +10 -10
  401. package/dist/peculiar/p-496449cf.system.entry.js.map +1 -0
  402. package/dist/peculiar/p-4bc5ddbe.js +19 -0
  403. package/dist/peculiar/{p-025b3cfb.entry.js → p-54b37ef9.entry.js} +2 -2
  404. package/dist/peculiar/p-54b37ef9.entry.js.map +1 -0
  405. package/dist/peculiar/p-5a662d6f.system.js +13 -0
  406. package/dist/peculiar/{p-e5b18cd1.entry.js → p-5c6f9a14.entry.js} +3 -3
  407. package/dist/peculiar/p-5c6f9a14.entry.js.map +1 -0
  408. package/dist/peculiar/p-5cf4562f.system.entry.js +111 -0
  409. package/dist/peculiar/p-5cf4562f.system.entry.js.map +1 -0
  410. package/dist/peculiar/{p-2f48fe70.entry.js → p-5f3b0fc7.entry.js} +3 -3
  411. package/dist/peculiar/p-5f3b0fc7.entry.js.map +1 -0
  412. package/dist/peculiar/{p-24050d82.system.entry.js → p-6680f277.system.entry.js} +10 -10
  413. package/dist/peculiar/p-6680f277.system.entry.js.map +1 -0
  414. package/dist/peculiar/p-713563fb.entry.js +5 -0
  415. package/dist/peculiar/p-713563fb.entry.js.map +1 -0
  416. package/dist/peculiar/{p-ca02a823.js → p-75166532.js} +60 -53
  417. package/dist/peculiar/p-75166532.js.map +1 -0
  418. package/dist/peculiar/p-821bdcdc.system.js +6 -0
  419. package/dist/peculiar/p-821bdcdc.system.js.map +1 -0
  420. package/dist/peculiar/p-8393399a.system.js +5 -0
  421. package/dist/peculiar/p-8393399a.system.js.map +1 -0
  422. package/dist/peculiar/p-8bbee8f4.system.js +13 -0
  423. package/dist/peculiar/p-924790f5.js +33 -0
  424. package/dist/peculiar/p-924790f5.js.map +1 -0
  425. package/dist/peculiar/p-9712b827.system.js +20 -0
  426. package/dist/peculiar/{p-2fcad8cb.system.js.map → p-9712b827.system.js.map} +1 -1
  427. package/dist/peculiar/{p-370cee20.js → p-99efefea.js} +2 -2
  428. package/dist/peculiar/{p-1ceb0fe3.js → p-a9487007.js} +2 -2
  429. package/dist/peculiar/{p-17e3c47b.js → p-ae91d778.js} +2 -2
  430. package/dist/peculiar/p-afbd1c8e.entry.js +5 -0
  431. package/dist/peculiar/p-afbd1c8e.entry.js.map +1 -0
  432. package/dist/peculiar/p-b2890eb8.system.js +5 -0
  433. package/dist/peculiar/p-b5389885.system.entry.js +5 -0
  434. package/dist/peculiar/p-b5389885.system.entry.js.map +1 -0
  435. package/dist/peculiar/p-c156b495.system.js +33 -0
  436. package/dist/peculiar/p-c156b495.system.js.map +1 -0
  437. package/dist/peculiar/p-c23fd001.entry.js +110 -0
  438. package/dist/peculiar/p-c23fd001.entry.js.map +1 -0
  439. package/dist/peculiar/p-c241e4ba.system.js +20 -0
  440. package/dist/peculiar/{p-c99507d4.system.js.map → p-c241e4ba.system.js.map} +1 -1
  441. package/dist/peculiar/p-c2995a63.system.js +5 -0
  442. package/dist/peculiar/p-c2995a63.system.js.map +1 -0
  443. package/dist/peculiar/p-dac867e8.js +5 -0
  444. package/dist/peculiar/p-dac867e8.js.map +1 -0
  445. package/dist/peculiar/p-dde511c8.system.js +43 -0
  446. package/dist/{cjs/download-0fa5b33c.js.map → peculiar/p-dde511c8.system.js.map} +1 -1
  447. package/dist/peculiar/p-e4ad4f13.system.entry.js +5 -0
  448. package/dist/peculiar/p-e4ad4f13.system.entry.js.map +1 -0
  449. package/dist/peculiar/p-e6a6e602.js +12 -0
  450. package/dist/peculiar/p-eea904d7.system.js +27 -0
  451. package/dist/peculiar/{p-ddae2f8e.system.js.map → p-eea904d7.system.js.map} +1 -1
  452. package/dist/peculiar/p-ff3ced3c.system.js +369 -0
  453. package/dist/peculiar/p-ff3ced3c.system.js.map +1 -0
  454. package/dist/peculiar/peculiar.esm.js +1 -1
  455. package/dist/peculiar/peculiar.esm.js.map +1 -1
  456. package/dist/peculiar/peculiar.js +15 -15
  457. package/dist/types/components/attribute-certificate-viewer/attribute-certificate-viewer.d.ts +68 -68
  458. package/dist/types/components/button/button.d.ts +4 -4
  459. package/dist/types/components/button-menu/button-menu.d.ts +7 -7
  460. package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +31 -31
  461. package/dist/types/components/certificate-details-parts/attributes/activity_description_attribute.d.ts +1 -1
  462. package/dist/types/components/certificate-details-parts/attributes/as_string_attribute.d.ts +1 -1
  463. package/dist/types/components/certificate-details-parts/attributes/basic_attribute.d.ts +1 -1
  464. package/dist/types/components/certificate-details-parts/attributes/challenge_password_attribute.d.ts +1 -1
  465. package/dist/types/components/certificate-details-parts/attributes/index.d.ts +1 -1
  466. package/dist/types/components/certificate-details-parts/attributes/insurance_value_attribute.d.ts +1 -1
  467. package/dist/types/components/certificate-details-parts/attributes/name_attribute.d.ts +1 -1
  468. package/dist/types/components/certificate-details-parts/attributes/name_part.d.ts +1 -1
  469. package/dist/types/components/certificate-details-parts/attributes/type_relationship_attribute.d.ts +1 -1
  470. package/dist/types/components/certificate-details-parts/attributes/unstructured_name_attribute.d.ts +1 -1
  471. package/dist/types/components/certificate-details-parts/attributes/valuation_ranking_attribute.d.ts +1 -1
  472. package/dist/types/components/certificate-details-parts/attributes/web_gdpr_attribute.d.ts +1 -1
  473. package/dist/types/components/certificate-details-parts/basic_information.d.ts +8 -8
  474. package/dist/types/components/certificate-details-parts/extensions/archive_rev_info_extension.d.ts +1 -1
  475. package/dist/types/components/certificate-details-parts/extensions/as_string_extension.d.ts +1 -1
  476. package/dist/types/components/certificate-details-parts/extensions/authority_key_identifier_extension.d.ts +1 -1
  477. package/dist/types/components/certificate-details-parts/extensions/basic_constraints_extension.d.ts +1 -1
  478. package/dist/types/components/certificate-details-parts/extensions/basic_extension.d.ts +1 -1
  479. package/dist/types/components/certificate-details-parts/extensions/biometric_syntax_extension.d.ts +1 -1
  480. package/dist/types/components/certificate-details-parts/extensions/ca_version_extension.d.ts +1 -1
  481. package/dist/types/components/certificate-details-parts/extensions/cabforganization_identifier_extension.d.ts +15 -0
  482. package/dist/types/components/certificate-details-parts/extensions/certificate_policies_extension.d.ts +1 -1
  483. package/dist/types/components/certificate-details-parts/extensions/certificate_template_extension.d.ts +1 -1
  484. package/dist/types/components/certificate-details-parts/extensions/certificate_transparency_extension.d.ts +1 -1
  485. package/dist/types/components/certificate-details-parts/extensions/crl_distribution_points_extension.d.ts +1 -1
  486. package/dist/types/components/certificate-details-parts/extensions/crl_number_extension.d.ts +1 -1
  487. package/dist/types/components/certificate-details-parts/extensions/crl_reason_extension.d.ts +1 -1
  488. package/dist/types/components/certificate-details-parts/extensions/enroll_cert_type_extension.d.ts +1 -1
  489. package/dist/types/components/certificate-details-parts/extensions/entrust_version_info_extension.d.ts +1 -1
  490. package/dist/types/components/certificate-details-parts/extensions/extended_key_usage_extension.d.ts +1 -1
  491. package/dist/types/components/certificate-details-parts/extensions/general_name_part.d.ts +1 -1
  492. package/dist/types/components/certificate-details-parts/extensions/index.d.ts +2 -2
  493. package/dist/types/components/certificate-details-parts/extensions/info_access_syntax_extension.d.ts +1 -1
  494. package/dist/types/components/certificate-details-parts/extensions/issuing_distribution_point_extension.d.ts +1 -1
  495. package/dist/types/components/certificate-details-parts/extensions/key_description_extension.d.ts +1 -1
  496. package/dist/types/components/certificate-details-parts/extensions/key_usage_extension.d.ts +1 -1
  497. package/dist/types/components/certificate-details-parts/extensions/lei_extension.d.ts +1 -1
  498. package/dist/types/components/certificate-details-parts/extensions/lei_role_extennsion.d.ts +1 -1
  499. package/dist/types/components/certificate-details-parts/extensions/logotype_extension.d.ts +1 -1
  500. package/dist/types/components/certificate-details-parts/extensions/name_constraints_extension.d.ts +1 -1
  501. package/dist/types/components/certificate-details-parts/extensions/netscape_cert_type_extension.d.ts +1 -1
  502. package/dist/types/components/certificate-details-parts/extensions/netscape_comment_extension.d.ts +1 -1
  503. package/dist/types/components/certificate-details-parts/extensions/policy_constraints_extension.d.ts +1 -1
  504. package/dist/types/components/certificate-details-parts/extensions/policy_mappings_extension.d.ts +1 -1
  505. package/dist/types/components/certificate-details-parts/extensions/private_key_usage_period_extension.d.ts +1 -1
  506. package/dist/types/components/certificate-details-parts/extensions/qc_statements_extension.d.ts +1 -1
  507. package/dist/types/components/certificate-details-parts/extensions/subject_alternative_name_extension.d.ts +1 -1
  508. package/dist/types/components/certificate-details-parts/extensions/subject_directory_attributes_extension.d.ts +1 -1
  509. package/dist/types/components/certificate-details-parts/extensions/subject_key_identifier_extension.d.ts +1 -1
  510. package/dist/types/components/certificate-details-parts/extensions/timestamp_extension.d.ts +1 -1
  511. package/dist/types/components/certificate-details-parts/extensions/tn_auth_list_extension.d.ts +1 -1
  512. package/dist/types/components/certificate-details-parts/holder.d.ts +1 -1
  513. package/dist/types/components/certificate-details-parts/issuer.d.ts +1 -1
  514. package/dist/types/components/certificate-details-parts/issuer_name.d.ts +2 -2
  515. package/dist/types/components/certificate-details-parts/miscellaneous.d.ts +1 -1
  516. package/dist/types/components/certificate-details-parts/public_key.d.ts +1 -1
  517. package/dist/types/components/certificate-details-parts/revoked_certificates.d.ts +1 -1
  518. package/dist/types/components/certificate-details-parts/row.d.ts +7 -7
  519. package/dist/types/components/certificate-details-parts/signature.d.ts +1 -1
  520. package/dist/types/components/certificate-details-parts/subject_name.d.ts +1 -1
  521. package/dist/types/components/certificate-details-parts/thumbprints.d.ts +1 -1
  522. package/dist/types/components/certificate-summary/certificate-summary.d.ts +2 -2
  523. package/dist/types/components/certificate-viewer/certificate-viewer.d.ts +74 -74
  524. package/dist/types/components/certificates-viewer/certificates-viewer.d.ts +75 -75
  525. package/dist/types/components/circular-progress/circular-progress.d.ts +10 -10
  526. package/dist/types/components/crl-viewer/crl-viewer.d.ts +56 -56
  527. package/dist/types/components/csr-viewer/csr-viewer.d.ts +52 -53
  528. package/dist/types/components/highlight-words/highlight-words.d.ts +8 -8
  529. package/dist/types/components/icons/actions.d.ts +1 -1
  530. package/dist/types/components/icons/arrow_bottom.d.ts +1 -1
  531. package/dist/types/components/icons/arrow_top.d.ts +1 -1
  532. package/dist/types/components/icons/cross.d.ts +1 -1
  533. package/dist/types/components/icons/details.d.ts +1 -1
  534. package/dist/types/components/icons/download.d.ts +1 -1
  535. package/dist/types/components/icons/link.d.ts +1 -1
  536. package/dist/types/components/link/link.d.ts +2 -2
  537. package/dist/types/components/text-hider/text-hider.d.ts +2 -2
  538. package/dist/types/components/typography/typography.d.ts +4 -4
  539. package/dist/types/components.d.ts +24 -0
  540. package/dist/types/constants/logs.d.ts +77 -76
  541. package/dist/types/constants/oids.d.ts +2326 -2307
  542. package/dist/types/crypto/asn_data.d.ts +6 -6
  543. package/dist/types/crypto/attribute.d.ts +21 -6
  544. package/dist/types/crypto/crl.d.ts +23 -23
  545. package/dist/types/crypto/csr.d.ts +23 -21
  546. package/dist/types/crypto/extension.d.ts +52 -5
  547. package/dist/types/crypto/extensions/cabforganization_identifier.d.ts +23 -0
  548. package/dist/types/crypto/extensions/index.d.ts +1 -0
  549. package/dist/types/crypto/name.d.ts +7 -7
  550. package/dist/types/crypto/provider.d.ts +15 -15
  551. package/dist/types/crypto/x509_attribute_certificate.d.ts +24 -24
  552. package/dist/types/crypto/x509_certificate.d.ts +33 -33
  553. package/dist/types/stencil-public-runtime.d.ts +29 -0
  554. package/dist/types/utils/download.d.ts +16 -16
  555. package/dist/types/utils/l10n.d.ts +56 -56
  556. package/dist/types/utils/read_file.d.ts +7 -7
  557. package/hydrate/index.d.ts +2 -2
  558. package/hydrate/index.js +12072 -10170
  559. package/package.json +21 -13
  560. package/dist/cjs/actions-19013d4a.js +0 -23
  561. package/dist/cjs/arrow_top-834fb7ec.js +0 -37
  562. package/dist/cjs/button-14e2b73f.js +0 -77
  563. package/dist/cjs/certification_request-bf416170.js.map +0 -1
  564. package/dist/cjs/crl-d9591b95.js +0 -322
  565. package/dist/cjs/crl-d9591b95.js.map +0 -1
  566. package/dist/cjs/cross-9872c473.js +0 -51
  567. package/dist/cjs/download-254ddc57.js +0 -23
  568. package/dist/cjs/index-efd561e9.js.map +0 -1
  569. package/dist/cjs/link-6aea0be4.js +0 -25
  570. package/dist/cjs/miscellaneous-6e800553.js +0 -1400
  571. package/dist/cjs/miscellaneous-6e800553.js.map +0 -1
  572. package/dist/cjs/x509_certificate-53feebd3.js +0 -160
  573. package/dist/cjs/x509_certificate-53feebd3.js.map +0 -1
  574. package/dist/esm/actions-8d745b2a.js +0 -21
  575. package/dist/esm/arrow_top-fc298828.js +0 -34
  576. package/dist/esm/button-35146bdd.js +0 -74
  577. package/dist/esm/certification_request-c9dc8e9c.js.map +0 -1
  578. package/dist/esm/crl-70e85374.js +0 -318
  579. package/dist/esm/crl-70e85374.js.map +0 -1
  580. package/dist/esm/cross-9ec9a759.js +0 -47
  581. package/dist/esm/download-0cc3077a.js +0 -21
  582. package/dist/esm/download-aacb6eff.js.map +0 -1
  583. package/dist/esm/index-4079bbb5.js.map +0 -1
  584. package/dist/esm/link-ad24c3be.js +0 -23
  585. package/dist/esm/miscellaneous-0763f98e.js +0 -1383
  586. package/dist/esm/miscellaneous-0763f98e.js.map +0 -1
  587. package/dist/esm/x509_certificate-8cf268d1.js +0 -158
  588. package/dist/esm/x509_certificate-8cf268d1.js.map +0 -1
  589. package/dist/esm-es5/button-35146bdd.js +0 -19
  590. package/dist/esm-es5/certification_request-c9dc8e9c.js +0 -97
  591. package/dist/esm-es5/certification_request-c9dc8e9c.js.map +0 -1
  592. package/dist/esm-es5/crl-70e85374.js +0 -33
  593. package/dist/esm-es5/crl-70e85374.js.map +0 -1
  594. package/dist/esm-es5/index-4079bbb5.js +0 -6
  595. package/dist/esm-es5/index-4079bbb5.js.map +0 -1
  596. package/dist/esm-es5/miscellaneous-0763f98e.js +0 -362
  597. package/dist/esm-es5/miscellaneous-0763f98e.js.map +0 -1
  598. package/dist/esm-es5/x509_certificate-8cf268d1.js +0 -12
  599. package/dist/peculiar/p-025b3cfb.entry.js.map +0 -1
  600. package/dist/peculiar/p-0b356bb5.js +0 -6
  601. package/dist/peculiar/p-0b356bb5.js.map +0 -1
  602. package/dist/peculiar/p-0bd7c6bc.system.entry.js.map +0 -1
  603. package/dist/peculiar/p-10d2d400.system.js +0 -34
  604. package/dist/peculiar/p-10d2d400.system.js.map +0 -1
  605. package/dist/peculiar/p-14f281b0.system.js +0 -43
  606. package/dist/peculiar/p-14f281b0.system.js.map +0 -1
  607. package/dist/peculiar/p-15cb92b5.system.js +0 -97
  608. package/dist/peculiar/p-15cb92b5.system.js.map +0 -1
  609. package/dist/peculiar/p-1ef997ee.js.map +0 -1
  610. package/dist/peculiar/p-24050d82.system.entry.js.map +0 -1
  611. package/dist/peculiar/p-2f48fe70.entry.js.map +0 -1
  612. package/dist/peculiar/p-2fcad8cb.system.js +0 -20
  613. package/dist/peculiar/p-31b60224.system.js +0 -362
  614. package/dist/peculiar/p-31b60224.system.js.map +0 -1
  615. package/dist/peculiar/p-33196289.entry.js +0 -5
  616. package/dist/peculiar/p-33196289.entry.js.map +0 -1
  617. package/dist/peculiar/p-4ab9673f.system.entry.js +0 -111
  618. package/dist/peculiar/p-4ab9673f.system.entry.js.map +0 -1
  619. package/dist/peculiar/p-5151cb6f.system.entry.js +0 -5
  620. package/dist/peculiar/p-5151cb6f.system.entry.js.map +0 -1
  621. package/dist/peculiar/p-53784f15.system.entry.js +0 -5
  622. package/dist/peculiar/p-53784f15.system.entry.js.map +0 -1
  623. package/dist/peculiar/p-542412ae.js +0 -33
  624. package/dist/peculiar/p-542412ae.js.map +0 -1
  625. package/dist/peculiar/p-5aabeba7.system.js +0 -6
  626. package/dist/peculiar/p-5aabeba7.system.js.map +0 -1
  627. package/dist/peculiar/p-5ab007e9.entry.js +0 -5
  628. package/dist/peculiar/p-5ab007e9.entry.js.map +0 -1
  629. package/dist/peculiar/p-5e49b881.system.entry.js.map +0 -1
  630. package/dist/peculiar/p-6cb88fd6.system.js +0 -13
  631. package/dist/peculiar/p-7f9beaa8.js +0 -19
  632. package/dist/peculiar/p-80832207.system.js +0 -5
  633. package/dist/peculiar/p-80832207.system.js.map +0 -1
  634. package/dist/peculiar/p-94a453d7.js +0 -12
  635. package/dist/peculiar/p-9c91dd68.entry.js +0 -110
  636. package/dist/peculiar/p-9c91dd68.entry.js.map +0 -1
  637. package/dist/peculiar/p-a3eeb94b.system.js +0 -5
  638. package/dist/peculiar/p-b313be9e.system.js +0 -13
  639. package/dist/peculiar/p-c99507d4.system.js +0 -20
  640. package/dist/peculiar/p-ca02a823.js.map +0 -1
  641. package/dist/peculiar/p-cfca7dae.system.js +0 -13
  642. package/dist/peculiar/p-ddae2f8e.system.js +0 -27
  643. package/dist/peculiar/p-e5b18cd1.entry.js.map +0 -1
  644. package/dist/peculiar/p-e6a3b4d4.system.js +0 -13
  645. /package/dist/esm-es5/{actions-8d745b2a.js.map → actions-aebcbc9d.js.map} +0 -0
  646. /package/dist/esm-es5/{arrow_top-fc298828.js.map → arrow_top-aee1ee02.js.map} +0 -0
  647. /package/dist/esm-es5/{button-35146bdd.js.map → button-a2fabf9a.js.map} +0 -0
  648. /package/dist/esm-es5/{cross-9ec9a759.js.map → cross-1377606f.js.map} +0 -0
  649. /package/dist/esm-es5/{download-0cc3077a.js.map → download-14dc1047.js.map} +0 -0
  650. /package/dist/esm-es5/{link-ad24c3be.js.map → link-7e4e9060.js.map} +0 -0
  651. /package/dist/peculiar/{p-59e5ac12.js.map → p-1f766dd5.js.map} +0 -0
  652. /package/dist/peculiar/{p-6cb88fd6.system.js.map → p-243244af.system.js.map} +0 -0
  653. /package/dist/peculiar/{p-0fc2e2b4.js.map → p-27ca6743.js.map} +0 -0
  654. /package/dist/peculiar/{p-72f53d81.js.map → p-3d44cbd2.js.map} +0 -0
  655. /package/dist/peculiar/{p-7f9beaa8.js.map → p-4bc5ddbe.js.map} +0 -0
  656. /package/dist/peculiar/{p-b313be9e.system.js.map → p-5a662d6f.system.js.map} +0 -0
  657. /package/dist/peculiar/{p-e6a3b4d4.system.js.map → p-8bbee8f4.system.js.map} +0 -0
  658. /package/dist/peculiar/{p-370cee20.js.map → p-99efefea.js.map} +0 -0
  659. /package/dist/peculiar/{p-1ceb0fe3.js.map → p-a9487007.js.map} +0 -0
  660. /package/dist/peculiar/{p-17e3c47b.js.map → p-ae91d778.js.map} +0 -0
  661. /package/dist/peculiar/{p-a3eeb94b.system.js.map → p-b2890eb8.system.js.map} +0 -0
  662. /package/dist/peculiar/{p-94a453d7.js.map → p-e6a6e602.js.map} +0 -0
@@ -17,77 +17,77 @@ import { Extension } from "./extension";
17
17
  import { Attribute } from "./attribute";
18
18
  import { certificateRawToBuffer, hexFormat, base64Format, getCertificateThumbprint, } from "./utils";
19
19
  export class X509AttributeCertificate extends AsnData {
20
- constructor(raw) {
21
- var _a;
22
- super(certificateRawToBuffer(raw), AttributeCertificate);
23
- this.thumbprints = {};
24
- this.type = 'X.509 Attribute Certificate';
25
- const { acinfo } = this.asn;
26
- this.serialNumber = Convert.ToHex(acinfo.serialNumber);
27
- this.version = acinfo.version;
28
- const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;
29
- if (!notBefore) {
30
- throw new Error("Cannot get 'notBefore' value");
20
+ constructor(raw) {
21
+ var _a;
22
+ super(certificateRawToBuffer(raw), AttributeCertificate);
23
+ this.thumbprints = {};
24
+ this.type = 'X.509 Attribute Certificate';
25
+ const { acinfo } = this.asn;
26
+ this.serialNumber = Convert.ToHex(acinfo.serialNumber);
27
+ this.version = acinfo.version;
28
+ const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;
29
+ if (!notBefore) {
30
+ throw new Error("Cannot get 'notBefore' value");
31
+ }
32
+ this.notBefore = notBefore;
33
+ const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;
34
+ if (!notAfter) {
35
+ throw new Error("Cannot get 'notAfter' value");
36
+ }
37
+ this.notAfter = notAfter;
38
+ this.validity = dateDiff(this.notBefore, this.notAfter);
39
+ this.issuer = acinfo.issuer.v1Form || ((_a = acinfo.issuer.v2Form) === null || _a === void 0 ? void 0 : _a.issuerName);
40
+ this.holder = acinfo.holder;
31
41
  }
32
- this.notBefore = notBefore;
33
- const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;
34
- if (!notAfter) {
35
- throw new Error("Cannot get 'notAfter' value");
42
+ get signature() {
43
+ const { signatureValue, signatureAlgorithm } = this.asn;
44
+ return {
45
+ value: signatureValue,
46
+ algorithm: signatureAlgorithm.algorithm,
47
+ };
36
48
  }
37
- this.notAfter = notAfter;
38
- this.validity = dateDiff(this.notBefore, this.notAfter);
39
- this.issuer = acinfo.issuer.v1Form || ((_a = acinfo.issuer.v2Form) === null || _a === void 0 ? void 0 : _a.issuerName);
40
- this.holder = acinfo.holder;
41
- }
42
- get signature() {
43
- const { signatureValue, signatureAlgorithm } = this.asn;
44
- return {
45
- value: signatureValue,
46
- algorithm: signatureAlgorithm.algorithm,
47
- };
48
- }
49
- parseExtensions() {
50
- const { acinfo } = this.asn;
51
- if (acinfo.extensions) {
52
- this.extensions = acinfo.extensions
53
- .map((e) => new Extension(AsnConvert.serialize(e)));
49
+ parseExtensions() {
50
+ const { acinfo } = this.asn;
51
+ if (acinfo.extensions) {
52
+ this.extensions = acinfo.extensions
53
+ .map((e) => new Extension(AsnConvert.serialize(e)));
54
+ }
54
55
  }
55
- }
56
- parseAttributes() {
57
- const { acinfo } = this.asn;
58
- if (acinfo.attributes) {
59
- this.attributes = acinfo.attributes
60
- .map((e) => new Attribute(AsnConvert.serialize(e)));
56
+ parseAttributes() {
57
+ const { acinfo } = this.asn;
58
+ if (acinfo.attributes) {
59
+ this.attributes = acinfo.attributes
60
+ .map((e) => new Attribute(AsnConvert.serialize(e)));
61
+ }
61
62
  }
62
- }
63
- async getThumbprint(algorithm = 'SHA-1') {
64
- try {
65
- const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
66
- if (thumbprint) {
67
- this.thumbprints[algorithm] = Convert.ToHex(thumbprint);
68
- }
63
+ async getThumbprint(algorithm = 'SHA-1') {
64
+ try {
65
+ const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
66
+ if (thumbprint) {
67
+ this.thumbprints[algorithm] = Convert.ToHex(thumbprint);
68
+ }
69
+ }
70
+ catch (error) {
71
+ console.error('Error thumbprint get:', error);
72
+ }
69
73
  }
70
- catch (error) {
71
- console.error('Error thumbprint get:', error);
74
+ exportAsBase64() {
75
+ return Convert.ToBase64(this.raw);
76
+ }
77
+ exportAsHexFormatted() {
78
+ return hexFormat(Convert.ToHex(this.raw));
79
+ }
80
+ exportAsPemFormatted() {
81
+ return `-----BEGIN ATTRIBUTE CERTIFICATE-----\n${base64Format(this.exportAsBase64())}\n-----END ATTRIBUTE CERTIFICATE-----`;
82
+ }
83
+ get commonName() {
84
+ return `attribute-certificate-${this.thumbprints['SHA-1']}`;
85
+ }
86
+ downloadAsPEM(name) {
87
+ Download.attrCert.asPEM(this.exportAsPemFormatted(), name || this.commonName);
88
+ }
89
+ downloadAsDER(name) {
90
+ Download.attrCert.asDER(this.exportAsHexFormatted(), name || this.commonName);
72
91
  }
73
- }
74
- exportAsBase64() {
75
- return Convert.ToBase64(this.raw);
76
- }
77
- exportAsHexFormatted() {
78
- return hexFormat(Convert.ToHex(this.raw));
79
- }
80
- exportAsPemFormatted() {
81
- return `-----BEGIN ATTRIBUTE CERTIFICATE-----\n${base64Format(this.exportAsBase64())}\n-----END ATTRIBUTE CERTIFICATE-----`;
82
- }
83
- get commonName() {
84
- return `attribute-certificate-${this.thumbprints['SHA-1']}`;
85
- }
86
- downloadAsPEM(name) {
87
- Download.attrCert.asPEM(this.exportAsPemFormatted(), name || this.commonName);
88
- }
89
- downloadAsDER(name) {
90
- Download.attrCert.asDER(this.exportAsHexFormatted(), name || this.commonName);
91
- }
92
92
  }
93
93
  //# sourceMappingURL=x509_attribute_certificate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x509_attribute_certificate.js","sourceRoot":"","sources":["../../src/crypto/x509_attribute_certificate.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAU,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAC;AACzD,OAAO,EACL,sBAAsB,EACtB,SAAS,EACT,YAAY,EACZ,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAOjB,MAAM,OAAO,wBAAyB,SAAQ,OAA6B;EAuBzE,YAAY,GAAW;;IACrB,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,EAAE,oBAAoB,CAAC,CAAC;IATpD,gBAAW,GAA2B,EAAE,CAAC;IAMzC,SA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AEM,aAAa,CAAC,IAAa;IAChC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CACrB,IAAI,CAAC,oBAAoB,EAAE,EAC3B,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;EACJ,CAAC;EAEM,aAAa,CAAC,IAAa;IAChC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CACrB,IAAI,CAAC,oBAAoB,EAAE,EAC3B,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;EACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport type { GeneralName } from '@peculiar/asn1-x509';\nimport { AttributeCertificate, Holder } from '@peculiar/asn1-x509-attr';\nimport { Convert } from 'pvtsutils';\n\nimport { dateDiff, Download } from '../utils';\n\nimport { AsnData } from './asn_data';\nimport { Extension, TExtensionValue } from './extension';\nimport { Attribute, TAttributeValue } from './attribute';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\nexport class X509AttributeCertificate extends AsnData<AttributeCertificate> {\n public readonly serialNumber: string;\n\n public readonly version: number;\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public attributes: Attribute<TAttributeValue>[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly issuer: GeneralName[];\n\n public holder: Holder;\n\n public type: string = 'X.509 Attribute Certificate';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), AttributeCertificate);\n\n const { acinfo } = this.asn;\n\n this.serialNumber = Convert.ToHex(acinfo.serialNumber);\n this.version = acinfo.version;\n\n const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;\n\n if (!notBefore) {\n throw new Error(\"Cannot get 'notBefore' value\");\n }\n\n this.notBefore = notBefore;\n\n const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;\n\n if (!notAfter) {\n throw new Error(\"Cannot get 'notAfter' value\");\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n this.issuer = acinfo.issuer.v1Form || acinfo.issuer.v2Form?.issuerName;\n this.holder = acinfo.holder;\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n\n return {\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public parseExtensions() {\n const { acinfo } = this.asn;\n\n if (acinfo.extensions) {\n this.extensions = acinfo.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n public parseAttributes() {\n const { acinfo } = this.asn;\n\n if (acinfo.attributes) {\n this.attributes = acinfo.attributes\n .map((e) => new Attribute(AsnConvert.serialize(e)));\n }\n }\n\n public async getThumbprint(\n algorithm: 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 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 ATTRIBUTE CERTIFICATE-----\\n${base64Format(this.exportAsBase64())}\\n-----END ATTRIBUTE CERTIFICATE-----`;\n }\n\n public get commonName(): string {\n return `attribute-certificate-${this.thumbprints['SHA-1']}`;\n }\n\n public downloadAsPEM(name?: string) {\n Download.attrCert.asPEM(\n this.exportAsPemFormatted(),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.attrCert.asDER(\n this.exportAsHexFormatted(),\n name || this.commonName,\n );\n }\n}\n"]}
1
+ {"version":3,"file":"x509_attribute_certificate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a,CACxB,YAAoB,OAAO;QAE3B,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,MAAM,wBAAwB,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YAEvE,IAAI,UAAU,EAAE,CAAC;gBACf,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAEM,cAAc;QACnB,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAEM,oBAAoB;QACzB,OAAO,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5C,CAAC;IAEM,oBAAoB;QACzB,OAAO,0CAA0C,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,uCAAuC,CAAC;IAC9H,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,yBAAyB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9D,CAAC;IAEM,aAAa,CAAC,IAAa;QAChC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CACrB,IAAI,CAAC,oBAAoB,EAAE,EAC3B,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;IACJ,CAAC;IAEM,aAAa,CAAC,IAAa;QAChC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CACrB,IAAI,CAAC,oBAAoB,EAAE,EAC3B,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport type { GeneralName } from '@peculiar/asn1-x509';\nimport { AttributeCertificate, Holder } from '@peculiar/asn1-x509-attr';\nimport { Convert } from 'pvtsutils';\n\nimport { dateDiff, Download } from '../utils';\n\nimport { AsnData } from './asn_data';\nimport { Extension, TExtensionValue } from './extension';\nimport { Attribute, TAttributeValue } from './attribute';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\nexport class X509AttributeCertificate extends AsnData<AttributeCertificate> {\n public readonly serialNumber: string;\n\n public readonly version: number;\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public attributes: Attribute<TAttributeValue>[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly issuer: GeneralName[];\n\n public holder: Holder;\n\n public type: string = 'X.509 Attribute Certificate';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), AttributeCertificate);\n\n const { acinfo } = this.asn;\n\n this.serialNumber = Convert.ToHex(acinfo.serialNumber);\n this.version = acinfo.version;\n\n const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;\n\n if (!notBefore) {\n throw new Error(\"Cannot get 'notBefore' value\");\n }\n\n this.notBefore = notBefore;\n\n const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;\n\n if (!notAfter) {\n throw new Error(\"Cannot get 'notAfter' value\");\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n this.issuer = acinfo.issuer.v1Form || acinfo.issuer.v2Form?.issuerName;\n this.holder = acinfo.holder;\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n\n return {\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public parseExtensions() {\n const { acinfo } = this.asn;\n\n if (acinfo.extensions) {\n this.extensions = acinfo.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n public parseAttributes() {\n const { acinfo } = this.asn;\n\n if (acinfo.attributes) {\n this.attributes = acinfo.attributes\n .map((e) => new Attribute(AsnConvert.serialize(e)));\n }\n }\n\n public async getThumbprint(\n algorithm: 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 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 ATTRIBUTE CERTIFICATE-----\\n${base64Format(this.exportAsBase64())}\\n-----END ATTRIBUTE CERTIFICATE-----`;\n }\n\n public get commonName(): string {\n return `attribute-certificate-${this.thumbprints['SHA-1']}`;\n }\n\n public downloadAsPEM(name?: string) {\n Download.attrCert.asPEM(\n this.exportAsPemFormatted(),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.attrCert.asDER(\n this.exportAsHexFormatted(),\n name || this.commonName,\n );\n }\n}\n"]}
@@ -20,144 +20,144 @@ import { Extension } from "./extension";
20
20
  import { AsnData } from "./asn_data";
21
21
  import { certificateRawToBuffer, hexFormat, base64Format, getCertificateThumbprint, } from "./utils";
22
22
  export class X509Certificate extends AsnData {
23
- constructor(raw) {
24
- super(certificateRawToBuffer(raw), Certificate);
25
- this.thumbprints = {};
26
- this.type = 'X.509 Certificate';
27
- const { tbsCertificate } = this.asn;
28
- this.serialNumber = Convert.ToHex(tbsCertificate.serialNumber);
29
- this.subject = new Name(tbsCertificate.subject).toJSON();
30
- this.issuer = new Name(tbsCertificate.issuer).toJSON();
31
- this.version = tbsCertificate.version + 1;
32
- const notBefore = tbsCertificate.validity.notBefore.utcTime
33
- || tbsCertificate.validity.notBefore.generalTime;
34
- if (!notBefore) {
35
- throw new Error("Cannot get 'notBefore' value");
36
- }
37
- this.notBefore = notBefore;
38
- const notAfter = tbsCertificate.validity.notAfter.utcTime
39
- || tbsCertificate.validity.notAfter.generalTime;
40
- if (!notAfter) {
41
- throw new Error("Cannot get 'notAfter' value");
42
- }
43
- this.notAfter = notAfter;
44
- this.validity = dateDiff(this.notBefore, this.notAfter);
45
- }
46
- parseExtensions() {
47
- const { tbsCertificate } = this.asn;
48
- if (tbsCertificate.extensions) {
49
- this.extensions = tbsCertificate.extensions
50
- .map((e) => new Extension(AsnConvert.serialize(e)));
51
- }
52
- }
53
- getPublicKeyInfo(publicKeyInfo) {
54
- const { subjectPublicKey, algorithm } = publicKeyInfo;
55
- let params;
56
- if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {
57
- params = AsnConvert.parse(algorithm.parameters, ECParameters);
58
- }
59
- if (algorithm.algorithm === id_rsaEncryption) {
60
- params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);
61
- }
62
- if (algorithm.algorithm === id_composite_key) {
63
- params = AsnConvert.parse(subjectPublicKey, CompositePublicKey);
64
- params = params.map((param) => this.getPublicKeyInfo(param));
65
- }
66
- const spki = AsnConvert.serialize(publicKeyInfo);
67
- return {
68
- params,
69
- value: spki,
70
- algorithm: algorithm.algorithm,
71
- };
72
- }
73
- get publicKey() {
74
- return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo);
75
- }
76
- get signature() {
77
- const { signatureValue, signatureAlgorithm } = this.asn;
78
- let params;
79
- if (signatureAlgorithm.algorithm === id_alg_composite) {
80
- const compositeSignatureValues = AsnConvert.parse(signatureValue, CompositeSignatureValue);
81
- const compositeParams = AsnConvert.parse(signatureAlgorithm.parameters, CompositeParams);
82
- params = compositeParams.map((param, index) => (Object.assign(Object.assign({}, param), { value: compositeSignatureValues[index] })));
83
- }
84
- return {
85
- params,
86
- value: signatureValue,
87
- algorithm: signatureAlgorithm.algorithm,
88
- };
89
- }
90
- exportAsBase64() {
91
- return Convert.ToBase64(this.raw);
92
- }
93
- exportAsHexFormatted() {
94
- return hexFormat(Convert.ToHex(this.raw));
95
- }
96
- exportAsPemFormatted() {
97
- return `-----BEGIN CERTIFICATE-----\n${base64Format(this.exportAsBase64())}\n-----END CERTIFICATE-----`;
98
- }
99
- async getThumbprint(algorithm = 'SHA-1') {
100
- try {
101
- const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
102
- if (thumbprint) {
103
- this.thumbprints[algorithm] = Convert.ToHex(thumbprint);
104
- }
105
- }
106
- catch (error) {
107
- console.error('Error thumbprint get:', error);
108
- }
109
- }
110
- get commonName() {
111
- if (!this.subject) {
112
- return '';
113
- }
114
- for (let i = 0; i < this.subject.length; i += 1) {
115
- const name = this.subject[i];
116
- if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {
117
- return name.value;
118
- }
119
- }
120
- return '';
121
- }
122
- get issuerCommonName() {
123
- if (!this.issuer) {
124
- return '';
125
- }
126
- for (let i = 0; i < this.issuer.length; i += 1) {
127
- const name = this.issuer[i];
128
- if (name.shortName === 'CN') {
129
- return name.value;
130
- }
131
- if (name.shortName === 'E') {
132
- return name.value;
133
- }
134
- }
135
- return '';
136
- }
137
- get isRoot() {
138
- return JSON.stringify(this.issuer) === JSON.stringify(this.subject);
139
- }
140
- subjectToString() {
141
- if (!this.subject) {
142
- return '';
143
- }
144
- return this.subject
145
- .map((name) => (`${name.shortName}=${name.value}`))
146
- .join(', ');
147
- }
148
- issuerToString() {
149
- if (!this.issuer) {
150
- return '';
151
- }
152
- return this.issuer
153
- .map((name) => (`${name.shortName}=${name.value}`))
154
- .join(', ');
155
- }
156
- downloadAsPEM(name) {
157
- Download.cert.asPEM(this.exportAsPemFormatted(), name || this.commonName);
158
- }
159
- downloadAsDER(name) {
160
- Download.cert.asDER(this.exportAsHexFormatted(), name || this.commonName);
161
- }
23
+ constructor(raw) {
24
+ super(certificateRawToBuffer(raw), Certificate);
25
+ this.thumbprints = {};
26
+ this.type = 'X.509 Certificate';
27
+ const { tbsCertificate } = this.asn;
28
+ this.serialNumber = Convert.ToHex(tbsCertificate.serialNumber);
29
+ this.subject = new Name(tbsCertificate.subject).toJSON();
30
+ this.issuer = new Name(tbsCertificate.issuer).toJSON();
31
+ this.version = tbsCertificate.version + 1;
32
+ const notBefore = tbsCertificate.validity.notBefore.utcTime
33
+ || tbsCertificate.validity.notBefore.generalTime;
34
+ if (!notBefore) {
35
+ throw new Error("Cannot get 'notBefore' value");
36
+ }
37
+ this.notBefore = notBefore;
38
+ const notAfter = tbsCertificate.validity.notAfter.utcTime
39
+ || tbsCertificate.validity.notAfter.generalTime;
40
+ if (!notAfter) {
41
+ throw new Error("Cannot get 'notAfter' value");
42
+ }
43
+ this.notAfter = notAfter;
44
+ this.validity = dateDiff(this.notBefore, this.notAfter);
45
+ }
46
+ parseExtensions() {
47
+ const { tbsCertificate } = this.asn;
48
+ if (tbsCertificate.extensions) {
49
+ this.extensions = tbsCertificate.extensions
50
+ .map((e) => new Extension(AsnConvert.serialize(e)));
51
+ }
52
+ }
53
+ getPublicKeyInfo(publicKeyInfo) {
54
+ const { subjectPublicKey, algorithm } = publicKeyInfo;
55
+ let params;
56
+ if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {
57
+ params = AsnConvert.parse(algorithm.parameters, ECParameters);
58
+ }
59
+ if (algorithm.algorithm === id_rsaEncryption) {
60
+ params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);
61
+ }
62
+ if (algorithm.algorithm === id_composite_key) {
63
+ params = AsnConvert.parse(subjectPublicKey, CompositePublicKey);
64
+ params = params.map((param) => this.getPublicKeyInfo(param));
65
+ }
66
+ const spki = AsnConvert.serialize(publicKeyInfo);
67
+ return {
68
+ params,
69
+ value: spki,
70
+ algorithm: algorithm.algorithm,
71
+ };
72
+ }
73
+ get publicKey() {
74
+ return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo);
75
+ }
76
+ get signature() {
77
+ const { signatureValue, signatureAlgorithm } = this.asn;
78
+ let params;
79
+ if (signatureAlgorithm.algorithm === id_alg_composite) {
80
+ const compositeSignatureValues = AsnConvert.parse(signatureValue, CompositeSignatureValue);
81
+ const compositeParams = AsnConvert.parse(signatureAlgorithm.parameters, CompositeParams);
82
+ params = compositeParams.map((param, index) => (Object.assign(Object.assign({}, param), { value: compositeSignatureValues[index] })));
83
+ }
84
+ return {
85
+ params,
86
+ value: signatureValue,
87
+ algorithm: signatureAlgorithm.algorithm,
88
+ };
89
+ }
90
+ exportAsBase64() {
91
+ return Convert.ToBase64(this.raw);
92
+ }
93
+ exportAsHexFormatted() {
94
+ return hexFormat(Convert.ToHex(this.raw));
95
+ }
96
+ exportAsPemFormatted() {
97
+ return `-----BEGIN CERTIFICATE-----\n${base64Format(this.exportAsBase64())}\n-----END CERTIFICATE-----`;
98
+ }
99
+ async getThumbprint(algorithm = 'SHA-1') {
100
+ try {
101
+ const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
102
+ if (thumbprint) {
103
+ this.thumbprints[algorithm] = Convert.ToHex(thumbprint);
104
+ }
105
+ }
106
+ catch (error) {
107
+ console.error('Error thumbprint get:', error);
108
+ }
109
+ }
110
+ get commonName() {
111
+ if (!this.subject) {
112
+ return '';
113
+ }
114
+ for (let i = 0; i < this.subject.length; i += 1) {
115
+ const name = this.subject[i];
116
+ if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {
117
+ return name.value;
118
+ }
119
+ }
120
+ return '';
121
+ }
122
+ get issuerCommonName() {
123
+ if (!this.issuer) {
124
+ return '';
125
+ }
126
+ for (let i = 0; i < this.issuer.length; i += 1) {
127
+ const name = this.issuer[i];
128
+ if (name.shortName === 'CN') {
129
+ return name.value;
130
+ }
131
+ if (name.shortName === 'E') {
132
+ return name.value;
133
+ }
134
+ }
135
+ return '';
136
+ }
137
+ get isRoot() {
138
+ return JSON.stringify(this.issuer) === JSON.stringify(this.subject);
139
+ }
140
+ subjectToString() {
141
+ if (!this.subject) {
142
+ return '';
143
+ }
144
+ return this.subject
145
+ .map((name) => (`${name.shortName}=${name.value}`))
146
+ .join(', ');
147
+ }
148
+ issuerToString() {
149
+ if (!this.issuer) {
150
+ return '';
151
+ }
152
+ return this.issuer
153
+ .map((name) => (`${name.shortName}=${name.value}`))
154
+ .join(', ');
155
+ }
156
+ downloadAsPEM(name) {
157
+ Download.cert.asPEM(this.exportAsPemFormatted(), name || this.commonName);
158
+ }
159
+ downloadAsDER(name) {
160
+ Download.cert.asDER(this.exportAsHexFormatted(), name || this.commonName);
161
+ }
162
162
  }
163
163
  //# sourceMappingURL=x509_certificate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x509_certificate.js","sourceRoot":"","sources":["../../src/crypto/x509_certificate.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAwB,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,IAAI,EAAa,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EACL,sBAAsB,EACtB,SAAS,EACT,YAAY,EACZ,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAiBjB,MAAM,OAAO,eAAgB,SAAQ,OAAoB;EAqBvD,Y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KACX;IAED,OAAO,IAAI,CAAC,OAAO;OAChB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACb,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,EAAE,CAClC,CAAC;OACD,IAAI,CAAC,IAAI,CAAC,CAAC;EAChB,CAAC;EAEM,cAAc;IACnB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;MAChB,OAAO,EAAE,CAAC;KACX;IAED,OAAO,IAAI,CAAC,MAAM;OACf,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACb,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,EAAE,CAClC,CAAC;OACD,IAAI,CAAC,IAAI,CAAC,CAAC;EAChB,CAAC;EAEM,aAAa,CAAC,IAAa;IAChC,QAAQ,CAAC,IAAI,CAAC,KAAK,CACjB,IAAI,CAAC,oBAAoB,EAAE,EAC3B,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;EACJ,CAAC;EAEM,aAAa,CAAC,IAAa;IAChC,QAAQ,CAAC,IAAI,CAAC,KAAK,CACjB,IAAI,CAAC,oBAAoB,EAAE,EAC3B,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;EACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport {\n id_composite_key,\n id_alg_composite,\n CompositePublicKey,\n CompositeSignatureValue,\n CompositeParams,\n} from '@peculiar/asn1-x509-post-quantum';\nimport { Certificate, SubjectPublicKeyInfo } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\n\nimport { dateDiff, Download } from '../utils';\n\nimport { Name, INameJSON } from './name';\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\nexport interface ISignature {\n algorithm: string;\n value: BufferSource;\n params?: {\n algorithm: string;\n value: BufferSource;\n }[];\n}\n\nexport interface IPublicKey {\n algorithm: string;\n value: BufferSource;\n params?: ECParameters | RSAPublicKey | IPublicKey[];\n}\n\nexport class X509Certificate extends AsnData<Certificate> {\n public readonly serialNumber: string;\n\n public readonly subject: INameJSON[];\n\n public readonly issuer: INameJSON[];\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public readonly version: number;\n\n public thumbprints: Record<string, string> = {};\n\n public type: string = 'X.509 Certificate';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), Certificate);\n\n const { tbsCertificate } = this.asn;\n\n this.serialNumber = Convert.ToHex(tbsCertificate.serialNumber);\n this.subject = new Name(tbsCertificate.subject).toJSON();\n this.issuer = new Name(tbsCertificate.issuer).toJSON();\n this.version = tbsCertificate.version + 1;\n\n const notBefore = tbsCertificate.validity.notBefore.utcTime\n || tbsCertificate.validity.notBefore.generalTime;\n\n if (!notBefore) {\n throw new Error(\"Cannot get 'notBefore' value\");\n }\n\n this.notBefore = notBefore;\n\n const notAfter = tbsCertificate.validity.notAfter.utcTime\n || tbsCertificate.validity.notAfter.generalTime;\n\n if (!notAfter) {\n throw new Error(\"Cannot get 'notAfter' value\");\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n }\n\n public parseExtensions() {\n const { tbsCertificate } = this.asn;\n\n if (tbsCertificate.extensions) {\n this.extensions = tbsCertificate.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n private getPublicKeyInfo(publicKeyInfo: SubjectPublicKeyInfo) {\n const { subjectPublicKey, algorithm } = publicKeyInfo;\n let params;\n\n if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {\n params = AsnConvert.parse(algorithm.parameters, ECParameters);\n }\n\n if (algorithm.algorithm === id_rsaEncryption) {\n params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);\n }\n\n if (algorithm.algorithm === id_composite_key) {\n params = AsnConvert.parse(subjectPublicKey, CompositePublicKey);\n\n params = params.map((param) => this.getPublicKeyInfo(param));\n }\n\n const spki = AsnConvert.serialize(publicKeyInfo);\n\n return {\n params,\n value: spki,\n algorithm: algorithm.algorithm,\n };\n }\n\n public get publicKey(): IPublicKey {\n return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo);\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n let params;\n\n if (signatureAlgorithm.algorithm === id_alg_composite) {\n const compositeSignatureValues = AsnConvert.parse(signatureValue, CompositeSignatureValue);\n const compositeParams = AsnConvert.parse(signatureAlgorithm.parameters, CompositeParams);\n\n params = compositeParams.map((param, index) => ({\n ...param,\n value: compositeSignatureValues[index],\n }));\n }\n\n return {\n params,\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public 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 CERTIFICATE-----\\n${base64Format(this.exportAsBase64())}\\n-----END CERTIFICATE-----`;\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 commonName(): string {\n if (!this.subject) {\n return '';\n }\n\n for (let i = 0; i < this.subject.length; i += 1) {\n const name = this.subject[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get issuerCommonName(): string {\n if (!this.issuer) {\n return '';\n }\n\n for (let i = 0; i < this.issuer.length; i += 1) {\n const name = this.issuer[i];\n\n if (name.shortName === 'CN') {\n return name.value;\n }\n\n if (name.shortName === 'E') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get isRoot(): boolean {\n return JSON.stringify(this.issuer) === JSON.stringify(this.subject);\n }\n\n public subjectToString() {\n if (!this.subject) {\n return '';\n }\n\n return this.subject\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public issuerToString() {\n if (!this.issuer) {\n return '';\n }\n\n return this.issuer\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public downloadAsPEM(name?: string) {\n Download.cert.asPEM(\n this.exportAsPemFormatted(),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.cert.asDER(\n this.exportAsHexFormatted(),\n name || this.commonName,\n );\n }\n}\n"]}
1
+ {"version":3,"file":"x509_certificate.js","sourceRoot":"","sources":["../../src/crypto/x509_certificate.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAwB,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,IAAI,EAAa,MAAM,QAAQ,CAAC;AACzC,OAA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AAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport {\n id_composite_key,\n id_alg_composite,\n CompositePublicKey,\n CompositeSignatureValue,\n CompositeParams,\n} from '@peculiar/asn1-x509-post-quantum';\nimport { Certificate, SubjectPublicKeyInfo } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\n\nimport { dateDiff, Download } from '../utils';\n\nimport { Name, INameJSON } from './name';\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\nexport interface ISignature {\n algorithm: string;\n value: BufferSource;\n params?: {\n algorithm: string;\n value: BufferSource;\n }[];\n}\n\nexport interface IPublicKey {\n algorithm: string;\n value: BufferSource;\n params?: ECParameters | RSAPublicKey | IPublicKey[];\n}\n\nexport class X509Certificate extends AsnData<Certificate> {\n public readonly serialNumber: string;\n\n public readonly subject: INameJSON[];\n\n public readonly issuer: INameJSON[];\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public readonly version: number;\n\n public thumbprints: Record<string, string> = {};\n\n public type: string = 'X.509 Certificate';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), Certificate);\n\n const { tbsCertificate } = this.asn;\n\n this.serialNumber = Convert.ToHex(tbsCertificate.serialNumber);\n this.subject = new Name(tbsCertificate.subject).toJSON();\n this.issuer = new Name(tbsCertificate.issuer).toJSON();\n this.version = tbsCertificate.version + 1;\n\n const notBefore = tbsCertificate.validity.notBefore.utcTime\n || tbsCertificate.validity.notBefore.generalTime;\n\n if (!notBefore) {\n throw new Error(\"Cannot get 'notBefore' value\");\n }\n\n this.notBefore = notBefore;\n\n const notAfter = tbsCertificate.validity.notAfter.utcTime\n || tbsCertificate.validity.notAfter.generalTime;\n\n if (!notAfter) {\n throw new Error(\"Cannot get 'notAfter' value\");\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n }\n\n public parseExtensions() {\n const { tbsCertificate } = this.asn;\n\n if (tbsCertificate.extensions) {\n this.extensions = tbsCertificate.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n private getPublicKeyInfo(publicKeyInfo: SubjectPublicKeyInfo) {\n const { subjectPublicKey, algorithm } = publicKeyInfo;\n let params;\n\n if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {\n params = AsnConvert.parse(algorithm.parameters, ECParameters);\n }\n\n if (algorithm.algorithm === id_rsaEncryption) {\n params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);\n }\n\n if (algorithm.algorithm === id_composite_key) {\n params = AsnConvert.parse(subjectPublicKey, CompositePublicKey);\n\n params = params.map((param) => this.getPublicKeyInfo(param));\n }\n\n const spki = AsnConvert.serialize(publicKeyInfo);\n\n return {\n params,\n value: spki,\n algorithm: algorithm.algorithm,\n };\n }\n\n public get publicKey(): IPublicKey {\n return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo);\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n let params;\n\n if (signatureAlgorithm.algorithm === id_alg_composite) {\n const compositeSignatureValues = AsnConvert.parse(signatureValue, CompositeSignatureValue);\n const compositeParams = AsnConvert.parse(signatureAlgorithm.parameters, CompositeParams);\n\n params = compositeParams.map((param, index) => ({\n ...param,\n value: compositeSignatureValues[index],\n }));\n }\n\n return {\n params,\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public 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 CERTIFICATE-----\\n${base64Format(this.exportAsBase64())}\\n-----END CERTIFICATE-----`;\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 commonName(): string {\n if (!this.subject) {\n return '';\n }\n\n for (let i = 0; i < this.subject.length; i += 1) {\n const name = this.subject[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get issuerCommonName(): string {\n if (!this.issuer) {\n return '';\n }\n\n for (let i = 0; i < this.issuer.length; i += 1) {\n const name = this.issuer[i];\n\n if (name.shortName === 'CN') {\n return name.value;\n }\n\n if (name.shortName === 'E') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get isRoot(): boolean {\n return JSON.stringify(this.issuer) === JSON.stringify(this.subject);\n }\n\n public subjectToString() {\n if (!this.subject) {\n return '';\n }\n\n return this.subject\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public issuerToString() {\n if (!this.issuer) {\n return '';\n }\n\n return this.issuer\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public downloadAsPEM(name?: string) {\n Download.cert.asPEM(\n this.exportAsPemFormatted(),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.cert.asDER(\n this.exportAsHexFormatted(),\n name || this.commonName,\n );\n }\n}\n"]}
@@ -9,7 +9,7 @@
9
9
  * LICENSE file in the root directory of this source tree.
10
10
  */
11
11
  export function camelCaseToWords(value) {
12
- const result = value.replace(/([A-Z])/g, ' $1');
13
- return result.charAt(0).toUpperCase() + result.slice(1);
12
+ const result = value.replace(/([A-Z])/g, ' $1');
13
+ return result.charAt(0).toUpperCase() + result.slice(1);
14
14
  }
15
15
  //# sourceMappingURL=camel_case_to_words.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"camel_case_to_words.js","sourceRoot":"","sources":["../../src/utils/camel_case_to_words.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,UAAU,gBAAgB,CAAC,KAAa;EAC5C,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;EAEhD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC","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\nexport function camelCaseToWords(value: string) {\n const result = value.replace(/([A-Z])/g, ' $1');\n\n return result.charAt(0).toUpperCase() + result.slice(1);\n}\n"]}
1
+ {"version":3,"file":"camel_case_to_words.js","sourceRoot":"","sources":["../../src/utils/camel_case_to_words.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IAEhD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC","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\nexport function camelCaseToWords(value: string) {\n const result = value.replace(/([A-Z])/g, ' $1');\n\n return result.charAt(0).toUpperCase() + result.slice(1);\n}\n"]}
@@ -13,11 +13,11 @@ import relativeTime from "dayjs/plugin/relativeTime";
13
13
  dayjs.extend(relativeTime);
14
14
  export const dateShort = (date) => (new Date(date).toUTCString());
15
15
  export const dateDiff = (dateStart, dateEnd) => {
16
- if (!dateStart || !dateEnd) {
17
- return '';
18
- }
19
- const start = dayjs(dateStart);
20
- const end = dayjs(dateEnd);
21
- return start.to(end, true);
16
+ if (!dateStart || !dateEnd) {
17
+ return '';
18
+ }
19
+ const start = dayjs(dateStart);
20
+ const end = dayjs(dateEnd);
21
+ return start.to(end, true);
22
22
  };
23
23
  //# sourceMappingURL=date_formatter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date_formatter.js","sourceRoot":"","sources":["../../src/utils/date_formatter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,2BAA2B,CAAC;AAErD,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAE3B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAA4B,EAAE,EAAE,CAAC,CACzD,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,SAAiC,EACjC,OAA+B,EAC/B,EAAE;EACF,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE;IAC1B,OAAO,EAAE,CAAC;GACX;EAED,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;EAC/B,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;EAE3B,OAAO,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC7B,CAAC,CAAC","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 dayjs from 'dayjs';\nimport relativeTime from 'dayjs/plugin/relativeTime';\n\ndayjs.extend(relativeTime);\n\nexport const dateShort = (date: string | number | Date) => (\n new Date(date).toUTCString()\n);\n\nexport const dateDiff = (\n dateStart: string | number | Date,\n dateEnd: string | number | Date,\n) => {\n if (!dateStart || !dateEnd) {\n return '';\n }\n\n const start = dayjs(dateStart);\n const end = dayjs(dateEnd);\n\n return start.to(end, true);\n};\n"]}
1
+ {"version":3,"file":"date_formatter.js","sourceRoot":"","sources":["../../src/utils/date_formatter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,2BAA2B,CAAC;AAErD,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAE3B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAA4B,EAAE,EAAE,CAAC,CACzD,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,SAAiC,EACjC,OAA+B,EAC/B,EAAE;IACF,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;IAC/B,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IAE3B,OAAO,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC7B,CAAC,CAAC","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 dayjs from 'dayjs';\nimport relativeTime from 'dayjs/plugin/relativeTime';\n\ndayjs.extend(relativeTime);\n\nexport const dateShort = (date: string | number | Date) => (\n new Date(date).toUTCString()\n);\n\nexport const dateDiff = (\n dateStart: string | number | Date,\n dateEnd: string | number | Date,\n) => {\n if (!dateStart || !dateEnd) {\n return '';\n }\n\n const start = dayjs(dateStart);\n const end = dayjs(dateEnd);\n\n return start.to(end, true);\n};\n"]}