@peculiar/certificates-viewer 4.2.2 → 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 (142) hide show
  1. package/components/attribute-certificate-viewer.js +1 -1
  2. package/components/attribute-certificate-viewer.js.map +1 -1
  3. package/components/certificate-viewer.js +2 -2
  4. package/components/certificate-viewer.js.map +1 -1
  5. package/components/crl-viewer.js +2 -2
  6. package/components/crl-viewer.js.map +1 -1
  7. package/components/download.js +84 -18
  8. package/components/download.js.map +1 -1
  9. package/components/peculiar-certificate-decoder.js +12 -69
  10. package/components/peculiar-certificate-decoder.js.map +1 -1
  11. package/components/pkcs10_certificate_request.js +1 -1
  12. package/components/pkcs10_certificate_request.js.map +1 -1
  13. package/dist/cjs/{certification_request-815ec558.js → certification_request-ad267278.js} +84 -23
  14. package/dist/cjs/certification_request-ad267278.js.map +1 -0
  15. package/dist/cjs/index.cjs.js +2 -2
  16. package/dist/cjs/{miscellaneous-9a573276.js → miscellaneous-67439e59.js} +2 -2
  17. package/dist/cjs/{miscellaneous-9a573276.js.map → miscellaneous-67439e59.js.map} +1 -1
  18. package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +4 -4
  19. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +15 -72
  20. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -1
  21. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +3 -3
  22. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +2 -2
  23. package/dist/cjs/{pkcs10_certificate_request-0ebc0023.js → pkcs10_certificate_request-64898c88.js} +3 -3
  24. package/dist/cjs/pkcs10_certificate_request-64898c88.js.map +1 -0
  25. package/dist/cjs/{x509_certificate-9914b149.js → x509_certificate-4b0894c2.js} +3 -3
  26. package/dist/cjs/x509_certificate-4b0894c2.js.map +1 -0
  27. package/dist/cjs/{x509_crl-86b6e71d.js → x509_crl-fc8d41a1.js} +5 -5
  28. package/dist/cjs/x509_crl-fc8d41a1.js.map +1 -0
  29. package/dist/collection/components/certificate-decoder/certificate-decoder.js +12 -69
  30. package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
  31. package/dist/collection/constants/oids.js +3 -0
  32. package/dist/collection/constants/oids.js.map +1 -1
  33. package/dist/collection/crypto/pkcs10_certificate_request.js +1 -1
  34. package/dist/collection/crypto/pkcs10_certificate_request.js.map +1 -1
  35. package/dist/collection/crypto/x509_attribute_certificate.js +1 -1
  36. package/dist/collection/crypto/x509_attribute_certificate.js.map +1 -1
  37. package/dist/collection/crypto/x509_certificate.js +1 -1
  38. package/dist/collection/crypto/x509_certificate.js.map +1 -1
  39. package/dist/collection/crypto/x509_crl.js +1 -1
  40. package/dist/collection/crypto/x509_crl.js.map +1 -1
  41. package/dist/collection/utils/download.js +8 -8
  42. package/dist/collection/utils/download.js.map +1 -1
  43. package/dist/collection/utils/validator.js +0 -8
  44. package/dist/collection/utils/validator.js.map +1 -1
  45. package/dist/esm/{certification_request-08b4deb8.js → certification_request-a4699dcf.js} +85 -19
  46. package/dist/esm/certification_request-a4699dcf.js.map +1 -0
  47. package/dist/esm/index.js +2 -2
  48. package/dist/esm/{miscellaneous-d4bbc6f2.js → miscellaneous-ba1fd2bd.js} +2 -2
  49. package/dist/esm/{miscellaneous-d4bbc6f2.js.map → miscellaneous-ba1fd2bd.js.map} +1 -1
  50. package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +4 -4
  51. package/dist/esm/peculiar-certificate-decoder.entry.js +15 -72
  52. package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
  53. package/dist/esm/peculiar-certificate-viewer.entry.js +3 -3
  54. package/dist/esm/peculiar-certificates-viewer.entry.js +2 -2
  55. package/dist/esm/{pkcs10_certificate_request-3763c2af.js → pkcs10_certificate_request-785a4794.js} +3 -3
  56. package/dist/esm/pkcs10_certificate_request-785a4794.js.map +1 -0
  57. package/dist/esm/{x509_certificate-47b4c5ee.js → x509_certificate-05a23c0e.js} +3 -3
  58. package/dist/esm/x509_certificate-05a23c0e.js.map +1 -0
  59. package/dist/esm/{x509_crl-ba76d3ed.js → x509_crl-26081461.js} +5 -5
  60. package/dist/esm/x509_crl-26081461.js.map +1 -0
  61. package/dist/esm-es5/{certification_request-08b4deb8.js → certification_request-a4699dcf.js} +6 -6
  62. package/dist/esm-es5/certification_request-a4699dcf.js.map +1 -0
  63. package/dist/esm-es5/index.js +1 -1
  64. package/dist/esm-es5/{miscellaneous-d4bbc6f2.js → miscellaneous-ba1fd2bd.js} +2 -2
  65. package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +1 -1
  66. package/dist/esm-es5/peculiar-certificate-decoder.entry.js +2 -2
  67. package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -1
  68. package/dist/esm-es5/peculiar-certificate-viewer.entry.js +1 -1
  69. package/dist/esm-es5/peculiar-certificates-viewer.entry.js +1 -1
  70. package/dist/esm-es5/{pkcs10_certificate_request-3763c2af.js → pkcs10_certificate_request-785a4794.js} +3 -3
  71. package/dist/esm-es5/{pkcs10_certificate_request-3763c2af.js.map → pkcs10_certificate_request-785a4794.js.map} +1 -1
  72. package/dist/esm-es5/{x509_certificate-47b4c5ee.js → x509_certificate-05a23c0e.js} +3 -3
  73. package/dist/{peculiar/p-1818204e.system.js.map → esm-es5/x509_certificate-05a23c0e.js.map} +1 -1
  74. package/dist/esm-es5/{x509_crl-ba76d3ed.js → x509_crl-26081461.js} +4 -4
  75. package/dist/esm-es5/x509_crl-26081461.js.map +1 -0
  76. package/dist/peculiar/index.esm.js +1 -1
  77. package/dist/peculiar/{p-8db3e1fd.system.entry.js → p-1566ad92.system.entry.js} +2 -2
  78. package/dist/peculiar/{p-c10bfa6a.system.js → p-2bc2abea.system.js} +2 -2
  79. package/dist/peculiar/{p-6acca6ea.js → p-32807e5e.js} +12 -12
  80. package/dist/peculiar/p-32807e5e.js.map +1 -0
  81. package/dist/peculiar/{p-84e3e94a.entry.js → p-5d1d4a96.entry.js} +7 -7
  82. package/dist/peculiar/{p-f8efbe93.entry.js → p-67e82386.entry.js} +2 -2
  83. package/dist/peculiar/{p-b0c963b1.js → p-6e2ad7eb.js} +13 -13
  84. package/dist/peculiar/{p-4ee5140c.system.js → p-7ddd9a82.system.js} +3 -3
  85. package/dist/peculiar/{p-4ee5140c.system.js.map → p-7ddd9a82.system.js.map} +1 -1
  86. package/dist/peculiar/p-8393399a.system.js +1 -1
  87. package/dist/peculiar/{p-0f3787cf.system.entry.js → p-9263e7ee.system.entry.js} +2 -2
  88. package/dist/peculiar/{p-1818204e.system.js → p-98e3a016.system.js} +3 -3
  89. package/dist/{esm-es5/x509_certificate-47b4c5ee.js.map → peculiar/p-98e3a016.system.js.map} +1 -1
  90. package/dist/peculiar/p-9ad547d2.system.entry.js +5 -0
  91. package/dist/peculiar/p-9ad547d2.system.entry.js.map +1 -0
  92. package/dist/peculiar/{p-28b4d316.system.js → p-a1a48332.system.js} +2 -2
  93. package/dist/peculiar/{p-31d5da39.js → p-ab5a4988.js} +3 -3
  94. package/dist/peculiar/{p-31d5da39.js.map → p-ab5a4988.js.map} +1 -1
  95. package/dist/peculiar/{p-30e18f2d.system.js → p-ae44c2b0.system.js} +4 -4
  96. package/dist/peculiar/p-ae44c2b0.system.js.map +1 -0
  97. package/dist/peculiar/{p-9c8dc738.entry.js → p-bafd67f3.entry.js} +2 -2
  98. package/dist/peculiar/p-cd1b1876.entry.js +5 -0
  99. package/dist/peculiar/p-cd1b1876.entry.js.map +1 -0
  100. package/dist/peculiar/{p-82e4faf0.js → p-d5ba4fc2.js} +4 -4
  101. package/dist/peculiar/p-d5ba4fc2.js.map +1 -0
  102. package/dist/peculiar/p-e37e4df2.system.js +135 -0
  103. package/dist/peculiar/p-e37e4df2.system.js.map +1 -0
  104. package/dist/peculiar/{p-78a6b479.js → p-f8c91ee4.js} +4 -4
  105. package/dist/peculiar/{p-78a6b479.js.map → p-f8c91ee4.js.map} +1 -1
  106. package/dist/peculiar/{p-364df80d.system.entry.js → p-f9c07207.system.entry.js} +3 -3
  107. package/dist/peculiar/peculiar.esm.js +1 -1
  108. package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +1 -1
  109. package/dist/types/constants/oids.d.ts +3 -0
  110. package/dist/types/utils/download.d.ts +4 -4
  111. package/dist/types/utils/validator.d.ts +0 -4
  112. package/hydrate/index.js +98 -89
  113. package/package.json +22 -22
  114. package/dist/cjs/certification_request-815ec558.js.map +0 -1
  115. package/dist/cjs/pkcs10_certificate_request-0ebc0023.js.map +0 -1
  116. package/dist/cjs/x509_certificate-9914b149.js.map +0 -1
  117. package/dist/cjs/x509_crl-86b6e71d.js.map +0 -1
  118. package/dist/esm/certification_request-08b4deb8.js.map +0 -1
  119. package/dist/esm/pkcs10_certificate_request-3763c2af.js.map +0 -1
  120. package/dist/esm/x509_certificate-47b4c5ee.js.map +0 -1
  121. package/dist/esm/x509_crl-ba76d3ed.js.map +0 -1
  122. package/dist/esm-es5/certification_request-08b4deb8.js.map +0 -1
  123. package/dist/esm-es5/x509_crl-ba76d3ed.js.map +0 -1
  124. package/dist/peculiar/p-30e18f2d.system.js.map +0 -1
  125. package/dist/peculiar/p-6acca6ea.js.map +0 -1
  126. package/dist/peculiar/p-82005297.system.entry.js +0 -5
  127. package/dist/peculiar/p-82005297.system.entry.js.map +0 -1
  128. package/dist/peculiar/p-82e4faf0.js.map +0 -1
  129. package/dist/peculiar/p-c3fce3f5.entry.js +0 -5
  130. package/dist/peculiar/p-c3fce3f5.entry.js.map +0 -1
  131. package/dist/peculiar/p-df2c8826.system.js +0 -135
  132. package/dist/peculiar/p-df2c8826.system.js.map +0 -1
  133. /package/dist/esm-es5/{miscellaneous-d4bbc6f2.js.map → miscellaneous-ba1fd2bd.js.map} +0 -0
  134. /package/dist/peculiar/{p-8db3e1fd.system.entry.js.map → p-1566ad92.system.entry.js.map} +0 -0
  135. /package/dist/peculiar/{p-c10bfa6a.system.js.map → p-2bc2abea.system.js.map} +0 -0
  136. /package/dist/peculiar/{p-84e3e94a.entry.js.map → p-5d1d4a96.entry.js.map} +0 -0
  137. /package/dist/peculiar/{p-f8efbe93.entry.js.map → p-67e82386.entry.js.map} +0 -0
  138. /package/dist/peculiar/{p-b0c963b1.js.map → p-6e2ad7eb.js.map} +0 -0
  139. /package/dist/peculiar/{p-0f3787cf.system.entry.js.map → p-9263e7ee.system.entry.js.map} +0 -0
  140. /package/dist/peculiar/{p-28b4d316.system.js.map → p-a1a48332.system.js.map} +0 -0
  141. /package/dist/peculiar/{p-9c8dc738.entry.js.map → p-bafd67f3.entry.js.map} +0 -0
  142. /package/dist/peculiar/{p-364df80d.system.entry.js.map → p-f9c07207.system.entry.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["certificateDecoderCss","PeculiarCertificateDecoderStyle0","CertificateDecoder","this","handleClickDecode","value","inputPaste","decode","handleClickClear","clearValue","handleChangeInputFile","async","event","element","target","files","file","readAsBinaryString","handleChangeExample","handleDropFile","stopPropagation","preventDefault","dataTransfer","componentDidLoad","defaultCertificate","setTimeout","certificateDecoded","clearCertificate","emit","setValue","toString","successParse","certificate","Promise","resolve","X509Certificate","catch","X509AttributeCertificate","Pkcs10CertificateRequest","X509Crl","then","res","err","console","log","alert","render","h","Host","key","placeholder","class","ref","el","onDrop","Typography","variant","color","type","accept","onChange","_a","certificateExamples","length","map","example","title","Button","onClick","download"],"sources":["src/components/certificate-decoder/certificate-decoder.scss?tag=peculiar-certificate-decoder&encapsulation=shadow","src/components/certificate-decoder/certificate-decoder.tsx"],"sourcesContent":["@import '../../css/base.scss';\n\n:host {\n display: block;\n width: 100%;\n}\n\n.textarea {\n min-height: 300px;\n width: 100%;\n border-radius: 4px;\n border: 1px solid var(--pv-color-gray-5);;\n padding: 14px;\n font-family: monospace;\n resize: vertical;\n}\n\n.viewer {\n margin-top: var(--pv-size-base-12);\n}\n\n.controls {\n margin-top: var(--pv-size-base-2);\n display: flex;\n flex-direction: column;\n gap: var(--pv-size-base-2);\n}\n\n.control_row {\n display: flex;\n align-items: center;\n gap: var(--pv-size-base);\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Host,\n h,\n State,\n Prop,\n Event,\n EventEmitter,\n} from '@stencil/core';\n\nimport { readAsBinaryString } from '../../utils';\nimport {\n X509Certificate,\n X509AttributeCertificate,\n Pkcs10CertificateRequest,\n X509Crl,\n} from '../../crypto';\nimport { Button } from '../button';\nimport { Typography } from '../typography';\n\n@Component({\n tag: 'peculiar-certificate-decoder',\n styleUrl: 'certificate-decoder.scss',\n shadow: true,\n})\nexport class CertificateDecoder {\n private inputPaste?: HTMLTextAreaElement;\n\n /**\n * The example certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() certificateExamples?: {\n title: string;\n value: string;\n }[];\n\n /**\n * The default certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() defaultCertificate?: string;\n\n @State() certificateDecoded: X509Certificate\n | X509AttributeCertificate\n | Pkcs10CertificateRequest\n | X509Crl;\n\n /**\n * Emitted when the certificate has been successfully parsed.\n */\n @Event() successParse!: EventEmitter<string>;\n\n /**\n * Emitted when the certificate has been removed.\n */\n @Event() clearCertificate!: EventEmitter<void>;\n\n componentDidLoad() {\n if (this.defaultCertificate) {\n /**\n * Prevent Stencil warning about re-render\n */\n setTimeout(() => this.decode(this.defaultCertificate), 100);\n }\n }\n\n private handleClickDecode = () => {\n const { value } = this.inputPaste;\n\n if (value) {\n this.decode(value);\n }\n };\n\n private handleClickClear = () => {\n this.clearValue();\n };\n\n private handleChangeInputFile = async (event: any) => {\n const element = event.target;\n\n if (element.files) {\n const file = await readAsBinaryString(element.files[0]);\n\n if (typeof file.value === 'string') {\n this.decode(file.value);\n }\n\n element.value = '';\n }\n };\n\n private handleChangeExample = (event: any) => {\n if (event.target.value) {\n this.decode(event.target.value);\n } else {\n this.clearValue();\n }\n };\n\n private handleDropFile = async (event: any) => {\n event.stopPropagation();\n event.preventDefault();\n\n const element = event.dataTransfer;\n\n if (element.files) {\n const file = await readAsBinaryString(element.files[0]);\n\n if (typeof file.value === 'string') {\n this.decode(file.value);\n }\n }\n };\n\n clearValue() {\n this.inputPaste.value = '';\n this.certificateDecoded = null;\n this.clearCertificate.emit();\n }\n\n setValue(value: typeof this.certificateDecoded) {\n this.certificateDecoded = value;\n this.inputPaste.value = value.toString('pem');\n this.successParse.emit(value.toString('base64'));\n }\n\n decode(certificate: string) {\n new Promise((resolve) => {\n resolve(new X509Certificate(certificate));\n })\n .catch(() => new X509AttributeCertificate(certificate))\n .catch(() => new Pkcs10CertificateRequest(certificate))\n .catch(() => new X509Crl(certificate))\n .then((res: typeof this.certificateDecoded) => this.setValue(res))\n .catch((err) => {\n this.clearValue();\n\n console.log(err);\n alert('Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.');\n });\n }\n\n render() {\n return (\n <Host>\n <textarea\n placeholder=\"Certificate DER or PEM\"\n class=\"textarea t-b2 c-black\"\n ref={(el) => { this.inputPaste = el; }}\n onDrop={this.handleDropFile}\n />\n <div class=\"controls\">\n <div class=\"control_row\">\n <Typography\n variant=\"b3\"\n color=\"secondary-tint-2\"\n >\n Drag or load file:\n </Typography>\n <input\n type=\"file\"\n accept=\"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl\"\n onChange={this.handleChangeInputFile}\n value=\"\"\n />\n </div>\n {this.certificateExamples?.length && (\n <div class=\"control_row\">\n <Typography\n variant=\"b3\"\n color=\"secondary-tint-2\"\n >\n Load examples:\n </Typography>\n <select onChange={this.handleChangeExample}>\n <option value=\"\">None</option>\n {this.certificateExamples.map((example) => (\n <option value={example.value}>\n {example.title}\n </option>\n ))}\n </select>\n </div>\n )}\n <div class=\"control_row\">\n <Button\n onClick={this.handleClickDecode}\n >\n Decode\n </Button>\n <Button\n onClick={this.handleClickClear}\n >\n Clear\n </Button>\n </div>\n </div>\n {this.certificateDecoded instanceof X509Certificate && (\n <peculiar-certificate-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n {this.certificateDecoded instanceof X509AttributeCertificate && (\n <peculiar-attribute-certificate-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n {this.certificateDecoded instanceof Pkcs10CertificateRequest && (\n <peculiar-csr-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n {this.certificateDecoded instanceof X509Crl && (\n <peculiar-crl-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n </Host>\n );\n }\n}\n"],"mappings":";;;mRAAA,MAAMA,EAAwB,knQAC9B,MAAAC,EAAeD,E,MCgCFE,EAAkB,M,uHAwCrBC,KAAAC,kBAAoB,KAC1B,MAAMC,MAAEA,GAAUF,KAAKG,WAEvB,GAAID,EAAO,CACTF,KAAKI,OAAOF,E,GAIRF,KAAAK,iBAAmB,KACzBL,KAAKM,YAAY,EAGXN,KAAAO,sBAAwBC,MAAOC,IACrC,MAAMC,EAAUD,EAAME,OAEtB,GAAID,EAAQE,MAAO,CACjB,MAAMC,QAAaC,EAAmBJ,EAAQE,MAAM,IAEpD,UAAWC,EAAKX,QAAU,SAAU,CAClCF,KAAKI,OAAOS,EAAKX,M,CAGnBQ,EAAQR,MAAQ,E,GAIZF,KAAAe,oBAAuBN,IAC7B,GAAIA,EAAME,OAAOT,MAAO,CACtBF,KAAKI,OAAOK,EAAME,OAAOT,M,KACpB,CACLF,KAAKM,Y,GAIDN,KAAAgB,eAAiBR,MAAOC,IAC9BA,EAAMQ,kBACNR,EAAMS,iBAEN,MAAMR,EAAUD,EAAMU,aAEtB,GAAIT,EAAQE,MAAO,CACjB,MAAMC,QAAaC,EAAmBJ,EAAQE,MAAM,IAEpD,UAAWC,EAAKX,QAAU,SAAU,CAClCF,KAAKI,OAAOS,EAAKX,M,2GAr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qBACrB6B,EAAA,UAAQ1C,MAAM,IAAE,QACfF,KAAK2D,oBAAoBE,KAAKC,GAC7BlB,EAAA,UAAQ1C,MAAO4D,EAAQ5D,OACpB4D,EAAQC,WAMnBnB,EAAA,OAAAE,IAAA,2CAAKE,MAAM,eACTJ,EAACoB,EAAM,CAAAlB,IAAA,2CACLmB,QAASjE,KAAKC,mBAAiB,UAIjC2C,EAACoB,EAAM,CAAAlB,IAAA,2CACLmB,QAASjE,KAAKK,kBAAgB,WAMnCL,KAAKuB,8BAA8BS,GAClCY,EAAA,+BACEf,YAAa7B,KAAKuB,mBAClByB,MAAM,SACNkB,SAAQ,OAGXlE,KAAKuB,8BAA8BW,GAClCU,EAAA,yCACEf,YAAa7B,KAAKuB,mBAClByB,MAAM,SACNkB,SAAQ,OAGXlE,KAAKuB,8BAA8BY,GAClCS,EAAA,uBACEf,YAAa7B,KAAKuB,mBAClByB,MAAM,SACNkB,SAAQ,OAGXlE,KAAKuB,8BAA8Ba,GAClCQ,EAAA,uBACEf,YAAa7B,KAAKuB,mBAClByB,MAAM,SACNkB,SAAQ,O"}
