@peculiar/certificates-viewer 4.3.0 → 4.3.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 (95) hide show
  1. package/components/download.js +72 -1
  2. package/components/download.js.map +1 -1
  3. package/dist/cjs/{certification_request-314859bb.js → certification_request-ad267278.js} +73 -2
  4. package/dist/cjs/certification_request-ad267278.js.map +1 -0
  5. package/dist/cjs/index.cjs.js +2 -2
  6. package/dist/cjs/{miscellaneous-f1bc3a4b.js → miscellaneous-67439e59.js} +2 -2
  7. package/dist/cjs/{miscellaneous-f1bc3a4b.js.map → miscellaneous-67439e59.js.map} +1 -1
  8. package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +4 -4
  9. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +4 -4
  10. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +3 -3
  11. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +2 -2
  12. package/dist/cjs/{pkcs10_certificate_request-93c66ce7.js → pkcs10_certificate_request-64898c88.js} +2 -2
  13. package/dist/cjs/{pkcs10_certificate_request-93c66ce7.js.map → pkcs10_certificate_request-64898c88.js.map} +1 -1
  14. package/dist/cjs/{x509_certificate-0776e3ec.js → x509_certificate-4b0894c2.js} +2 -2
  15. package/dist/cjs/{x509_certificate-0776e3ec.js.map → x509_certificate-4b0894c2.js.map} +1 -1
  16. package/dist/cjs/{x509_crl-5326d209.js → x509_crl-fc8d41a1.js} +3 -3
  17. package/dist/cjs/{x509_crl-5326d209.js.map → x509_crl-fc8d41a1.js.map} +1 -1
  18. package/dist/esm/{certification_request-b531916a.js → certification_request-a4699dcf.js} +73 -2
  19. package/dist/esm/certification_request-a4699dcf.js.map +1 -0
  20. package/dist/esm/index.js +2 -2
  21. package/dist/esm/{miscellaneous-7fe71e3f.js → miscellaneous-ba1fd2bd.js} +2 -2
  22. package/dist/esm/{miscellaneous-7fe71e3f.js.map → miscellaneous-ba1fd2bd.js.map} +1 -1
  23. package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +4 -4
  24. package/dist/esm/peculiar-certificate-decoder.entry.js +4 -4
  25. package/dist/esm/peculiar-certificate-viewer.entry.js +3 -3
  26. package/dist/esm/peculiar-certificates-viewer.entry.js +2 -2
  27. package/dist/esm/{pkcs10_certificate_request-cca2ca68.js → pkcs10_certificate_request-785a4794.js} +2 -2
  28. package/dist/esm/{pkcs10_certificate_request-cca2ca68.js.map → pkcs10_certificate_request-785a4794.js.map} +1 -1
  29. package/dist/esm/{x509_certificate-050175dd.js → x509_certificate-05a23c0e.js} +2 -2
  30. package/dist/esm/{x509_certificate-050175dd.js.map → x509_certificate-05a23c0e.js.map} +1 -1
  31. package/dist/esm/{x509_crl-c497f907.js → x509_crl-26081461.js} +3 -3
  32. package/dist/esm/{x509_crl-c497f907.js.map → x509_crl-26081461.js.map} +1 -1
  33. package/dist/esm-es5/{certification_request-b531916a.js → certification_request-a4699dcf.js} +3 -3
  34. package/dist/esm-es5/certification_request-a4699dcf.js.map +1 -0
  35. package/dist/esm-es5/index.js +1 -1
  36. package/dist/esm-es5/{miscellaneous-7fe71e3f.js → miscellaneous-ba1fd2bd.js} +2 -2
  37. package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +1 -1
  38. package/dist/esm-es5/peculiar-certificate-decoder.entry.js +1 -1
  39. package/dist/esm-es5/peculiar-certificate-viewer.entry.js +1 -1
  40. package/dist/esm-es5/peculiar-certificates-viewer.entry.js +1 -1
  41. package/dist/esm-es5/{pkcs10_certificate_request-cca2ca68.js → pkcs10_certificate_request-785a4794.js} +2 -2
  42. package/dist/esm-es5/{x509_certificate-050175dd.js → x509_certificate-05a23c0e.js} +2 -2
  43. package/dist/esm-es5/{x509_crl-c497f907.js → x509_crl-26081461.js} +2 -2
  44. package/dist/peculiar/index.esm.js +1 -1
  45. package/dist/peculiar/{p-bd7fb688.system.entry.js → p-1566ad92.system.entry.js} +2 -2
  46. package/dist/peculiar/{p-52f13c4a.system.js → p-2bc2abea.system.js} +2 -2
  47. package/dist/peculiar/{p-666438a8.js → p-32807e5e.js} +11 -11
  48. package/dist/peculiar/p-32807e5e.js.map +1 -0
  49. package/dist/peculiar/{p-7a5173be.entry.js → p-5d1d4a96.entry.js} +2 -2
  50. package/dist/peculiar/{p-ddadcb44.entry.js → p-67e82386.entry.js} +2 -2
  51. package/dist/peculiar/{p-adf16adb.js → p-6e2ad7eb.js} +2 -2
  52. package/dist/peculiar/{p-a06f51a2.system.js → p-7ddd9a82.system.js} +2 -2
  53. package/dist/peculiar/p-8393399a.system.js +1 -1
  54. package/dist/peculiar/{p-cc256004.system.entry.js → p-9263e7ee.system.entry.js} +2 -2
  55. package/dist/peculiar/{p-05af3b74.system.js → p-98e3a016.system.js} +4 -4
  56. package/dist/peculiar/{p-6221d0a4.system.entry.js → p-9ad547d2.system.entry.js} +2 -2
  57. package/dist/peculiar/{p-d6229f42.system.js → p-a1a48332.system.js} +2 -2
  58. package/dist/peculiar/{p-80477c05.js → p-ab5a4988.js} +2 -2
  59. package/dist/peculiar/{p-163a3052.system.js → p-ae44c2b0.system.js} +5 -5
  60. package/dist/peculiar/{p-8ff95ad8.entry.js → p-bafd67f3.entry.js} +2 -2
  61. package/dist/peculiar/{p-494d26fb.entry.js → p-cd1b1876.entry.js} +2 -2
  62. package/dist/peculiar/{p-5a699274.js → p-d5ba4fc2.js} +4 -4
  63. package/dist/peculiar/{p-d1066b51.system.js → p-e37e4df2.system.js} +10 -10
  64. package/dist/peculiar/p-e37e4df2.system.js.map +1 -0
  65. package/dist/peculiar/{p-b6d5e413.js → p-f8c91ee4.js} +4 -4
  66. package/dist/peculiar/{p-2d9c40d6.system.entry.js → p-f9c07207.system.entry.js} +3 -3
  67. package/dist/peculiar/peculiar.esm.js +1 -1
  68. package/hydrate/index.js +72 -1
  69. package/package.json +21 -21
  70. package/dist/cjs/certification_request-314859bb.js.map +0 -1
  71. package/dist/esm/certification_request-b531916a.js.map +0 -1
  72. package/dist/esm-es5/certification_request-b531916a.js.map +0 -1
  73. package/dist/peculiar/p-666438a8.js.map +0 -1
  74. package/dist/peculiar/p-d1066b51.system.js.map +0 -1
  75. /package/dist/esm-es5/{miscellaneous-7fe71e3f.js.map → miscellaneous-ba1fd2bd.js.map} +0 -0
  76. /package/dist/esm-es5/{pkcs10_certificate_request-cca2ca68.js.map → pkcs10_certificate_request-785a4794.js.map} +0 -0
  77. /package/dist/esm-es5/{x509_certificate-050175dd.js.map → x509_certificate-05a23c0e.js.map} +0 -0
  78. /package/dist/esm-es5/{x509_crl-c497f907.js.map → x509_crl-26081461.js.map} +0 -0
  79. /package/dist/peculiar/{p-bd7fb688.system.entry.js.map → p-1566ad92.system.entry.js.map} +0 -0
  80. /package/dist/peculiar/{p-52f13c4a.system.js.map → p-2bc2abea.system.js.map} +0 -0
  81. /package/dist/peculiar/{p-7a5173be.entry.js.map → p-5d1d4a96.entry.js.map} +0 -0
  82. /package/dist/peculiar/{p-ddadcb44.entry.js.map → p-67e82386.entry.js.map} +0 -0
  83. /package/dist/peculiar/{p-adf16adb.js.map → p-6e2ad7eb.js.map} +0 -0
  84. /package/dist/peculiar/{p-a06f51a2.system.js.map → p-7ddd9a82.system.js.map} +0 -0
  85. /package/dist/peculiar/{p-cc256004.system.entry.js.map → p-9263e7ee.system.entry.js.map} +0 -0
  86. /package/dist/peculiar/{p-05af3b74.system.js.map → p-98e3a016.system.js.map} +0 -0
  87. /package/dist/peculiar/{p-6221d0a4.system.entry.js.map → p-9ad547d2.system.entry.js.map} +0 -0
  88. /package/dist/peculiar/{p-d6229f42.system.js.map → p-a1a48332.system.js.map} +0 -0
  89. /package/dist/peculiar/{p-80477c05.js.map → p-ab5a4988.js.map} +0 -0
  90. /package/dist/peculiar/{p-163a3052.system.js.map → p-ae44c2b0.system.js.map} +0 -0
  91. /package/dist/peculiar/{p-8ff95ad8.entry.js.map → p-bafd67f3.entry.js.map} +0 -0
  92. /package/dist/peculiar/{p-494d26fb.entry.js.map → p-cd1b1876.entry.js.map} +0 -0
  93. /package/dist/peculiar/{p-5a699274.js.map → p-d5ba4fc2.js.map} +0 -0
  94. /package/dist/peculiar/{p-b6d5e413.js.map → p-f8c91ee4.js.map} +0 -0
  95. /package/dist/peculiar/{p-2d9c40d6.system.entry.js.map → p-f9c07207.system.entry.js.map} +0 -0
