@peculiar/certificates-viewer 4.0.2 → 4.1.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/README.md +1 -1
- package/components/attribute-certificate-viewer.js +7 -7
- package/components/attribute-certificate-viewer.js.map +1 -1
- package/components/certificate-viewer.js +5 -5
- package/components/certificate-viewer.js.map +1 -1
- package/components/crl-viewer.js +6 -6
- package/components/crl-viewer.js.map +1 -1
- package/components/csr-viewer.js +4 -4
- package/components/csr-viewer.js.map +1 -1
- package/components/download.js +374 -374
- package/components/download.js.map +1 -1
- package/components/index2.js +2 -2
- package/components/index2.js.map +1 -1
- package/components/miscellaneous.js +647 -217
- package/components/miscellaneous.js.map +1 -1
- package/components/subject_name.js +2 -2
- package/components/subject_name.js.map +1 -1
- package/dist/cjs/{certification_request-c0cafa72.js → certification_request-bf416170.js} +553 -214
- package/dist/cjs/certification_request-bf416170.js.map +1 -0
- package/dist/cjs/{crl-b4322166.js → crl-d9591b95.js} +14 -14
- package/dist/cjs/{crl-b4322166.js.map → crl-d9591b95.js.map} +1 -1
- package/dist/cjs/{download-972dda8a.js → download-0fa5b33c.js} +377 -377
- package/dist/cjs/download-0fa5b33c.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{miscellaneous-e43aaae5.js → miscellaneous-6e800553.js} +109 -15
- package/dist/cjs/miscellaneous-6e800553.js.map +1 -0
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +8 -8
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +4 -4
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +4 -4
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +3 -3
- package/dist/cjs/{x509_certificate-989b1435.js → x509_certificate-53feebd3.js} +7 -7
- package/dist/cjs/{x509_certificate-989b1435.js.map → x509_certificate-53feebd3.js.map} +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/index.js +5 -0
- package/dist/collection/components/certificate-details-parts/extensions/index.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/key_description_extension.js +80 -0
- package/dist/collection/components/certificate-details-parts/extensions/key_description_extension.js.map +1 -0
- package/dist/collection/constants/oids.js +1 -0
- package/dist/collection/constants/oids.js.map +1 -1
- package/dist/collection/crypto/extension.js +4 -0
- package/dist/collection/crypto/extension.js.map +1 -1
- package/dist/collection/utils/camel_case_to_words.js +15 -0
- package/dist/collection/utils/camel_case_to_words.js.map +1 -0
- package/dist/collection/utils/index.js +1 -0
- package/dist/collection/utils/index.js.map +1 -1
- package/dist/esm/{certification_request-5cadde9f.js → certification_request-c9dc8e9c.js} +545 -209
- package/dist/esm/certification_request-c9dc8e9c.js.map +1 -0
- package/dist/esm/{crl-11670c3e.js → crl-70e85374.js} +14 -14
- package/dist/esm/{crl-11670c3e.js.map → crl-70e85374.js.map} +1 -1
- package/dist/esm/{download-57c5bf8f.js → download-aacb6eff.js} +375 -375
- package/dist/esm/download-aacb6eff.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/{miscellaneous-7793a310.js → miscellaneous-0763f98e.js} +109 -15
- package/dist/esm/miscellaneous-0763f98e.js.map +1 -0
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +8 -8
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-decoder.entry.js +4 -4
- package/dist/esm/peculiar-certificate-viewer.entry.js +4 -4
- package/dist/esm/peculiar-certificates-viewer.entry.js +3 -3
- package/dist/esm/{x509_certificate-dfae6999.js → x509_certificate-8cf268d1.js} +7 -7
- package/dist/esm/{x509_certificate-dfae6999.js.map → x509_certificate-8cf268d1.js.map} +1 -1
- package/dist/esm-es5/certification_request-c9dc8e9c.js +97 -0
- package/dist/esm-es5/certification_request-c9dc8e9c.js.map +1 -0
- package/dist/esm-es5/{crl-11670c3e.js → crl-70e85374.js} +6 -6
- package/dist/esm-es5/{crl-11670c3e.js.map → crl-70e85374.js.map} +1 -1
- package/dist/esm-es5/download-aacb6eff.js +43 -0
- package/dist/esm-es5/download-aacb6eff.js.map +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{miscellaneous-7793a310.js → miscellaneous-0763f98e.js} +63 -49
- package/dist/esm-es5/miscellaneous-0763f98e.js.map +1 -0
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +3 -3
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js +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/x509_certificate-8cf268d1.js +12 -0
- package/dist/esm-es5/{x509_certificate-dfae6999.js.map → x509_certificate-8cf268d1.js.map} +1 -1
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/{p-7f9fef87.entry.js → p-025b3cfb.entry.js} +2 -2
- package/dist/peculiar/{p-441109db.system.entry.js → p-0bd7c6bc.system.entry.js} +2 -2
- package/dist/peculiar/p-10d2d400.system.js +34 -0
- package/dist/peculiar/{p-6667fe6e.system.js.map → p-10d2d400.system.js.map} +1 -1
- package/dist/peculiar/p-14f281b0.system.js +43 -0
- package/dist/peculiar/p-14f281b0.system.js.map +1 -0
- package/dist/peculiar/p-15cb92b5.system.js +97 -0
- package/dist/peculiar/p-15cb92b5.system.js.map +1 -0
- package/dist/peculiar/p-1ef997ee.js +97 -0
- package/dist/peculiar/p-1ef997ee.js.map +1 -0
- package/dist/peculiar/{p-e39de121.system.entry.js → p-24050d82.system.entry.js} +2 -2
- package/dist/peculiar/{p-bcc86979.entry.js → p-2f48fe70.entry.js} +2 -2
- package/dist/peculiar/{p-c362dc5e.system.js → p-31b60224.system.js} +65 -51
- package/dist/peculiar/p-31b60224.system.js.map +1 -0
- package/dist/peculiar/{p-0b475f2a.system.entry.js → p-4ab9673f.system.entry.js} +4 -4
- package/dist/peculiar/{p-0b475f2a.system.entry.js.map → p-4ab9673f.system.entry.js.map} +1 -1
- package/dist/peculiar/p-542412ae.js +33 -0
- package/dist/peculiar/{p-43eb3721.js.map → p-542412ae.js.map} +1 -1
- package/dist/peculiar/p-59e5ac12.js +43 -0
- package/dist/peculiar/p-59e5ac12.js.map +1 -0
- package/dist/peculiar/{p-1844b807.system.entry.js → p-5e49b881.system.entry.js} +2 -2
- package/dist/peculiar/p-72f53d81.js +12 -0
- package/dist/peculiar/{p-6e79b9c8.js.map → p-72f53d81.js.map} +1 -1
- package/dist/peculiar/p-80832207.system.js +1 -1
- package/dist/peculiar/{p-673336cf.entry.js → p-9c91dd68.entry.js} +5 -5
- package/dist/peculiar/{p-673336cf.entry.js.map → p-9c91dd68.entry.js.map} +1 -1
- package/dist/peculiar/{p-1de0381c.system.js → p-a3eeb94b.system.js} +2 -2
- package/dist/peculiar/p-ca02a823.js +362 -0
- package/dist/peculiar/p-ca02a823.js.map +1 -0
- package/dist/peculiar/p-cfca7dae.system.js +13 -0
- package/dist/peculiar/{p-31586b23.system.js.map → p-cfca7dae.system.js.map} +1 -1
- package/dist/peculiar/{p-882e1281.entry.js → p-e5b18cd1.entry.js} +2 -2
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/types/components/certificate-details-parts/extensions/key_description_extension.d.ts +15 -0
- package/dist/types/constants/oids.d.ts +1 -0
- package/dist/types/crypto/extension.d.ts +2 -1
- package/dist/types/utils/camel_case_to_words.d.ts +8 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/hydrate/index.js +1039 -609
- package/package.json +22 -21
- package/dist/cjs/certification_request-c0cafa72.js.map +0 -1
- package/dist/cjs/download-972dda8a.js.map +0 -1
- package/dist/cjs/miscellaneous-e43aaae5.js.map +0 -1
- package/dist/esm/certification_request-5cadde9f.js.map +0 -1
- package/dist/esm/download-57c5bf8f.js.map +0 -1
- package/dist/esm/miscellaneous-7793a310.js.map +0 -1
- package/dist/esm-es5/certification_request-5cadde9f.js +0 -97
- package/dist/esm-es5/certification_request-5cadde9f.js.map +0 -1
- package/dist/esm-es5/download-57c5bf8f.js +0 -19
- package/dist/esm-es5/download-57c5bf8f.js.map +0 -1
- package/dist/esm-es5/miscellaneous-7793a310.js.map +0 -1
- package/dist/esm-es5/x509_certificate-dfae6999.js +0 -12
- package/dist/peculiar/p-31586b23.system.js +0 -13
- package/dist/peculiar/p-43eb3721.js +0 -33
- package/dist/peculiar/p-6667fe6e.system.js +0 -34
- package/dist/peculiar/p-6e79b9c8.js +0 -12
- package/dist/peculiar/p-74c241e7.js +0 -97
- package/dist/peculiar/p-74c241e7.js.map +0 -1
- package/dist/peculiar/p-a053c132.js +0 -19
- package/dist/peculiar/p-a053c132.js.map +0 -1
- package/dist/peculiar/p-a6e2e335.js +0 -348
- package/dist/peculiar/p-a6e2e335.js.map +0 -1
- package/dist/peculiar/p-ae9189f6.system.js +0 -19
- package/dist/peculiar/p-ae9189f6.system.js.map +0 -1
- package/dist/peculiar/p-c0a298fd.system.js +0 -97
- package/dist/peculiar/p-c0a298fd.system.js.map +0 -1
- package/dist/peculiar/p-c362dc5e.system.js.map +0 -1
- /package/dist/peculiar/{p-7f9fef87.entry.js.map → p-025b3cfb.entry.js.map} +0 -0
- /package/dist/peculiar/{p-441109db.system.entry.js.map → p-0bd7c6bc.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-e39de121.system.entry.js.map → p-24050d82.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-bcc86979.entry.js.map → p-2f48fe70.entry.js.map} +0 -0
- /package/dist/peculiar/{p-1844b807.system.entry.js.map → p-5e49b881.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-1de0381c.system.js.map → p-a3eeb94b.system.js.map} +0 -0
- /package/dist/peculiar/{p-882e1281.entry.js.map → p-e5b18cd1.entry.js.map} +0 -0
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
var __extends=this&&this.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]};return t(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n["throw"](t))}catch(t){a(t)}}function u(t){t.done?r(t.value):o(t.value).then(i,s)}u((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(t){return function(e){return u([t,e])}}function u(s){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,s[0]&&(r=0)),r)try{if(n=1,o&&(a=s[0]&2?o["return"]:s[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,s[1])).done)return a;if(o=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;o=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){r.label=s[1];break}if(s[0]===6&&r.label<a[1]){r.label=a[1];a=s;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(s);break}if(a[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t];o=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};
|
|
2
|
-
/*!
|
|
3
|
-
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
4
|
-
*/System.register(["./p-c0a298fd.system.js","./p-ae9189f6.system.js"],(function(t){"use strict";var e,r,n,o,a,i,s,u,c,f,p,l,h,m,v,b,y,d,g,x,w,E,A,C,_,T,N,P,R,j,I,k,B,F,H,O,S,D,U,z,M,q,K,L;return{setters:[function(t){e=t.A;r=t.t;n=t.u;o=t.v;a=t.w;i=t.E;s=t.g;u=t.x;c=t.U;f=t.y;p=t.z;l=t.B;h=t.V;m=t.D;v=t.I;b=t.F;y=t.W;d=t.G;g=t.H;x=t.J;w=t.T;E=t.K;A=t.L;C=t.M;_=t.O;T=t.P;N=t.Q;P=t.S;R=t.X;j=t.e;I=t.Y;k=t.f;B=t.s;F=t.q;H=t.r;O=t.Z;S=t.N;D=t.h;U=t.j;z=t.k;M=t.R;q=t._},function(t){K=t.b;L=t.D}],execute:function(){
|
|
5
|
-
/**
|
|
6
|
-
* @license
|
|
7
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/
|
|
12
|
-
var V=function(t){__extends(e,t);function e(e){var j=t.call(this,e,r)||this;var I=j.getAsnExtnValue();switch(j.asn.type){case P:j.value=o.parse(I,R);break;case T:j.value=o.parse(I,N);break;case C:j.value=o.parse(I,_);break;case E:j.value=o.parse(I,A);break;case x:j.value=o.parse(I,w);break;case d:j.value=o.parse(I,g);break;case b:j.value=o.parse(I,y);break;case m:j.value=o.parse(I,v);break;case l:j.value=o.parse(I,h);break;case f:j.value=o.parse(I,p);break;case u:j.value=o.parse(I,c);break;case n:{var k=o.parse(I,a);j.value=k.map((function(t){return new i(s.serialize(t))}));break}default:j.value=K.Convert.ToHex(I)}return j}e.prototype.getAsnExtnValue=function(){return this.asn.values[0]};return e}(e);
|
|
13
|
-
/**
|
|
14
|
-
* @license
|
|
15
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the MIT license found in the
|
|
18
|
-
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/var X=function(t){__extends(e,t);function e(e){var r=this;var n;r=t.call(this,j(e),I)||this;r.thumbprints={};r.type="X.509 Attribute Certificate";var o=r.asn.acinfo;r.serialNumber=K.Convert.ToHex(o.serialNumber);r.version=o.version;var a=o.attrCertValidityPeriod.notBeforeTime;if(!a){throw new Error("Cannot get 'notBefore' value")}r.notBefore=a;var i=o.attrCertValidityPeriod.notAfterTime;if(!i){throw new Error("Cannot get 'notAfter' value")}r.notAfter=i;r.validity=k(r.notBefore,r.notAfter);r.issuer=o.issuer.v1Form||((n=o.issuer.v2Form)===null||n===void 0?void 0:n.issuerName);r.holder=o.holder;return r}Object.defineProperty(e.prototype,"signature",{get:function(){var t=this.asn,e=t.signatureValue,r=t.signatureAlgorithm;return{value:e,algorithm:r.algorithm}},enumerable:false,configurable:true});e.prototype.parseExtensions=function(){var t=this.asn.acinfo;if(t.extensions){this.extensions=t.extensions.map((function(t){return new i(s.serialize(t))}))}};e.prototype.parseAttributes=function(){var t=this.asn.acinfo;if(t.attributes){this.attributes=t.attributes.map((function(t){return new V(s.serialize(t))}))}};e.prototype.getThumbprint=function(t){if(t===void 0){t="SHA-1"}return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,B(t,this.raw)];case 1:e=n.sent();if(e){this.thumbprints[t]=K.Convert.ToHex(e)}return[3,3];case 2:r=n.sent();console.error("Error thumbprint get:",r);return[3,3];case 3:return[2]}}))}))};e.prototype.exportAsBase64=function(){return K.Convert.ToBase64(this.raw)};e.prototype.exportAsHexFormatted=function(){return F(K.Convert.ToHex(this.raw))};e.prototype.exportAsPemFormatted=function(){return"-----BEGIN ATTRIBUTE CERTIFICATE-----\n".concat(H(this.exportAsBase64()),"\n-----END ATTRIBUTE CERTIFICATE-----")};Object.defineProperty(e.prototype,"commonName",{get:function(){return"attribute-certificate-".concat(this.thumbprints["SHA-1"])},enumerable:false,configurable:true});e.prototype.downloadAsPEM=function(t){L.attrCert.asPEM(this.exportAsPemFormatted(),t||this.commonName)};e.prototype.downloadAsDER=function(t){L.attrCert.asDER(this.exportAsHexFormatted(),t||this.commonName)};return e}(e);t("X",X);
|
|
20
|
-
/**
|
|
21
|
-
* @license
|
|
22
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var G=function(t){__extends(e,t);function e(e){var r=t.call(this,j(e),O)||this;r.thumbprints={};r.type="PKCS#10 Certificate Request";var n=r.asn.certificationRequestInfo;r.subject=new S(n.subject).toJSON();r.version=n.version;return r}Object.defineProperty(e.prototype,"publicKey",{get:function(){var t=this.asn.certificationRequestInfo.subjectPKInfo,e=t.subjectPublicKey,r=t.algorithm;var n;if(r.algorithm===D&&r.parameters){n=s.parse(r.parameters,U)}if(r.algorithm===z){n=s.parse(e,M)}var o=s.serialize(this.asn.certificationRequestInfo.subjectPKInfo);return{params:n,value:o,algorithm:r.algorithm}},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"signature",{get:function(){var t=this.asn,e=t.signature,r=t.signatureAlgorithm;return{value:e,algorithm:r.algorithm}},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"commonName",{get:function(){if(!this.subject){return""}for(var t=0;t<this.subject.length;t+=1){var e=this.subject[t];if(e.shortName==="CN"||e.shortName==="E"||e.shortName==="O"){return e.value}}return""},enumerable:false,configurable:true});e.prototype.getThumbprint=function(t){if(t===void 0){t="SHA-1"}return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,B(t,this.raw)];case 1:e=n.sent();if(e){this.thumbprints[t]=K.Convert.ToHex(e)}return[3,3];case 2:r=n.sent();console.error("Error thumbprint get:",r);return[3,3];case 3:return[2]}}))}))};e.prototype.parseAttributes=function(){var t=this.asn.certificationRequestInfo;if(t.attributes){this.attributes=t.attributes.map((function(t){return new V(s.serialize(t))}))}};e.prototype.exportAsBase64=function(){return K.Convert.ToBase64(this.raw)};e.prototype.exportAsHexFormatted=function(){return F(K.Convert.ToHex(this.raw))};e.prototype.exportAsPemFormatted=function(){return"-----BEGIN CERTIFICATE REQUEST-----\n".concat(H(this.exportAsBase64()),"\n-----END CERTIFICATE REQUEST-----")};e.prototype.downloadAsPEM=function(t){L.csr.asPEM(this.exportAsPemFormatted(),t||this.commonName)};e.prototype.downloadAsDER=function(t){L.csr.asDER(this.exportAsHexFormatted(),t||this.commonName)};return e}(e);t("C",G);
|
|
27
|
-
/**
|
|
28
|
-
* @license
|
|
29
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var J=function(t){__extends(e,t);function e(e){var r=t.call(this,j(e),q)||this;r.thumbprints={};r.type="X.509 Certificate Revocation List";var n=r.asn.tbsCertList;r.issuer=new S(n.issuer).toJSON();r.version=n.version+1;r.lastUpdate=n.thisUpdate.getTime();r.nextUpdate=n.nextUpdate.getTime();r.revokedCertificates=(n.revokedCertificates||[]).map((function(t){var e;return{revocationDate:t.revocationDate,userCertificate:t.userCertificate,crlEntryExtensions:(e=t.crlEntryExtensions)===null||e===void 0?void 0:e.map((function(t){return new i(s.serialize(t))}))}}));return r}e.prototype.getThumbprint=function(t){if(t===void 0){t="SHA-1"}return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,B(t,this.raw)];case 1:e=n.sent();if(e){this.thumbprints[t]=K.Convert.ToHex(e)}return[3,3];case 2:r=n.sent();console.error("Error thumbprint get:",r);return[3,3];case 3:return[2]}}))}))};Object.defineProperty(e.prototype,"signature",{get:function(){var t=this.asn,e=t.signature,r=t.signatureAlgorithm;return{value:e,algorithm:r.algorithm}},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"commonName",{get:function(){if(!this.issuer){return""}for(var t=0;t<this.issuer.length;t+=1){var e=this.issuer[t];if(e.shortName==="CN"||e.shortName==="E"||e.shortName==="O"){return e.value}}return""},enumerable:false,configurable:true});e.prototype.parseExtensions=function(){var t=this.asn.tbsCertList;if(t.crlExtensions){this.extensions=t.crlExtensions.map((function(t){return new i(s.serialize(t))}))}};e.prototype.exportAsBase64=function(){return K.Convert.ToBase64(this.raw)};e.prototype.exportAsHexFormatted=function(){return F(K.Convert.ToHex(this.raw))};e.prototype.exportAsPemFormatted=function(){return"-----BEGIN X509 CRL-----\n".concat(H(this.exportAsBase64()),"\n-----END X509 CRL-----")};e.prototype.downloadAsPEM=function(t){L.crl.asPEM(this.exportAsPemFormatted(),t||this.commonName)};e.prototype.downloadAsDER=function(t){L.crl.asDER(this.exportAsHexFormatted(),t||this.commonName)};return e}(e);t("a",J)}}}));
|
|
34
|
-
//# sourceMappingURL=p-6667fe6e.system.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{A as t,e as s,C as r,N as e,f as i,E as n,g as a,h as o,j as h,k as u,R as c,l as f,m as l,n as m,o as g,p,q as E,r as C,s as b}from"./p-74c241e7.js";import{b as A,D as w}from"./p-a053c132.js";
|
|
5
|
-
/**
|
|
6
|
-
* @license
|
|
7
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/class N extends t{constructor(t){super(s(t),r);this.thumbprints={};this.type="X.509 Certificate";const{tbsCertificate:n}=this.asn;this.serialNumber=A.Convert.ToHex(n.serialNumber);this.subject=new e(n.subject).toJSON();this.issuer=new e(n.issuer).toJSON();this.version=n.version+1;const a=n.validity.notBefore.utcTime||n.validity.notBefore.generalTime;if(!a){throw new Error("Cannot get 'notBefore' value")}this.notBefore=a;const o=n.validity.notAfter.utcTime||n.validity.notAfter.generalTime;if(!o){throw new Error("Cannot get 'notAfter' value")}this.notAfter=o;this.validity=i(this.notBefore,this.notAfter)}parseExtensions(){const{tbsCertificate:t}=this.asn;if(t.extensions){this.extensions=t.extensions.map((t=>new n(a.serialize(t))))}}getPublicKeyInfo(t){const{subjectPublicKey:s,algorithm:r}=t;let e;if(r.algorithm===o&&r.parameters){e=a.parse(r.parameters,h)}if(r.algorithm===u){e=a.parse(s,c)}if(r.algorithm===f){e=a.parse(s,l);e=e.map((t=>this.getPublicKeyInfo(t)))}const i=a.serialize(t);return{params:e,value:i,algorithm:r.algorithm}}get publicKey(){return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo)}get signature(){const{signatureValue:t,signatureAlgorithm:s}=this.asn;let r;if(s.algorithm===m){const e=a.parse(t,g);const i=a.parse(s.parameters,p);r=i.map(((t,s)=>Object.assign(Object.assign({},t),{value:e[s]})))}return{params:r,value:t,algorithm:s.algorithm}}exportAsBase64(){return A.Convert.ToBase64(this.raw)}exportAsHexFormatted(){return E(A.Convert.ToHex(this.raw))}exportAsPemFormatted(){return`-----BEGIN CERTIFICATE-----\n${C(this.exportAsBase64())}\n-----END CERTIFICATE-----`}async getThumbprint(t="SHA-1"){try{const s=await b(t,this.raw);if(s){this.thumbprints[t]=A.Convert.ToHex(s)}}catch(t){console.error("Error thumbprint get:",t)}}get commonName(){if(!this.subject){return""}for(let t=0;t<this.subject.length;t+=1){const s=this.subject[t];if(s.shortName==="CN"||s.shortName==="E"||s.shortName==="O"){return s.value}}return""}get issuerCommonName(){if(!this.issuer){return""}for(let t=0;t<this.issuer.length;t+=1){const s=this.issuer[t];if(s.shortName==="CN"){return s.value}if(s.shortName==="E"){return s.value}}return""}get isRoot(){return JSON.stringify(this.issuer)===JSON.stringify(this.subject)}subjectToString(){if(!this.subject){return""}return this.subject.map((t=>`${t.shortName}=${t.value}`)).join(", ")}issuerToString(){if(!this.issuer){return""}return this.issuer.map((t=>`${t.shortName}=${t.value}`)).join(", ")}downloadAsPEM(t){w.cert.asPEM(this.exportAsPemFormatted(),t||this.commonName)}downloadAsDER(t){w.cert.asDER(this.exportAsHexFormatted(),t||this.commonName)}}export{N as X};
|
|
12
|
-
//# sourceMappingURL=p-6e79b9c8.js.map
|