@peculiar/certificates-viewer 4.7.0 → 4.7.1-alpha.4
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 +4 -2
- package/components/attribute-certificate-viewer.js.map +1 -1
- package/components/attribute.js +1 -1
- package/components/certificate-viewer.js +3 -2
- package/components/certificate-viewer.js.map +1 -1
- package/components/crl-viewer.js +4 -2
- package/components/crl-viewer.js.map +1 -1
- package/components/csr-viewer.js +1 -1
- package/components/download.js +1674 -45
- package/components/download.js.map +1 -1
- package/components/index2.js +3 -2
- package/components/index2.js.map +1 -1
- package/components/issuer_name.js +1 -1
- package/components/miscellaneous.js +4 -79
- package/components/miscellaneous.js.map +1 -1
- package/components/peculiar-certificate-decoder.js +32 -16
- package/components/peculiar-certificate-decoder.js.map +1 -1
- package/components/peculiar-certificates-viewer.js +1 -1
- package/components/peculiar-ssh-certificate-viewer.d.ts +11 -0
- package/components/peculiar-ssh-certificate-viewer.js +12 -0
- package/components/peculiar-ssh-certificate-viewer.js.map +1 -0
- package/components/peculiar-text-hider.js +1 -32
- package/components/peculiar-text-hider.js.map +1 -1
- package/components/pkcs10_certificate_request.js +2 -1
- package/components/pkcs10_certificate_request.js.map +1 -1
- package/components/row.js +87 -0
- package/components/row.js.map +1 -0
- package/components/ssh-certificate-viewer.js +210 -0
- package/components/ssh-certificate-viewer.js.map +1 -0
- package/components/subject_name.js +2 -2
- package/components/text-hider.js +40 -0
- package/components/text-hider.js.map +1 -0
- package/components/utils.js +39 -0
- package/components/utils.js.map +1 -0
- package/dist/cjs/extension-DTtJlxk8.js +110 -0
- package/dist/cjs/{extension-CGZpfI3W.js.map → extension-DTtJlxk8.js.map} +1 -1
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{miscellaneous-D_RAtkZz.js → miscellaneous-DCeacaAw.js} +147 -147
- package/dist/cjs/{miscellaneous-D_RAtkZz.js.map → miscellaneous-DCeacaAw.js.map} +1 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.cjs.js.map +1 -0
- package/dist/cjs/{peculiar-attribute-certificate-viewer_4.cjs.entry.js → peculiar-attribute-certificate-viewer_5.cjs.entry.js} +215 -45
- package/dist/cjs/peculiar-attribute-certificate-viewer_5.cjs.entry.js.map +1 -0
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +25 -21
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-decoder.entry.cjs.js.map +1 -1
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +4 -4
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +23 -23
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificates-viewer.entry.cjs.js.map +1 -1
- package/dist/cjs/peculiar.cjs.js +1 -1
- package/dist/cjs/pkcs10_certificate_request-DE-0eDXE.js +146 -0
- package/dist/cjs/{pkcs10_certificate_request-BQkkkT42.js.map → pkcs10_certificate_request-DE-0eDXE.js.map} +1 -1
- package/dist/cjs/{certification_request-DISQwgjn.js → ssh_certificate-D2q_p49O.js} +1676 -16
- package/dist/cjs/ssh_certificate-D2q_p49O.js.map +1 -0
- package/dist/cjs/{x509_certificate-DGRpZGA2.js → x509_certificate-Cto1q-eu.js} +29 -29
- package/dist/cjs/{x509_certificate-DGRpZGA2.js.map → x509_certificate-Cto1q-eu.js.map} +1 -1
- package/dist/cjs/{x509_crl-DMvJk_81.js → x509_crl-CgixMZrh.js} +32 -32
- package/dist/cjs/{x509_crl-DMvJk_81.js.map → x509_crl-CgixMZrh.js.map} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +10 -6
- package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
- package/dist/collection/components/ssh-certificate-viewer/-components/basic_information.js +29 -0
- package/dist/collection/components/ssh-certificate-viewer/-components/basic_information.js.map +1 -0
- package/dist/collection/components/ssh-certificate-viewer/-components/miscellaneous.js +23 -0
- package/dist/collection/components/ssh-certificate-viewer/-components/miscellaneous.js.map +1 -0
- package/dist/collection/components/ssh-certificate-viewer/-components/public_key.js +26 -0
- package/dist/collection/components/ssh-certificate-viewer/-components/public_key.js.map +1 -0
- package/dist/collection/components/ssh-certificate-viewer/-components/signature_key.js +26 -0
- package/dist/collection/components/ssh-certificate-viewer/-components/signature_key.js.map +1 -0
- package/dist/collection/components/ssh-certificate-viewer/ssh-certificate-viewer.js +194 -0
- package/dist/collection/components/ssh-certificate-viewer/ssh-certificate-viewer.js.map +1 -0
- package/dist/collection/crypto/index.js +1 -0
- package/dist/collection/crypto/index.js.map +1 -1
- package/dist/collection/crypto/ssh_certificate.js +74 -0
- package/dist/collection/crypto/ssh_certificate.js.map +1 -0
- package/dist/collection/locales/en.json +6 -1
- package/dist/collection/utils/download.js +5 -0
- package/dist/collection/utils/download.js.map +1 -1
- package/dist/esm/{extension-CUOKUt7o.js → extension-DmlhftES.js} +3 -3
- package/dist/{esm-es5/extension-CUOKUt7o.js.map → esm/extension-DmlhftES.js.map} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{miscellaneous-DVlekgVM.js → miscellaneous-BTlqwN5_.js} +4 -4
- package/dist/esm/{miscellaneous-DVlekgVM.js.map → miscellaneous-BTlqwN5_.js.map} +1 -1
- package/dist/esm/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -0
- package/dist/esm/{peculiar-attribute-certificate-viewer_4.entry.js → peculiar-attribute-certificate-viewer_5.entry.js} +185 -16
- package/dist/esm/peculiar-attribute-certificate-viewer_5.entry.js.map +1 -0
- package/dist/esm/peculiar-certificate-decoder.entry.js +14 -10
- package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-viewer.entry.js +4 -4
- package/dist/esm/peculiar-certificates-viewer.entry.js +3 -3
- package/dist/esm/peculiar.js +1 -1
- package/dist/esm/{pkcs10_certificate_request-B9Q42jiE.js → pkcs10_certificate_request-B5C1NYFc.js} +3 -3
- package/dist/esm/{pkcs10_certificate_request-B9Q42jiE.js.map → pkcs10_certificate_request-B5C1NYFc.js.map} +1 -1
- package/dist/esm/{certification_request-CSS3OhZq.js → ssh_certificate-PCn0WXhQ.js} +1676 -17
- package/dist/esm/ssh_certificate-PCn0WXhQ.js.map +1 -0
- package/dist/esm/{x509_certificate-fWXLCtc8.js → x509_certificate-BiAmXJ4S.js} +4 -4
- package/dist/esm/{x509_certificate-fWXLCtc8.js.map → x509_certificate-BiAmXJ4S.js.map} +1 -1
- package/dist/esm/{x509_crl-Dq33Vv-q.js → x509_crl-CCeoLLUZ.js} +5 -5
- package/dist/esm/{x509_crl-Dq33Vv-q.js.map → x509_crl-CCeoLLUZ.js.map} +1 -1
- package/dist/esm-es5/{extension-CUOKUt7o.js → extension-DmlhftES.js} +2 -2
- package/dist/{esm/extension-CUOKUt7o.js.map → esm-es5/extension-DmlhftES.js.map} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +2 -2
- package/dist/esm-es5/{miscellaneous-DVlekgVM.js → miscellaneous-BTlqwN5_.js} +2 -2
- package/dist/esm-es5/{miscellaneous-DVlekgVM.js.map → miscellaneous-BTlqwN5_.js.map} +1 -1
- package/dist/esm-es5/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -0
- package/dist/esm-es5/{peculiar-attribute-certificate-viewer_4.entry.js → peculiar-attribute-certificate-viewer_5.entry.js} +31 -3
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_5.entry.js.map +1 -0
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js +1 -1
- 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/peculiar.js +1 -1
- package/dist/esm-es5/{pkcs10_certificate_request-B9Q42jiE.js → pkcs10_certificate_request-B5C1NYFc.js} +2 -2
- package/dist/esm-es5/{pkcs10_certificate_request-B9Q42jiE.js.map → pkcs10_certificate_request-B5C1NYFc.js.map} +1 -1
- package/dist/esm-es5/{certification_request-CSS3OhZq.js → ssh_certificate-PCn0WXhQ.js} +8 -8
- package/dist/esm-es5/ssh_certificate-PCn0WXhQ.js.map +1 -0
- package/dist/esm-es5/{x509_certificate-fWXLCtc8.js → x509_certificate-BiAmXJ4S.js} +4 -4
- package/dist/esm-es5/{x509_certificate-fWXLCtc8.js.map → x509_certificate-BiAmXJ4S.js.map} +1 -1
- package/dist/esm-es5/{x509_crl-Dq33Vv-q.js → x509_crl-CCeoLLUZ.js} +2 -2
- package/dist/esm-es5/{x509_crl-Dq33Vv-q.js.map → x509_crl-CCeoLLUZ.js.map} +1 -1
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/locales/en.json +6 -1
- package/dist/peculiar/{p-17ebc78c.system.entry.js → p-24861cf6.system.entry.js} +2 -2
- package/dist/peculiar/{p-a193f8fd.system.entry.js → p-46c17c8d.system.entry.js} +2 -2
- package/dist/peculiar/{p-a4e74904.entry.js → p-71cb31c6.entry.js} +47 -19
- package/dist/peculiar/p-71cb31c6.entry.js.map +1 -0
- package/dist/peculiar/{p-4cc72a56.entry.js → p-71eab586.entry.js} +2 -2
- package/dist/peculiar/p-7273601a.entry.js +5 -0
- package/dist/peculiar/p-7273601a.entry.js.map +1 -0
- package/dist/peculiar/p-83bfd8e5.system.entry.js +5 -0
- package/dist/peculiar/p-83bfd8e5.system.entry.js.map +1 -0
- package/dist/peculiar/{p-e3967e76.entry.js → p-98219569.entry.js} +2 -2
- package/dist/peculiar/p-9MJeDspO.system.js.map +1 -0
- package/dist/peculiar/p-AjXipXSl.system.js +12 -0
- package/dist/peculiar/{p-CgCUixvk.system.js.map → p-AjXipXSl.system.js.map} +1 -1
- package/dist/peculiar/{p-CEzxVCEh.system.js → p-B2FH4Pv2.system.js} +2 -2
- package/dist/peculiar/{p-CEzxVCEh.system.js.map → p-B2FH4Pv2.system.js.map} +1 -1
- package/dist/peculiar/{p-DcTXA-2R.system.js → p-B5GO6_Ut.system.js} +18 -18
- package/dist/peculiar/{p-DcTXA-2R.system.js.map → p-B5GO6_Ut.system.js.map} +1 -1
- package/dist/peculiar/{p-Bsy7Sqzl.system.js.map → p-B82-c-xr.system.js.map} +1 -1
- package/dist/peculiar/p-BGASC3UX.system.js +1 -1
- package/dist/peculiar/p-BHpSDBz_.system.js.map +1 -0
- package/dist/peculiar/p-BwlcJAh0.js +12 -0
- package/dist/peculiar/{p-CZuaTO2G.js.map → p-BwlcJAh0.js.map} +1 -1
- package/dist/peculiar/{p-D8TC0Na9.system.js.map → p-CSz5liuX.system.js.map} +1 -1
- package/dist/peculiar/{p-tl0v45Y7.js → p-CstRxc9v.js} +2 -2
- package/dist/peculiar/{p-tl0v45Y7.js.map → p-CstRxc9v.js.map} +1 -1
- package/dist/peculiar/p-DMDALRLP.system.js +135 -0
- package/dist/peculiar/p-DMDALRLP.system.js.map +1 -0
- package/dist/peculiar/{p-DTz3NA_M.system.js → p-DPbpwYQ8.system.js} +3 -3
- package/dist/peculiar/{p-DTz3NA_M.system.js.map → p-DPbpwYQ8.system.js.map} +1 -1
- package/dist/peculiar/{p-CoPYW15U.js → p-Db41gPxb.js} +4 -4
- package/dist/peculiar/{p-CoPYW15U.js.map → p-Db41gPxb.js.map} +1 -1
- package/dist/peculiar/{p-DKooqn40.js → p-DnOLjFJP.js} +39 -39
- package/dist/peculiar/{p-DKooqn40.js.map → p-DnOLjFJP.js.map} +1 -1
- package/dist/peculiar/{p-CSS3OhZq.js → p-PCn0WXhQ.js} +13 -13
- package/dist/peculiar/p-PCn0WXhQ.js.map +1 -0
- package/dist/peculiar/{p-7fTYvx_V.system.js → p-SjVQtfgD.system.js} +5 -5
- package/dist/peculiar/{p-7fTYvx_V.system.js.map → p-SjVQtfgD.system.js.map} +1 -1
- package/dist/peculiar/{p-e7c60082.system.entry.js → p-cc01a2da.system.entry.js} +47 -19
- package/dist/peculiar/p-cc01a2da.system.entry.js.map +1 -0
- package/dist/peculiar/{p-BTn-wukS.system.js → p-dOkqMp-O.system.js} +2 -2
- package/dist/peculiar/p-dOkqMp-O.system.js.map +1 -0
- package/dist/peculiar/{p-BG_D4qzJ.js → p-h7XP7otl.js} +3 -3
- package/dist/peculiar/{p-BG_D4qzJ.js.map → p-h7XP7otl.js.map} +1 -1
- package/dist/peculiar/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.esm.js.map +1 -0
- package/dist/peculiar/peculiar-certificate-decoder.entry.esm.js.map +1 -1
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +4 -4
- package/dist/types/components/ssh-certificate-viewer/-components/basic_information.d.ts +21 -0
- package/dist/types/components/ssh-certificate-viewer/-components/miscellaneous.d.ts +14 -0
- package/dist/types/components/ssh-certificate-viewer/-components/public_key.d.ts +14 -0
- package/dist/types/components/ssh-certificate-viewer/-components/signature_key.d.ts +14 -0
- package/dist/types/components/ssh-certificate-viewer/ssh-certificate-viewer.d.ts +43 -0
- package/dist/types/components.d.ts +43 -0
- package/dist/types/crypto/index.d.ts +1 -0
- package/dist/types/crypto/ssh_certificate.d.ts +30 -0
- package/dist/types/utils/download.d.ts +3 -0
- package/dist/types/utils/l10n.d.ts +5 -0
- package/hydrate/index.js +1869 -27
- package/hydrate/index.mjs +1869 -27
- package/package.json +3 -2
- package/dist/cjs/certification_request-DISQwgjn.js.map +0 -1
- package/dist/cjs/extension-CGZpfI3W.js +0 -110
- package/dist/cjs/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.cjs.js.map +0 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer_4.cjs.entry.js.map +0 -1
- package/dist/cjs/pkcs10_certificate_request-BQkkkT42.js +0 -146
- package/dist/esm/certification_request-CSS3OhZq.js.map +0 -1
- package/dist/esm/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.js.map +0 -1
- package/dist/esm/peculiar-attribute-certificate-viewer_4.entry.js.map +0 -1
- package/dist/esm-es5/certification_request-CSS3OhZq.js.map +0 -1
- package/dist/esm-es5/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.js.map +0 -1
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_4.entry.js.map +0 -1
- package/dist/peculiar/p-BTn-wukS.system.js.map +0 -1
- package/dist/peculiar/p-CSS3OhZq.js.map +0 -1
- package/dist/peculiar/p-CZuaTO2G.js +0 -12
- package/dist/peculiar/p-CgCUixvk.system.js +0 -12
- package/dist/peculiar/p-DLsQGkmT.system.js.map +0 -1
- package/dist/peculiar/p-D_WeukQa.system.js +0 -135
- package/dist/peculiar/p-D_WeukQa.system.js.map +0 -1
- package/dist/peculiar/p-a4e74904.entry.js.map +0 -1
- package/dist/peculiar/p-ce006f1c.system.entry.js +0 -5
- package/dist/peculiar/p-ce006f1c.system.entry.js.map +0 -1
- package/dist/peculiar/p-e7c60082.system.entry.js.map +0 -1
- package/dist/peculiar/p-f465afe6.entry.js +0 -5
- package/dist/peculiar/p-f465afe6.entry.js.map +0 -1
- package/dist/peculiar/p-tBL0ekYY.system.js.map +0 -1
- package/dist/peculiar/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.esm.js.map +0 -1
- /package/dist/peculiar/{p-17ebc78c.system.entry.js.map → p-24861cf6.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-a193f8fd.system.entry.js.map → p-46c17c8d.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-4cc72a56.entry.js.map → p-71eab586.entry.js.map} +0 -0
- /package/dist/peculiar/{p-e3967e76.entry.js.map → p-98219569.entry.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __extends=this&&this.__extends||function(){var t=function(n,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r))t[r]=n[r]};return t(n,r)};return function(n,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(n,r);function e(){this.constructor=n}n.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}}();var __awaiter=this&&this.__awaiter||function(t,n,r,e){function i(t){return t instanceof r?t:new r((function(n){n(t)}))}return new(r||(r=Promise))((function(r,u){function o(t){try{f(e.next(t))}catch(t){u(t)}}function a(t){try{f(e["throw"](t))}catch(t){u(t)}}function f(t){t.done?r(t.value):i(t.value).then(o,a)}f((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var r={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},e,i,u,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(t){return function(n){return f([t,n])}}function f(a){if(e)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(r=0)),r)try{if(e=1,i&&(u=a[0]&2?i["return"]:a[0]?i["throw"]||((u=i["return"])&&u.call(i),0):i.next)&&!(u=u.call(i,a[1])).done)return u;if(i=0,u)a=[a[0]&2,u.value];switch(a[0]){case 0:case 1:u=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;i=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(u=r.trys,u=u.length>0&&u[u.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!u||a[1]>u[0]&&a[1]<u[3])){r.label=a[1];break}if(a[0]===6&&r.label<u[1]){r.label=u[1];u=a;break}if(u&&r.label<u[2]){r.label=u[2];r.ops.push(a);break}if(u[2])r.ops.pop();r.trys.pop();continue}a=n.call(t,r)}catch(t){a=[6,t];i=0}finally{e=u=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
4
|
-
*/System.register(["./p-
|
|
4
|
+
*/System.register(["./p-DMDALRLP.system.js","./p-AjXipXSl.system.js"],(function(t){"use strict";var n,r,e,i,u,o,a,f,c,s,h,l,v,b,m,w,g,y,p,_;return{setters:[function(t){n=t.A;r=t.c;e=t.C;i=t.P;u=t.b;o=t.N;a=t.a;f=t.e;c=t.i;s=t.E;h=t.f;l=t.R;v=t.g;b=t.h;m=t.j;w=t.k;g=t.l;y=t.m;p=t.D},function(t){_=t.E}],execute:function(){
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -9,5 +9,5 @@ var __extends=this&&this.__extends||function(){var t=function(n,r){t=Object.setP
|
|
|
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
11
|
*/
|
|
12
|
-
var O=function(t){__extends(n,t);function n(n){var f=t.call(this,r(n),e)||this;f.thumbprints={};f.type="X.509 Certificate";f.tag=i.CertificateTag;var c=f.asn.tbsCertificate;f.serialNumber=u.Convert.ToHex(c.serialNumber);f.subject=new o(c.subject).toJSON();f.issuer=new o(c.issuer).toJSON();f.version=c.version+1;var s=c.validity.notBefore.utcTime||c.validity.notBefore.generalTime;if(!s){throw new Error("Cannot get 'notBefore' value")}f.notBefore=s;var h=c.validity.notAfter.utcTime||c.validity.notAfter.generalTime;if(!h){throw new Error("Cannot get 'notAfter' value")}f.notAfter=h;f.validity=a(f.notBefore,f.notAfter);return f}n.prototype.parseExtensions=function(){var t=this.asn.tbsCertificate;if(t.extensions){this.extensions=t.extensions.map((function(t){return new
|
|
13
|
-
//# sourceMappingURL=p-
|
|
12
|
+
var O=function(t){__extends(n,t);function n(n){var f=t.call(this,r(n),e)||this;f.thumbprints={};f.type="X.509 Certificate";f.tag=i.CertificateTag;var c=f.asn.tbsCertificate;f.serialNumber=u.Convert.ToHex(c.serialNumber);f.subject=new o(c.subject).toJSON();f.issuer=new o(c.issuer).toJSON();f.version=c.version+1;var s=c.validity.notBefore.utcTime||c.validity.notBefore.generalTime;if(!s){throw new Error("Cannot get 'notBefore' value")}f.notBefore=s;var h=c.validity.notAfter.utcTime||c.validity.notAfter.generalTime;if(!h){throw new Error("Cannot get 'notAfter' value")}f.notAfter=h;f.validity=a(f.notBefore,f.notAfter);return f}n.prototype.parseExtensions=function(){var t=this.asn.tbsCertificate;if(t.extensions){this.extensions=t.extensions.map((function(t){return new _(f.serialize(t))}))}};n.prototype.getPublicKeyInfo=function(t){var n=this;var r=t.subjectPublicKey,e=t.algorithm;var i;if(e.algorithm===c&&e.parameters){i=f.parse(e.parameters,s)}if(e.algorithm===h){i=f.parse(r,l)}if(e.algorithm===v){i=f.parse(r,b);i=i.map((function(t){return n.getPublicKeyInfo(t)}))}var u=f.serialize(t);return{params:i,value:u,algorithm:e.algorithm}};Object.defineProperty(n.prototype,"publicKey",{get:function(){return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo)},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"signature",{get:function(){var t=this.asn,n=t.signatureValue,r=t.signatureAlgorithm;var e;if(r.algorithm===m){var i=f.parse(n,w);var u=f.parse(r.parameters,g);e=u.map((function(t,n){return Object.assign(Object.assign({},t),{value:i[n]})}))}return{params:e,value:n,algorithm:r.algorithm}},enumerable:false,configurable:true});n.prototype.getThumbprint=function(){return __awaiter(this,arguments,void 0,(function(t){var n,r;if(t===void 0){t="SHA-1"}return __generator(this,(function(e){switch(e.label){case 0:e.trys.push([0,2,,3]);return[4,y(t,this.raw)];case 1:n=e.sent();if(n){this.thumbprints[t]=u.Convert.ToHex(n)}return[3,3];case 2:r=e.sent();console.error("Error thumbprint get:",r);return[3,3];case 3:return[2]}}))}))};Object.defineProperty(n.prototype,"commonName",{get:function(){if(!this.subject){return""}for(var t=0;t<this.subject.length;t+=1){var n=this.subject[t];if(n.shortName==="CN"||n.shortName==="E"||n.shortName==="O"){return n.value}}return""},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"issuerCommonName",{get:function(){if(!this.issuer){return""}for(var t=0;t<this.issuer.length;t+=1){var n=this.issuer[t];if(n.shortName==="CN"||n.shortName==="E"||n.shortName==="O"){return n.value}}return""},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"isRoot",{get:function(){return JSON.stringify(this.issuer)===JSON.stringify(this.subject)},enumerable:false,configurable:true});n.prototype.subjectToString=function(){if(!this.subject){return""}return this.subject.map((function(t){return"".concat(t.shortName,"=").concat(t.value)})).join(", ")};n.prototype.issuerToString=function(){if(!this.issuer){return""}return this.issuer.map((function(t){return"".concat(t.shortName,"=").concat(t.value)})).join(", ")};n.prototype.toString=function(t){if(t===void 0){t="pem"}switch(t){case"pem":return i.encode(this.raw,this.tag);case"base64url":return u.Convert.ToBase64Url(this.raw);default:return u.Convert.ToBase64(this.raw)}};n.prototype.downloadAsPEM=function(t){p.cert.asPEM(this.toString("pem"),t||this.commonName)};n.prototype.downloadAsDER=function(t){p.cert.asDER(this.raw,t||this.commonName)};return n}(n);t("X",O)}}}));
|
|
13
|
+
//# sourceMappingURL=p-DPbpwYQ8.system.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-DTz3NA_M.system.js","sources":["src/crypto/x509_certificate.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport {\n id_composite_key,\n id_alg_composite,\n CompositePublicKey,\n CompositeSignatureValue,\n CompositeParams,\n} from '@peculiar/asn1-x509-post-quantum';\nimport { Certificate, SubjectPublicKeyInfo } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\nimport { dateDiff, Download } from '../utils';\nimport { Name, INameJSON } from './name';\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport { PemConverter } from './pem_converter';\nimport {\n certificateRawToBuffer,\n getCertificateThumbprint,\n} from './utils';\n\nexport interface ISignature {\n algorithm: string;\n value: BufferSource;\n params?: {\n algorithm: string;\n value: BufferSource;\n }[];\n}\n\nexport interface IPublicKey {\n algorithm: string;\n value: BufferSource;\n params?: ECParameters | RSAPublicKey | IPublicKey[];\n}\n\nexport class X509Certificate extends AsnData<Certificate> {\n public readonly serialNumber: string;\n\n public readonly subject: INameJSON[];\n\n public readonly issuer: INameJSON[];\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public readonly version: number;\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'X.509 Certificate';\n\n public readonly tag = PemConverter.CertificateTag;\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), Certificate);\n\n const { tbsCertificate } = this.asn;\n\n this.serialNumber = Convert.ToHex(tbsCertificate.serialNumber);\n this.subject = new Name(tbsCertificate.subject).toJSON();\n this.issuer = new Name(tbsCertificate.issuer).toJSON();\n this.version = tbsCertificate.version + 1;\n\n const notBefore = tbsCertificate.validity.notBefore.utcTime\n || tbsCertificate.validity.notBefore.generalTime;\n\n if (!notBefore) {\n throw new Error('Cannot get \\'notBefore\\' value');\n }\n\n this.notBefore = notBefore;\n\n const notAfter = tbsCertificate.validity.notAfter.utcTime\n || tbsCertificate.validity.notAfter.generalTime;\n\n if (!notAfter) {\n throw new Error('Cannot get \\'notAfter\\' value');\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n }\n\n public parseExtensions() {\n const { tbsCertificate } = this.asn;\n\n if (tbsCertificate.extensions) {\n this.extensions = tbsCertificate.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n private getPublicKeyInfo(publicKeyInfo: SubjectPublicKeyInfo) {\n const { subjectPublicKey, algorithm } = publicKeyInfo;\n let params;\n\n if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {\n params = AsnConvert.parse(algorithm.parameters, ECParameters);\n }\n\n if (algorithm.algorithm === id_rsaEncryption) {\n params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);\n }\n\n if (algorithm.algorithm === id_composite_key) {\n params = AsnConvert.parse(subjectPublicKey, CompositePublicKey);\n\n params = params.map((param) => this.getPublicKeyInfo(param));\n }\n\n const spki = AsnConvert.serialize(publicKeyInfo);\n\n return {\n params,\n value: spki,\n algorithm: algorithm.algorithm,\n };\n }\n\n public get publicKey(): IPublicKey {\n return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo);\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n let params;\n\n if (signatureAlgorithm.algorithm === id_alg_composite) {\n const compositeSignatureValues = AsnConvert.parse(signatureValue, CompositeSignatureValue);\n const compositeParams = AsnConvert.parse(signatureAlgorithm.parameters, CompositeParams);\n\n params = compositeParams.map((param, index) => ({\n ...param,\n value: compositeSignatureValues[index],\n }));\n }\n\n return {\n params,\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public async getThumbprint(\n algorithm = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get commonName(): string {\n if (!this.subject) {\n return '';\n }\n\n for (let i = 0; i < this.subject.length; i += 1) {\n const name = this.subject[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get issuerCommonName(): string {\n if (!this.issuer) {\n return '';\n }\n\n for (let i = 0; i < this.issuer.length; i += 1) {\n const name = this.issuer[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get isRoot(): boolean {\n return JSON.stringify(this.issuer) === JSON.stringify(this.subject);\n }\n\n public subjectToString() {\n if (!this.subject) {\n return '';\n }\n\n return this.subject\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public issuerToString() {\n if (!this.issuer) {\n return '';\n }\n\n return this.issuer\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public toString(format: 'pem' | 'base64' | 'base64url' = 'pem'): string {\n switch (format) {\n case 'pem':\n return PemConverter.encode(this.raw, this.tag);\n case 'base64url':\n return Convert.ToBase64Url(this.raw);\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.cert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.cert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"names":["Convert"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAAA;;;;;;YAMG;YAuCG,MAAO,eAAgB,SAAQ,OAAoB,CAAA;YAuBvD,IAAA,WAAA,CAAY,GAAW,EAAA;oBACrB,KAAK,CAAC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;;oBAGX,OAAO,IAAI,CAAC;YACT,aAAA,GAAG,CAAC,CAAC,IAAI,MACR,CAAA,EAAG,IAAI,CAAC,SAAS,CAAI,CAAA,EAAA,IAAI,CAAC,KAAK,CAAA,CAAE,CAClC;yBACA,IAAI,CAAC,IAAI,CAAC;;gBAGR,QAAQ,CAAC,SAAyC,KAAK,EAAA;oBAC5D,QAAQ,MAAM;YACZ,YAAA,KAAK,KAAK;YACR,gBAAA,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC;YAChD,YAAA,KAAK,WAAW;4BACd,OAAOA,oBAAO,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;YACtC,YAAA;4BACE,OAAOA,oBAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC;;;YAIhC,IAAA,aAAa,CAAC,IAAa,EAAA;YAChC,QAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CACjB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpB,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB;;YAGI,IAAA,aAAa,CAAC,IAAa,EAAA;YAChC,QAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CACjB,IAAI,CAAC,GAAG,EACR,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB;;YAEJ;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-DPbpwYQ8.system.js","sources":["src/crypto/x509_certificate.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport {\n id_composite_key,\n id_alg_composite,\n CompositePublicKey,\n CompositeSignatureValue,\n CompositeParams,\n} from '@peculiar/asn1-x509-post-quantum';\nimport { Certificate, SubjectPublicKeyInfo } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\nimport { dateDiff, Download } from '../utils';\nimport { Name, INameJSON } from './name';\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport { PemConverter } from './pem_converter';\nimport {\n certificateRawToBuffer,\n getCertificateThumbprint,\n} from './utils';\n\nexport interface ISignature {\n algorithm: string;\n value: BufferSource;\n params?: {\n algorithm: string;\n value: BufferSource;\n }[];\n}\n\nexport interface IPublicKey {\n algorithm: string;\n value: BufferSource;\n params?: ECParameters | RSAPublicKey | IPublicKey[];\n}\n\nexport class X509Certificate extends AsnData<Certificate> {\n public readonly serialNumber: string;\n\n public readonly subject: INameJSON[];\n\n public readonly issuer: INameJSON[];\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public readonly version: number;\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'X.509 Certificate';\n\n public readonly tag = PemConverter.CertificateTag;\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), Certificate);\n\n const { tbsCertificate } = this.asn;\n\n this.serialNumber = Convert.ToHex(tbsCertificate.serialNumber);\n this.subject = new Name(tbsCertificate.subject).toJSON();\n this.issuer = new Name(tbsCertificate.issuer).toJSON();\n this.version = tbsCertificate.version + 1;\n\n const notBefore = tbsCertificate.validity.notBefore.utcTime\n || tbsCertificate.validity.notBefore.generalTime;\n\n if (!notBefore) {\n throw new Error('Cannot get \\'notBefore\\' value');\n }\n\n this.notBefore = notBefore;\n\n const notAfter = tbsCertificate.validity.notAfter.utcTime\n || tbsCertificate.validity.notAfter.generalTime;\n\n if (!notAfter) {\n throw new Error('Cannot get \\'notAfter\\' value');\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n }\n\n public parseExtensions() {\n const { tbsCertificate } = this.asn;\n\n if (tbsCertificate.extensions) {\n this.extensions = tbsCertificate.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n private getPublicKeyInfo(publicKeyInfo: SubjectPublicKeyInfo) {\n const { subjectPublicKey, algorithm } = publicKeyInfo;\n let params;\n\n if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {\n params = AsnConvert.parse(algorithm.parameters, ECParameters);\n }\n\n if (algorithm.algorithm === id_rsaEncryption) {\n params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);\n }\n\n if (algorithm.algorithm === id_composite_key) {\n params = AsnConvert.parse(subjectPublicKey, CompositePublicKey);\n\n params = params.map((param) => this.getPublicKeyInfo(param));\n }\n\n const spki = AsnConvert.serialize(publicKeyInfo);\n\n return {\n params,\n value: spki,\n algorithm: algorithm.algorithm,\n };\n }\n\n public get publicKey(): IPublicKey {\n return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo);\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n let params;\n\n if (signatureAlgorithm.algorithm === id_alg_composite) {\n const compositeSignatureValues = AsnConvert.parse(signatureValue, CompositeSignatureValue);\n const compositeParams = AsnConvert.parse(signatureAlgorithm.parameters, CompositeParams);\n\n params = compositeParams.map((param, index) => ({\n ...param,\n value: compositeSignatureValues[index],\n }));\n }\n\n return {\n params,\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public async getThumbprint(\n algorithm = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get commonName(): string {\n if (!this.subject) {\n return '';\n }\n\n for (let i = 0; i < this.subject.length; i += 1) {\n const name = this.subject[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get issuerCommonName(): string {\n if (!this.issuer) {\n return '';\n }\n\n for (let i = 0; i < this.issuer.length; i += 1) {\n const name = this.issuer[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get isRoot(): boolean {\n return JSON.stringify(this.issuer) === JSON.stringify(this.subject);\n }\n\n public subjectToString() {\n if (!this.subject) {\n return '';\n }\n\n return this.subject\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public issuerToString() {\n if (!this.issuer) {\n return '';\n }\n\n return this.issuer\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public toString(format: 'pem' | 'base64' | 'base64url' = 'pem'): string {\n switch (format) {\n case 'pem':\n return PemConverter.encode(this.raw, this.tag);\n case 'base64url':\n return Convert.ToBase64Url(this.raw);\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.cert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.cert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"names":["Convert"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAAA;;;;;;YAMG;YAuCG,MAAO,eAAgB,SAAQ,OAAoB,CAAA;YAuBvD,IAAA,WAAA,CAAY,GAAW,EAAA;oBACrB,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC;oBAP1C,IAAW,CAAA,WAAA,GAA2B,EAAE;oBAE/B,IAAI,CAAA,IAAA,GAAG,mBAAmB;YAE1B,QAAA,IAAA,CAAA,GAAG,GAAG,YAAY,CAAC,cAAc;YAK/C,QAAA,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,GAAG;oBAEnC,IAAI,CAAC,YAAY,GAAGA,oBAAO,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC;YAC9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AE,IAAI,CAAC,GAAG,CAAC;YAChD,YAAA,KAAK,WAAW;4BACd,OAAOA,oBAAO,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;YACtC,YAAA;4BACE,OAAOA,oBAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC;;;YAIhC,IAAA,aAAa,CAAC,IAAa,EAAA;YAChC,QAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CACjB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpB,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB;;YAGI,IAAA,aAAa,CAAC,IAAa,EAAA;YAChC,QAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CACjB,IAAI,CAAC,GAAG,EACR,IAAI,IAAI,IAAI,CAAC,UAAU,CACxB;;YAEJ;;;;;;;;"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{A as s,p as t,q as a,r as e,s as i,U as r,t as n,V as h,I as o,W as c,u,T as l,v as f,w as m,x as p,y as g,b,z as d,B as A,F as w,G as E,H as y,J as
|
|
4
|
+
import{A as s,p as t,q as a,r as e,s as i,U as r,t as n,V as h,I as o,W as c,u,T as l,v as f,w as m,x as p,y as g,b,z as d,B as A,F as w,G as E,H as y,J as P,K as x,L as R,M as q,O as C,Q as K,S,X as v,c as D,Y as I,P as N,N as j,i as H,e as M,E as O,f as Q,R as T,m as V,D as W}from"./p-PCn0WXhQ.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
|
-
*/const
|
|
11
|
+
*/const X={[v]:g,[S]:p,[K]:m,[C]:f,[q]:l,[R]:u,[x]:c,[P]:o,[y]:h,[E]:n,[w]:r,[A]:i,[d]:e};class $ extends s{getAsnExtnValue(){return this.asn.values[0]}constructor(s){super(s,t);const e=this.getAsnExtnValue();try{const s=X[this.asn.type];if(s){this.value=a.parse(e,s)}else{console.warn(`Didn't detect parser for "${this.asn.type}" attribute.`);this.value=b.Convert.ToHex(e)}}catch(s){console.error(`Error parse "${this.asn.type}" attribute:`,s.message);this.value=b.Convert.ToHex(e)}}}
|
|
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
|
|
19
|
-
//# sourceMappingURL=p-
|
|
18
|
+
*/class z extends s{constructor(s){super(D(s),I);this.thumbprints={};this.type="PKCS#10 Certificate Request";this.tag=N.CertificateRequestTag;const{certificationRequestInfo:t}=this.asn;this.subject=new j(t.subject).toJSON();this.version=t.version}get publicKey(){const{subjectPublicKey:s,algorithm:t}=this.asn.certificationRequestInfo.subjectPKInfo;let a;if(t.algorithm===H&&t.parameters){a=M.parse(t.parameters,O)}if(t.algorithm===Q){a=M.parse(s,T)}const e=M.serialize(this.asn.certificationRequestInfo.subjectPKInfo);return{params:a,value:e,algorithm:t.algorithm}}get signature(){const{signature:s,signatureAlgorithm:t}=this.asn;return{value:s,algorithm:t.algorithm}}get commonName(){if(!this.subject){return""}for(let s=0;s<this.subject.length;s+=1){const t=this.subject[s];if(t.shortName==="CN"||t.shortName==="E"||t.shortName==="O"){return t.value}}return""}async getThumbprint(s="SHA-1"){try{const t=await V(s,this.raw);if(t){this.thumbprints[s]=b.Convert.ToHex(t)}}catch(s){console.error("Error thumbprint get:",s)}}parseAttributes(){const{certificationRequestInfo:s}=this.asn;if(s.attributes){this.attributes=s.attributes.map((s=>new $(M.serialize(s))))}}toString(s="pem"){switch(s){case"pem":return N.encode(this.raw,this.tag);case"base64url":return b.Convert.ToBase64Url(this.raw);default:return b.Convert.ToBase64(this.raw)}}downloadAsPEM(s){W.csr.asPEM(this.toString("pem"),s||this.commonName)}downloadAsDER(s){W.csr.asDER(this.raw,s||this.commonName)}}export{$ as A,z as P};
|
|
19
|
+
//# sourceMappingURL=p-Db41gPxb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-CoPYW15U.js","sources":["src/crypto/attribute.ts","src/crypto/pkcs10_certificate_request.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { Convert } from 'pvtsutils';\nimport { AsnParser } from '@peculiar/asn1-schema';\nimport { Attribute as AsnAttribute } from '@peculiar/asn1-x509';\nimport {\n id_DomainNameBeneficiary,\n DomainNameBeneficiary,\n\n id_DomainNameLegalRepresentative,\n DomainNameLegalRepresentative,\n\n id_DomainNameOwner,\n DomainNameOwner,\n\n id_DomainNameTechnicalOperator,\n DomainNameTechnicalOperator,\n\n id_TypeRelationship,\n TypeRelationship,\n\n id_ActivityDescription,\n ActivityDescription,\n\n id_WebGDPR,\n WebGDPR,\n\n id_InsuranceValue,\n InsuranceValue,\n\n id_ValuationRanking,\n ValuationRanking,\n} from '@peculiar/asn1-ntqwac';\nimport {\n id_pkcs9_at_extensionRequest,\n ExtensionRequest,\n\n id_pkcs9_at_challengePassword,\n ChallengePassword,\n\n id_pkcs9_at_unstructuredName,\n UnstructuredName,\n} from '@peculiar/asn1-pkcs9';\nimport {\n id_at_statementOfPossession,\n PrivateKeyPossessionStatement,\n} from '@peculiar/asn1-private-key-stmt';\nimport { AsnData } from './asn_data';\n\nconst attributesParsers = {\n [id_DomainNameBeneficiary]: DomainNameBeneficiary,\n [id_DomainNameLegalRepresentative]: DomainNameLegalRepresentative,\n [id_DomainNameOwner]: DomainNameOwner,\n [id_DomainNameTechnicalOperator]: DomainNameTechnicalOperator,\n [id_TypeRelationship]: TypeRelationship,\n [id_ActivityDescription]: ActivityDescription,\n [id_WebGDPR]: WebGDPR,\n [id_InsuranceValue]: InsuranceValue,\n [id_ValuationRanking]: ValuationRanking,\n [id_pkcs9_at_challengePassword]: ChallengePassword,\n [id_pkcs9_at_unstructuredName]: UnstructuredName,\n [id_pkcs9_at_extensionRequest]: ExtensionRequest,\n [id_at_statementOfPossession]: PrivateKeyPossessionStatement,\n};\n\ntype TAttributeKeys = keyof typeof attributesParsers;\n\nexport type TAttributeValue = InstanceType<typeof attributesParsers[TAttributeKeys]> | string;\n\nexport class Attribute<T extends TAttributeValue> extends AsnData<AsnAttribute> {\n public readonly value: T;\n\n private getAsnExtnValue() {\n return this.asn.values[0];\n }\n\n constructor(raw: BufferSource) {\n super(raw, AsnAttribute);\n\n const asnExtnValue = this.getAsnExtnValue();\n\n try {\n const target = attributesParsers[this.asn.type];\n\n if (target) {\n this.value = AsnParser.parse<T>(asnExtnValue, target);\n } else {\n console.warn(`Didn't detect parser for \"${this.asn.type}\" attribute.`);\n\n this.value = Convert.ToHex(asnExtnValue) as T;\n }\n } catch (error) {\n console.error(`Error parse \"${this.asn.type}\" attribute:`, error.message);\n\n this.value = Convert.ToHex(asnExtnValue) as T;\n }\n }\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport { CertificationRequest } from '@peculiar/asn1-csr';\nimport { Convert } from 'pvtsutils';\nimport { Download } from '../utils';\nimport { AsnData } from './asn_data';\nimport { Name, INameJSON } from './name';\nimport { Attribute, TAttributeValue } from './attribute';\nimport { PemConverter } from './pem_converter';\nimport {\n certificateRawToBuffer,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\ninterface IPublicKey {\n algorithm: string;\n value: BufferSource;\n params?: ECParameters | RSAPublicKey;\n}\n\nexport class Pkcs10CertificateRequest extends AsnData<CertificationRequest> {\n public readonly subject: INameJSON[];\n\n public readonly version: number;\n\n public attributes: Attribute<TAttributeValue>[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'PKCS#10 Certificate Request';\n\n public readonly tag = PemConverter.CertificateRequestTag;\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), CertificationRequest);\n\n const { certificationRequestInfo } = this.asn;\n\n this.subject = new Name(certificationRequestInfo.subject).toJSON();\n this.version = certificationRequestInfo.version;\n }\n\n public get publicKey(): IPublicKey {\n const { subjectPublicKey, algorithm } = this.asn.certificationRequestInfo.subjectPKInfo;\n let params;\n\n if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {\n params = AsnConvert.parse(algorithm.parameters, ECParameters);\n }\n\n if (algorithm.algorithm === id_rsaEncryption) {\n params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);\n }\n\n const spki = AsnConvert.serialize(this.asn.certificationRequestInfo.subjectPKInfo);\n\n return {\n params,\n value: spki,\n algorithm: algorithm.algorithm,\n };\n }\n\n public get signature(): ISignature {\n const { signature, signatureAlgorithm } = this.asn;\n\n return {\n value: signature,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public get commonName(): string {\n if (!this.subject) {\n return '';\n }\n\n for (let i = 0; i < this.subject.length; i += 1) {\n const name = this.subject[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public async getThumbprint(\n algorithm = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public parseAttributes() {\n const { certificationRequestInfo } = this.asn;\n\n if (certificationRequestInfo.attributes) {\n this.attributes = certificationRequestInfo.attributes\n .map((e) => new Attribute(AsnConvert.serialize(e)));\n }\n }\n\n public toString(format: 'pem' | 'base64' | 'base64url' = 'pem'): string {\n switch (format) {\n case 'pem':\n return PemConverter.encode(this.raw, this.tag);\n case 'base64url':\n return Convert.ToBase64Url(this.raw);\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.csr.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.csr.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"names":["AsnAttribute","Convert"],"mappings":";;;;;AAAA;;;;;;AAMG;AAiDH,MAAM,iBAAiB,GAAG;IACxB,CAAC,wBAAwB,GAAG,qBAAqB;IACjD,CAAC,gCAAgC,GAAG,6BAA6B;IACjE,CAAC,kBAAkB,GAAG,eAAe;IACrC,CAAC,8BAA8B,GAAG,2BAA2B;IAC7D,CAAC,mBAAmB,GAAG,gBAAgB;IACvC,CAAC,sBAAsB,GAAG,mBAAmB;IAC7C,CAAC,UAAU,GAAG,OAAO;IACrB,CAAC,iBAAiB,GAAG,cAAc;IACnC,CAAC,mBAAmB,GAAG,gBAAgB;IACvC,CAAC,6BAA6B,GAAG,iBAAiB;IAClD,CAAC,4BAA4B,GAAG,gBAAgB;IAChD,CAAC,4BAA4B,GAAG,gBAAgB;IAChD,CAAC,2BAA2B,GAAG,6BAA6B;CAC7D;AAMK,MAAO,SAAqC,SAAQ,OAAqB,CAAA;IAGrE,eAAe,GAAA;QACrB,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;;AAG3B,IAAA,WAAA,CAAY,GAAiB,EAAA;AAC3B,QAAA,KAAK,CAAC,GAAG,EAAEA,WAAY,CAAC;AAExB,QAAA,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE;AAE3C,QAAA,IAAI;YACF,MAAM,MAAM,GAAG,iBAAiB,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
|
1
|
+
{"version":3,"file":"p-Db41gPxb.js","sources":["src/crypto/attribute.ts","src/crypto/pkcs10_certificate_request.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { Convert } from 'pvtsutils';\nimport { AsnParser } from '@peculiar/asn1-schema';\nimport { Attribute as AsnAttribute } from '@peculiar/asn1-x509';\nimport {\n id_DomainNameBeneficiary,\n DomainNameBeneficiary,\n\n id_DomainNameLegalRepresentative,\n DomainNameLegalRepresentative,\n\n id_DomainNameOwner,\n DomainNameOwner,\n\n id_DomainNameTechnicalOperator,\n DomainNameTechnicalOperator,\n\n id_TypeRelationship,\n TypeRelationship,\n\n id_ActivityDescription,\n ActivityDescription,\n\n id_WebGDPR,\n WebGDPR,\n\n id_InsuranceValue,\n InsuranceValue,\n\n id_ValuationRanking,\n ValuationRanking,\n} from '@peculiar/asn1-ntqwac';\nimport {\n id_pkcs9_at_extensionRequest,\n ExtensionRequest,\n\n id_pkcs9_at_challengePassword,\n ChallengePassword,\n\n id_pkcs9_at_unstructuredName,\n UnstructuredName,\n} from '@peculiar/asn1-pkcs9';\nimport {\n id_at_statementOfPossession,\n PrivateKeyPossessionStatement,\n} from '@peculiar/asn1-private-key-stmt';\nimport { AsnData } from './asn_data';\n\nconst attributesParsers = {\n [id_DomainNameBeneficiary]: DomainNameBeneficiary,\n [id_DomainNameLegalRepresentative]: DomainNameLegalRepresentative,\n [id_DomainNameOwner]: DomainNameOwner,\n [id_DomainNameTechnicalOperator]: DomainNameTechnicalOperator,\n [id_TypeRelationship]: TypeRelationship,\n [id_ActivityDescription]: ActivityDescription,\n [id_WebGDPR]: WebGDPR,\n [id_InsuranceValue]: InsuranceValue,\n [id_ValuationRanking]: ValuationRanking,\n [id_pkcs9_at_challengePassword]: ChallengePassword,\n [id_pkcs9_at_unstructuredName]: UnstructuredName,\n [id_pkcs9_at_extensionRequest]: ExtensionRequest,\n [id_at_statementOfPossession]: PrivateKeyPossessionStatement,\n};\n\ntype TAttributeKeys = keyof typeof attributesParsers;\n\nexport type TAttributeValue = InstanceType<typeof attributesParsers[TAttributeKeys]> | string;\n\nexport class Attribute<T extends TAttributeValue> extends AsnData<AsnAttribute> {\n public readonly value: T;\n\n private getAsnExtnValue() {\n return this.asn.values[0];\n }\n\n constructor(raw: BufferSource) {\n super(raw, AsnAttribute);\n\n const asnExtnValue = this.getAsnExtnValue();\n\n try {\n const target = attributesParsers[this.asn.type];\n\n if (target) {\n this.value = AsnParser.parse<T>(asnExtnValue, target);\n } else {\n console.warn(`Didn't detect parser for \"${this.asn.type}\" attribute.`);\n\n this.value = Convert.ToHex(asnExtnValue) as T;\n }\n } catch (error) {\n console.error(`Error parse \"${this.asn.type}\" attribute:`, error.message);\n\n this.value = Convert.ToHex(asnExtnValue) as T;\n }\n }\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport { CertificationRequest } from '@peculiar/asn1-csr';\nimport { Convert } from 'pvtsutils';\nimport { Download } from '../utils';\nimport { AsnData } from './asn_data';\nimport { Name, INameJSON } from './name';\nimport { Attribute, TAttributeValue } from './attribute';\nimport { PemConverter } from './pem_converter';\nimport {\n certificateRawToBuffer,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\ninterface IPublicKey {\n algorithm: string;\n value: BufferSource;\n params?: ECParameters | RSAPublicKey;\n}\n\nexport class Pkcs10CertificateRequest extends AsnData<CertificationRequest> {\n public readonly subject: INameJSON[];\n\n public readonly version: number;\n\n public attributes: Attribute<TAttributeValue>[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'PKCS#10 Certificate Request';\n\n public readonly tag = PemConverter.CertificateRequestTag;\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), CertificationRequest);\n\n const { certificationRequestInfo } = this.asn;\n\n this.subject = new Name(certificationRequestInfo.subject).toJSON();\n this.version = certificationRequestInfo.version;\n }\n\n public get publicKey(): IPublicKey {\n const { subjectPublicKey, algorithm } = this.asn.certificationRequestInfo.subjectPKInfo;\n let params;\n\n if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {\n params = AsnConvert.parse(algorithm.parameters, ECParameters);\n }\n\n if (algorithm.algorithm === id_rsaEncryption) {\n params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);\n }\n\n const spki = AsnConvert.serialize(this.asn.certificationRequestInfo.subjectPKInfo);\n\n return {\n params,\n value: spki,\n algorithm: algorithm.algorithm,\n };\n }\n\n public get signature(): ISignature {\n const { signature, signatureAlgorithm } = this.asn;\n\n return {\n value: signature,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public get commonName(): string {\n if (!this.subject) {\n return '';\n }\n\n for (let i = 0; i < this.subject.length; i += 1) {\n const name = this.subject[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public async getThumbprint(\n algorithm = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public parseAttributes() {\n const { certificationRequestInfo } = this.asn;\n\n if (certificationRequestInfo.attributes) {\n this.attributes = certificationRequestInfo.attributes\n .map((e) => new Attribute(AsnConvert.serialize(e)));\n }\n }\n\n public toString(format: 'pem' | 'base64' | 'base64url' = 'pem'): string {\n switch (format) {\n case 'pem':\n return PemConverter.encode(this.raw, this.tag);\n case 'base64url':\n return Convert.ToBase64Url(this.raw);\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.csr.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.csr.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"names":["AsnAttribute","Convert"],"mappings":";;;;;AAAA;;;;;;AAMG;AAiDH,MAAM,iBAAiB,GAAG;IACxB,CAAC,wBAAwB,GAAG,qBAAqB;IACjD,CAAC,gCAAgC,GAAG,6BAA6B;IACjE,CAAC,kBAAkB,GAAG,eAAe;IACrC,CAAC,8BAA8B,GAAG,2BAA2B;IAC7D,CAAC,mBAAmB,GAAG,gBAAgB;IACvC,CAAC,sBAAsB,GAAG,mBAAmB;IAC7C,CAAC,UAAU,GAAG,OAAO;IACrB,CAAC,iBAAiB,GAAG,cAAc;IACnC,CAAC,mBAAmB,GAAG,gBAAgB;IACvC,CAAC,6BAA6B,GAAG,iBAAiB;IAClD,CAAC,4BAA4B,GAAG,gBAAgB;IAChD,CAAC,4BAA4B,GAAG,gBAAgB;IAChD,CAAC,2BAA2B,GAAG,6BAA6B;CAC7D;AAMK,MAAO,SAAqC,SAAQ,OAAqB,CAAA;IAGrE,eAAe,GAAA;QACrB,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;;AAG3B,IAAA,WAAA,CAAY,GAAiB,EAAA;AAC3B,QAAA,KAAK,CAAC,GAAG,EAAEA,WAAY,CAAC;AAExB,QAAA,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE;AAE3C,QAAA,IAAI;YACF,MAAM,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAE/C,IAAI,MAAM,EAAE;gBACV,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,CAAI,YAAY,EAAE,MAAM,CAAC;;iBAChD;gBACL,OAAO,CAAC,IAAI,CAAC,CAA6B,0BAAA,EAA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.js";import{$ as n,Z as a,_ as t,b as c,bn as o,bo as s,q as r,bp as i,bq as f,br as u,bs as l,bt as b,bu as d,bv as m,bw as v,bx as p,by as x,bz as g,bA as y,bB as h,bC as C,bD as S,au as N,aE as A,ay as D,ao as I,aF as j,aB as O,aG as T,a8 as G,aq as k,aC as L,at as P,am as B,al as R,ai as V,an as $,ak as E,aj as U,ag as K,ah as q,af as w,ae as H,az as M,ap as X,ad as Y,ac as z,ab as F,aa as Q,a9 as W,as as Z,ar as J,a7 as _,aA as ee,a5 as ne,a4 as ae}from"./p-PCn0WXhQ.js";import{L as te}from"./p-DMZr5ztF.js";import{C as ce}from"./p-BwlcJAh0.js";import{T as oe,B as se}from"./p-CutTi-2B.js";import{D as re}from"./p-JyD6URnB.js";
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -85,42 +85,42 @@ import{h as e}from"./p-CwgZaF40.js";import{$ as n,Z as a,_ as t,b as c,bm as o,b
|
|
|
85
85
|
*
|
|
86
86
|
* This source code is licensed under the MIT license found in the
|
|
87
87
|
* LICENSE file in the root directory of this source tree.
|
|
88
|
-
*/const
|
|
88
|
+
*/const De=(n,t)=>{const{extension:c}=n;return[e(pe,{name:"Name",value:ie(c.asn.extnID)}),e(pe,{name:"Critical",value:c.asn.critical?a.getString("yes"):a.getString("no")}),t,e("tr",null,e("td",{colSpan:2,class:"divider"},e("span",null)))]};
|
|
89
89
|
/**
|
|
90
90
|
* @license
|
|
91
91
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
92
92
|
*
|
|
93
93
|
* This source code is licensed under the MIT license found in the
|
|
94
94
|
* LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const
|
|
95
|
+
*/const Ie=n=>{const{extension:a}=n;return e(De,{extension:a},e(pe,{name:"Usage",value:a.value.toJSON().join(", ")}))};
|
|
96
96
|
/**
|
|
97
97
|
* @license
|
|
98
98
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
99
99
|
*
|
|
100
100
|
* This source code is licensed under the MIT license found in the
|
|
101
101
|
* LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const je=n=>{const{extension:t}=n;return e(
|
|
102
|
+
*/const je=n=>{const{extension:t}=n;return e(De,{extension:t},e(pe,{name:"Certificate Authority",value:t.value.cA?a.getString("yes"):a.getString("no")}),e(pe,{name:"Path Length Constraint",value:t.value.pathLenConstraint}))};
|
|
103
103
|
/**
|
|
104
104
|
* @license
|
|
105
105
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
106
106
|
*
|
|
107
107
|
* This source code is licensed under the MIT license found in the
|
|
108
108
|
* LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const Oe=n=>{const{extension:a}=n;return e(
|
|
109
|
+
*/const Oe=n=>{const{extension:a}=n;return e(De,{extension:a},Boolean(a.value.length)&&[e(pe,{name:"Purposes",value:""}),a.value.map((n=>e(me,null,e(pe,{name:"Purpose",value:ie(n)}))))])};
|
|
110
110
|
/**
|
|
111
111
|
* @license
|
|
112
112
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
113
113
|
*
|
|
114
114
|
* This source code is licensed under the MIT license found in the
|
|
115
115
|
* LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const Te=n=>{const{extension:a,getSubjectKeyIdChildrenLink:t,getSubjectKeyIdSiblingsLink:o}=n;const s=c.Convert.ToHex(a.value.buffer);const r=t(s);const i=o(s);return e(
|
|
116
|
+
*/const Te=n=>{const{extension:a,getSubjectKeyIdChildrenLink:t,getSubjectKeyIdSiblingsLink:o}=n;const s=c.Convert.ToHex(a.value.buffer);const r=t(s);const i=o(s);return e(De,{extension:a},e(pe,{name:"Key ID",value:s,monospace:true,extraValue:[r&&e("span",null," [",e(te,{href:r},"children"),"]"),i&&e("span",null," [",e(te,{href:i},"siblings"),"]")]}))};
|
|
117
117
|
/**
|
|
118
118
|
* @license
|
|
119
119
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
120
120
|
*
|
|
121
121
|
* This source code is licensed under the MIT license found in the
|
|
122
122
|
* LICENSE file in the root directory of this source tree.
|
|
123
|
-
*/const Ge=n=>{const{extension:a,getAuthKeyIdParentLink:t,getAuthKeyIdSiblingsLink:o}=n;const s=c.Convert.ToHex(a.value.keyIdentifier.buffer);const r=t(s);const i=o(s);return e(
|
|
123
|
+
*/const Ge=n=>{const{extension:a,getAuthKeyIdParentLink:t,getAuthKeyIdSiblingsLink:o}=n;const s=c.Convert.ToHex(a.value.keyIdentifier.buffer);const r=t(s);const i=o(s);return e(De,{extension:a},e(pe,{name:"Key ID",value:s,monospace:true,extraValue:[r&&e("span",null," [",e(te,{href:r},"parents"),"]"),i&&e("span",null," [",e(te,{href:i},"siblings"),"]")]}))};
|
|
124
124
|
/**
|
|
125
125
|
* @license
|
|
126
126
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -134,28 +134,28 @@ import{h as e}from"./p-CwgZaF40.js";import{$ as n,Z as a,_ as t,b as c,bm as o,b
|
|
|
134
134
|
*
|
|
135
135
|
* This source code is licensed under the MIT license found in the
|
|
136
136
|
* LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/const Pe=n=>{const{extension:a}=n;return e(
|
|
137
|
+
*/const Pe=n=>{const{extension:a}=n;return e(De,{extension:a},a.value.map((a=>{var t,c;return[(t=a.distributionPoint)===null||t===void 0?void 0:t.fullName.map((a=>e(Le,Object.assign({generalName:a},n)))),(c=a.cRLIssuer)===null||c===void 0?void 0:c.map((a=>e(Le,Object.assign({generalName:a},n))))]})))};
|
|
138
138
|
/**
|
|
139
139
|
* @license
|
|
140
140
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
141
141
|
*
|
|
142
142
|
* This source code is licensed under the MIT license found in the
|
|
143
143
|
* LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const Be=n=>{const{extension:a}=n;return e(
|
|
144
|
+
*/const Be=n=>{const{extension:a}=n;return e(De,{extension:a},Boolean(a.value.length)&&[e(pe,{name:"Descriptions",value:""}),a.value.map((a=>e(me,null,e(pe,{name:"Method",value:ie(a.accessMethod)}),e(Le,Object.assign({generalName:a.accessLocation},n)))))])};
|
|
145
145
|
/**
|
|
146
146
|
* @license
|
|
147
147
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
148
148
|
*
|
|
149
149
|
* This source code is licensed under the MIT license found in the
|
|
150
150
|
* LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const Re=n=>{const{extension:a}=n;return e(
|
|
151
|
+
*/const Re=n=>{const{extension:a}=n;return e(De,{extension:a},a.value.map((a=>e(Le,Object.assign({generalName:a},n)))))};
|
|
152
152
|
/**
|
|
153
153
|
* @license
|
|
154
154
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
155
155
|
*
|
|
156
156
|
* This source code is licensed under the MIT license found in the
|
|
157
157
|
* LICENSE file in the root directory of this source tree.
|
|
158
|
-
*/const Ve=n=>{const{extension:a}=n;return e(
|
|
158
|
+
*/const Ve=n=>{const{extension:a}=n;return e(De,{extension:a},Boolean(a.value.length)&&[e(pe,{name:"Policies",value:""}),a.value.map((n=>e(me,null,e(pe,{name:"Policy ID",value:ie(n.policyIdentifier)}),n.policyQualifiers&&Boolean(n.policyQualifiers.length)&&[e(pe,{name:"Qualifiers",value:""}),n.policyQualifiers.map((n=>{const a=[e(pe,{name:"Qualifier ID",value:ie(n.policyQualifierId)})];if(n.policyQualifierId==="1.3.6.1.5.5.7.2.1"){const t=r.parse(n.qualifier,i);a.push(e(pe,{name:"Value",value:t.toString()}))}if(n.policyQualifierId==="1.3.6.1.5.5.7.2.2"){const t=r.parse(n.qualifier,f);if(t.explicitText){a.push(e(pe,{name:"Value",value:t.explicitText.toString()}))}}return e(me,null,a)}))])))])};
|
|
159
159
|
/**
|
|
160
160
|
* @license
|
|
161
161
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -169,91 +169,91 @@ import{h as e}from"./p-CwgZaF40.js";import{$ as n,Z as a,_ as t,b as c,bm as o,b
|
|
|
169
169
|
*
|
|
170
170
|
* This source code is licensed under the MIT license found in the
|
|
171
171
|
* LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/const Ee=n=>{const{extension:a}=n;return e(
|
|
172
|
+
*/const Ee=n=>{const{extension:a}=n;return e(De,{extension:a},Boolean(a.value.items.length)&&[e(pe,{name:"Signed Certificate Timestamps",value:""}),a.value.toJSON().map((n=>e(me,null,e(pe,{name:"Version",value:n.version+1}),e(pe,{name:"Log Operator",value:$e[n.logId]||n.logId}),e(pe,{name:"Log Key ID",value:n.logId,monospace:true}),e(pe,{name:"Timestamp",value:t(n.timestamp)}),e(pe,{name:"Signature Algorithm",value:`${n.hashAlgorithm} ${n.signatureAlgorithm}`.toUpperCase()}),e(pe,{name:"Signature",value:n.signature,monospace:true}))))])};
|
|
173
173
|
/**
|
|
174
174
|
* @license
|
|
175
175
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
176
176
|
*
|
|
177
177
|
* This source code is licensed under the MIT license found in the
|
|
178
178
|
* LICENSE file in the root directory of this source tree.
|
|
179
|
-
*/const Ue=n=>{var a,t;const{extension:c}=n;return e(
|
|
179
|
+
*/const Ue=n=>{var a,t;const{extension:c}=n;return e(De,{extension:c},(a=c.value.excludedSubtrees)===null||a===void 0?void 0:a.map((a=>e(Le,Object.assign({generalName:a.base},n)))),(t=c.value.permittedSubtrees)===null||t===void 0?void 0:t.map((a=>e(Le,Object.assign({generalName:a.base},n)))))};
|
|
180
180
|
/**
|
|
181
181
|
* @license
|
|
182
182
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
183
183
|
*
|
|
184
184
|
* This source code is licensed under the MIT license found in the
|
|
185
185
|
* LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const Ke=n=>{const{extension:a}=n;return e(
|
|
186
|
+
*/const Ke=n=>{const{extension:a}=n;return e(De,{extension:a},e(pe,{name:"Template ID",value:a.value.templateID}),e(pe,{name:"Template Major Version",value:a.value.templateMajorVersion}),e(pe,{name:"Template Minor Version",value:a.value.templateMinorVersion}))};
|
|
187
187
|
/**
|
|
188
188
|
* @license
|
|
189
189
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
190
190
|
*
|
|
191
191
|
* This source code is licensed under the MIT license found in the
|
|
192
192
|
* LICENSE file in the root directory of this source tree.
|
|
193
|
-
*/const qe=n=>{const{extension:a}=n;return e(
|
|
193
|
+
*/const qe=n=>{const{extension:a}=n;return e(De,{extension:a},e(pe,{name:"Name",value:a.value.toString()}))};
|
|
194
194
|
/**
|
|
195
195
|
* @license
|
|
196
196
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
197
197
|
*
|
|
198
198
|
* This source code is licensed under the MIT license found in the
|
|
199
199
|
* LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const we=n=>{const{extension:a}=n;const t=a.value.getVersion();return e(
|
|
200
|
+
*/const we=n=>{const{extension:a}=n;const t=a.value.getVersion();return e(De,{extension:a},e(pe,{name:"Certificate Index",value:t.certificateIndex}),e(pe,{name:"Key Index",value:t.keyIndex}))};var He,Me,Xe,Ye;let ze=class e{constructor(e){if(typeof e==="string"){this.alphabetic=e}else if(typeof e==="number"){this.numeric=e}}};l([b({type:d.PrintableString})],ze.prototype,"alphabetic",void 0);l([b({type:d.PrintableString})],ze.prototype,"numeric",void 0);ze=l([m({type:v.Choice})],ze);class Fe{constructor(e={}){this.currency=new ze;this.amount=0;this.exponent=0;Object.assign(this,e)}}l([b({type:ze})],Fe.prototype,"currency",void 0);l([b({type:d.Integer})],Fe.prototype,"amount",void 0);l([b({type:d.Integer})],Fe.prototype,"exponent",void 0);let Qe=class e extends Fe{};Qe=l([m({type:v.Sequence})],Qe);let We=class e{constructor(e=0){this.value=e}};l([b({type:d.Integer})],We.prototype,"value",void 0);We=l([m({type:v.Choice})],We);let Ze=class e{constructor(e={}){this.url="";this.language="";Object.assign(this,e)}};l([b({type:d.IA5String})],Ze.prototype,"url",void 0);l([b({type:d.PrintableString})],Ze.prototype,"language",void 0);Ze=l([m({type:v.Sequence})],Ze);let Je=He=class e extends p{constructor(e){super(e);Object.setPrototypeOf(this,He.prototype)}};Je=He=l([m({type:v.Sequence,itemType:Ze})],Je);let _e=Me=class e extends Je{constructor(e){super(e);Object.setPrototypeOf(this,Me.prototype)}};_e=Me=l([m({type:v.Sequence,itemType:Ze})],_e);let en=Xe=class e extends p{constructor(e){super(e);Object.setPrototypeOf(this,Xe.prototype)}};en=Xe=l([m({type:v.Sequence,itemType:d.ObjectIdentifier})],en);let nn=Ye=class e extends p{constructor(e){super(e);Object.setPrototypeOf(this,Ye.prototype)}};nn=Ye=l([m({type:v.Sequence,itemType:d.PrintableString})],nn);const an="0.4.0.1862.1";const tn=`${an}.3`;const cn=`${an}.5`;const on=`${an}.6`
|
|
201
201
|
/**
|
|
202
202
|
* @license
|
|
203
203
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
204
204
|
*
|
|
205
205
|
* This source code is licensed under the MIT license found in the
|
|
206
206
|
* LICENSE file in the root directory of this source tree.
|
|
207
|
-
*/;const sn=n=>{const{extension:a}=n;function t(n,a){if(!a.byteLength){return null}if(n===x){const n=r.parse(a,g);return e(pe,{name:"Semantics Identifier",value:ie(n.semanticsIdentifier)})}if(n===on){const n=r.parse(a,en);return e(pe,{name:"QC Types",value:n.map((e=>ie(e))).join(", ")})}if(n===tn){const n=r.parse(a,
|
|
207
|
+
*/;const sn=n=>{const{extension:a}=n;function t(n,a){if(!a.byteLength){return null}if(n===x){const n=r.parse(a,g);return e(pe,{name:"Semantics Identifier",value:ie(n.semanticsIdentifier)})}if(n===on){const n=r.parse(a,en);return e(pe,{name:"QC Types",value:n.map((e=>ie(e))).join(", ")})}if(n===tn){const n=r.parse(a,We);return e(pe,{name:"Retention Period",value:`${n.value} years`})}if(n===cn){const n=r.parse(a,Je);return[e(pe,{name:"PDS Locations",value:""}),n.map((n=>e(me,null,e(pe,{name:"URL",value:n.url}),e(pe,{name:"Language",value:n.language}))))]}return e(pe,{name:"Info",value:c.Convert.ToHex(a),monospace:true})}return e(De,{extension:a},Boolean(a.value.length)&&[e(pe,{name:"Statements",value:""}),a.value.map((n=>e(me,null,e(pe,{name:"Statement ID",value:ie(n.statementId)}),t(n.statementId,n.statementInfo))))])};
|
|
208
208
|
/**
|
|
209
209
|
* @license
|
|
210
210
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
211
211
|
*
|
|
212
212
|
* This source code is licensed under the MIT license found in the
|
|
213
213
|
* LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const rn=n=>{const{extension:a}=n;return e(
|
|
214
|
+
*/const rn=n=>{const{extension:a}=n;return e(De,{extension:a},e(pe,{name:"Comment",value:a.value.value}))};
|
|
215
215
|
/**
|
|
216
216
|
* @license
|
|
217
217
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
218
218
|
*
|
|
219
219
|
* This source code is licensed under the MIT license found in the
|
|
220
220
|
* LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const fn=n=>{const{extension:a}=n;return e(
|
|
221
|
+
*/const fn=n=>{const{extension:a}=n;return e(De,{extension:a},e(pe,{name:"Type",value:a.value.toJSON().join(", ")}))};
|
|
222
222
|
/**
|
|
223
223
|
* @license
|
|
224
224
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
225
225
|
*
|
|
226
226
|
* This source code is licensed under the MIT license found in the
|
|
227
227
|
* LICENSE file in the root directory of this source tree.
|
|
228
|
-
*/const un=n=>{const{extension:a}=n;return e(
|
|
228
|
+
*/const un=n=>{const{extension:a}=n;return e(De,{extension:a},e(pe,{name:"Role",value:a.value.text}))};
|
|
229
229
|
/**
|
|
230
230
|
* @license
|
|
231
231
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
232
232
|
*
|
|
233
233
|
* This source code is licensed under the MIT license found in the
|
|
234
234
|
* LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const ln=n=>{const{extension:a,getLEILink:t}=n;return e(
|
|
235
|
+
*/const ln=n=>{const{extension:a,getLEILink:t}=n;return e(De,{extension:a},e(pe,{name:"Identifier",value:a.value.text,href:t(a.value.text)}))};
|
|
236
236
|
/**
|
|
237
237
|
* @license
|
|
238
238
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
239
239
|
*
|
|
240
240
|
* This source code is licensed under the MIT license found in the
|
|
241
241
|
* LICENSE file in the root directory of this source tree.
|
|
242
|
-
*/const bn=n=>{const{extension:t}=n;return e(
|
|
242
|
+
*/const bn=n=>{const{extension:t}=n;return e(De,{extension:t},e(pe,{name:"Version",value:t.value.version}),e(Le,Object.assign({generalName:t.value.location},n)),e(pe,{name:"Requires Auth",value:t.value.requiresAuth?a.getString("yes"):a.getString("no")}))};
|
|
243
243
|
/**
|
|
244
244
|
* @license
|
|
245
245
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
246
246
|
*
|
|
247
247
|
* This source code is licensed under the MIT license found in the
|
|
248
248
|
* LICENSE file in the root directory of this source tree.
|
|
249
|
-
*/const dn=n=>{const{extension:a}=n;return e(
|
|
249
|
+
*/const dn=n=>{const{extension:a}=n;return e(De,{extension:a},e(pe,{name:"Version",value:a.value.version}))};
|
|
250
250
|
/**
|
|
251
251
|
* @license
|
|
252
252
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
253
253
|
*
|
|
254
254
|
* This source code is licensed under the MIT license found in the
|
|
255
255
|
* LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/const mn=n=>{const{extension:a}=n;return e(
|
|
256
|
+
*/const mn=n=>{const{extension:a}=n;return e(De,{extension:a},e(pe,{name:"Reason",value:a.value.toJSON()}))};
|
|
257
257
|
/**
|
|
258
258
|
* @license
|
|
259
259
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -267,98 +267,98 @@ import{h as e}from"./p-CwgZaF40.js";import{$ as n,Z as a,_ as t,b as c,bm as o,b
|
|
|
267
267
|
*
|
|
268
268
|
* This source code is licensed under the MIT license found in the
|
|
269
269
|
* LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const pn=n=>{const{extension:a}=n;return e(
|
|
270
|
+
*/const pn=n=>{const{extension:a}=n;return e(De,{extension:a},Boolean(a.value.length)&&[e(pe,{name:"Attributes",value:""}),a.value.map((n=>e(me,null,e(pe,{name:"Type",value:ie(n.type)}),e(pe,{name:"Value",value:vn(n)}))))])};
|
|
271
271
|
/**
|
|
272
272
|
* @license
|
|
273
273
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
274
274
|
*
|
|
275
275
|
* This source code is licensed under the MIT license found in the
|
|
276
276
|
* LICENSE file in the root directory of this source tree.
|
|
277
|
-
*/const xn=n=>{const{extension:a}=n;return e(
|
|
277
|
+
*/const xn=n=>{const{extension:a}=n;return e(De,{extension:a},e(pe,{name:"Value",value:a.value,monospace:true}))};
|
|
278
278
|
/**
|
|
279
279
|
* @license
|
|
280
280
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
281
281
|
*
|
|
282
282
|
* This source code is licensed under the MIT license found in the
|
|
283
283
|
* LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/const gn=n=>{const{extension:a}=n;return e(
|
|
284
|
+
*/const gn=n=>{const{extension:a}=n;return e(De,{extension:a},e(pe,{name:"Not Before",value:t(a.value.notBefore)}),e(pe,{name:"Not After",value:t(a.value.notAfter)}))};
|
|
285
285
|
/**
|
|
286
286
|
* @license
|
|
287
287
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
288
288
|
*
|
|
289
289
|
* This source code is licensed under the MIT license found in the
|
|
290
290
|
* LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/const yn=n=>{const{extension:a}=n;return e(
|
|
291
|
+
*/const yn=n=>{const{extension:a}=n;return e(De,{extension:a},e(pe,{name:"Version",value:a.value.entrustVers}),e(pe,{name:"Info Flags",value:a.value.entrustInfoFlags.toJSON().join(", ")}))};
|
|
292
292
|
/**
|
|
293
293
|
* @license
|
|
294
294
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
295
295
|
*
|
|
296
296
|
* This source code is licensed under the MIT license found in the
|
|
297
297
|
* LICENSE file in the root directory of this source tree.
|
|
298
|
-
*/const hn=n=>{const{extension:a}=n;return e(
|
|
298
|
+
*/const hn=n=>{const{extension:a}=n;return e(De,{extension:a},Boolean(a.value.length)&&[e(pe,{name:"Biometrics",value:""}),a.value.map((n=>e(me,null,e(pe,{name:"OID",value:ie(n.typeOfBiometricData.biometricDataOid)}),e(pe,{name:"Type",value:n.typeOfBiometricData.predefinedBiometricType}),e(pe,{name:"Algorithm",value:ie(n.hashAlgorithm.algorithm)}),e(pe,{name:"Hash",value:c.Convert.ToHex(n.biometricDataHash.buffer),monospace:true}),e(pe,{name:"Source Uri",value:n.sourceDataUri}))))])};
|
|
299
299
|
/**
|
|
300
300
|
* @license
|
|
301
301
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
302
302
|
*
|
|
303
303
|
* This source code is licensed under the MIT license found in the
|
|
304
304
|
* LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/const Cn=n=>{const{extension:a}=n;const t=n=>{if(!n){return null}return n.map((n=>{const{imageDetails:a}=n;return[e(pe,{name:"Image Type",value:a.mediaType}),e(pe,{name:"Image Hash",value:c.Convert.ToHex(a.logotypeHash[0].hashValue),monospace:true}),e(pe,{name:"Image URL",value:a.logotypeURI[0],monospace:true,collapse:true}),e(pe,{name:"Image Hash Algorithm",value:ie(a.logotypeHash[0].hashAlg.algorithm)})]}))};const o=n=>{if(!n){return null}return n.map((n=>{const{audioDetails:a}=n;return[e(pe,{name:"Audio Type",value:a.mediaType}),e(pe,{name:"Audio Hash",value:c.Convert.ToHex(a.logotypeHash[0].hashValue),monospace:true}),e(pe,{name:"Audio URL",value:a.logotypeURI[0],monospace:true,collapse:true}),e(pe,{name:"Audio Hash Algorithm",value:ie(a.logotypeHash[0].hashAlg.algorithm)})]}))};const s=(n,a)=>{if(!a||!a.direct){return null}const{image:c,audio:s}=a.direct;return[e(pe,{name:"Type",value:n}),t(c),o(s),e("tr",null,e("td",null),e("td",null))]};return e(
|
|
305
|
+
*/const Cn=n=>{const{extension:a}=n;const t=n=>{if(!n){return null}return n.map((n=>{const{imageDetails:a}=n;return[e(pe,{name:"Image Type",value:a.mediaType}),e(pe,{name:"Image Hash",value:c.Convert.ToHex(a.logotypeHash[0].hashValue),monospace:true}),e(pe,{name:"Image URL",value:a.logotypeURI[0],monospace:true,collapse:true}),e(pe,{name:"Image Hash Algorithm",value:ie(a.logotypeHash[0].hashAlg.algorithm)})]}))};const o=n=>{if(!n){return null}return n.map((n=>{const{audioDetails:a}=n;return[e(pe,{name:"Audio Type",value:a.mediaType}),e(pe,{name:"Audio Hash",value:c.Convert.ToHex(a.logotypeHash[0].hashValue),monospace:true}),e(pe,{name:"Audio URL",value:a.logotypeURI[0],monospace:true,collapse:true}),e(pe,{name:"Audio Hash Algorithm",value:ie(a.logotypeHash[0].hashAlg.algorithm)})]}))};const s=(n,a)=>{if(!a||!a.direct){return null}const{image:c,audio:s}=a.direct;return[e(pe,{name:"Type",value:n}),t(c),o(s),e("tr",null,e("td",null),e("td",null))]};return e(De,{extension:a},s("Subject",a.value.subjectLogo),s("Issuer",a.value.issuerLogo))};
|
|
306
306
|
/**
|
|
307
307
|
* @license
|
|
308
308
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
309
309
|
*
|
|
310
310
|
* This source code is licensed under the MIT license found in the
|
|
311
311
|
* LICENSE file in the root directory of this source tree.
|
|
312
|
-
*/const Sn=n=>{const{extension:a}=n;return e(
|
|
312
|
+
*/const Sn=n=>{const{extension:a}=n;return e(De,{extension:a},a.value.length>0&&[e(pe,{name:"Entries",value:""}),a.value.map((n=>e(me,null,e(pe,{name:"SPC",value:n.spc}),e(pe,{name:"Range",value:n.range?`start=${n.range.start} count==${n.range.count}`:null}),e(pe,{name:"One",value:n.one}))))])};
|
|
313
313
|
/**
|
|
314
314
|
* @license
|
|
315
315
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
316
316
|
*
|
|
317
317
|
* This source code is licensed under the MIT license found in the
|
|
318
318
|
* LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/const Nn=n=>{const{extension:a}=n;return e(
|
|
319
|
+
*/const Nn=n=>{const{extension:a}=n;return e(De,{extension:a},a.value.requireExplicitPolicy&&e(pe,{name:"Require Explicit Policy",value:y.toASN(a.value.requireExplicitPolicy).valueBlock.toString()}),a.value.inhibitPolicyMapping&&e(pe,{name:"Inhibit Policy Mapping",value:y.toASN(a.value.inhibitPolicyMapping).valueBlock.toString()}))};
|
|
320
320
|
/**
|
|
321
321
|
* @license
|
|
322
322
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
323
323
|
*
|
|
324
324
|
* This source code is licensed under the MIT license found in the
|
|
325
325
|
* LICENSE file in the root directory of this source tree.
|
|
326
|
-
*/const An=n=>{const{extension:a}=n;return e(
|
|
326
|
+
*/const An=n=>{const{extension:a}=n;return e(De,{extension:a},a.value.length>0&&[e(pe,{name:"Policies",value:""}),a.value.map((n=>e(me,null,e(pe,{name:"Issuer Domain",value:ie(n.issuerDomainPolicy)}),e(pe,{name:"Subject Domain",value:ie(n.subjectDomainPolicy)}))))])};
|
|
327
327
|
/**
|
|
328
328
|
* @license
|
|
329
329
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
330
330
|
*
|
|
331
331
|
* This source code is licensed under the MIT license found in the
|
|
332
332
|
* LICENSE file in the root directory of this source tree.
|
|
333
|
-
*/const
|
|
333
|
+
*/const Dn=n=>{const{extension:t}=n;return e(De,{extension:t},e(pe,{name:a.getString("value"),value:t.value.value}))};
|
|
334
334
|
/**
|
|
335
335
|
* @license
|
|
336
336
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
337
337
|
*
|
|
338
338
|
* This source code is licensed under the MIT license found in the
|
|
339
339
|
* LICENSE file in the root directory of this source tree.
|
|
340
|
-
*/const
|
|
340
|
+
*/const In=n=>{var t;const{extension:c}=n;return e(De,{extension:c},(t=c.value.distributionPoint)===null||t===void 0?void 0:t.fullName.map((a=>e(Le,Object.assign({generalName:a},n)))),c.value.onlySomeReasons&&e(pe,{name:a.getString("onlyReasons"),value:c.value.onlySomeReasons.toJSON().join(", ")}),c.value.indirectCRL&&e(pe,{name:a.getString("indirectCRL"),value:a.getString("yes")}),c.value.onlyContainsUserCerts&&e(pe,{name:a.getString("onlyUserCertificates"),value:a.getString("yes")}),c.value.onlyContainsAttributeCerts&&e(pe,{name:a.getString("onlyAttributeCertificates"),value:a.getString("yes")}),c.value.onlyContainsCACerts&&e(pe,{name:a.getString("onlyCACertificates"),value:a.getString("yes")}))};
|
|
341
341
|
/**
|
|
342
342
|
* @license
|
|
343
343
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
344
344
|
*
|
|
345
345
|
* This source code is licensed under the MIT license found in the
|
|
346
346
|
* LICENSE file in the root directory of this source tree.
|
|
347
|
-
*/const jn=n=>{const{extension:t}=n;const o=n=>Object.keys(n).map((t=>{const s=n[t];let i="";switch(true){case typeof s==="string"||typeof s==="number":i=s;break;case s instanceof S:i=s.join(", ");break;case typeof s==="boolean":i=s?a.getString("yes"):a.getString("no");break;case Object.is(s,null):i="NULL";break;case s instanceof C:return[e(pe,{name:fe(t),value:""}),e(me,null,o(s))];case c.BufferSourceConverter.isBufferSource(s):if(t==="attestationApplicationId"){try{const n=r.parse(s,h);if(n.packageInfos.length||n.signatureDigests.length){return[e(pe,{name:fe(t),value:""}),Boolean(n.packageInfos)&&e(me,null,e(pe,{name:fe("packageInfos"),value:""}),n.packageInfos.map((n=>e(me,null,o(n)))))]}}catch(e){}}try{i=c.Convert.ToString(s)}catch(e){i=c.Convert.ToHex(s)}break}return e(pe,{name:fe(t),value:i})}));const s=(n,a)=>{if(a.length===0){return null}return[e(pe,{name:n,value:""}),e(me,null,a.map(o))]};return e(
|
|
347
|
+
*/const jn=n=>{const{extension:t}=n;const o=n=>Object.keys(n).map((t=>{const s=n[t];let i="";switch(true){case typeof s==="string"||typeof s==="number":i=s;break;case s instanceof S:i=s.join(", ");break;case typeof s==="boolean":i=s?a.getString("yes"):a.getString("no");break;case Object.is(s,null):i="NULL";break;case s instanceof C:return[e(pe,{name:fe(t),value:""}),e(me,null,o(s))];case c.BufferSourceConverter.isBufferSource(s):if(t==="attestationApplicationId"){try{const n=r.parse(s,h);if(n.packageInfos.length||n.signatureDigests.length){return[e(pe,{name:fe(t),value:""}),Boolean(n.packageInfos)&&e(me,null,e(pe,{name:fe("packageInfos"),value:""}),n.packageInfos.map((n=>e(me,null,o(n)))))]}}catch(e){}}try{i=c.Convert.ToString(s)}catch(e){i=c.Convert.ToHex(s)}break}return e(pe,{name:fe(t),value:i})}));const s=(n,a)=>{if(a.length===0){return null}return[e(pe,{name:n,value:""}),e(me,null,a.map(o))]};return e(De,{extension:t},e(pe,{name:fe("attestationVersion"),value:t.value.attestationVersion}),e(pe,{name:fe("attestationSecurityLevel"),value:t.value.attestationSecurityLevel}),e(pe,{name:fe("keymasterVersion"),value:t.value.keymasterVersion}),e(pe,{name:fe("keymasterSecurityLevel"),value:t.value.keymasterSecurityLevel}),e(pe,{name:fe("attestationChallenge"),value:c.Convert.ToString(t.value.attestationChallenge)}),e(pe,{name:fe("uniqueId"),value:c.Convert.ToString(t.value.uniqueId)||undefined}),s(fe("softwareEnforced"),t.value.softwareEnforced),s(fe("teeEnforced"),t.value.teeEnforced))};
|
|
348
348
|
/**
|
|
349
349
|
* @license
|
|
350
350
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
351
351
|
*
|
|
352
352
|
* This source code is licensed under the MIT license found in the
|
|
353
353
|
* LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/const On=n=>{const{extension:a}=n;return e(
|
|
354
|
+
*/const On=n=>{const{extension:a}=n;return e(De,{extension:a},Object.keys(a.value).map((n=>e(pe,{name:fe(n),value:a.value[n]}))))};
|
|
355
355
|
/**
|
|
356
356
|
* @license
|
|
357
357
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
358
358
|
*
|
|
359
359
|
* This source code is licensed under the MIT license found in the
|
|
360
360
|
* LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const Tn=n=>{const{extensions:a,title:t}=n;if(!a||!a.length){return null}return[e(ve,{value:t||"Extensions"}),a.map((a=>{try{if(a.value instanceof N){return e(
|
|
361
|
+
*/const Tn=n=>{const{extensions:a,title:t}=n;if(!a||!a.length){return null}return[e(ve,{value:t||"Extensions"}),a.map((a=>{try{if(a.value instanceof N){return e(Ie,{extension:a})}if(a.value instanceof A){return e(je,{extension:a})}if(a.value instanceof D){return e(Oe,{extension:a})}if(a.value instanceof I){return e(Te,Object.assign({extension:a},n))}if(a.value instanceof j){return e(Ge,Object.assign({extension:a},n))}if(a.value instanceof O){return e(Pe,Object.assign({extension:a},n))}if(a.value instanceof T||a.value instanceof G){return e(Be,Object.assign({extension:a},n))}if(a.value instanceof k){return e(Re,Object.assign({extension:a},n))}if(a.value instanceof L){return e(Ve,{extension:a})}if(a.value instanceof ce){return e(Ee,{extension:a})}if(a.value instanceof P){return e(Ue,Object.assign({extension:a},n))}if(a.value instanceof B){return e(Ke,{extension:a})}if(a.value instanceof R){return e(qe,{extension:a})}if(a.value instanceof V){return e(we,{extension:a})}if(a.value instanceof $){return e(sn,{extension:a})}if(a.value instanceof E){return e(rn,{extension:a})}if(a.value instanceof U){return e(fn,{extension:a})}if(a.value instanceof K){return e(un,{extension:a})}if(a.value instanceof q){return e(ln,Object.assign({extension:a},n))}if(a.value instanceof w){return e(bn,Object.assign({extension:a},n))}if(a.value instanceof H){return e(dn,{extension:a})}if(a.value instanceof M){return e(mn,{extension:a})}if(a.value instanceof X){return e(pn,{extension:a})}if(a.value instanceof Y){return e(gn,{extension:a})}if(a.value instanceof z){return e(yn,{extension:a})}if(a.value instanceof F){return e(hn,{extension:a})}if(a.value instanceof Q){return e(Cn,{extension:a})}if(a.value instanceof W){return e(Sn,{extension:a})}if(a.value instanceof Z){return e(Nn,{extension:a})}if(a.value instanceof J){return e(An,{extension:a})}if(a.value instanceof _){return e(Dn,{extension:a})}if(a.value instanceof ee){return e(In,Object.assign({extension:a},n))}if(a.value instanceof ne){return e(jn,Object.assign({extension:a},n))}if(a.value instanceof ae){return e(On,Object.assign({extension:a},n))}if(typeof a.value==="string"){return e(xn,{extension:a})}return e(De,{extension:a})}catch(e){console.error("Error render extension:",a.asn.extnID);return null}}))]};
|
|
362
362
|
/**
|
|
363
363
|
* @license
|
|
364
364
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -366,4 +366,4 @@ import{h as e}from"./p-CwgZaF40.js";import{$ as n,Z as a,_ as t,b as c,bm as o,b
|
|
|
366
366
|
* This source code is licensed under the MIT license found in the
|
|
367
367
|
* LICENSE file in the root directory of this source tree.
|
|
368
368
|
*/const Gn=n=>{const{certificate:t}=n;return[e(ve,{value:a.getString("miscellaneous")}),e("tr",null,e("td",null,e(se,{startIcon:e(re,null),onClick:()=>t.downloadAsPEM()},a.getString("download.pem")))),e("tr",null,e("td",null,e(se,{startIcon:e(re,null),onClick:()=>t.downloadAsDER()},a.getString("download.der"))))]};export{xe as B,Tn as E,Le as G,Se as I,Gn as M,he as P,pe as R,Ce as S,Ae as T,Ne as a,le as b,ue as c,ie as d,fe as e,me as f,be as g,ve as h};
|
|
369
|
-
//# sourceMappingURL=p-
|
|
369
|
+
//# sourceMappingURL=p-DnOLjFJP.js.map
|