@@ -6,11 +6,11 @@
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-e2ae280a.js');
9
- const certification_request = require('./certification_request-314859bb.js');
10
- const x509_crl = require('./x509_crl-5326d209.js');
11
- const miscellaneous = require('./miscellaneous-f1bc3a4b.js');
9
+ const certification_request = require('./certification_request-ad267278.js');
10
+ const x509_crl = require('./x509_crl-fc8d41a1.js');
11
+ const miscellaneous = require('./miscellaneous-67439e59.js');
12
12
  const button = require('./button-87086210.js');
13
- const pkcs10_certificate_request = require('./pkcs10_certificate_request-93c66ce7.js');
13
+ const pkcs10_certificate_request = require('./pkcs10_certificate_request-64898c88.js');
14
14
  require('./link-a3d3799d.js');
15
15
  require('./download-820d66ba.js');
16
16
 
@@ -7,10 +7,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-e2ae280a.js');
9
9
  const read_file = require('./read_file-2e22a97e.js');
10
- require('./certification_request-314859bb.js');
11
- const x509_certificate = require('./x509_certificate-0776e3ec.js');
12
- const x509_crl = require('./x509_crl-5326d209.js');
13
- const pkcs10_certificate_request = require('./pkcs10_certificate_request-93c66ce7.js');
10
+ require('./certification_request-ad267278.js');
11
+ const x509_certificate = require('./x509_certificate-4b0894c2.js');
12
+ const x509_crl = require('./x509_crl-fc8d41a1.js');
13
+ const pkcs10_certificate_request = require('./pkcs10_certificate_request-64898c88.js');
14
14
  const button = require('./button-87086210.js');
15
15
 
16
16
  const certificateDecoderCss = "*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%}.textarea{min-height:300px;width:100%;border-radius:4px;border:1px solid var(--pv-color-gray-5);padding:14px;font-family:monospace;resize:vertical}.viewer{margin-top:var(--pv-size-base-12)}.controls{margin-top:var(--pv-size-base-2);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--pv-size-base-2)}.control_row{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--pv-size-base)}";
@@ -6,9 +6,9 @@
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-e2ae280a.js');
9
- const x509_certificate = require('./x509_certificate-0776e3ec.js');
10
- require('./certification_request-314859bb.js');
11
- const miscellaneous = require('./miscellaneous-f1bc3a4b.js');
9
+ const x509_certificate = require('./x509_certificate-4b0894c2.js');
10
+ require('./certification_request-ad267278.js');
11
+ const miscellaneous = require('./miscellaneous-67439e59.js');
12
12
  const button = require('./button-87086210.js');
13
13
  require('./link-a3d3799d.js');
14
14
  require('./download-820d66ba.js');