@@ -1,19 +1,19 @@
1
1
  /*!
2
2
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
3
  */
4
- import{A as t,v as s,a0 as i,C as e,S as r,G as n,y as a,F as h,H as o,J as c,D as u,a1 as l,N as m}from"./p-6acca6ea.js";import{A as f}from"./p-78a6b479.js";
4
+ import{A as t,v as s,X as i,C as e,L as r,G as n,y as a,F as h,H as o,J as c,D as u,Y as l,N as f}from"./p-32807e5e.js";import{A as m}from"./p-f8c91ee4.js";
5
5
  /**
6
6
  * @license
7
7
  * Copyright (c) Peculiar Ventures, LLC.
8
8
  *
9
9
  * This source code is licensed under the MIT license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
- */class g extends t{constructor(t){var n;super(s(t),i);this.thumbprints={};this.type="X.509 Attribute Certificate";this.tag="ATTRIBUTE CERTIFICATE";const{acinfo:a}=this.asn;this.serialNumber=e.ToHex(a.serialNumber);this.version=a.version;const h=a.attrCertValidityPeriod.notBeforeTime;if(!h){throw new Error("Cannot get 'notBefore' value")}this.notBefore=h;const o=a.attrCertValidityPeriod.notAfterTime;if(!o){throw new Error("Cannot get 'notAfter' value")}this.notAfter=o;this.validity=r(this.notBefore,this.notAfter);this.issuer=a.issuer.v1Form||((n=a.issuer.v2Form)===null||n===void 0?void 0:n.issuerName);this.holder=a.holder}get signature(){const{signatureValue:t,signatureAlgorithm:s}=this.asn;return{value:t,algorithm:s.algorithm}}parseExtensions(){const{acinfo:t}=this.asn;if(t.extensions){this.extensions=t.extensions.map((t=>new n(a.serialize(t))))}}parseAttributes(){const{acinfo:t}=this.asn;if(t.attributes){this.attributes=t.attributes.map((t=>new f(a.serialize(t))))}}async getThumbprint(t="SHA-1"){try{const s=await h(t,this.raw);if(s){this.thumbprints[t]=e.ToHex(s)}}catch(t){console.error("Error thumbprint get:",t)}}get commonName(){return`attribute-certificate-${this.thumbprints["SHA-1"]}`}toString(t="pem"){switch(t){case"hex":return c(e.ToHex(this.raw));case"pem":return`-----BEGIN ${this.tag}-----\n${o(this.toString("base64"))}\n-----END ${this.tag}-----`;default:return e.ToBase64(this.raw)}}downloadAsPEM(t){u.attrCert.asPEM(this.toString("pem"),t||this.commonName)}downloadAsDER(t){u.attrCert.asDER(this.toString("hex"),t||this.commonName)}}
11
+ */class g extends t{constructor(t){var n;super(s(t),i);this.thumbprints={};this.type="X.509 Attribute Certificate";this.tag="ATTRIBUTE CERTIFICATE";const{acinfo:a}=this.asn;this.serialNumber=e.ToHex(a.serialNumber);this.version=a.version;const h=a.attrCertValidityPeriod.notBeforeTime;if(!h){throw new Error("Cannot get 'notBefore' value")}this.notBefore=h;const o=a.attrCertValidityPeriod.notAfterTime;if(!o){throw new Error("Cannot get 'notAfter' value")}this.notAfter=o;this.validity=r(this.notBefore,this.notAfter);this.issuer=a.issuer.v1Form||((n=a.issuer.v2Form)===null||n===void 0?void 0:n.issuerName);this.holder=a.holder}get signature(){const{signatureValue:t,signatureAlgorithm:s}=this.asn;return{value:t,algorithm:s.algorithm}}parseExtensions(){const{acinfo:t}=this.asn;if(t.extensions){this.extensions=t.extensions.map((t=>new n(a.serialize(t))))}}parseAttributes(){const{acinfo:t}=this.asn;if(t.attributes){this.attributes=t.attributes.map((t=>new m(a.serialize(t))))}}async getThumbprint(t="SHA-1"){try{const s=await h(t,this.raw);if(s){this.thumbprints[t]=e.ToHex(s)}}catch(t){console.error("Error thumbprint get:",t)}}get commonName(){return`attribute-certificate-${this.thumbprints["SHA-1"]}`}toString(t="pem"){switch(t){case"hex":return c(e.ToHex(this.raw));case"pem":return`-----BEGIN ${this.tag}-----\n${o(this.toString("base64"))}\n-----END ${this.tag}-----`;default:return e.ToBase64(this.raw)}}downloadAsPEM(t){u.attrCert.asPEM(this.toString("pem"),t||this.commonName)}downloadAsDER(t){u.attrCert.asDER(this.raw,t||this.commonName)}}
12
12
  /**
13
13
  * @license
14
14
  * Copyright (c) Peculiar Ventures, LLC.
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */class p extends t{constructor(t){super(s(t),l);this.thumbprints={};this.type="X.509 Certificate Revocation List";this.tag="X509 CRL";const{tbsCertList:i}=this.asn;this.issuer=new m(i.issuer).toJSON();this.version=i.version+1;this.lastUpdate=i.thisUpdate.getTime();this.nextUpdate=i.nextUpdate.getTime();this.revokedCertificates=(i.revokedCertificates||[]).map((t=>{var s;return{revocationDate:t.revocationDate,userCertificate:t.userCertificate,crlEntryExtensions:(s=t.crlEntryExtensions)===null||s===void 0?void 0:s.map((t=>new n(a.serialize(t))))}}))}async getThumbprint(t="SHA-1"){try{const s=await h(t,this.raw);if(s){this.thumbprints[t]=e.ToHex(s)}}catch(t){console.error("Error thumbprint get:",t)}}get signature(){const{signature:t,signatureAlgorithm:s}=this.asn;return{value:t,algorithm:s.algorithm}}get commonName(){if(!this.issuer){return""}for(let t=0;t<this.issuer.length;t+=1){const s=this.issuer[t];if(s.shortName==="CN"||s.shortName==="E"||s.shortName==="O"){return s.value}}return""}parseExtensions(){const{tbsCertList:t}=this.asn;if(t.crlExtensions){this.extensions=t.crlExtensions.map((t=>new n(a.serialize(t))))}}toString(t="pem"){switch(t){case"hex":return c(e.ToHex(this.raw));case"pem":return`-----BEGIN ${this.tag}-----\n${o(this.toString("base64"))}\n-----END ${this.tag}-----`;default:return e.ToBase64(this.raw)}}downloadAsPEM(t){u.crl.asPEM(this.toString("pem"),t||this.commonName)}downloadAsDER(t){u.crl.asDER(this.toString("hex"),t||this.commonName)}}export{g as X,p as a};
19
- //# sourceMappingURL=p-82e4faf0.js.map
18
+ */class p extends t{constructor(t){super(s(t),l);this.thumbprints={};this.type="X.509 Certificate Revocation List";this.tag="X509 CRL";const{tbsCertList:i}=this.asn;this.issuer=new f(i.issuer).toJSON();this.version=i.version+1;this.lastUpdate=i.thisUpdate.getTime();this.nextUpdate=i.nextUpdate.getTime();this.revokedCertificates=(i.revokedCertificates||[]).map((t=>{var s;return{revocationDate:t.revocationDate,userCertificate:t.userCertificate,crlEntryExtensions:(s=t.crlEntryExtensions)===null||s===void 0?void 0:s.map((t=>new n(a.serialize(t))))}}))}async getThumbprint(t="SHA-1"){try{const s=await h(t,this.raw);if(s){this.thumbprints[t]=e.ToHex(s)}}catch(t){console.error("Error thumbprint get:",t)}}get signature(){const{signature:t,signatureAlgorithm:s}=this.asn;return{value:t,algorithm:s.algorithm}}get commonName(){if(!this.issuer){return""}for(let t=0;t<this.issuer.length;t+=1){const s=this.issuer[t];if(s.shortName==="CN"||s.shortName==="E"||s.shortName==="O"){return s.value}}return""}parseExtensions(){const{tbsCertList:t}=this.asn;if(t.crlExtensions){this.extensions=t.crlExtensions.map((t=>new n(a.serialize(t))))}}toString(t="pem"){switch(t){case"hex":return c(e.ToHex(this.raw));case"pem":return`-----BEGIN ${this.tag}-----\n${o(this.toString("base64"))}\n-----END ${this.tag}-----`;default:return e.ToBase64(this.raw)}}downloadAsPEM(t){u.crl.asPEM(this.toString("pem"),t||this.commonName)}downloadAsDER(t){u.crl.asDER(this.raw,t||this.commonName)}}export{g as X,p as a};
19
+ //# sourceMappingURL=p-d5ba4fc2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["X509AttributeCertificate","AsnData","constructor","raw","super","certificateRawToBuffer","AttributeCertificate","this","thumbprints","type","tag","acinfo","asn","serialNumber","Convert","ToHex","version","notBefore","attrCertValidityPeriod","notBeforeTime","Error","notAfter","notAfterTime","validity","dateDiff","issuer","v1Form","_a","v2Form","issuerName","holder","signature","signatureValue","signatureAlgorithm","value","algorithm","parseExtensions","extensions","map","e","Extension","AsnConvert","serialize","parseAttributes","attributes","Attribute","getThumbprint","thumbprint","getCertificateThumbprint","error","console","commonName","toString","format","hexFormat","base64Format","ToBase64","downloadAsPEM","name","Download","attrCert","asPEM","downloadAsDER","asDER","X509Crl","CertificateList","tbsCertList","Name","toJSON","lastUpdate","thisUpdate","getTime","nextUpdate","revokedCertificates","revokedCertificate","revocationDate","userCertificate","crlEntryExtensions","i","length","shortName","crlExtensions","crl"],"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"],"mappings":";;;;;;;;;;SA8BaA,UAAiCC,EAyB5C,WA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