@peculiar/certificates-viewer 4.2.2 → 4.3.0
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.
- package/components/attribute-certificate-viewer.js +1 -1
- package/components/attribute-certificate-viewer.js.map +1 -1
- package/components/certificate-viewer.js +2 -2
- package/components/certificate-viewer.js.map +1 -1
- package/components/crl-viewer.js +2 -2
- package/components/crl-viewer.js.map +1 -1
- package/components/download.js +12 -17
- package/components/download.js.map +1 -1
- package/components/peculiar-certificate-decoder.js +12 -69
- package/components/peculiar-certificate-decoder.js.map +1 -1
- package/components/pkcs10_certificate_request.js +1 -1
- package/components/pkcs10_certificate_request.js.map +1 -1
- package/dist/cjs/{certification_request-815ec558.js → certification_request-314859bb.js} +12 -22
- package/dist/cjs/certification_request-314859bb.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{miscellaneous-9a573276.js → miscellaneous-f1bc3a4b.js} +2 -2
- package/dist/cjs/{miscellaneous-9a573276.js.map → miscellaneous-f1bc3a4b.js.map} +1 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +4 -4
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +15 -72
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +3 -3
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +2 -2
- package/dist/cjs/{pkcs10_certificate_request-0ebc0023.js → pkcs10_certificate_request-93c66ce7.js} +3 -3
- package/dist/cjs/pkcs10_certificate_request-93c66ce7.js.map +1 -0
- package/dist/cjs/{x509_certificate-9914b149.js → x509_certificate-0776e3ec.js} +3 -3
- package/dist/cjs/x509_certificate-0776e3ec.js.map +1 -0
- package/dist/cjs/{x509_crl-86b6e71d.js → x509_crl-5326d209.js} +5 -5
- package/dist/cjs/x509_crl-5326d209.js.map +1 -0
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +12 -69
- package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
- package/dist/collection/constants/oids.js +3 -0
- package/dist/collection/constants/oids.js.map +1 -1
- package/dist/collection/crypto/pkcs10_certificate_request.js +1 -1
- package/dist/collection/crypto/pkcs10_certificate_request.js.map +1 -1
- package/dist/collection/crypto/x509_attribute_certificate.js +1 -1
- package/dist/collection/crypto/x509_attribute_certificate.js.map +1 -1
- package/dist/collection/crypto/x509_certificate.js +1 -1
- package/dist/collection/crypto/x509_certificate.js.map +1 -1
- package/dist/collection/crypto/x509_crl.js +1 -1
- package/dist/collection/crypto/x509_crl.js.map +1 -1
- package/dist/collection/utils/download.js +8 -8
- package/dist/collection/utils/download.js.map +1 -1
- package/dist/collection/utils/validator.js +0 -8
- package/dist/collection/utils/validator.js.map +1 -1
- package/dist/esm/{certification_request-08b4deb8.js → certification_request-b531916a.js} +13 -18
- package/dist/esm/certification_request-b531916a.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/{miscellaneous-d4bbc6f2.js → miscellaneous-7fe71e3f.js} +2 -2
- package/dist/esm/{miscellaneous-d4bbc6f2.js.map → miscellaneous-7fe71e3f.js.map} +1 -1
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +4 -4
- package/dist/esm/peculiar-certificate-decoder.entry.js +15 -72
- package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-viewer.entry.js +3 -3
- package/dist/esm/peculiar-certificates-viewer.entry.js +2 -2
- package/dist/esm/{pkcs10_certificate_request-3763c2af.js → pkcs10_certificate_request-cca2ca68.js} +3 -3
- package/dist/esm/pkcs10_certificate_request-cca2ca68.js.map +1 -0
- package/dist/esm/{x509_certificate-47b4c5ee.js → x509_certificate-050175dd.js} +3 -3
- package/dist/esm/x509_certificate-050175dd.js.map +1 -0
- package/dist/esm/{x509_crl-ba76d3ed.js → x509_crl-c497f907.js} +5 -5
- package/dist/esm/x509_crl-c497f907.js.map +1 -0
- package/dist/esm-es5/{certification_request-08b4deb8.js → certification_request-b531916a.js} +5 -5
- package/dist/esm-es5/certification_request-b531916a.js.map +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{miscellaneous-d4bbc6f2.js → miscellaneous-7fe71e3f.js} +2 -2
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +1 -1
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js +2 -2
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificate-viewer.entry.js +1 -1
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js +1 -1
- package/dist/esm-es5/{pkcs10_certificate_request-3763c2af.js → pkcs10_certificate_request-cca2ca68.js} +3 -3
- package/dist/esm-es5/{pkcs10_certificate_request-3763c2af.js.map → pkcs10_certificate_request-cca2ca68.js.map} +1 -1
- package/dist/esm-es5/{x509_certificate-47b4c5ee.js → x509_certificate-050175dd.js} +3 -3
- package/dist/{peculiar/p-1818204e.system.js.map → esm-es5/x509_certificate-050175dd.js.map} +1 -1
- package/dist/esm-es5/{x509_crl-ba76d3ed.js → x509_crl-c497f907.js} +4 -4
- package/dist/esm-es5/x509_crl-c497f907.js.map +1 -0
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/{p-1818204e.system.js → p-05af3b74.system.js} +4 -4
- package/dist/{esm-es5/x509_certificate-47b4c5ee.js.map → peculiar/p-05af3b74.system.js.map} +1 -1
- package/dist/peculiar/{p-30e18f2d.system.js → p-163a3052.system.js} +5 -5
- package/dist/peculiar/p-163a3052.system.js.map +1 -0
- package/dist/peculiar/{p-364df80d.system.entry.js → p-2d9c40d6.system.entry.js} +2 -2
- package/dist/peculiar/p-494d26fb.entry.js +5 -0
- package/dist/peculiar/p-494d26fb.entry.js.map +1 -0
- package/dist/peculiar/{p-c10bfa6a.system.js → p-52f13c4a.system.js} +2 -2
- package/dist/peculiar/{p-82e4faf0.js → p-5a699274.js} +4 -4
- package/dist/peculiar/p-5a699274.js.map +1 -0
- package/dist/peculiar/p-6221d0a4.system.entry.js +5 -0
- package/dist/peculiar/p-6221d0a4.system.entry.js.map +1 -0
- package/dist/peculiar/{p-6acca6ea.js → p-666438a8.js} +11 -11
- package/dist/peculiar/p-666438a8.js.map +1 -0
- package/dist/peculiar/{p-84e3e94a.entry.js → p-7a5173be.entry.js} +7 -7
- package/dist/peculiar/{p-31d5da39.js → p-80477c05.js} +3 -3
- package/dist/peculiar/{p-31d5da39.js.map → p-80477c05.js.map} +1 -1
- package/dist/peculiar/p-8393399a.system.js +1 -1
- package/dist/peculiar/{p-9c8dc738.entry.js → p-8ff95ad8.entry.js} +2 -2
- package/dist/peculiar/{p-4ee5140c.system.js → p-a06f51a2.system.js} +3 -3
- package/dist/peculiar/{p-4ee5140c.system.js.map → p-a06f51a2.system.js.map} +1 -1
- package/dist/peculiar/{p-b0c963b1.js → p-adf16adb.js} +13 -13
- package/dist/peculiar/{p-78a6b479.js → p-b6d5e413.js} +4 -4
- package/dist/peculiar/{p-78a6b479.js.map → p-b6d5e413.js.map} +1 -1
- package/dist/peculiar/{p-8db3e1fd.system.entry.js → p-bd7fb688.system.entry.js} +2 -2
- package/dist/peculiar/{p-0f3787cf.system.entry.js → p-cc256004.system.entry.js} +2 -2
- package/dist/peculiar/p-d1066b51.system.js +135 -0
- package/dist/peculiar/p-d1066b51.system.js.map +1 -0
- package/dist/peculiar/{p-28b4d316.system.js → p-d6229f42.system.js} +2 -2
- package/dist/peculiar/{p-f8efbe93.entry.js → p-ddadcb44.entry.js} +2 -2
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +1 -1
- package/dist/types/constants/oids.d.ts +3 -0
- package/dist/types/utils/download.d.ts +4 -4
- package/dist/types/utils/validator.d.ts +0 -4
- package/hydrate/index.js +26 -88
- package/package.json +3 -3
- package/dist/cjs/certification_request-815ec558.js.map +0 -1
- package/dist/cjs/pkcs10_certificate_request-0ebc0023.js.map +0 -1
- package/dist/cjs/x509_certificate-9914b149.js.map +0 -1
- package/dist/cjs/x509_crl-86b6e71d.js.map +0 -1
- package/dist/esm/certification_request-08b4deb8.js.map +0 -1
- package/dist/esm/pkcs10_certificate_request-3763c2af.js.map +0 -1
- package/dist/esm/x509_certificate-47b4c5ee.js.map +0 -1
- package/dist/esm/x509_crl-ba76d3ed.js.map +0 -1
- package/dist/esm-es5/certification_request-08b4deb8.js.map +0 -1
- package/dist/esm-es5/x509_crl-ba76d3ed.js.map +0 -1
- package/dist/peculiar/p-30e18f2d.system.js.map +0 -1
- package/dist/peculiar/p-6acca6ea.js.map +0 -1
- package/dist/peculiar/p-82005297.system.entry.js +0 -5
- package/dist/peculiar/p-82005297.system.entry.js.map +0 -1
- package/dist/peculiar/p-82e4faf0.js.map +0 -1
- package/dist/peculiar/p-c3fce3f5.entry.js +0 -5
- package/dist/peculiar/p-c3fce3f5.entry.js.map +0 -1
- package/dist/peculiar/p-df2c8826.system.js +0 -135
- package/dist/peculiar/p-df2c8826.system.js.map +0 -1
- /package/dist/esm-es5/{miscellaneous-d4bbc6f2.js.map → miscellaneous-7fe71e3f.js.map} +0 -0
- /package/dist/peculiar/{p-364df80d.system.entry.js.map → p-2d9c40d6.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-c10bfa6a.system.js.map → p-52f13c4a.system.js.map} +0 -0
- /package/dist/peculiar/{p-84e3e94a.entry.js.map → p-7a5173be.entry.js.map} +0 -0
- /package/dist/peculiar/{p-9c8dc738.entry.js.map → p-8ff95ad8.entry.js.map} +0 -0
- /package/dist/peculiar/{p-b0c963b1.js.map → p-adf16adb.js.map} +0 -0
- /package/dist/peculiar/{p-8db3e1fd.system.entry.js.map → p-bd7fb688.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-0f3787cf.system.entry.js.map → p-cc256004.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-28b4d316.system.js.map → p-d6229f42.system.js.map} +0 -0
- /package/dist/peculiar/{p-f8efbe93.entry.js.map → p-ddadcb44.entry.js.map} +0 -0
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,r,a){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,c){function i(t){try{s(a.next(t))}catch(t){c(t)}}function n(t){try{s(a["throw"](t))}catch(t){c(t)}}function s(t){t.done?r(t.value):o(t.value).then(i,n)}s((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},a,o,c,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(t){return function(e){return s([t,e])}}function s(n){if(a)throw new TypeError("Generator is already executing.");while(i&&(i=0,n[0]&&(r=0)),r)try{if(a=1,o&&(c=n[0]&2?o["return"]:n[0]?o["throw"]||((c=o["return"])&&c.call(o),0):o.next)&&!(c=c.call(o,n[1])).done)return c;if(o=0,c)n=[n[0]&2,c.value];switch(n[0]){case 0:case 1:c=n;break;case 4:r.label++;return{value:n[1],done:false};case 5:r.label++;o=n[1];n=[0];continue;case 7:n=r.ops.pop();r.trys.pop();continue;default:if(!(c=r.trys,c=c.length>0&&c[c.length-1])&&(n[0]===6||n[0]===2)){r=0;continue}if(n[0]===3&&(!c||n[1]>c[0]&&n[1]<c[3])){r.label=n[1];break}if(n[0]===6&&r.label<c[1]){r.label=c[1];c=n;break}if(c&&r.label<c[2]){r.label=c[2];r.ops.push(n);break}if(c[2])r.ops.pop();r.trys.pop();continue}n=e.call(t,r)}catch(t){n=[6,t];o=0}finally{a=c=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};
|
|
2
|
-
/*!
|
|
3
|
-
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
4
|
-
*/System.register(["./p-821bdcdc.system.js","./p-df2c8826.system.js","./p-55303453.system.js","./p-1818204e.system.js","./p-30e18f2d.system.js","./p-4ee5140c.system.js","./p-9712b827.system.js"],(function(t){"use strict";var e,r,a,o,c,i,n,s,v,p,l,h,f,d,b,g;return{setters:[function(t){e=t.r;r=t.c;a=t.h;o=t.H},function(t){c=t.K;i=t.L;n=t.M;s=t.O;v=t.P},function(t){p=t.a},function(t){l=t.X},function(t){h=t.X;f=t.a},function(t){d=t.P},function(t){b=t.T;g=t.B}],execute:function(){var u="*{-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)}";var y=u;var w=t("peculiar_certificate_decoder",function(){function t(t){var a=this;e(this,t);this.successParse=r(this,"successParse",7);this.clearCertificate=r(this,"clearCertificate",7);this.handleClickDecode=function(){var t=a.inputPaste.value;if(t){a.decode(t)}};this.handleClickClear=function(){a.clearValue()};this.handleChangeInputFile=function(t){return __awaiter(a,void 0,void 0,(function(){var e,r;return __generator(this,(function(a){switch(a.label){case 0:e=t.target;if(!e.files)return[3,2];return[4,p(e.files[0])];case 1:r=a.sent();if(typeof r.value==="string"){this.decode(r.value)}e.value="";a.label=2;case 2:return[2]}}))}))};this.handleChangeExample=function(t){if(t.target.value){a.decode(t.target.value)}else{a.clearValue()}};this.handleDropFile=function(t){return __awaiter(a,void 0,void 0,(function(){var e,r;return __generator(this,(function(a){switch(a.label){case 0:t.stopPropagation();t.preventDefault();e=t.dataTransfer;if(!e.files)return[3,2];return[4,p(e.files[0])];case 1:r=a.sent();if(typeof r.value==="string"){this.decode(r.value)}a.label=2;case 2:return[2]}}))}))};this.certificateExamples=undefined;this.defaultCertificate=undefined;this.certificateDecoded=undefined}t.prototype.componentDidLoad=function(){var t=this;if(this.defaultCertificate){setTimeout((function(){return t.decode(t.defaultCertificate)}),100)}};t.prototype.clearValue=function(){this.inputPaste.value="";this.certificateDecoded=null;this.clearCertificate.emit()};t.prototype.setValue=function(t){this.certificateDecoded=t;this.inputPaste.value=t.toString("pem");this.successParse.emit(t.toString("base64"))};t.prototype.decode=function(t){var e=c(t);var r=i(t);var a=n(t);var o=s(t);var p=v(t);var b;var g;if(e&&!(r||o||a||p)){this.clearValue();alert("Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.");return}try{if(r){b=new l(t)}if(o){b=new h(t)}if(a){b=new d(t)}if(p){b=new f(t)}}catch(t){g=t}if(!b){try{b=new l(t)}catch(t){g=t}}if(!b){try{b=new h(t)}catch(t){g=t}}if(!b){try{b=new d(t)}catch(t){g=t}}if(!b){try{b=new f(t)}catch(t){g=t}}if(!b){this.clearValue();console.log(g);alert("Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.")}else{this.setValue(b)}};t.prototype.render=function(){var t=this;var e;return a(o,{key:"7e7738b6552c8bcecc62850e7cffd915b94dc144"},a("textarea",{key:"fce9e435a476f015ac9fcafba23cb6cd338734b9",placeholder:"Certificate DER or PEM",class:"textarea t-b2 c-black",ref:function(e){t.inputPaste=e},onDrop:this.handleDropFile}),a("div",{key:"5fbb94920b5226a81ca57c9ebf489f081684f282",class:"controls"},a("div",{key:"828ff9a65a035dafa43b8bca8f7746682b86afac",class:"control_row"},a(b,{key:"80b75774669e2f54dda2fbdbd87cb5a6932f43fc",variant:"b3",color:"secondary-tint-2"},"Drag or load file:"),a("input",{key:"fb281f25973807c84fda36dd52c99c1fe6c62398",type:"file",accept:"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl",onChange:this.handleChangeInputFile,value:""})),((e=this.certificateExamples)===null||e===void 0?void 0:e.length)&&a("div",{class:"control_row"},a(b,{variant:"b3",color:"secondary-tint-2"},"Load examples:"),a("select",{onChange:this.handleChangeExample},a("option",{value:""},"None"),this.certificateExamples.map((function(t){return a("option",{value:t.value},t.title)})))),a("div",{key:"a975c8f848d0c2dd2dd1e74d558051a3a28c99e7",class:"control_row"},a(g,{key:"4979abadf98b879c32751d5454d00bb4323a306b",onClick:this.handleClickDecode},"Decode"),a(g,{key:"2f1118d241db412e56a00bf449acbc24853efff9",onClick:this.handleClickClear},"Clear"))),this.certificateDecoded instanceof l&&a("peculiar-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof h&&a("peculiar-attribute-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof d&&a("peculiar-csr-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof f&&a("peculiar-crl-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}))};return t}());w.style=y}}}));
|
|
5
|
-
//# sourceMappingURL=p-82005297.system.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["certificateDecoderCss","PeculiarCertificateDecoderStyle0","CertificateDecoder","exports","this","handleClickDecode","value","_this","inputPaste","decode","handleClickClear","clearValue","handleChangeInputFile","event","__awaiter","element","target","files","readAsBinaryString","file","_b","sent","handleChangeExample","handleDropFile","stopPropagation","preventDefault","dataTransfer","class_1","prototype","componentDidLoad","defaultCertificate","setTimeout","certificateDecoded","clearCertificate","emit","setValue","toString","successParse","certificate","isPem","validator.isPem","isX509Pem","validator.isX509Pem","isPkcs10Pem","validator.isPkcs10Pem","isX509AttributePem","validator.isX509AttributePem","isX509CRLPem","validator.isX509CRLPem","decoded","decodeError","alert","X509Certificate","X509AttributeCertificate","Pkcs10CertificateRequest","X509Crl","error","console","log","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 { validator, 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: X509Certificate | X509AttributeCertificate | Pkcs10CertificateRequest | X509Crl) {\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 const isPem = validator.isPem(certificate);\n const isX509Pem = validator.isX509Pem(certificate);\n const isPkcs10Pem = validator.isPkcs10Pem(certificate);\n const isX509AttributePem = validator.isX509AttributePem(certificate);\n const isX509CRLPem = validator.isX509CRLPem(certificate);\n let decoded: X509Certificate | X509AttributeCertificate | Pkcs10CertificateRequest | X509Crl;\n let decodeError: Error;\n\n if (isPem && !(isX509Pem || isX509AttributePem || isPkcs10Pem || isX509CRLPem)) {\n this.clearValue();\n\n alert('Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.');\n\n return;\n }\n\n try {\n if (isX509Pem) {\n decoded = new X509Certificate(certificate);\n }\n\n if (isX509AttributePem) {\n decoded = new X509AttributeCertificate(certificate);\n }\n\n if (isPkcs10Pem) {\n decoded = new Pkcs10CertificateRequest(certificate);\n }\n\n if (isX509CRLPem) {\n decoded = new X509Crl(certificate);\n }\n } catch (error) {\n decodeError = error;\n }\n\n if (!decoded) {\n try {\n decoded = new X509Certificate(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n try {\n decoded = new X509AttributeCertificate(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n try {\n decoded = new Pkcs10CertificateRequest(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n try {\n decoded = new X509Crl(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n this.clearValue();\n\n console.log(decodeError);\n alert('Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.');\n } else {\n this.setValue(decoded);\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":";;;ieAAA,IAAMA,EAAwB,knQAC9B,IAAAC,EAAeD,E,ICgCFE,EAAkBC,EAAA,0C,iIAwCrBC,KAAAC,kBAAoB,WAClB,IAAAC,EAAUC,EAAKC,WAAUF,MAEjC,GAAIA,EAAO,CACTC,EAAKE,OAAOH,E,GAIRF,KAAAM,iBAAmB,WACzBH,EAAKI,Y,EAGCP,KAAAQ,sBAAwB,SAAOC,GAAU,OAAAC,UAAAP,OAAA,qB,oEACzCQ,EAAUF,EAAMG,O,IAElBD,EAAQE,MAAR,YACW,SAAMC,EAAmBH,EAAQE,MAAM,K,OAA9CE,EAAOC,EAAAC,OAEb,UAAWF,EAAKb,QAAU,SAAU,CAClCF,KAAKK,OAAOU,EAAKb,M,CAGnBS,EAAQT,MAAQ,G,mCAIZF,KAAAkB,oBAAsB,SAACT,GAC7B,GAAIA,EAAMG,OAAOV,MAAO,CACtBC,EAAKE,OAAOI,EAAMG,OAAOV,M,KACpB,CACLC,EAAKI,Y,GAIDP,KAAAmB,eAAiB,SAAOV,GAAU,OAAAC,UAAAP,OAAA,qB,oEACxCM,EAAMW,kBACNX,EAAMY,iBAEAV,EAAUF,EAAMa,a,IAElBX,EAAQE,MAAR,YACW,SAAMC,EAAmBH,EAAQE,MAAM,K,OAA9CE,EAAOC,EAAAC,OAEb,UAAWF,EAAKb,QAAU,SAAU,CAClCF,KAAKK,OAAOU,EAAKb,M,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,OAGX9E,KAAK4B,8BAA8BqB,GAClCO,EAAA,yCACEtB,YAAalC,KAAK4B,mBAClBgC,MAAM,SACNkB,SAAQ,OAGX9E,KAAK4B,8BAA8BsB,GAClCM,EAAA,uBACEtB,YAAalC,KAAK4B,mBAClBgC,MAAM,SACNkB,SAAQ,OAGX9E,KAAK4B,8BAA8BuB,GAClCK,EAAA,uBACEtB,YAAalC,KAAK4B,mBAClBgC,MAAM,SACNkB,SAAQ,O,WApQW,I"}
|
|
@@ -1 +0,0 @@
|
|
|
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.toString('hex'),\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.toString('hex'),\n name || this.commonName,\n );\n }\n}\n"],"mappings":";;;;;;;;;;SA8BaA,UAAiCC,EAyB5C,WAAAC,CAAYC,G,MACVC,MAAMC,EAAuBF,GAAMG,GAX9BC,KAAAC,YAAsC,GAM7BD,KAAAE,KAAO,8BAEPF,KAAAG,IAAM,wBAKpB,MAAMC,OAAEA,GAAWJ,KAAKK,IAExBL,KAAKM,aAAeC,EAAQC,MAAMJ,EAAOE,cACzCN,KAAKS,QAAUL,EAAOK,QAEtB,MAAMC,EAAYN,EAAOO,uBAAuBC,cAEhD,IAAKF,EAAW,CACd,MAAM,IAAIG,MAAM,+B,CAGlBb,KAAKU,UAAYA,EAEjB,MAAMI,EAAWV,EAAOO,uBAAuBI,aAE/C,IAAKD,EAAU,CACb,MAAM,IAAID,MAAM,8B,CAGlBb,KAAKc,SAAWA,EAChBd,KAAKgB,SAAWC,EAASjB,KAAKU,UAAWV,KAAKc,UAC9Cd,KAAKkB,OAASd,EAAOc,OAAOC,UAAUC,EAAAhB,EAAOc,OAAOG,UAAM,MAAAD,SAAA,SAAAA,EAAEE,YAC5DtB,KAAKuB,OAASnB,EAAOmB,M,CAGvB,aAAWC,GACT,MAAMC,eAAEA,EAAcC,mBAAEA,GAAuB1B,KAAKK,IAEpD,MAAO,CACLsB,MAAOF,EACPG,UAAWF,EAAmBE,U,CAI3B,eAAAC,GACL,MAAMzB,OAAEA,GAAWJ,KAAKK,IAExB,GAAID,EAAO0B,WAAY,CACrB9B,KAAK8B,WAAa1B,EAAO0B,WACtBC,KAAKC,GAAM,IAAIC,EAAUC,EAAWC,UAAUH,K,EAI9C,eAAAI,GACL,MAAMhC,OAAEA,GAAWJ,KAAKK,IAExB,GAAID,EAAOiC,WAAY,CACrBrC,KAAKqC,WAAajC,EAAOiC,WACtBN,KAAKC,GAAM,IA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,KAAK4C,W"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,c as e,h as a,H as r}from"./p-3cb79cd9.js";import{K as o,L as c,M as s,O as i,P as n}from"./p-6acca6ea.js";import{a as v}from"./p-25a532a3.js";import{X as p}from"./p-31d5da39.js";import{X as l,a as h}from"./p-82e4faf0.js";import{P as d}from"./p-78a6b479.js";import{T as b,B as g}from"./p-4bc5ddbe.js";const f="*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%}.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)}";const y=f;const x=class{constructor(a){t(this,a);this.successParse=e(this,"successParse",7);this.clearCertificate=e(this,"clearCertificate",7);this.handleClickDecode=()=>{const{value:t}=this.inputPaste;if(t){this.decode(t)}};this.handleClickClear=()=>{this.clearValue()};this.handleChangeInputFile=async t=>{const e=t.target;if(e.files){const t=await v(e.files[0]);if(typeof t.value==="string"){this.decode(t.value)}e.value=""}};this.handleChangeExample=t=>{if(t.target.value){this.decode(t.target.value)}else{this.clearValue()}};this.handleDropFile=async t=>{t.stopPropagation();t.preventDefault();const e=t.dataTransfer;if(e.files){const t=await v(e.files[0]);if(typeof t.value==="string"){this.decode(t.value)}}};this.certificateExamples=undefined;this.defaultCertificate=undefined;this.certificateDecoded=undefined}componentDidLoad(){if(this.defaultCertificate){setTimeout((()=>this.decode(this.defaultCertificate)),100)}}clearValue(){this.inputPaste.value="";this.certificateDecoded=null;this.clearCertificate.emit()}setValue(t){this.certificateDecoded=t;this.inputPaste.value=t.toString("pem");this.successParse.emit(t.toString("base64"))}decode(t){const e=o(t);const a=c(t);const r=s(t);const v=i(t);const b=n(t);let g;let f;if(e&&!(a||v||r||b)){this.clearValue();alert("Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.");return}try{if(a){g=new p(t)}if(v){g=new l(t)}if(r){g=new d(t)}if(b){g=new h(t)}}catch(t){f=t}if(!g){try{g=new p(t)}catch(t){f=t}}if(!g){try{g=new l(t)}catch(t){f=t}}if(!g){try{g=new d(t)}catch(t){f=t}}if(!g){try{g=new h(t)}catch(t){f=t}}if(!g){this.clearValue();console.log(f);alert("Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.")}else{this.setValue(g)}}render(){var t;return a(r,{key:"7e7738b6552c8bcecc62850e7cffd915b94dc144"},a("textarea",{key:"fce9e435a476f015ac9fcafba23cb6cd338734b9",placeholder:"Certificate DER or PEM",class:"textarea t-b2 c-black",ref:t=>{this.inputPaste=t},onDrop:this.handleDropFile}),a("div",{key:"5fbb94920b5226a81ca57c9ebf489f081684f282",class:"controls"},a("div",{key:"828ff9a65a035dafa43b8bca8f7746682b86afac",class:"control_row"},a(b,{key:"80b75774669e2f54dda2fbdbd87cb5a6932f43fc",variant:"b3",color:"secondary-tint-2"},"Drag or load file:"),a("input",{key:"fb281f25973807c84fda36dd52c99c1fe6c62398",type:"file",accept:"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl",onChange:this.handleChangeInputFile,value:""})),((t=this.certificateExamples)===null||t===void 0?void 0:t.length)&&a("div",{class:"control_row"},a(b,{variant:"b3",color:"secondary-tint-2"},"Load examples:"),a("select",{onChange:this.handleChangeExample},a("option",{value:""},"None"),this.certificateExamples.map((t=>a("option",{value:t.value},t.title))))),a("div",{key:"a975c8f848d0c2dd2dd1e74d558051a3a28c99e7",class:"control_row"},a(g,{key:"4979abadf98b879c32751d5454d00bb4323a306b",onClick:this.handleClickDecode},"Decode"),a(g,{key:"2f1118d241db412e56a00bf449acbc24853efff9",onClick:this.handleClickClear},"Clear"))),this.certificateDecoded instanceof p&&a("peculiar-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof l&&a("peculiar-attribute-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof d&&a("peculiar-csr-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof h&&a("peculiar-crl-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}))}};x.style=y;export{x as peculiar_certificate_decoder};
|
|
5
|
-
//# sourceMappingURL=p-c3fce3f5.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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","isPem","validator.isPem","isX509Pem","validator.isX509Pem","isPkcs10Pem","validator.isPkcs10Pem","isX509AttributePem","validator.isX509AttributePem","isX509CRLPem","validator.isX509CRLPem","decoded","decodeError","alert","X509Certificate","X509AttributeCertificate","Pkcs10CertificateRequest","X509Crl","error","console","log","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 { validator, 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: X509Certificate | X509AttributeCertificate | Pkcs10CertificateRequest | X509Crl) {\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 const isPem = validator.isPem(certificate);\n const isX509Pem = validator.isX509Pem(certificate);\n const isPkcs10Pem = validator.isPkcs10Pem(certificate);\n const isX509AttributePem = validator.isX509AttributePem(certificate);\n const isX509CRLPem = validator.isX509CRLPem(certificate);\n let decoded: X509Certificate | X509AttributeCertificate | Pkcs10CertificateRequest | X509Crl;\n let decodeError: Error;\n\n if (isPem && !(isX509Pem || isX509AttributePem || isPkcs10Pem || isX509CRLPem)) {\n this.clearValue();\n\n alert('Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.');\n\n return;\n }\n\n try {\n if (isX509Pem) {\n decoded = new X509Certificate(certificate);\n }\n\n if (isX509AttributePem) {\n decoded = new X509AttributeCertificate(certificate);\n }\n\n if (isPkcs10Pem) {\n decoded = new Pkcs10CertificateRequest(certificate);\n }\n\n if (isX509CRLPem) {\n decoded = new X509Crl(certificate);\n }\n } catch (error) {\n decodeError = error;\n }\n\n if (!decoded) {\n try {\n decoded = new X509Certificate(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n try {\n decoded = new X509AttributeCertificate(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n try {\n decoded = new Pkcs10CertificateRequest(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n try {\n decoded = new X509Crl(certificate);\n } catch (error) {\n decodeError = error;\n }\n }\n\n if (!decoded) {\n this.clearValue();\n\n console.log(decodeError);\n alert('Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.');\n } else {\n this.setValue(decoded);\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":";;;2TAAA,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,2GArDvB,gBAAAkB,GACE,GAAIpB,KAAKqB,mBAAoB,CAI3BC,YAAW,IAAMtB,KAAKI,OAAOJ,KAAKqB,qBAAqB,I,EAqD3D,UAAAf,GACEN,KAAKG,WAAWD,MAAQ,GACxBF,KAAKuB,mBAAqB,KAC1BvB,KAAKwB,iBAAiBC,M,CAGxB,QAAAC,CAASxB,GACPF,KAAKuB,mBAAqBrB,EAC1BF,KAAKG,WAAWD,MAAQA,EAAMyB,SAAS,OACvC3B,KAAK4B,aAAaH,KAAKvB,E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