@@ -6,8 +6,8 @@
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-e2ae280a.js');
9
- const x509_certificate = require('./x509_certificate-0776e3ec.js');
10
- const certification_request = require('./certification_request-314859bb.js');
9
+ const x509_certificate = require('./x509_certificate-4b0894c2.js');
10
+ const certification_request = require('./certification_request-ad267278.js');
11
11
  const button = require('./button-87086210.js');
12
12
  const cross = require('./cross-bd099933.js');
13
13
  const download = require('./download-820d66ba.js');
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const certification_request = require('./certification_request-314859bb.js');
6
+ const certification_request = require('./certification_request-ad267278.js');
7
7
 
8
8
  /**
9
9
  * @license
@@ -146,4 +146,4 @@ class Pkcs10CertificateRequest extends certification_request.AsnData {
146
146
  exports.Attribute = Attribute;
147
147
  exports.Pkcs10CertificateRequest = Pkcs10CertificateRequest;
148
148
 
149
- //# sourceMappingURL=pkcs10_certificate_request-93c66ce7.js.map
149
+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eneficiary","DomainNameBeneficiary","id_DomainNameLegalRepresentative","DomainNameLegalRepresentative","id_DomainNameOwner","DomainNameOwner","id_DomainNameTechnicalOperator","DomainNameTechnicalOperator","id_TypeRelationship","TypeRelationship","id_ActivityDescription","ActivityDescription","id_WebGDPR","WebGDPR","id_InsuranceValue","InsuranceValue","id_ValuationRanking","ValuationRanking","id_pkcs9_at_challengePassword","ChallengePassword","id_pkcs9_at_unstructuredName","UnstructuredName","id_pkcs9_at_extensionRequest","ExtensionRequest","AsnData","AsnAttribute","AsnParser","Convert","certificateRawToBuffer","CertificationRequest","Name","id_ecPublicKey","AsnConvert","ECParameters","id_rsaEncryption","RSAPublicKey","getCertificateThumbprint","Extension","hexFormat","base64Format","Download"],"sources":["src/crypto/attribute.ts","src/crypto/pkcs10_certificate_request.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { Convert } from 'pvtsutils';\nimport { AsnParser } from '@peculiar/asn1-schema';\nimport { Attribute as AsnAttribute } from '@peculiar/asn1-x509';\nimport {\n id_DomainNameBeneficiary,\n DomainNameBeneficiary,\n\n id_DomainNameLegalRepresentative,\n DomainNameLegalRepresentative,\n\n id_DomainNameOwner,\n DomainNameOwner,\n\n id_DomainNameTechnicalOperator,\n DomainNameTechnicalOperator,\n\n id_TypeRelationship,\n TypeRelationship,\n\n id_ActivityDescription,\n ActivityDescription,\n\n id_WebGDPR,\n WebGDPR,\n\n id_InsuranceValue,\n InsuranceValue,\n\n id_ValuationRanking,\n ValuationRanking,\n} from '@peculiar/asn1-ntqwac';\nimport {\n id_pkcs9_at_extensionRequest,\n ExtensionRequest,\n\n id_pkcs9_at_challengePassword,\n ChallengePassword,\n\n id_pkcs9_at_unstructuredName,\n UnstructuredName,\n} from '@peculiar/asn1-pkcs9';\n\nimport { AsnData } from './asn_data';\n\nconst attributesParsers = {\n [id_DomainNameBeneficiary]: DomainNameBeneficiary,\n [id_DomainNameLegalRepresentative]: DomainNameLegalRepresentative,\n [id_DomainNameOwner]: DomainNameOwner,\n [id_DomainNameTechnicalOperator]: DomainNameTechnicalOperator,\n [id_TypeRelationship]: TypeRelationship,\n [id_ActivityDescription]: ActivityDescription,\n [id_WebGDPR]: WebGDPR,\n [id_InsuranceValue]: InsuranceValue,\n [id_ValuationRanking]: ValuationRanking,\n [id_pkcs9_at_challengePassword]: ChallengePassword,\n [id_pkcs9_at_unstructuredName]: UnstructuredName,\n [id_pkcs9_at_extensionRequest]: ExtensionRequest,\n};\n\ntype TAttributeKeys = keyof typeof attributesParsers;\nexport type TAttributeValue = InstanceType<typeof attributesParsers[TAttributeKeys]> | string;\n\nexport class Attribute<T extends TAttributeValue> extends AsnData<AsnAttribute> {\n public readonly value: T;\n\n private getAsnExtnValue() {\n return this.asn.values[0];\n }\n\n constructor(raw: BufferSource) {\n super(raw, AsnAttribute);\n\n const asnExtnValue = this.getAsnExtnValue();\n\n try {\n const target = attributesParsers[this.asn.type];\n\n if (target) {\n this.value = AsnParser.parse<T>(asnExtnValue, target);\n } else {\n console.warn(`Didn't detect parser for \"${this.asn.type}\" attribute.`);\n\n this.value = Convert.ToHex(asnExtnValue) as T;\n }\n } catch (error) {\n console.error(`Error parse \"${this.asn.type}\" attribute:`, error.message);\n\n this.value = Convert.ToHex(asnExtnValue) as T;\n }\n }\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport { CertificationRequest } from '@peculiar/asn1-csr';\nimport {\n id_pkcs9_at_extensionRequest,\n ExtensionRequest,\n} from '@peculiar/asn1-pkcs9';\nimport { Convert } from 'pvtsutils';\n\nimport { Download } from '../utils';\n\nimport { AsnData } from './asn_data';\nimport { Name, INameJSON } from './name';\nimport { Attribute, TAttributeValue } from './attribute';\nimport { Extension, TExtensionValue } from './extension';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\ninterface IPublicKey {\n algorithm: string;\n value: BufferSource;\n params?: ECParameters | RSAPublicKey;\n}\n\nexport class Pkcs10CertificateRequest extends AsnData<CertificationRequest> {\n public readonly subject: INameJSON[];\n\n public readonly version: number;\n\n public attributes: Attribute<TAttributeValue>[];\n\n public extensions: Extension<TExtensionValue>[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'PKCS#10 Certificate Request';\n\n public readonly tag = 'CERTIFICATE REQUEST';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), CertificationRequest);\n\n const { certificationRequestInfo } = this.asn;\n\n this.subject = new Name(certificationRequestInfo.subject).toJSON();\n this.version = certificationRequestInfo.version;\n }\n\n public get publicKey(): IPublicKey {\n const { subjectPublicKey, algorithm } = this.asn.certificationRequestInfo.subjectPKInfo;\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 const spki = AsnConvert.serialize(this.asn.certificationRequestInfo.subjectPKInfo);\n\n return {\n params,\n value: spki,\n algorithm: algorithm.algorithm,\n };\n }\n\n public get signature(): ISignature {\n const { signature, signatureAlgorithm } = this.asn;\n\n return {\n value: signature,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public get commonName(): string {\n if (!this.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 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 parseAttributes() {\n const { certificationRequestInfo } = this.asn;\n\n if (certificationRequestInfo.attributes) {\n this.attributes = certificationRequestInfo.attributes\n .map((e) => new Attribute(AsnConvert.serialize(e)));\n\n const extensionRequestAttribute = this.attributes.find(\n (attribute) => attribute.asn.type === id_pkcs9_at_extensionRequest,\n ) as Attribute<ExtensionRequest>;\n\n if (extensionRequestAttribute) {\n this.extensions = extensionRequestAttribute.value\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.csr.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.csr.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"version":3}
1
+ {"file":"pkcs10_certificate_request-64898c88.js","mappings":";;;;;;;AAAA;;;;;;;AAoDA,MAAM,iBAAiB,GAAG;IACxB,CAACA,8CAAwB,GAAGC,2CAAqB;IACjD,CAACC,sDAAgC,GAAGC,mDAA6B;IACjE,CAACC,wCAAkB,GAAGC,qCAAe;IACrC,CAACC,oDAA8B,GAAGC,iDAA2B;IAC7D,CAACC,yCAAmB,GAAGC,sCAAgB;IACvC,CAACC,4CAAsB,GAAGC,yCAAmB;IAC7C,CAACC,gCAAU,GAAGC,6BAAO;IACrB,CAACC,uCAAiB,GAAGC,oCAAc;IACnC,CAACC,yC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,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACvD;SACF;KACF;IAEM,QAAQ,CAAC,SAAmC,KAAK;QACtD,QAAQ,MAAM;YACZ,KAAK,KAAK;gBACR,OAAOM,+BAAS,CAACX,+BAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAC5C,KAAK,KAAK;gBACR,OAAO,cAAc,IAAI,CAAC,GAAG,UAAUY,kCAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,cAAc,IAAI,CAAC,GAAG,OAAO,CAAC;YAC5G;gBACE,OAAOZ,+BAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACrC;KACF;IAEM,aAAa,CAAC,IAAa;QAChCa,8BAAQ,CAAC,GAAG,CAAC,KAAK,CAChB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpB,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;KACH;IAEM,aAAa,CAAC,IAAa;QAChCA,8BAAQ,CAAC,GAAG,CAAC,KAAK,CAChB,IAAI,CAAC,GAAG,EACR,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;KACH;;;;;;","names":["id_DomainNameBeneficiary","DomainNameBeneficiary","id_DomainNameLegalRepresentative","DomainNameLegalRepresentative","id_DomainNameOwner","DomainNameOwner","id_DomainNameTechnicalOperator","DomainNameTechnicalOperator","id_TypeRelationship","TypeRelationship","id_ActivityDescription","ActivityDescription","id_WebGDPR","WebGDPR","id_InsuranceValue","InsuranceValue","id_ValuationRanking","ValuationRanking","id_pkcs9_at_challengePassword","ChallengePassword","id_pkcs9_at_unstructuredName","UnstructuredName","id_pkcs9_at_extensionRequest","ExtensionRequest","AsnData","AsnAttribute","AsnParser","Convert","certificateRawToBuffer","CertificationRequest","Name","id_ecPublicKey","AsnConvert","ECParameters","id_rsaEncryption","RSAPublicKey","getCertificateThumbprint","Extension","hexFormat","base64Format","Download"],"sources":["src/crypto/attribute.ts","src/crypto/pkcs10_certificate_request.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { Convert } from 'pvtsutils';\nimport { AsnParser } from '@peculiar/asn1-schema';\nimport { Attribute as AsnAttribute } from '@peculiar/asn1-x509';\nimport {\n id_DomainNameBeneficiary,\n DomainNameBeneficiary,\n\n id_DomainNameLegalRepresentative,\n DomainNameLegalRepresentative,\n\n id_DomainNameOwner,\n DomainNameOwner,\n\n id_DomainNameTechnicalOperator,\n DomainNameTechnicalOperator,\n\n id_TypeRelationship,\n TypeRelationship,\n\n id_ActivityDescription,\n ActivityDescription,\n\n id_WebGDPR,\n WebGDPR,\n\n id_InsuranceValue,\n InsuranceValue,\n\n id_ValuationRanking,\n ValuationRanking,\n} from '@peculiar/asn1-ntqwac';\nimport {\n id_pkcs9_at_extensionRequest,\n ExtensionRequest,\n\n id_pkcs9_at_challengePassword,\n ChallengePassword,\n\n id_pkcs9_at_unstructuredName,\n UnstructuredName,\n} from '@peculiar/asn1-pkcs9';\n\nimport { AsnData } from './asn_data';\n\nconst attributesParsers = {\n [id_DomainNameBeneficiary]: DomainNameBeneficiary,\n [id_DomainNameLegalRepresentative]: DomainNameLegalRepresentative,\n [id_DomainNameOwner]: DomainNameOwner,\n [id_DomainNameTechnicalOperator]: DomainNameTechnicalOperator,\n [id_TypeRelationship]: TypeRelationship,\n [id_ActivityDescription]: ActivityDescription,\n [id_WebGDPR]: WebGDPR,\n [id_InsuranceValue]: InsuranceValue,\n [id_ValuationRanking]: ValuationRanking,\n [id_pkcs9_at_challengePassword]: ChallengePassword,\n [id_pkcs9_at_unstructuredName]: UnstructuredName,\n [id_pkcs9_at_extensionRequest]: ExtensionRequest,\n};\n\ntype TAttributeKeys = keyof typeof attributesParsers;\nexport type TAttributeValue = InstanceType<typeof attributesParsers[TAttributeKeys]> | string;\n\nexport class Attribute<T extends TAttributeValue> extends AsnData<AsnAttribute> {\n public readonly value: T;\n\n private getAsnExtnValue() {\n return this.asn.values[0];\n }\n\n constructor(raw: BufferSource) {\n super(raw, AsnAttribute);\n\n const asnExtnValue = this.getAsnExtnValue();\n\n try {\n const target = attributesParsers[this.asn.type];\n\n if (target) {\n this.value = AsnParser.parse<T>(asnExtnValue, target);\n } else {\n console.warn(`Didn't detect parser for \"${this.asn.type}\" attribute.`);\n\n this.value = Convert.ToHex(asnExtnValue) as T;\n }\n } catch (error) {\n console.error(`Error parse \"${this.asn.type}\" attribute:`, error.message);\n\n this.value = Convert.ToHex(asnExtnValue) as T;\n }\n }\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport { CertificationRequest } from '@peculiar/asn1-csr';\nimport {\n id_pkcs9_at_extensionRequest,\n ExtensionRequest,\n} from '@peculiar/asn1-pkcs9';\nimport { Convert } from 'pvtsutils';\n\nimport { Download } from '../utils';\n\nimport { AsnData } from './asn_data';\nimport { Name, INameJSON } from './name';\nimport { Attribute, TAttributeValue } from './attribute';\nimport { Extension, TExtensionValue } from './extension';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\ninterface IPublicKey {\n algorithm: string;\n value: BufferSource;\n params?: ECParameters | RSAPublicKey;\n}\n\nexport class Pkcs10CertificateRequest extends AsnData<CertificationRequest> {\n public readonly subject: INameJSON[];\n\n public readonly version: number;\n\n public attributes: Attribute<TAttributeValue>[];\n\n public extensions: Extension<TExtensionValue>[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'PKCS#10 Certificate Request';\n\n public readonly tag = 'CERTIFICATE REQUEST';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), CertificationRequest);\n\n const { certificationRequestInfo } = this.asn;\n\n this.subject = new Name(certificationRequestInfo.subject).toJSON();\n this.version = certificationRequestInfo.version;\n }\n\n public get publicKey(): IPublicKey {\n const { subjectPublicKey, algorithm } = this.asn.certificationRequestInfo.subjectPKInfo;\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 const spki = AsnConvert.serialize(this.asn.certificationRequestInfo.subjectPKInfo);\n\n return {\n params,\n value: spki,\n algorithm: algorithm.algorithm,\n };\n }\n\n public get signature(): ISignature {\n const { signature, signatureAlgorithm } = this.asn;\n\n return {\n value: signature,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public get commonName(): string {\n if (!this.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 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 parseAttributes() {\n const { certificationRequestInfo } = this.asn;\n\n if (certificationRequestInfo.attributes) {\n this.attributes = certificationRequestInfo.attributes\n .map((e) => new Attribute(AsnConvert.serialize(e)));\n\n const extensionRequestAttribute = this.attributes.find(\n (attribute) => attribute.asn.type === id_pkcs9_at_extensionRequest,\n ) as Attribute<ExtensionRequest>;\n\n if (extensionRequestAttribute) {\n this.extensions = extensionRequestAttribute.value\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.csr.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.csr.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"version":3}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const certification_request = require('./certification_request-314859bb.js');
6
+ const certification_request = require('./certification_request-ad267278.js');
7
7
 
8
8
  /**
9
9
  * @license
@@ -158,4 +158,4 @@ class X509Certificate extends certification_request.AsnData {
158
158
 
159
159
  exports.X509Certificate = X509Certificate;
160
160
 
161
- //# sourceMappingURL=x509_certificate-0776e3ec.js.map
161
+ //# sourceMappingURL=x509_certificate-4b0894c2.js.map
@@ -1 +1 @@
1
- {"file":"x509_certificate-0776e3ec.js","mappings":";;;;;;;AAAA;;;;;;;MAgDa,eAAgB,SAAQA,6BAAoB;IAuBvD,YAAY,GAAW;QACrB,KAAK,CAACC,4CAAsB,CAAC,GAAG,CAAC,EAAEC,iCAAW,CAAC,CAAC;QAP3C,gBAAW,GAA2B,EAAE,CAAC;QAEhC,SAAI,GAAG,mBAAmB,CAAC;QAE3B,QAAG,GAAG,aAAa,CAAC;QAKlC,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QAEpC,IAAI,CAAC,YAAY,GAAGC,+BAAO,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;QAC/D,IAAI,CAAC,OAAO,GAAG,IAAIC,0BAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE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,OAAOhB,+BAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACrC;KACF;IAEM,aAAa,CAAC,IAAa;QAChCiB,8BAAQ,CAAC,IAAI,CAAC,KAAK,CACjB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpB,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;KACH;IAEM,aAAa,CAAC,IAAa;QAChCA,8BAAQ,CAAC,IAAI,CAAC,KAAK,CACjB,IAAI,CAAC,GAAG,EACR,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;KACH;;;;;","names":["AsnData","certificateRawToBuffer","Certificate","Convert","Name","dateDiff","Extension","AsnConvert","id_ecPublicKey","ECParameters","id_rsaEncryption","RSAPublicKey","id_composite_key","CompositePublicKey","id_alg_composite","CompositeSignatureValue","CompositeParams","getCertificateThumbprint","hexFormat","base64Format","Download"],"sources":["src/crypto/x509_certificate.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport {\n id_composite_key,\n id_alg_composite,\n CompositePublicKey,\n CompositeSignatureValue,\n CompositeParams,\n} from '@peculiar/asn1-x509-post-quantum';\nimport { Certificate, SubjectPublicKeyInfo } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\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 readonly type = 'X.509 Certificate';\n\n public readonly tag = '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 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 toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.cert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.cert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"version":3}
1
+ {"file":"x509_certificate-4b0894c2.js","mappings":";;;;;;;AAAA;;;;;;;MAgDa,eAAgB,SAAQA,6BAAoB;IAuBvD,YAAY,GAAW;QACrB,KAAK,CAACC,4CAAsB,CAAC,GAAG,CAAC,EAAEC,iCAAW,CAAC,CAAC;QAP3C,gBAAW,GAA2B,EAAE,CAAC;QAEhC,SAAI,GAAG,mBAAmB,CAAC;QAE3B,QAAG,GAAG,aAAa,CAAC;QAKlC,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QAEpC,IAAI,CAAC,YAAY,GAAGC,+BAAO,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;QAC/D,IAAI,CAAC,OAAO,GAAG,IAAIC,0BAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;QACzD,IAAI,CAAC,MAAM,GAAG,IAAIA,0BAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;QACvD,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC;QAE1C,MAAM,SAAS,GAAG,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO;eACtD,cAAc,CAAC,Q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a;QAChCA,8BAAQ,CAAC,IAAI,CAAC,KAAK,CACjB,IAAI,CAAC,GAAG,EACR,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;KACH;;;;;","names":["AsnData","certificateRawToBuffer","Certificate","Convert","Name","dateDiff","Extension","AsnConvert","id_ecPublicKey","ECParameters","id_rsaEncryption","RSAPublicKey","id_composite_key","CompositePublicKey","id_alg_composite","CompositeSignatureValue","CompositeParams","getCertificateThumbprint","hexFormat","base64Format","Download"],"sources":["src/crypto/x509_certificate.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport {\n id_composite_key,\n id_alg_composite,\n CompositePublicKey,\n CompositeSignatureValue,\n CompositeParams,\n} from '@peculiar/asn1-x509-post-quantum';\nimport { Certificate, SubjectPublicKeyInfo } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\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 readonly type = 'X.509 Certificate';\n\n public readonly tag = '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 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 toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.cert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.cert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"version":3}
@@ -3,8 +3,8 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const certification_request = require('./certification_request-314859bb.js');
7
- const pkcs10_certificate_request = require('./pkcs10_certificate_request-93c66ce7.js');
6
+ const certification_request = require('./certification_request-ad267278.js');
7
+ const pkcs10_certificate_request = require('./pkcs10_certificate_request-64898c88.js');
8
8
 
9
9
  /**
10
10
  * @license
@@ -176,4 +176,4 @@ class X509Crl extends certification_request.AsnData {
176
176
  exports.X509AttributeCertificate = X509AttributeCertificate;
177
177
  exports.X509Crl = X509Crl;
178
178
 
179
- //# sourceMappingURL=x509_crl-5326d209.js.map
179
+ //# sourceMappingURL=x509_crl-fc8d41a1.js.map
@@ -1 +1 @@
1
- {"file":"x509_crl-5326d209.js","mappings":";;;;;;;;AAAA;;;;;;;MA8Ba,wBAAyB,SAAQA,6BAA6B;IAyBzE,YAAY,GAAW;;QACrB,KAAK,CAACC,4CAAsB,CAAC,GAAG,CAAC,EAAEC,0CAAoB,CAAC,CAAC;QAXpD,gBAAW,GAA2B,EAAE,CAAC;QAMhC,SAAI,GAAG,6BAA6B,CAAC;QAErC,QAAG,GAAG,uBAAuB,CAAC;QAK5C,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QAE5B,IAAI,CAAC,YAAY,GAAGC,+BAAO,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACvD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAE9B,MAAM,SAAS,GAAG,MAAM,CAAC,sBAAsB,CAAC,aAAa,CAAC;QAE9D,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,IAAI,KAAK,CA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,KAAK;gBACR,OAAO,cAAc,IAAI,CAAC,GAAG,UAAUO,kCAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,cAAc,IAAI,CAAC,GAAG,OAAO,CAAC;YAC5G;gBACE,OAAOP,+BAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACrC;KACF;IAEM,aAAa,CAAC,IAAa;QAChCQ,8BAAQ,CAAC,GAAG,CAAC,KAAK,CAChB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpB,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;KACH;IAEM,aAAa,CAAC,IAAa;QAChCA,8BAAQ,CAAC,GAAG,CAAC,KAAK,CAChB,IAAI,CAAC,GAAG,EACR,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;KACH;;;;;;","names":["AsnData","certificateRawToBuffer","AttributeCertificate","Convert","dateDiff","Extension","AsnConvert","Attribute","getCertificateThumbprint","hexFormat","base64Format","Download","CertificateList","Name"],"sources":["src/crypto/x509_attribute_certificate.ts","src/crypto/x509_crl.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport type { GeneralName } from '@peculiar/asn1-x509';\nimport { AttributeCertificate, Holder } from '@peculiar/asn1-x509-attr';\nimport { Convert } from 'pvtsutils';\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 readonly type = 'X.509 Attribute Certificate';\n\n public readonly tag = '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 get commonName(): string {\n return `attribute-certificate-${this.thumbprints['SHA-1']}`;\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.attrCert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.attrCert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { CertificateList, Time } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\n\nimport { Download } from '../utils';\n\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport { Name, INameJSON } from './name';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\nexport interface IRevokedCertificate {\n userCertificate: ArrayBuffer;\n revocationDate: Time;\n crlEntryExtensions?: Extension<TExtensionValue>[];\n}\n\nexport class X509Crl extends AsnData<CertificateList> {\n public readonly issuer: INameJSON[];\n\n public readonly version: number;\n\n public readonly lastUpdate: Date;\n\n public readonly nextUpdate: Date;\n\n public extensions: Extension<TExtensionValue>[];\n\n public revokedCertificates: IRevokedCertificate[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'X.509 Certificate Revocation List';\n\n public readonly tag = 'X509 CRL';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), CertificateList);\n\n const { tbsCertList } = this.asn;\n\n this.issuer = new Name(tbsCertList.issuer).toJSON();\n this.version = tbsCertList.version + 1;\n this.lastUpdate = tbsCertList.thisUpdate.getTime();\n this.nextUpdate = tbsCertList.nextUpdate.getTime();\n\n this.revokedCertificates = (tbsCertList.revokedCertificates || [])\n .map((revokedCertificate) => ({\n revocationDate: revokedCertificate.revocationDate,\n userCertificate: revokedCertificate.userCertificate,\n crlEntryExtensions: revokedCertificate.crlEntryExtensions\n ?.map((e) => new Extension(AsnConvert.serialize(e))),\n }));\n }\n\n public async getThumbprint(\n algorithm: string = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get signature(): ISignature {\n const { signature, signatureAlgorithm } = this.asn;\n\n return {\n value: signature,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public get commonName(): string {\n if (!this.issuer) {\n return '';\n }\n\n for (let i = 0; i < this.issuer.length; i += 1) {\n const name = this.issuer[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public parseExtensions() {\n const { tbsCertList } = this.asn;\n\n if (tbsCertList.crlExtensions) {\n this.extensions = tbsCertList.crlExtensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.crl.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.crl.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"version":3}
1
+ {"file":"x509_crl-fc8d41a1.js","mappings":";;;;;;;;AAAA;;;;;;;MA8Ba,wBAAyB,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AE;gBAC/E,OAAO,IAAI,CAAC,KAAK,CAAC;aACnB;SACF;QAED,OAAO,EAAE,CAAC;KACX;IAEM,eAAe;QACpB,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QAEjC,IAAI,WAAW,CAAC,aAAa,EAAE;YAC7B,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC,aAAa;iBACxC,GAAG,CAAC,CAAC,CAAC,KAAK,IAAIE,+BAAS,CAACC,gCAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACvD;KACF;IAEM,QAAQ,CAAC,SAAmC,KAAK;QACtD,QAAQ,MAAM;YACZ,KAAK,KAAK;gBACR,OAAOG,+BAAS,CAACN,+BAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAC5C,KAAK,KAAK;gBACR,OAAO,cAAc,IAAI,CAAC,GAAG,UAAUO,kCAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,cAAc,IAAI,CAAC,GAAG,OAAO,CAAC;YAC5G;gBACE,OAAOP,+BAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACrC;KACF;IAEM,aAAa,CAAC,IAAa;QAChCQ,8BAAQ,CAAC,GAAG,CAAC,KAAK,CAChB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpB,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;KACH;IAEM,aAAa,CAAC,IAAa;QAChCA,8BAAQ,CAAC,GAAG,CAAC,KAAK,CAChB,IAAI,CAAC,GAAG,EACR,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB,CAAC;KACH;;;;;;","names":["AsnData","certificateRawToBuffer","AttributeCertificate","Convert","dateDiff","Extension","AsnConvert","Attribute","getCertificateThumbprint","hexFormat","base64Format","Download","CertificateList","Name"],"sources":["src/crypto/x509_attribute_certificate.ts","src/crypto/x509_crl.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport type { GeneralName } from '@peculiar/asn1-x509';\nimport { AttributeCertificate, Holder } from '@peculiar/asn1-x509-attr';\nimport { Convert } from 'pvtsutils';\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 readonly type = 'X.509 Attribute Certificate';\n\n public readonly tag = '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 get commonName(): string {\n return `attribute-certificate-${this.thumbprints['SHA-1']}`;\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.attrCert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.attrCert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { CertificateList, Time } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\n\nimport { Download } from '../utils';\n\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport { Name, INameJSON } from './name';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\nexport interface IRevokedCertificate {\n userCertificate: ArrayBuffer;\n revocationDate: Time;\n crlEntryExtensions?: Extension<TExtensionValue>[];\n}\n\nexport class X509Crl extends AsnData<CertificateList> {\n public readonly issuer: INameJSON[];\n\n public readonly version: number;\n\n public readonly lastUpdate: Date;\n\n public readonly nextUpdate: Date;\n\n public extensions: Extension<TExtensionValue>[];\n\n public revokedCertificates: IRevokedCertificate[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'X.509 Certificate Revocation List';\n\n public readonly tag = 'X509 CRL';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), CertificateList);\n\n const { tbsCertList } = this.asn;\n\n this.issuer = new Name(tbsCertList.issuer).toJSON();\n this.version = tbsCertList.version + 1;\n this.lastUpdate = tbsCertList.thisUpdate.getTime();\n this.nextUpdate = tbsCertList.nextUpdate.getTime();\n\n this.revokedCertificates = (tbsCertList.revokedCertificates || [])\n .map((revokedCertificate) => ({\n revocationDate: revokedCertificate.revocationDate,\n userCertificate: revokedCertificate.userCertificate,\n crlEntryExtensions: revokedCertificate.crlEntryExtensions\n ?.map((e) => new Extension(AsnConvert.serialize(e))),\n }));\n }\n\n public async getThumbprint(\n algorithm: string = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get signature(): ISignature {\n const { signature, signatureAlgorithm } = this.asn;\n\n return {\n value: signature,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public get commonName(): string {\n if (!this.issuer) {\n return '';\n }\n\n for (let i = 0; i < this.issuer.length; i += 1) {\n const name = this.issuer[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public parseExtensions() {\n const { tbsCertList } = this.asn;\n\n if (tbsCertList.crlExtensions) {\n this.extensions = tbsCertList.crlExtensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.crl.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.crl.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"version":3}
@@ -6763,6 +6763,71 @@ create$1(id_ecdsaWithSHA256);
6763
6763
  create$1(id_ecdsaWithSHA384);
6764
6764
  create$1(id_ecdsaWithSHA512);
6765
6765
 
6766
+ let FieldID = class FieldID {
6767
+ constructor(params = {}) {
6768
+ Object.assign(this, params);
6769
+ }
6770
+ };
6771
+ __decorate$1([
6772
+ AsnProp({ type: AsnPropTypes.ObjectIdentifier })
6773
+ ], FieldID.prototype, "fieldType", void 0);
6774
+ __decorate$1([
6775
+ AsnProp({ type: AsnPropTypes.Any })
6776
+ ], FieldID.prototype, "parameters", void 0);
6777
+ FieldID = __decorate$1([
6778
+ AsnType({ type: AsnTypeTypes.Sequence })
6779
+ ], FieldID);
6780
+ class ECPoint extends OctetString {
6781
+ }
6782
+ let Curve = class Curve {
6783
+ constructor(params = {}) {
6784
+ Object.assign(this, params);
6785
+ }
6786
+ };
6787
+ __decorate$1([
6788
+ AsnProp({ type: AsnPropTypes.OctetString })
6789
+ ], Curve.prototype, "a", void 0);
6790
+ __decorate$1([
6791
+ AsnProp({ type: AsnPropTypes.OctetString })
6792
+ ], Curve.prototype, "b", void 0);
6793
+ __decorate$1([
6794
+ AsnProp({ type: AsnPropTypes.BitString, optional: true })
6795
+ ], Curve.prototype, "seed", void 0);
6796
+ Curve = __decorate$1([
6797
+ AsnType({ type: AsnTypeTypes.Sequence })
6798
+ ], Curve);
6799
+ var ECPVer;
6800
+ (function (ECPVer) {
6801
+ ECPVer[ECPVer["ecpVer1"] = 1] = "ecpVer1";
6802
+ })(ECPVer || (ECPVer = {}));
6803
+ let SpecifiedECDomain = class SpecifiedECDomain {
6804
+ constructor(params = {}) {
6805
+ this.version = ECPVer.ecpVer1;
6806
+ Object.assign(this, params);
6807
+ }
6808
+ };
6809
+ __decorate$1([
6810
+ AsnProp({ type: AsnPropTypes.Integer })
6811
+ ], SpecifiedECDomain.prototype, "version", void 0);
6812
+ __decorate$1([
6813
+ AsnProp({ type: FieldID })
6814
+ ], SpecifiedECDomain.prototype, "fieldID", void 0);
6815
+ __decorate$1([
6816
+ AsnProp({ type: Curve })
6817
+ ], SpecifiedECDomain.prototype, "curve", void 0);
6818
+ __decorate$1([
6819
+ AsnProp({ type: ECPoint })
6820
+ ], SpecifiedECDomain.prototype, "base", void 0);
6821
+ __decorate$1([
6822
+ AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
6823
+ ], SpecifiedECDomain.prototype, "order", void 0);
6824
+ __decorate$1([
6825
+ AsnProp({ type: AsnPropTypes.Integer, optional: true })
6826
+ ], SpecifiedECDomain.prototype, "cofactor", void 0);
6827
+ SpecifiedECDomain = __decorate$1([
6828
+ AsnType({ type: AsnTypeTypes.Sequence })
6829
+ ], SpecifiedECDomain);
6830
+
6766
6831
  let ECParameters = class ECParameters {
6767
6832
  constructor(params = {}) {
6768
6833
  Object.assign(this, params);
@@ -6771,6 +6836,12 @@ let ECParameters = class ECParameters {
6771
6836
  __decorate$1([
6772
6837
  AsnProp({ type: AsnPropTypes.ObjectIdentifier })
6773
6838
  ], ECParameters.prototype, "namedCurve", void 0);
6839
+ __decorate$1([
6840
+ AsnProp({ type: AsnPropTypes.Null })
6841
+ ], ECParameters.prototype, "implicitCurve", void 0);
6842
+ __decorate$1([
6843
+ AsnProp({ type: SpecifiedECDomain })
6844
+ ], ECParameters.prototype, "specifiedCurve", void 0);
6774
6845
  ECParameters = __decorate$1([
6775
6846
  AsnType({ type: AsnTypeTypes.Choice })
6776
6847
  ], ECParameters);
@@ -12563,7 +12634,7 @@ __decorate$1([
12563
12634
  AsnProp({ type: CertificateSet, context: 0, implicit: true, optional: true })
12564
12635
  ], SignedData.prototype, "certificates", void 0);
12565
12636
  __decorate$1([
12566
- AsnProp({ type: RevocationInfoChoice, context: 1, implicit: true, optional: true })
12637
+ AsnProp({ type: RevocationInfoChoices, context: 1, implicit: true, optional: true })
12567
12638
  ], SignedData.prototype, "crls", void 0);
12568
12639
  __decorate$1([
12569
12640
  AsnProp({ type: SignerInfos })
@@ -12976,4 +13047,4 @@ __decorate$1([
12976
13047
 
12977
13048
  export { OIDs as $, AsnData as A, id_rsaEncryption as B, Convert_1 as C, Download as D, ExtensionRequest as E, getCertificateThumbprint as F, Extension as G, base64Format as H, InsuranceValue as I, hexFormat as J, Certificate as K, dateDiff as L, id_composite_key as M, Name as N, CompositePublicKey as O, id_alg_composite as P, CompositeSignatureValue as Q, RSAPublicKey as R, CompositeParams as S, TypeRelationship as T, UnstructuredName as U, ValuationRanking as V, WebGDPR as W, AttributeCertificate as X, CertificateList as Y, l10n as Z, dateShort as _, Attribute$1 as a, Name$1 as a0, CRLReason as a1, InvalidityDate as a2, CertificateIssuer as a3, OtherName as a4, DisplayText as a5, UserNotice as a6, BufferSourceConverter_1 as a7, EDIPartyName as a8, __decorate$1 as a9, QCStatements as aA, NetscapeComment as aB, NetscapeCertType as aC, LeiRole as aD, LeiChoice as aE, Timestamp as aF, ArchiveRevInfo as aG, SubjectDirectoryAttributes as aH, PrivateKeyUsagePeriod as aI, EntrustVersionInfo as aJ, BiometricSyntax as aK, LogotypeExtn as aL, TNAuthorizationList as aM, PolicyConstraints as aN, PolicyMappings as aO, CRLNumber as aP, IssuingDistributionPoint as aQ, NonStandardKeyDescription as aR, CabforganizationIdentifier as aS, AsnProp as aa, AsnPropTypes as ab, AsnType as ac, AsnTypeTypes as ad, AsnArray as ae, id_qcs_pkixQCSyntax_v2 as af, SemanticsInformation as ag, AsnIntegerArrayBufferConverter as ah, AttestationApplicationId as ai, RootOfTrust as aj, IntegerSet as ak, KeyUsage as al, BasicConstraints as am, ExtendedKeyUsage as an, SubjectKeyIdentifier as ao, AuthorityKeyIdentifier as ap, CRLDistributionPoints as aq, AuthorityInfoAccessSyntax as ar, SubjectInfoAccessSyntax as as, SubjectAlternativeName as at, CertificatePolicies as au, CertificateTransparency as av, NameConstraints as aw, CertificateTemplate as ax, EnrollCertTypeChoice as ay, CaVersion as az, AsnParser as b, DomainNameBeneficiary as c, downloadFromBuffer as d, id_DomainNameLegalRepresentative as e, DomainNameLegalRepresentative as f, id_DomainNameOwner as g, DomainNameOwner as h, id_DomainNameBeneficiary as i, id_DomainNameTechnicalOperator as j, DomainNameTechnicalOperator as k, id_TypeRelationship as l, id_ActivityDescription as m, ActivityDescription as n, id_WebGDPR as o, id_InsuranceValue as p, id_ValuationRanking as q, id_pkcs9_at_challengePassword as r, ChallengePassword as s, id_pkcs9_at_unstructuredName as t, id_pkcs9_at_extensionRequest as u, certificateRawToBuffer as v, CertificationRequest as w, id_ecPublicKey as x, AsnConvert as y, ECParameters as z };
12978
13049
 
12979
- //# sourceMappingURL=certification_request-b531916a.js.map
13050
+ //# sourceMappingURL=certification_request-a4699dcf.js.map