@peculiar/certificates-viewer 3.8.0 → 3.10.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/dist/cjs/{certification_request-6eb7ef37.js → certification_request-d5c6e32d.js} +9 -5
- package/dist/cjs/{crl-75106e2e.js → crl-5bce64c4.js} +6 -6
- package/dist/cjs/{download-a97f4cb2.js → download-93f7b773.js} +9 -5
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{l10n-17c96aba.js → l10n-ddc7cff9.js} +1 -1
- package/dist/cjs/{miscellaneous-0eade914.js → miscellaneous-cac1cd8b.js} +9 -12
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +7 -5
- package/dist/cjs/peculiar-button-split_4.cjs.entry.js +2 -2
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +5 -5
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +5 -5
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +4 -4
- package/dist/cjs/{x509_certificate-9e7652cf.js → x509_certificate-3760e0a8.js} +4 -4
- package/dist/collection/components/certificate-details-parts/extensions/general_name_part.js +2 -2
- package/dist/collection/components/certificate-details-parts/public_key.js +5 -8
- package/dist/collection/components/csr-viewer/csr-viewer.js +2 -0
- package/dist/collection/constants/oids.js +5 -2
- package/dist/collection/crypto/crl.js +1 -1
- package/dist/collection/crypto/csr.js +1 -1
- package/dist/collection/crypto/provider.js +2 -1
- package/dist/collection/crypto/x509_attribute_certificate.js +1 -1
- package/dist/collection/crypto/x509_certificate.js +1 -1
- package/dist/collection/utils/download_from_buffer.js +9 -5
- package/dist/esm/{certification_request-4adeae0c.js → certification_request-23cd5124.js} +9 -5
- package/dist/esm/{crl-2857d300.js → crl-7f23c111.js} +6 -6
- package/dist/esm/{download-67ac9120.js → download-91511aeb.js} +9 -5
- package/dist/esm/index.js +1 -1
- package/dist/esm/{l10n-a68d5748.js → l10n-d48f35ff.js} +1 -1
- package/dist/esm/{miscellaneous-91256fd3.js → miscellaneous-c7c0d04a.js} +9 -12
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +7 -5
- package/dist/esm/peculiar-button-split_4.entry.js +2 -2
- package/dist/esm/peculiar-certificate-decoder.entry.js +5 -5
- package/dist/esm/peculiar-certificate-viewer.entry.js +5 -5
- package/dist/esm/peculiar-certificates-viewer.entry.js +4 -4
- package/dist/esm/{x509_certificate-e7b4d8d1.js → x509_certificate-d8e0af2d.js} +4 -4
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/{p-40808c02.entry.js → p-01cea5c0.entry.js} +2 -2
- package/dist/peculiar/{p-5fb5f008.entry.js → p-3bfefa4a.entry.js} +1 -1
- package/dist/peculiar/{p-22d8ae9c.entry.js → p-4e8169cb.entry.js} +1 -1
- package/dist/peculiar/{p-7de0bfb3.entry.js → p-5b4eed12.entry.js} +1 -1
- package/dist/peculiar/p-711b4e1e.js +18 -0
- package/dist/peculiar/p-81a88a33.js +11 -0
- package/dist/peculiar/p-a050e184.js +69 -0
- package/dist/peculiar/{p-e7518804.js → p-c24c26c2.js} +5 -5
- package/dist/peculiar/{p-893659f4.entry.js → p-df53fbcc.entry.js} +1 -1
- package/dist/peculiar/{p-fec9d812.js → p-ec250cc4.js} +1 -1
- package/dist/peculiar/{p-b44dc7c9.js → p-fe05f51e.js} +5 -5
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/types/constants/oids.d.ts +4 -1
- package/dist/types/crypto/crl.d.ts +1 -1
- package/dist/types/crypto/csr.d.ts +1 -1
- package/dist/types/crypto/x509_attribute_certificate.d.ts +1 -1
- package/dist/types/crypto/x509_certificate.d.ts +1 -1
- package/dist/types/interface.d.ts +1 -0
- package/package.json +2 -2
- package/dist/peculiar/p-05f4713f.js +0 -11
- package/dist/peculiar/p-77121cf7.js +0 -69
- package/dist/peculiar/p-cff9655c.js +0 -18
|
@@ -24,7 +24,9 @@ function downloadFromBuffer(value, name, extension, mime = 'application/octet-st
|
|
|
24
24
|
if (navigator.msSaveBlob) { // IE10+ : (has Blob, but not a[download] or URL)
|
|
25
25
|
// @ts-ignore
|
|
26
26
|
navigator.msSaveBlob(blob, `${name}.${extension}`);
|
|
27
|
-
return new Promise((
|
|
27
|
+
return new Promise((resolve) => {
|
|
28
|
+
setTimeout(resolve, 100);
|
|
29
|
+
});
|
|
28
30
|
}
|
|
29
31
|
const blobURL = window.URL.createObjectURL(blob);
|
|
30
32
|
const link = document.createElement('a');
|
|
@@ -39,10 +41,12 @@ function downloadFromBuffer(value, name, extension, mime = 'application/octet-st
|
|
|
39
41
|
document.body.appendChild(link);
|
|
40
42
|
link.dispatchEvent(new MouseEvent('click'));
|
|
41
43
|
document.body.removeChild(link);
|
|
42
|
-
return new Promise((
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
return new Promise((resolve) => {
|
|
45
|
+
setTimeout(() => {
|
|
46
|
+
document.body.removeChild(frame);
|
|
47
|
+
resolve();
|
|
48
|
+
}, 100);
|
|
49
|
+
});
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import { c as createCommonjsModule, a as commonjsGlobal } from './download-
|
|
4
|
+
import { c as createCommonjsModule, a as commonjsGlobal } from './download-91511aeb.js';
|
|
5
5
|
|
|
6
6
|
var dayjs_min = createCommonjsModule(function (module, exports) {
|
|
7
7
|
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=v;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),l=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(h){case c:return r?l(1,0):l(31,11);case f:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),l=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,l=this;r=Number(r);var $=O.p(h),y=function(t){var e=w(l);return O.w(e.date(e.date()+Math.round(t*r)),l)};if($===f)return this.set(f,this.$M+r);if($===c)return this.set(c,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},$={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||$[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,v=this-M,g=O.m(this,M);return g=($={},$[c]=g/12,$[f]=g,$[h]=g/3,$[o]=(v-m)/6048e5,$[a]=(v-m)/864e5,$[u]=v/n,$[s]=v/e,$[i]=v/t,$)[y]||v,l?g:O.a(g)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[g],w.Ls=D,w.p={},w}));
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { h } from './index-bbd484d9.js';
|
|
5
|
-
import { l as l10n, a as dateShort } from './l10n-
|
|
6
|
-
import { b as build } from './download-
|
|
7
|
-
import { _ as OIDs, $ as Name, a3 as OtherName, u as AsnParser, a4 as DisplayText, a5 as UserNotice, a6 as EDIPartyName, a7 as __decorate, a8 as AsnProp, a9 as AsnPropTypes, aa as AsnType, ab as AsnTypeTypes, ac as AsnArray, ad as id_qcs_pkixQCSyntax_v2, ae as SemanticsInformation, af as AsnIntegerArrayBufferConverter, ag as KeyUsage, ah as BasicConstraints, ai as ExtendedKeyUsage, aj as SubjectKeyIdentifier, ak as AuthorityKeyIdentifier, al as CRLDistributionPoints, am as AuthorityInfoAccessSyntax, an as SubjectInfoAccessSyntax, ao as SubjectAlternativeName, ap as CertificatePolicies, aq as CertificateTransparency, ar as NameConstraints, as as CertificateTemplate, at as EnrollCertTypeChoice, au as CaVersion, av as QCStatements, aw as NetscapeComment, ax as NetscapeCertType, ay as LeiRole, az as LeiChoice, aA as Timestamp, aB as ArchiveRevInfo, a0 as CRLReason, aC as SubjectDirectoryAttributes, aD as PrivateKeyUsagePeriod, aE as EntrustVersionInfo, aF as BiometricSyntax, aG as LogotypeExtn, aH as TNAuthorizationList, aI as PolicyConstraints, aJ as PolicyMappings, aK as CRLNumber, aL as IssuingDistributionPoint } from './certification_request-
|
|
5
|
+
import { l as l10n, a as dateShort } from './l10n-d48f35ff.js';
|
|
6
|
+
import { b as build } from './download-91511aeb.js';
|
|
7
|
+
import { _ as OIDs, $ as Name, a3 as OtherName, u as AsnParser, a4 as DisplayText, a5 as UserNotice, a6 as EDIPartyName, a7 as __decorate, a8 as AsnProp, a9 as AsnPropTypes, aa as AsnType, ab as AsnTypeTypes, ac as AsnArray, ad as id_qcs_pkixQCSyntax_v2, ae as SemanticsInformation, af as AsnIntegerArrayBufferConverter, ag as KeyUsage, ah as BasicConstraints, ai as ExtendedKeyUsage, aj as SubjectKeyIdentifier, ak as AuthorityKeyIdentifier, al as CRLDistributionPoints, am as AuthorityInfoAccessSyntax, an as SubjectInfoAccessSyntax, ao as SubjectAlternativeName, ap as CertificatePolicies, aq as CertificateTransparency, ar as NameConstraints, as as CertificateTemplate, at as EnrollCertTypeChoice, au as CaVersion, av as QCStatements, aw as NetscapeComment, ax as NetscapeCertType, ay as LeiRole, az as LeiChoice, aA as Timestamp, aB as ArchiveRevInfo, a0 as CRLReason, aC as SubjectDirectoryAttributes, aD as PrivateKeyUsagePeriod, aE as EntrustVersionInfo, aF as BiometricSyntax, aG as LogotypeExtn, aH as TNAuthorizationList, aI as PolicyConstraints, aJ as PolicyMappings, aK as CRLNumber, aL as IssuingDistributionPoint } from './certification_request-23cd5124.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @license
|
|
@@ -120,9 +120,8 @@ const BasicInformation = (props) => {
|
|
|
120
120
|
* LICENSE file in the root directory of this source tree.
|
|
121
121
|
*/
|
|
122
122
|
function getPublicKeyModulus(publicKey) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
let length = publicKey.params['modulus'].byteLength;
|
|
123
|
+
if ('modulus' in publicKey.params) {
|
|
124
|
+
let length = publicKey.params.modulus.byteLength;
|
|
126
125
|
if (length % 2) {
|
|
127
126
|
length -= 1;
|
|
128
127
|
}
|
|
@@ -131,9 +130,8 @@ function getPublicKeyModulus(publicKey) {
|
|
|
131
130
|
return null;
|
|
132
131
|
}
|
|
133
132
|
function getPublicKeyExponent(publicKey) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return publicKey.params['publicExponent'].byteLength === 3
|
|
133
|
+
if ('publicExponent' in publicKey.params) {
|
|
134
|
+
return publicKey.params.publicExponent.byteLength === 3
|
|
137
135
|
? 65537
|
|
138
136
|
: 3;
|
|
139
137
|
}
|
|
@@ -145,10 +143,9 @@ const PublicKey = (props) => {
|
|
|
145
143
|
return null;
|
|
146
144
|
}
|
|
147
145
|
function renderKeyDetails(key) {
|
|
148
|
-
var _a;
|
|
149
146
|
return [
|
|
150
147
|
h(RowValue, { name: l10n.getString('algorithm'), value: getStringByOID(key.algorithm) }),
|
|
151
|
-
h(RowValue, { name: l10n.getString('namedCurve'), value: getStringByOID(
|
|
148
|
+
h(RowValue, { name: l10n.getString('namedCurve'), value: getStringByOID('namedCurve' in key.params ? key.params.namedCurve : undefined) }),
|
|
152
149
|
h(RowValue, { name: l10n.getString('exponent'), value: getPublicKeyExponent(key) }),
|
|
153
150
|
h(RowValue, { name: l10n.getString('modulus'), value: getPublicKeyModulus(key) }),
|
|
154
151
|
h(RowValue, { name: l10n.getString('value'), value: build.Convert.ToHex(key.value), monospace: true, collapse: true }),
|
|
@@ -379,7 +376,7 @@ const GeneralNamePart = (props) => {
|
|
|
379
376
|
if (value instanceof Name) {
|
|
380
377
|
return [
|
|
381
378
|
h(RowValue, { name: names[name] || name, value: "" }),
|
|
382
|
-
value.map((relativeDistinguishedName) => (relativeDistinguishedName.map((attributeTypeAndValue) => (h(RowValue, { name: OIDs[attributeTypeAndValue.type] || attributeTypeAndValue.type, value: attributeTypeAndValue.value.toString() }))))),
|
|
379
|
+
h(TableRowTable, null, value.map((relativeDistinguishedName) => (relativeDistinguishedName.map((attributeTypeAndValue) => (h(RowValue, { name: OIDs[attributeTypeAndValue.type] || attributeTypeAndValue.type, value: attributeTypeAndValue.value.toString() })))))),
|
|
383
380
|
];
|
|
384
381
|
}
|
|
385
382
|
if (value instanceof OtherName) {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { h, r as registerInstance, H as Host } from './index-bbd484d9.js';
|
|
5
|
-
import { _ as OIDs, $ as Name, G as ActivityDescription, W as WebGDPR, I as InsuranceValue, T as TypeRelationship, V as ValuationRanking, U as UnstructuredName, y as ChallengePassword, a0 as CRLReason, a1 as InvalidityDate, a2 as CertificateIssuer } from './certification_request-
|
|
6
|
-
import { b as build } from './download-
|
|
7
|
-
import { l as l10n, a as dateShort } from './l10n-
|
|
8
|
-
import { X as X509AttributeCertificate, a as CRL, C as CSR } from './crl-
|
|
9
|
-
import { g as getStringByOID, R as RowValue, G as GeneralNamePart, a as RowTitle, T as TableRowTable, B as BasicInformation, S as Signature, b as Thumbprints, c as getLEILink, d as getDNSNameLink, e as getIPAddressLink, E as Extensions, M as Miscellaneous, I as IssuerName, f as SubjectName, P as PublicKey } from './miscellaneous-
|
|
5
|
+
import { _ as OIDs, $ as Name, G as ActivityDescription, W as WebGDPR, I as InsuranceValue, T as TypeRelationship, V as ValuationRanking, U as UnstructuredName, y as ChallengePassword, a0 as CRLReason, a1 as InvalidityDate, a2 as CertificateIssuer } from './certification_request-23cd5124.js';
|
|
6
|
+
import { b as build } from './download-91511aeb.js';
|
|
7
|
+
import { l as l10n, a as dateShort } from './l10n-d48f35ff.js';
|
|
8
|
+
import { X as X509AttributeCertificate, a as CRL, C as CSR } from './crl-7f23c111.js';
|
|
9
|
+
import { g as getStringByOID, R as RowValue, G as GeneralNamePart, a as RowTitle, T as TableRowTable, B as BasicInformation, S as Signature, b as Thumbprints, c as getLEILink, d as getDNSNameLink, e as getIPAddressLink, E as Extensions, M as Miscellaneous, I as IssuerName, f as SubjectName, P as PublicKey } from './miscellaneous-c7c0d04a.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @license
|
|
@@ -510,7 +510,9 @@ const CsrViewer = class {
|
|
|
510
510
|
constructor(hostRef) {
|
|
511
511
|
registerInstance(this, hostRef);
|
|
512
512
|
this.isDecodeInProcess = true;
|
|
513
|
+
// eslint-disable-next-line class-methods-use-this
|
|
513
514
|
this.getAuthKeyIdParentLink = (value) => value;
|
|
515
|
+
// eslint-disable-next-line class-methods-use-this
|
|
514
516
|
this.getAuthKeyIdSiblingsLink = (value) => value;
|
|
515
517
|
this.getSubjectKeyIdChildrenLink = (value) => {
|
|
516
518
|
var _a;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-bbd484d9.js';
|
|
5
|
-
import { l as l10n, a as dateShort } from './l10n-
|
|
6
|
-
import './download-
|
|
5
|
+
import { l as l10n, a as dateShort } from './l10n-d48f35ff.js';
|
|
6
|
+
import './download-91511aeb.js';
|
|
7
7
|
|
|
8
8
|
const buttonSplitCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:inline-block;vertical-align:top;position:relative;white-space:nowrap;font-size:0}.button_split_icon{width:7px;height:5px;display:inline-block;vertical-align:middle}.button_split_with_icon{width:25px;border-bottom-left-radius:0;border-top-left-radius:0}.button_split_with_icon.m_open::part(base):before{position:fixed;width:100%;height:100%;top:0;left:0;content:\"\"}.button_split_action{width:100%}.button_split_container{position:absolute;bottom:calc(100% + 1px);left:0;width:100%;border-radius:2px;-webkit-box-shadow:0px -2px 1px rgb(var(--pv-color-light-rgb)), 0px 0px 10px rgba(var(--pv-color-dark-rgb), 0.0241168);box-shadow:0px -2px 1px rgb(var(--pv-color-light-rgb)), 0px 0px 10px rgba(var(--pv-color-dark-rgb), 0.0241168);z-index:1}.button_split>peculiar-button:first-of-type::part(base){border-top-right-radius:0;border-bottom-right-radius:0}.button_split>peculiar-button:last-of-type::part(base){border-top-left-radius:0;border-bottom-left-radius:0}.button_split>peculiar-button:not(:first-child){margin-left:-1px}";
|
|
9
9
|
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-bbd484d9.js';
|
|
5
|
-
import { i as isPem, a as isX509Pem, b as isPkcs10Pem, c as isX509AttributePem, d as isX509CRLPem } from './certification_request-
|
|
6
|
-
import './l10n-
|
|
7
|
-
import './download-
|
|
8
|
-
import { X as X509Certificate } from './x509_certificate-
|
|
9
|
-
import { X as X509AttributeCertificate, C as CSR, a as CRL } from './crl-
|
|
5
|
+
import { i as isPem, a as isX509Pem, b as isPkcs10Pem, c as isX509AttributePem, d as isX509CRLPem } from './certification_request-23cd5124.js';
|
|
6
|
+
import './l10n-d48f35ff.js';
|
|
7
|
+
import './download-91511aeb.js';
|
|
8
|
+
import { X as X509Certificate } from './x509_certificate-d8e0af2d.js';
|
|
9
|
+
import { X as X509AttributeCertificate, C as CSR, a as CRL } from './crl-7f23c111.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @license
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, h, H as Host } from './index-bbd484d9.js';
|
|
5
|
-
import { X as X509Certificate } from './x509_certificate-
|
|
6
|
-
import './certification_request-
|
|
7
|
-
import './download-
|
|
8
|
-
import './l10n-
|
|
9
|
-
import { B as BasicInformation, f as SubjectName, I as IssuerName, P as PublicKey, S as Signature, b as Thumbprints, E as Extensions, c as getLEILink, d as getDNSNameLink, e as getIPAddressLink, M as Miscellaneous } from './miscellaneous-
|
|
5
|
+
import { X as X509Certificate } from './x509_certificate-d8e0af2d.js';
|
|
6
|
+
import './certification_request-23cd5124.js';
|
|
7
|
+
import './download-91511aeb.js';
|
|
8
|
+
import './l10n-d48f35ff.js';
|
|
9
|
+
import { B as BasicInformation, f as SubjectName, I as IssuerName, P as PublicKey, S as Signature, b as Thumbprints, E as Extensions, c as getLEILink, d as getDNSNameLink, e as getIPAddressLink, M as Miscellaneous } from './miscellaneous-c7c0d04a.js';
|
|
10
10
|
|
|
11
11
|
const certificateViewerCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%;word-wrap:break-word;position:relative;min-width:280px;min-height:300px;background:white;background:rgba(var(--pv-color-light-rgb), 1)}th,td{border:none}table{width:100%;margin-bottom:30px;border-spacing:0;border-collapse:collapse}table table{margin-bottom:0}table .title td{border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5);padding-top:60px;padding-bottom:15px;border-bottom-width:1px;border-bottom-style:solid}table td:first-child{padding-left:30px;width:130px;padding-right:10px}table td:last-child{padding-right:30px;width:calc(100% - 130px)}table td{vertical-align:top;padding-top:5px;padding-bottom:5px}table td.vertical_align_middle{vertical-align:middle}table .title:first-child td{padding-top:15px}table .title+tr td{padding-top:15px}table td.monospace{max-width:0}table .divider{padding-top:15px;padding-bottom:15px}.divider .bg_fill{background-color:rgba(209, 213, 217, 0.5);background-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr:last-child .divider{padding-top:0;opacity:0}.divider span{display:block;height:1px}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.interaction_text{padding:15px 0;width:300px;margin:auto;text-align:center}@media (max-width: 900px){table,tr,td{display:block}table td:last-child,table td:first-child{padding-right:15px;padding-left:15px;width:100%}table .title+tr td{padding-top:5px}table .title+tr td:first-child{padding-top:15px}table td.monospace{width:100%;max-width:none}}:host([data-view=mobile]) table,:host([data-view=mobile]) tr,:host([data-view=mobile]) td{display:block}:host([data-view=mobile]) table td:last-child,:host([data-view=mobile]) table td:first-child{padding-right:15px;padding-left:15px;width:100%}:host([data-view=mobile]) table .title+tr td{padding-top:5px}:host([data-view=mobile]) table .title+tr td:first-child{padding-top:15px}:host([data-view=mobile]) table td.monospace{width:100%;max-width:none}";
|
|
12
12
|
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-bbd484d9.js';
|
|
5
|
-
import { X as X509Certificate } from './x509_certificate-
|
|
6
|
-
import { _ as OIDs } from './certification_request-
|
|
7
|
-
import './download-
|
|
8
|
-
import { l as l10n } from './l10n-
|
|
5
|
+
import { X as X509Certificate } from './x509_certificate-d8e0af2d.js';
|
|
6
|
+
import { _ as OIDs } from './certification_request-23cd5124.js';
|
|
7
|
+
import './download-91511aeb.js';
|
|
8
|
+
import { l as l10n } from './l10n-d48f35ff.js';
|
|
9
9
|
|
|
10
10
|
const certificatesViewerCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%;word-wrap:break-word;min-width:280px;overflow:auto;position:relative;background:white;background:rgba(var(--pv-color-light-rgb), 1)}table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}table thead{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07)}table tr td{vertical-align:middle}table tbody tr:not(.expanded_summary){cursor:pointer}table tr{border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table th{padding:15px 10px;border-width:1px;border-style:solid;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table td{padding:8px 10px;border-width:1px;border-style:solid;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table .col_issuer,table .col_name,table .col_public_key{width:16%}table .col_actions,table .col_tests{width:18%}table.m_extra .col_issuer,table.m_extra .col_name,table.m_extra .col_public_key{width:12%}table.m_extra .col_actions,table.m_extra .col_tests{width:17%}table tr.expanded td:not(:last-child){border-right-color:transparent}table tr.expanded td{border-bottom-color:transparent}.expanded{border-bottom-color:transparent;background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}table tr.expanded_summary{background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}table tr.expanded_summary td{vertical-align:top;padding:10px 20px 26px}@-webkit-keyframes fadeIn{0%{opacity:0.001}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0.001}100%{opacity:1}}.modal_wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;overflow:auto;text-align:center;-webkit-animation:fadeIn 200ms;animation:fadeIn 200ms;padding:30px 10px}.modal_wrapper:before{display:inline-block;vertical-align:middle;width:0;height:100%;content:\"\"}.modal_backdrop{background:rgba(42, 49, 52, 0.5);background:rgba(var(--pv-color-dark-rgb), 0.5);z-index:-1;position:fixed;top:0;right:0;bottom:0;left:0}.modal_container{position:relative;display:inline-block;vertical-align:middle;width:100%;max-width:900px;text-align:left;border-radius:3px;overflow:hidden;background-color:white;background-color:rgba(var(--pv-color-light-rgb), 1);height:100%}.modal_title{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);border-bottom-width:1px;border-bottom-style:solid;padding:20px 60px 16px 20px;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:60px}.modal_content{height:calc(100% - 60px);overflow-y:auto}.modal_close{cursor:pointer;border:none;background-color:transparent;position:absolute;top:0;bottom:0;right:0;padding:0 12px;-webkit-transition:opacity 100ms;transition:opacity 100ms;outline:none}.modal_close:hover{opacity:0.6}.modal_close svg{fill:#2a3134;fill:rgba(var(--pv-color-dark-rgb), 1)}.button_table_action{margin:2px}.mobile_title{display:none}.status_wrapper{height:85px;text-align:center;pointer-events:none}.search_section{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);height:50px;padding:10px;border-width:1px 1px 0 1px;border-style:solid}.input_search{height:100%;width:100%;border-radius:3px;border-width:1px;border-style:solid;padding:0 14px;font-size:12px;outline:none;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);color:#2a3134;color:rgba(var(--pv-color-dark-rgb), 1)}.input_search::-webkit-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::-moz-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search:-ms-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::-ms-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.loading_container{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(42, 49, 52, 0.3);background:rgba(var(--pv-color-dark-rgb), 0.3);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.align_center{text-align:center}@media (hover: hover){table tbody tr:not(.expanded_summary):hover{background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}}@media (max-width: 900px){table,tbody,tr,td{display:block}thead{display:none}tr{padding:0 15px;border-width:1px;border-style:solid}tr:not(:first-child){margin-top:-1px}tr:not(.expanded_summary) td:first-child{border:none !important}table td{padding-left:0;padding-right:0;border-width:1px 0 0 0 !important;border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr.expanded_summary td{padding:15px 0}.mobile_title{display:inline-block;width:90px;vertical-align:middle}.modal_title{padding:17px 60px 17px 15px}.content{display:inline-block;width:calc(100% - 90px);vertical-align:middle;text-align:left}.expanded_summary{border-top-color:transparent;padding-bottom:10px}.expanded_summary td:before{content:none}.status_wrapper{height:266px;display:table-cell}.search_section{height:60px;padding:15px}.align_center{text-align:inherit}}";
|
|
11
11
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import { A as AsnData, e as certificateRawToBuffer, C as Certificate, N as Name, E as Extension, f as AsnConvert, g as id_ecPublicKey, h as ECParameters, j as id_rsaEncryption, R as RSAPublicKey, k as id_composite_key, l as CompositePublicKey, m as id_alg_composite, n as CompositeSignatureValue, o as CompositeParams, p as hexFormat, q as base64Format, r as getCertificateThumbprint } from './certification_request-
|
|
5
|
-
import { b as build, D as Download } from './download-
|
|
6
|
-
import { d as dateDiff } from './l10n-
|
|
4
|
+
import { A as AsnData, e as certificateRawToBuffer, C as Certificate, N as Name, E as Extension, f as AsnConvert, g as id_ecPublicKey, h as ECParameters, j as id_rsaEncryption, R as RSAPublicKey, k as id_composite_key, l as CompositePublicKey, m as id_alg_composite, n as CompositeSignatureValue, o as CompositeParams, p as hexFormat, q as base64Format, r as getCertificateThumbprint } from './certification_request-23cd5124.js';
|
|
5
|
+
import { b as build, D as Download } from './download-91511aeb.js';
|
|
6
|
+
import { d as dateDiff } from './l10n-d48f35ff.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
@@ -93,7 +93,7 @@ class X509Certificate extends AsnData {
|
|
|
93
93
|
try {
|
|
94
94
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
95
95
|
if (thumbprint) {
|
|
96
|
-
this.thumbprints[algorithm
|
|
96
|
+
this.thumbprints[algorithm] = build.Convert.ToHex(thumbprint);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
catch (error) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as i,h as e,H as s}from"./p-f7683ba5.js";import{i as o,a as r,b as a,c,d as n}from"./p-
|
|
4
|
+
import{r as t,c as i,h as e,H as s}from"./p-f7683ba5.js";import{i as o,a as r,b as a,c,d as n}from"./p-fe05f51e.js";import"./p-ec250cc4.js";import"./p-711b4e1e.js";import{X as l}from"./p-81a88a33.js";import{X as p,C as h,a as f}from"./p-c24c26c2.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
|
-
*/function
|
|
11
|
+
*/function u(t){return new Promise(((i,e)=>{const s=new FileReader;s.onload=()=>i({value:s.result,fileName:t.name,fileSize:t.size,sourceMime:t.type}),s.onerror=()=>e(s.error),s.readAsBinaryString(t)}))}const d=class{constructor(e){t(this,e),this.successParse=i(this,"successParse",7),this.clearCertificate=i(this,"clearCertificate",7),this.onClickDecode=()=>{const{value:t}=this.inputPaste;t&&this.decode(t)},this.onClickExample=()=>{this.decode(this.certificateExample)},this.onClickClear=()=>{this.clearValue()},this.onChangeInputFile=async t=>{const i=t.target;if(i.files){const t=await u(i.files[0]);"string"==typeof t.value&&this.decode(t.value),i.value=""}},this.onDropFile=async t=>{t.stopPropagation(),t.preventDefault();const i=t.dataTransfer;if(i.files){const t=await u(i.files[0]);"string"==typeof t.value&&this.decode(t.value)}}}componentDidLoad(){this.defaultCertificate&&setTimeout((()=>this.decode(this.defaultCertificate)),100)}clearValue(){this.inputPaste.value="",this.certificateDecoded=null,this.clearCertificate.emit()}setValue(t){this.certificateDecoded=t,this.inputPaste.value=t.exportAsPemFormatted(),this.successParse.emit(t.exportAsBase64())}decode(t){const i=o(t),e=r(t),s=a(t),u=c(t),d=n(t);let b,w;if(i&&!(e||u||s||d))return this.clearValue(),void alert("Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.");try{e&&(b=new l(t)),u&&(b=new p(t)),s&&(b=new h(t)),d&&(b=new f(t))}catch(t){w=t}if(!b)try{b=new l(t)}catch(t){w=t}if(!b)try{b=new p(t)}catch(t){w=t}if(!b)try{b=new h(t)}catch(t){w=t}if(!b)try{b=new f(t)}catch(t){w=t}b?this.setValue(b):(this.clearValue(),console.log(w),alert("Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL."))}render(){return e(s,null,e("textarea",{placeholder:"Certificate DER or PEM",class:"textarea",ref:t=>{this.inputPaste=t},onDrop:this.onDropFile}),e("div",{class:"controls"},e("peculiar-button",{fill:"fill",class:"button",onClick:this.onClickDecode},"Decode"),e("peculiar-button",{class:"button"},"Choose file",e("input",{type:"file",class:"input_file",accept:"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl",onChange:this.onChangeInputFile,value:""})),e("peculiar-button",{class:"button",onClick:this.onClickClear},"Clear"),this.certificateExample&&e("peculiar-button",{class:"button",onClick:this.onClickExample},"Example")),this.certificateDecoded instanceof l&&e("peculiar-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:!0}),this.certificateDecoded instanceof p&&e("peculiar-attribute-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:!0}),this.certificateDecoded instanceof h&&e("peculiar-csr-viewer",{certificate:this.certificateDecoded,class:"viewer",download:!0}),this.certificateDecoded instanceof f&&e("peculiar-crl-viewer",{certificate:this.certificateDecoded,class:"viewer",download:!0}))}};d.style=":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-user-drag:none;-ms-content-zooming:none;word-wrap:break-word;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;display:block;width:100%;font-size:0}.textarea{min-height:300px;width:100%;border-radius:3px;border-width:1px;border-style:solid;padding:14px;font-family:monospace;resize:vertical;background-color:white;background-color:rgba(var(--pv-color-light-rgb), 1);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);color:#2a3134;color:rgba(var(--pv-color-dark-rgb), 1);letter-spacing:0.03em;letter-spacing:var(--pv-letter-spacing-normal);font-size:14px;font-size:var(--pv-font-size-h7)}.controls{margin-top:10px}.button{position:relative}.button:not(:first-child){margin-left:10px}.viewer{margin-top:64px}.input_file{opacity:0;width:100%;height:100%;top:0;left:0;display:block;position:absolute}";export{d as peculiar_certificate_decoder}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{h as t,r as e,H as i}from"./p-f7683ba5.js";import{_ as a,$ as r,G as s,W as n,I as d,T as o,V as l,U as c,y as h,a0 as p,a1 as b,a2 as g}from"./p-
|
|
4
|
+
import{h as t,r as e,H as i}from"./p-f7683ba5.js";import{_ as a,$ as r,G as s,W as n,I as d,T as o,V as l,U as c,y as h,a0 as p,a1 as b,a2 as g}from"./p-fe05f51e.js";import{b as u}from"./p-711b4e1e.js";import{l as m,a as x}from"./p-ec250cc4.js";import{X as v,a as f,C as w}from"./p-c24c26c2.js";import{g as y,R as k,G as L,a as I,T as S,B as A,S as _,b as N,c as D,d as j,e as K,E as P,M as C,I as E,f as z,P as T}from"./p-a050e184.js";
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as r,h as e,H as o}from"./p-f7683ba5.js";import{X as a}from"./p-05f4713f.js";import{_ as i}from"./p-b44dc7c9.js";import"./p-cff9655c.js";import{l}from"./p-fec9d812.js";const s=class{constructor(e){t(this,e),this.detailsOpen=r(this,"detailsOpen",7),this.detailsClose=r(this,"detailsClose",7),this.certificates=[],this.filterWithSearch=!0,this.highlightWithSearch=!0,this.search="",this.certificatesDecoded=[],this.isDecodeInProcess=!0,this.isHasTests=!1,this.isHasRoots=!1,this.handleClickDetails=(t,r)=>{r.stopPropagation(),this.certificateSelectedForDetails=t,this.detailsOpen.emit(t)},this.handleModalClose=()=>{this.certificateSelectedForDetails=void 0,this.detailsClose.emit()},this.handleSearch=t=>{this.search=t.target.value.trim()}}componentWillLoad(){this.certificatesDecodeAndSet()}watchCertificates(t,r){JSON.stringify(t)!==JSON.stringify(r)&&this.certificatesDecodeAndSet()}async certificatesDecodeAndSet(){let t=!1,r=!1;if(!Array.isArray(this.certificates))return;const e=[];for(const o of this.certificates)try{const i=new a(o.value);await i.getThumbprint("SHA-1"),e.push({body:i,tests:o.tests,name:o.name}),!r&&i.isRoot&&(r=!0),t||o.tests&&(o.tests.expired||o.tests.revoked||o.tests.valid)&&(t=!0)}catch(t){console.error("Error certificate parse:",t)}this.isHasTests=t,this.isHasRoots=r,this.isDecodeInProcess=!1,this.certificatesDecoded=e}handleClickDownloadAsPem(t,r){r.stopPropagation(),t.body.downloadAsPEM(t.name||t.body.commonName)}handleClickDownloadAsDer(t,r){r.stopPropagation(),t.body.downloadAsDER(t.name||t.body.commonName)}handleClickRow(t){this.expandedRow=this.expandedRow===t?void 0:t}getMaxColSpanValue(){let t=4;return this.isHasTests&&(t+=1),this.isHasRoots||(t+=1),t}renderExpandedRow(t){const r=this.getMaxColSpanValue();return e("tr",{class:"expanded_summary"},e("td",{colSpan:r},e("peculiar-certificate-summary",{certificate:t,showIssuer:!t.isRoot})))}renderCertificateTests(t){if(!t)return null;const r=[];return t.valid&&r.push(e("peculiar-button",{class:"button_table_action",href:t.valid,target:"_blank"},l.getString("valid"))),t.revoked&&r.push(e("peculiar-button",{class:"button_table_action",href:t.revoked,target:"_blank"},l.getString("revoked"))),t.expired&&r.push(e("peculiar-button",{class:"button_table_action",href:t.expired,target:"_blank"},l.getString("expired"))),r}renderContentState(){const t=this.highlightWithSearch?this.search:"",r=[];return this.certificatesDecoded.forEach(((o,a)=>{const s=a===this.expandedRow,c=i[o.body.signature.algorithm]||o.body.signature.algorithm;this.filterWithSearch&&this.search&&-1===[c,o.body.issuerCommonName,o.name,o.body.commonName,o.body.thumbprints["SHA-1"]].join(" ").toLowerCase().indexOf(this.search.toLowerCase())||r.push([e("tr",{class:{expanded:s},onClick:this.handleClickRow.bind(this,a),key:o.body.thumbprints["SHA-1"]},!this.isHasRoots&&e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},l.getString("issuer"),":"),e("peculiar-typography",{class:"content"},e("peculiar-highlight-words",{search:t},o.body.issuerCommonName))),e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},l.getString("name"),":"),e("peculiar-typography",{class:"content"},e("peculiar-highlight-words",{search:t},o.name||o.body.commonName))),e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},l.getString("publicKey"),":"),e("peculiar-typography",{class:"content"},e("peculiar-highlight-words",{search:t},c))),e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},l.getString("fingerprint")," (SHA-1):"),e("peculiar-typography",{class:"content",monospace:!0},e("peculiar-highlight-words",{search:t},o.body.thumbprints["SHA-1"]))),e("td",{class:"align_center"},e("peculiar-typography",{class:"mobile_title",color:"grey_5"},l.getString("actions"),":"),e("span",{class:"content"},e("peculiar-button",{onClick:this.handleClickDetails.bind(this,o.body),class:"button_table_action"},l.getString("details")),e("peculiar-button-split",{onClick:this.handleClickDownloadAsPem.bind(this,o),actions:[{text:l.getString("download.der"),onClick:this.handleClickDownloadAsDer.bind(this,o)}],class:"button_table_action"},l.getString("download.pem")))),this.isHasTests&&e("td",{class:"align_center"},e("peculiar-typography",{class:"mobile_title",color:"grey_5"},l.getString("testURLs"),":"),e("span",{class:"content"},this.renderCertificateTests(o.tests)))),s&&this.renderExpandedRow(o.body)])})),r}renderCertificateDetailsModal(){return this.certificateSelectedForDetails?e("div",{class:"modal_wrapper",role:"presentation","aria-hidden":"false",part:"presentation"},e("div",{class:"modal_backdrop",onClick:this.handleModalClose,"aria-hidden":"true"}),e("div",{class:"modal_container",role:"dialog",part:"presentation_container"},e("header",{class:"modal_title"},e("peculiar-typography",{type:"h4"},l.getString("certificateDetails")),e("button",{class:"modal_close",onClick:this.handleModalClose,type:"button","aria-label":"Close",title:"Close"},e("svg",{width:"30",height:"30",viewBox:"0 0 30 30",xmlns:"http://www.w3.org/2000/svg"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.7204 14.375L21.0654 19.7185C21.3115 19.9658 21.3115 20.3693 21.0654 20.6154L20.615 21.0645C20.3689 21.3118 19.9667 21.3118 19.7181 21.0645L14.3744 15.721L9.03194 21.0645C8.78327 21.3118 8.3811 21.3118 8.13371 21.0645L7.68459 20.6154C7.43847 20.3693 7.43847 19.9658 7.68459 19.7185L13.0296 14.375L7.68459 9.03155C7.43847 8.78417 7.43847 8.38074 7.68459 8.13463L8.13371 7.68554C8.3811 7.43815 8.78327 7.43815 9.03194 7.68554L14.3744 13.029L19.7181 7.68554C19.9667 7.43815 20.3689 7.43815 20.615 7.68554L21.0654 8.13463C21.3115 8.38074 21.3115 8.78417 21.0654 9.03155L15.7204 14.375Z"})))),e("div",{class:"modal_content"},e("peculiar-certificate-viewer",{certificate:this.certificateSelectedForDetails})))):null}renderSearch(){return this.filterWithSearch||this.highlightWithSearch?e("div",{class:"search_section"},e("input",{onInput:this.handleSearch,type:"search",value:"",class:"input_search",disabled:!this.certificatesDecoded.length,placeholder:"Search"})):null}renderEmptyState(){const t=this.getMaxColSpanValue();return e("tr",null,e("td",{class:"status_wrapper",colSpan:t},e("peculiar-typography",{type:"b1",align:"center"},"There are no certificates available.")))}renderEmptySearchState(){const t=this.getMaxColSpanValue();return e("tr",null,e("td",{class:"status_wrapper",colSpan:t},e("peculiar-typography",{type:"b1",align:"center"},"No results found for “",this.search,"“")))}renderLoadingState(){return e("div",{class:"loading_container"},e("peculiar-circular-progress",null))}renderBody(){if(this.isDecodeInProcess)return null;if(!this.certificatesDecoded.length)return this.renderEmptyState();const t=this.renderContentState();return this.search&&!t.length?this.renderEmptySearchState():t}render(){return e(o,null,this.renderSearch(),e("table",{class:{m_extra:this.isHasTests||!this.isHasRoots}},e("thead",null,e("tr",null,!this.isHasRoots&&e("th",{class:"col_issuer"},e("peculiar-typography",{type:"h7",align:"left"},l.getString("issuer"))),e("th",{class:"col_name"},e("peculiar-typography",{type:"h7",align:"left"},l.getString("name"))),e("th",{class:"col_public_key"},e("peculiar-typography",{type:"h7",align:"left"},l.getString("publicKey"))),e("th",{class:"col_fingerprint"},e("peculiar-typography",{type:"h7",align:"left"},l.getString("fingerprint")," (SHA-1)")),e("th",{class:"col_actions"},e("peculiar-typography",{type:"h7",align:"center"},l.getString("actions"))),this.isHasTests&&e("th",{class:"col_tests"},e("peculiar-typography",{type:"h7",align:"center"},l.getString("testURLs"))))),e("tbody",null,this.renderBody())),this.renderCertificateDetailsModal(),this.isDecodeInProcess&&this.renderLoadingState())}static get watchers(){return{certificates:["watchCertificates"]}}};s.style=':host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%;word-wrap:break-word;min-width:280px;overflow:auto;position:relative;background:white;background:rgba(var(--pv-color-light-rgb), 1)}table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}table thead{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07)}table tr td{vertical-align:middle}table tbody tr:not(.expanded_summary){cursor:pointer}table tr{border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table th{padding:15px 10px;border-width:1px;border-style:solid;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table td{padding:8px 10px;border-width:1px;border-style:solid;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table .col_issuer,table .col_name,table .col_public_key{width:16%}table .col_actions,table .col_tests{width:18%}table.m_extra .col_issuer,table.m_extra .col_name,table.m_extra .col_public_key{width:12%}table.m_extra .col_actions,table.m_extra .col_tests{width:17%}table tr.expanded td:not(:last-child){border-right-color:transparent}table tr.expanded td{border-bottom-color:transparent}.expanded{border-bottom-color:transparent;background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}table tr.expanded_summary{background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}table tr.expanded_summary td{vertical-align:top;padding:10px 20px 26px}@-webkit-keyframes fadeIn{0%{opacity:0.001}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0.001}100%{opacity:1}}.modal_wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;overflow:auto;text-align:center;-webkit-animation:fadeIn 200ms;animation:fadeIn 200ms;padding:30px 10px}.modal_wrapper:before{display:inline-block;vertical-align:middle;width:0;height:100%;content:""}.modal_backdrop{background:rgba(42, 49, 52, 0.5);background:rgba(var(--pv-color-dark-rgb), 0.5);z-index:-1;position:fixed;top:0;right:0;bottom:0;left:0}.modal_container{position:relative;display:inline-block;vertical-align:middle;width:100%;max-width:900px;text-align:left;border-radius:3px;overflow:hidden;background-color:white;background-color:rgba(var(--pv-color-light-rgb), 1);height:100%}.modal_title{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);border-bottom-width:1px;border-bottom-style:solid;padding:20px 60px 16px 20px;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:60px}.modal_content{height:calc(100% - 60px);overflow-y:auto}.modal_close{cursor:pointer;border:none;background-color:transparent;position:absolute;top:0;bottom:0;right:0;padding:0 12px;-webkit-transition:opacity 100ms;transition:opacity 100ms;outline:none}.modal_close:hover{opacity:0.6}.modal_close svg{fill:#2a3134;fill:rgba(var(--pv-color-dark-rgb), 1)}.button_table_action{margin:2px}.mobile_title{display:none}.status_wrapper{height:85px;text-align:center;pointer-events:none}.search_section{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);height:50px;padding:10px;border-width:1px 1px 0 1px;border-style:solid}.input_search{height:100%;width:100%;border-radius:3px;border-width:1px;border-style:solid;padding:0 14px;font-size:12px;outline:none;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);color:#2a3134;color:rgba(var(--pv-color-dark-rgb), 1)}.input_search::-webkit-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::-moz-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search:-ms-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::-ms-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.loading_container{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(42, 49, 52, 0.3);background:rgba(var(--pv-color-dark-rgb), 0.3);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.align_center{text-align:center}@media (hover: hover){table tbody tr:not(.expanded_summary):hover{background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}}@media (max-width: 900px){table,tbody,tr,td{display:block}thead{display:none}tr{padding:0 15px;border-width:1px;border-style:solid}tr:not(:first-child){margin-top:-1px}tr:not(.expanded_summary) td:first-child{border:none !important}table td{padding-left:0;padding-right:0;border-width:1px 0 0 0 !important;border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr.expanded_summary td{padding:15px 0}.mobile_title{display:inline-block;width:90px;vertical-align:middle}.modal_title{padding:17px 60px 17px 15px}.content{display:inline-block;width:calc(100% - 90px);vertical-align:middle;text-align:left}.expanded_summary{border-top-color:transparent;padding-bottom:10px}.expanded_summary td:before{content:none}.status_wrapper{height:266px;display:table-cell}.search_section{height:60px;padding:15px}.align_center{text-align:inherit}}';export{s as peculiar_certificates_viewer}
|
|
4
|
+
import{r as t,c as r,h as e,H as o}from"./p-f7683ba5.js";import{X as a}from"./p-81a88a33.js";import{_ as i}from"./p-fe05f51e.js";import"./p-711b4e1e.js";import{l}from"./p-ec250cc4.js";const s=class{constructor(e){t(this,e),this.detailsOpen=r(this,"detailsOpen",7),this.detailsClose=r(this,"detailsClose",7),this.certificates=[],this.filterWithSearch=!0,this.highlightWithSearch=!0,this.search="",this.certificatesDecoded=[],this.isDecodeInProcess=!0,this.isHasTests=!1,this.isHasRoots=!1,this.handleClickDetails=(t,r)=>{r.stopPropagation(),this.certificateSelectedForDetails=t,this.detailsOpen.emit(t)},this.handleModalClose=()=>{this.certificateSelectedForDetails=void 0,this.detailsClose.emit()},this.handleSearch=t=>{this.search=t.target.value.trim()}}componentWillLoad(){this.certificatesDecodeAndSet()}watchCertificates(t,r){JSON.stringify(t)!==JSON.stringify(r)&&this.certificatesDecodeAndSet()}async certificatesDecodeAndSet(){let t=!1,r=!1;if(!Array.isArray(this.certificates))return;const e=[];for(const o of this.certificates)try{const i=new a(o.value);await i.getThumbprint("SHA-1"),e.push({body:i,tests:o.tests,name:o.name}),!r&&i.isRoot&&(r=!0),t||o.tests&&(o.tests.expired||o.tests.revoked||o.tests.valid)&&(t=!0)}catch(t){console.error("Error certificate parse:",t)}this.isHasTests=t,this.isHasRoots=r,this.isDecodeInProcess=!1,this.certificatesDecoded=e}handleClickDownloadAsPem(t,r){r.stopPropagation(),t.body.downloadAsPEM(t.name||t.body.commonName)}handleClickDownloadAsDer(t,r){r.stopPropagation(),t.body.downloadAsDER(t.name||t.body.commonName)}handleClickRow(t){this.expandedRow=this.expandedRow===t?void 0:t}getMaxColSpanValue(){let t=4;return this.isHasTests&&(t+=1),this.isHasRoots||(t+=1),t}renderExpandedRow(t){const r=this.getMaxColSpanValue();return e("tr",{class:"expanded_summary"},e("td",{colSpan:r},e("peculiar-certificate-summary",{certificate:t,showIssuer:!t.isRoot})))}renderCertificateTests(t){if(!t)return null;const r=[];return t.valid&&r.push(e("peculiar-button",{class:"button_table_action",href:t.valid,target:"_blank"},l.getString("valid"))),t.revoked&&r.push(e("peculiar-button",{class:"button_table_action",href:t.revoked,target:"_blank"},l.getString("revoked"))),t.expired&&r.push(e("peculiar-button",{class:"button_table_action",href:t.expired,target:"_blank"},l.getString("expired"))),r}renderContentState(){const t=this.highlightWithSearch?this.search:"",r=[];return this.certificatesDecoded.forEach(((o,a)=>{const s=a===this.expandedRow,c=i[o.body.signature.algorithm]||o.body.signature.algorithm;this.filterWithSearch&&this.search&&-1===[c,o.body.issuerCommonName,o.name,o.body.commonName,o.body.thumbprints["SHA-1"]].join(" ").toLowerCase().indexOf(this.search.toLowerCase())||r.push([e("tr",{class:{expanded:s},onClick:this.handleClickRow.bind(this,a),key:o.body.thumbprints["SHA-1"]},!this.isHasRoots&&e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},l.getString("issuer"),":"),e("peculiar-typography",{class:"content"},e("peculiar-highlight-words",{search:t},o.body.issuerCommonName))),e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},l.getString("name"),":"),e("peculiar-typography",{class:"content"},e("peculiar-highlight-words",{search:t},o.name||o.body.commonName))),e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},l.getString("publicKey"),":"),e("peculiar-typography",{class:"content"},e("peculiar-highlight-words",{search:t},c))),e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},l.getString("fingerprint")," (SHA-1):"),e("peculiar-typography",{class:"content",monospace:!0},e("peculiar-highlight-words",{search:t},o.body.thumbprints["SHA-1"]))),e("td",{class:"align_center"},e("peculiar-typography",{class:"mobile_title",color:"grey_5"},l.getString("actions"),":"),e("span",{class:"content"},e("peculiar-button",{onClick:this.handleClickDetails.bind(this,o.body),class:"button_table_action"},l.getString("details")),e("peculiar-button-split",{onClick:this.handleClickDownloadAsPem.bind(this,o),actions:[{text:l.getString("download.der"),onClick:this.handleClickDownloadAsDer.bind(this,o)}],class:"button_table_action"},l.getString("download.pem")))),this.isHasTests&&e("td",{class:"align_center"},e("peculiar-typography",{class:"mobile_title",color:"grey_5"},l.getString("testURLs"),":"),e("span",{class:"content"},this.renderCertificateTests(o.tests)))),s&&this.renderExpandedRow(o.body)])})),r}renderCertificateDetailsModal(){return this.certificateSelectedForDetails?e("div",{class:"modal_wrapper",role:"presentation","aria-hidden":"false",part:"presentation"},e("div",{class:"modal_backdrop",onClick:this.handleModalClose,"aria-hidden":"true"}),e("div",{class:"modal_container",role:"dialog",part:"presentation_container"},e("header",{class:"modal_title"},e("peculiar-typography",{type:"h4"},l.getString("certificateDetails")),e("button",{class:"modal_close",onClick:this.handleModalClose,type:"button","aria-label":"Close",title:"Close"},e("svg",{width:"30",height:"30",viewBox:"0 0 30 30",xmlns:"http://www.w3.org/2000/svg"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.7204 14.375L21.0654 19.7185C21.3115 19.9658 21.3115 20.3693 21.0654 20.6154L20.615 21.0645C20.3689 21.3118 19.9667 21.3118 19.7181 21.0645L14.3744 15.721L9.03194 21.0645C8.78327 21.3118 8.3811 21.3118 8.13371 21.0645L7.68459 20.6154C7.43847 20.3693 7.43847 19.9658 7.68459 19.7185L13.0296 14.375L7.68459 9.03155C7.43847 8.78417 7.43847 8.38074 7.68459 8.13463L8.13371 7.68554C8.3811 7.43815 8.78327 7.43815 9.03194 7.68554L14.3744 13.029L19.7181 7.68554C19.9667 7.43815 20.3689 7.43815 20.615 7.68554L21.0654 8.13463C21.3115 8.38074 21.3115 8.78417 21.0654 9.03155L15.7204 14.375Z"})))),e("div",{class:"modal_content"},e("peculiar-certificate-viewer",{certificate:this.certificateSelectedForDetails})))):null}renderSearch(){return this.filterWithSearch||this.highlightWithSearch?e("div",{class:"search_section"},e("input",{onInput:this.handleSearch,type:"search",value:"",class:"input_search",disabled:!this.certificatesDecoded.length,placeholder:"Search"})):null}renderEmptyState(){const t=this.getMaxColSpanValue();return e("tr",null,e("td",{class:"status_wrapper",colSpan:t},e("peculiar-typography",{type:"b1",align:"center"},"There are no certificates available.")))}renderEmptySearchState(){const t=this.getMaxColSpanValue();return e("tr",null,e("td",{class:"status_wrapper",colSpan:t},e("peculiar-typography",{type:"b1",align:"center"},"No results found for “",this.search,"“")))}renderLoadingState(){return e("div",{class:"loading_container"},e("peculiar-circular-progress",null))}renderBody(){if(this.isDecodeInProcess)return null;if(!this.certificatesDecoded.length)return this.renderEmptyState();const t=this.renderContentState();return this.search&&!t.length?this.renderEmptySearchState():t}render(){return e(o,null,this.renderSearch(),e("table",{class:{m_extra:this.isHasTests||!this.isHasRoots}},e("thead",null,e("tr",null,!this.isHasRoots&&e("th",{class:"col_issuer"},e("peculiar-typography",{type:"h7",align:"left"},l.getString("issuer"))),e("th",{class:"col_name"},e("peculiar-typography",{type:"h7",align:"left"},l.getString("name"))),e("th",{class:"col_public_key"},e("peculiar-typography",{type:"h7",align:"left"},l.getString("publicKey"))),e("th",{class:"col_fingerprint"},e("peculiar-typography",{type:"h7",align:"left"},l.getString("fingerprint")," (SHA-1)")),e("th",{class:"col_actions"},e("peculiar-typography",{type:"h7",align:"center"},l.getString("actions"))),this.isHasTests&&e("th",{class:"col_tests"},e("peculiar-typography",{type:"h7",align:"center"},l.getString("testURLs"))))),e("tbody",null,this.renderBody())),this.renderCertificateDetailsModal(),this.isDecodeInProcess&&this.renderLoadingState())}static get watchers(){return{certificates:["watchCertificates"]}}};s.style=':host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%;word-wrap:break-word;min-width:280px;overflow:auto;position:relative;background:white;background:rgba(var(--pv-color-light-rgb), 1)}table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}table thead{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07)}table tr td{vertical-align:middle}table tbody tr:not(.expanded_summary){cursor:pointer}table tr{border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table th{padding:15px 10px;border-width:1px;border-style:solid;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table td{padding:8px 10px;border-width:1px;border-style:solid;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table .col_issuer,table .col_name,table .col_public_key{width:16%}table .col_actions,table .col_tests{width:18%}table.m_extra .col_issuer,table.m_extra .col_name,table.m_extra .col_public_key{width:12%}table.m_extra .col_actions,table.m_extra .col_tests{width:17%}table tr.expanded td:not(:last-child){border-right-color:transparent}table tr.expanded td{border-bottom-color:transparent}.expanded{border-bottom-color:transparent;background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}table tr.expanded_summary{background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}table tr.expanded_summary td{vertical-align:top;padding:10px 20px 26px}@-webkit-keyframes fadeIn{0%{opacity:0.001}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0.001}100%{opacity:1}}.modal_wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;overflow:auto;text-align:center;-webkit-animation:fadeIn 200ms;animation:fadeIn 200ms;padding:30px 10px}.modal_wrapper:before{display:inline-block;vertical-align:middle;width:0;height:100%;content:""}.modal_backdrop{background:rgba(42, 49, 52, 0.5);background:rgba(var(--pv-color-dark-rgb), 0.5);z-index:-1;position:fixed;top:0;right:0;bottom:0;left:0}.modal_container{position:relative;display:inline-block;vertical-align:middle;width:100%;max-width:900px;text-align:left;border-radius:3px;overflow:hidden;background-color:white;background-color:rgba(var(--pv-color-light-rgb), 1);height:100%}.modal_title{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);border-bottom-width:1px;border-bottom-style:solid;padding:20px 60px 16px 20px;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:60px}.modal_content{height:calc(100% - 60px);overflow-y:auto}.modal_close{cursor:pointer;border:none;background-color:transparent;position:absolute;top:0;bottom:0;right:0;padding:0 12px;-webkit-transition:opacity 100ms;transition:opacity 100ms;outline:none}.modal_close:hover{opacity:0.6}.modal_close svg{fill:#2a3134;fill:rgba(var(--pv-color-dark-rgb), 1)}.button_table_action{margin:2px}.mobile_title{display:none}.status_wrapper{height:85px;text-align:center;pointer-events:none}.search_section{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);height:50px;padding:10px;border-width:1px 1px 0 1px;border-style:solid}.input_search{height:100%;width:100%;border-radius:3px;border-width:1px;border-style:solid;padding:0 14px;font-size:12px;outline:none;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);color:#2a3134;color:rgba(var(--pv-color-dark-rgb), 1)}.input_search::-webkit-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::-moz-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search:-ms-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::-ms-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.loading_container{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(42, 49, 52, 0.3);background:rgba(var(--pv-color-dark-rgb), 0.3);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.align_center{text-align:center}@media (hover: hover){table tbody tr:not(.expanded_summary):hover{background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}}@media (max-width: 900px){table,tbody,tr,td{display:block}thead{display:none}tr{padding:0 15px;border-width:1px;border-style:solid}tr:not(:first-child){margin-top:-1px}tr:not(.expanded_summary) td:first-child{border:none !important}table td{padding-left:0;padding-right:0;border-width:1px 0 0 0 !important;border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr.expanded_summary td{padding:15px 0}.mobile_title{display:inline-block;width:90px;vertical-align:middle}.modal_title{padding:17px 60px 17px 15px}.content{display:inline-block;width:calc(100% - 90px);vertical-align:middle;text-align:left}.expanded_summary{border-top-color:transparent;padding-bottom:10px}.expanded_summary td:before{content:none}.status_wrapper{height:266px;display:table-cell}.search_section{height:60px;padding:15px}.align_center{text-align:inherit}}';export{s as peculiar_certificates_viewer}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as i,H as e}from"./p-f7683ba5.js";import{X as a}from"./p-
|
|
4
|
+
import{r as t,h as i,H as e}from"./p-f7683ba5.js";import{X as a}from"./p-81a88a33.js";import"./p-fe05f51e.js";import"./p-711b4e1e.js";import"./p-ec250cc4.js";import{B as r,f as d,I as s,P as o,S as l,b as n,E as p,c as h,d as c,e as b,M as g}from"./p-a050e184.js";const m=class{constructor(i){t(this,i),this.isDecodeInProcess=!0,this.getAuthKeyIdParentLink=t=>{var i;return null===(i=this.authKeyIdParentLink)||void 0===i?void 0:i.replace("{{authKeyId}}",t)},this.getAuthKeyIdSiblingsLink=t=>{var i;return null===(i=this.authKeyIdSiblingsLink)||void 0===i?void 0:i.replace("{{authKeyId}}",t)},this.getSubjectKeyIdChildrenLink=t=>{var i;return null===(i=this.subjectKeyIdChildrenLink)||void 0===i?void 0:i.replace("{{subjectKeyId}}",t)},this.getSubjectKeyIdSiblingsLink=t=>{var i;return null===(i=this.subjectKeyIdSiblingsLink)||void 0===i?void 0:i.replace("{{subjectKeyId}}",t)}}componentWillLoad(){this.decodeCertificate(this.certificate)}async decodeCertificate(t){this.isDecodeInProcess=!0;try{if(t instanceof a)this.certificateDecoded=t;else{if("string"!=typeof t)return;this.certificateDecoded=new a(t)}this.certificateDecoded.parseExtensions(),await this.certificateDecoded.getThumbprint("SHA-1"),await this.certificateDecoded.getThumbprint("SHA-256")}catch(t){this.certificateDecodeError=t,console.error("Error certificate parse:",t)}this.isDecodeInProcess=!1}watchCertificateAndDecode(t,i){"string"!=typeof t||"string"!=typeof i?t instanceof a&&i instanceof a&&t.serialNumber!==i.serialNumber&&this.decodeCertificate(t):t!==i&&this.decodeCertificate(t)}getIssuerDnLink(){return this.issuerDnLink}renderErrorState(){return i("div",{class:"status_wrapper"},i("peculiar-typography",{type:"b1",class:"interaction_text"},"There was an error decoding this certificate."))}renderEmptyState(){return i("div",{class:"status_wrapper"},i("peculiar-typography",{type:"b1",class:"interaction_text"},"There is no certificate available."))}render(){return this.certificateDecodeError?this.renderErrorState():this.certificateDecoded?i(e,{"data-view":this.view},i("table",null,i(r,Object.assign({},this.certificateDecoded)),i(d,{name:this.certificateDecoded.subject}),i(s,{name:this.certificateDecoded.issuer,issuerDnLink:this.getIssuerDnLink()}),i(o,{publicKey:this.certificateDecoded.publicKey}),i(l,{signature:this.certificateDecoded.signature}),i(n,{thumbprints:this.certificateDecoded.thumbprints}),i(p,{extensions:this.certificateDecoded.extensions,getLEILink:h,getDNSNameLink:c,getIPAddressLink:b,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),this.download&&i(g,{certificate:this.certificateDecoded}))):this.renderEmptyState()}static get watchers(){return{certificate:["watchCertificateAndDecode"]}}};m.style=":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%;word-wrap:break-word;position:relative;min-width:280px;min-height:300px;background:white;background:rgba(var(--pv-color-light-rgb), 1)}th,td{border:none}table{width:100%;margin-bottom:30px;border-spacing:0;border-collapse:collapse}table table{margin-bottom:0}table .title td{border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5);padding-top:60px;padding-bottom:15px;border-bottom-width:1px;border-bottom-style:solid}table td:first-child{padding-left:30px;width:130px;padding-right:10px}table td:last-child{padding-right:30px;width:calc(100% - 130px)}table td{vertical-align:top;padding-top:5px;padding-bottom:5px}table td.vertical_align_middle{vertical-align:middle}table .title:first-child td{padding-top:15px}table .title+tr td{padding-top:15px}table td.monospace{max-width:0}table .divider{padding-top:15px;padding-bottom:15px}.divider .bg_fill{background-color:rgba(209, 213, 217, 0.5);background-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr:last-child .divider{padding-top:0;opacity:0}.divider span{display:block;height:1px}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.interaction_text{padding:15px 0;width:300px;margin:auto;text-align:center}@media (max-width: 900px){table,tr,td{display:block}table td:last-child,table td:first-child{padding-right:15px;padding-left:15px;width:100%}table .title+tr td{padding-top:5px}table .title+tr td:first-child{padding-top:15px}table td.monospace{width:100%;max-width:none}}:host([data-view=mobile]) table,:host([data-view=mobile]) tr,:host([data-view=mobile]) td{display:block}:host([data-view=mobile]) table td:last-child,:host([data-view=mobile]) table td:first-child{padding-right:15px;padding-left:15px;width:100%}:host([data-view=mobile]) table .title+tr td{padding-top:5px}:host([data-view=mobile]) table .title+tr td:first-child{padding-top:15px}:host([data-view=mobile]) table td.monospace{width:100%;max-width:none}";export{m as peculiar_certificate_viewer}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/
|
|
11
|
+
function t(t,r,e,n="application/octet-stream"){const s=new Blob([t],{type:n});if(navigator.msSaveBlob)return navigator.msSaveBlob(s,`${r}.${e}`),new Promise((t=>{setTimeout(t,100)}));const i=window.URL.createObjectURL(s),a=document.createElement("a"),o=document.createElement("iframe");return a.style.display="none",o.style.display="none",o.name=i,document.body.appendChild(o),a.href=i,a.target=i,a.download=`${r}.${e}`,document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a),new Promise((t=>{setTimeout((()=>{document.body.removeChild(o),t()}),100)}))}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,r,e){return t(e={path:r,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},e.exports),e.exports}var n=e((function(t,r){Object.defineProperty(r,"__esModule",{value:!0});class e{static isArrayBuffer(t){return"[object ArrayBuffer]"===Object.prototype.toString.call(t)}static toArrayBuffer(t){return this.isArrayBuffer(t)?t:t.byteLength===t.buffer.byteLength?t.buffer:this.toUint8Array(t).slice().buffer}static toUint8Array(t){return this.toView(t,Uint8Array)}static toView(t,r){if(t.constructor===r)return t;if(this.isArrayBuffer(t))return new r(t);if(this.isArrayBufferView(t))return new r(t.buffer,t.byteOffset,t.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(t){return this.isArrayBufferView(t)||this.isArrayBuffer(t)}static isArrayBufferView(t){return ArrayBuffer.isView(t)||t&&this.isArrayBuffer(t.buffer)}static isEqual(t,r){const n=e.toUint8Array(t),s=e.toUint8Array(r);if(n.length!==s.byteLength)return!1;for(let t=0;t<n.length;t++)if(n[t]!==s[t])return!1;return!0}static concat(...t){if(Array.isArray(t[0])){const r=t[0];let e=0;for(const t of r)e+=t.byteLength;const n=new Uint8Array(e);let s=0;for(const t of r){const r=this.toUint8Array(t);n.set(r,s),s+=r.length}return t[1]?this.toView(n,t[1]):n.buffer}return this.concat(t)}}class n{static fromString(t){const r=unescape(encodeURIComponent(t)),e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e.buffer}static toString(t){const r=e.toUint8Array(t);let n="";for(let t=0;t<r.length;t++)n+=String.fromCharCode(r[t]);return decodeURIComponent(escape(n))}}class s{static toString(t,r=!1){const n=e.toArrayBuffer(t),s=new DataView(n);let i="";for(let t=0;t<n.byteLength;t+=2){const e=s.getUint16(t,r);i+=String.fromCharCode(e)}return i}static fromString(t,r=!1){const e=new ArrayBuffer(2*t.length),n=new DataView(e);for(let e=0;e<t.length;e++)n.setUint16(2*e,t.charCodeAt(e),r);return e}}class i{static isHex(t){return"string"==typeof t&&/^[a-z0-9]+$/i.test(t)}static isBase64(t){return"string"==typeof t&&/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}static isBase64Url(t){return"string"==typeof t&&/^[a-zA-Z0-9-_]+$/i.test(t)}static ToString(t,r="utf8"){const n=e.toUint8Array(t);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return s.toString(n,!0);case"utf16":case"utf16be":return s.toString(n);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(t,r="utf8"){if(!t)return new ArrayBuffer(0);switch(r.toLowerCase()){case"utf8":return this.FromUtf8String(t);case"binary":return this.FromBinary(t);case"hex":return this.FromHex(t);case"base64":return this.FromBase64(t);case"base64url":return this.FromBase64Url(t);case"utf16le":return s.fromString(t,!0);case"utf16":case"utf16be":return s.fromString(t);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(t){const r=e.toUint8Array(t);if("undefined"!=typeof btoa){const t=this.ToString(r,"binary");return btoa(t)}return Buffer.from(r).toString("base64")}static FromBase64(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!i.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return"undefined"!=typeof atob?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!i.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(t){return this.ToBase64(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(t,r=i.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(t);case"utf8":return n.fromString(t);case"utf16":case"utf16be":return s.fromString(t);case"utf16le":case"usc2":return s.fromString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(t,r=i.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(t);case"utf8":return n.toString(t);case"utf16":case"utf16be":return s.toString(t);case"utf16le":case"usc2":return s.toString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(t){const r=t.length,e=new Uint8Array(r);for(let n=0;n<r;n++)e[n]=t.charCodeAt(n);return e.buffer}static ToBinary(t){const r=e.toUint8Array(t);let n="";for(let t=0;t<r.length;t++)n+=String.fromCharCode(r[t]);return n}static ToHex(t){const r=e.toUint8Array(t),n=[],s=r.length;for(let t=0;t<s;t++){const e=r[t].toString(16).padStart(2,"0");n.push(e)}return n.join("")}static FromHex(t){let r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!i.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);const e=new Uint8Array(r.length/2);for(let t=0;t<r.length;t+=2){const n=r.slice(t,t+2);e[t/2]=parseInt(n,16)}return e.buffer}static ToUtf16String(t,r=!1){return s.toString(t,r)}static FromUtf16String(t,r=!1){return s.fromString(t,r)}static Base64Padding(t){const r=4-t.length%4;if(r<4)for(let e=0;e<r;e++)t+="=";return t}static formatString(t){return(null==t?void 0:t.replace(/[\n\r\t ]/g,""))||""}}i.DEFAULT_UTF8_ENCODING="utf8",r.BufferSourceConverter=e,r.Convert=i,r.assign=function(t){const r=arguments[0];for(let t=1;t<arguments.length;t++){const e=arguments[t];for(const t in e)r[t]=e[t]}return r},r.combine=function(...t){const r=t.map((t=>t.byteLength)).reduce(((t,r)=>t+r)),e=new Uint8Array(r);let n=0;return t.map((t=>new Uint8Array(t))).forEach((t=>{for(const r of t)e[n++]=r})),e.buffer},r.isEqual=function(t,r){if(!t||!r)return!1;if(t.byteLength!==r.byteLength)return!1;const e=new Uint8Array(t),n=new Uint8Array(r);for(let r=0;r<t.byteLength;r++)if(e[r]!==n[r])return!1;return!0}}));
|
|
12
|
+
/**
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/class s{}s.cert={asPEM:(r,e)=>{t(n.Convert.FromString(r),e,"cer","application/pkix-cert")},asDER:(r,e)=>{t(n.Convert.FromString(r),e,"cer","application/pkix-cert")}},s.attrCert={asPEM:(r,e)=>{t(n.Convert.FromString(r),e,"cer","application/pkix-attr-cert")},asDER:(r,e)=>{t(n.Convert.FromString(r),e,"cer","application/pkix-attr-cert")}},s.csr={asPEM:(r,e)=>{t(n.Convert.FromString(r),e,"csr","application/pkcs10")},asDER:(r,e)=>{t(n.Convert.FromString(r),e,"csr","application/pkcs10")}},s.crl={asPEM:(r,e)=>{t(n.Convert.FromString(r),e,"crl","application/pkix-crl")},asDER:(r,e)=>{t(n.Convert.FromString(r),e,"crl","application/pkix-crl")}};export{s as D,r as a,n as b,e as c,t as d}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import{A as t,e as s,C as e,N as r,E as i,f as n,g as o,h as a,j as h,R as u,k as c,l as m,m as f,n as l,o as g,p,q as E,r as b}from"./p-fe05f51e.js";import{b as C,D as A}from"./p-711b4e1e.js";import{d as w}from"./p-ec250cc4.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),e),this.thumbprints={},this.type="X.509 Certificate";const{tbsCertificate:i}=this.asn;this.serialNumber=C.Convert.ToHex(i.serialNumber),this.subject=new r(i.subject).toJSON(),this.issuer=new r(i.issuer).toJSON(),this.version=i.version+1;const n=i.validity.notBefore.utcTime||i.validity.notBefore.generalTime;if(!n)throw new Error("Cannot get 'notBefore' value");this.notBefore=n;const o=i.validity.notAfter.utcTime||i.validity.notAfter.generalTime;if(!o)throw new Error("Cannot get 'notAfter' value");this.notAfter=o,this.validity=w(this.notBefore,this.notAfter)}parseExtensions(){const{tbsCertificate:t}=this.asn;t.extensions&&(this.extensions=t.extensions.map((t=>new i(n.serialize(t)))))}getPublicKeyInfo(t){const{subjectPublicKey:s,algorithm:e}=t;let r;return e.algorithm===o&&e.parameters&&(r=n.parse(e.parameters,a)),e.algorithm===h&&(r=n.parse(s,u)),e.algorithm===c&&(r=n.parse(s,m),r=r.map((t=>this.getPublicKeyInfo(t)))),{params:r,value:n.serialize(t),algorithm:e.algorithm}}get publicKey(){return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo)}get signature(){const{signatureValue:t,signatureAlgorithm:s}=this.asn;let e;if(s.algorithm===f){const r=n.parse(t,l);e=n.parse(s.parameters,g).map(((t,s)=>Object.assign(Object.assign({},t),{value:r[s]})))}return{params:e,value:t,algorithm:s.algorithm}}exportAsBase64(){return C.Convert.ToBase64(this.raw)}exportAsHexFormatted(){return p(C.Convert.ToHex(this.raw))}exportAsPemFormatted(){return`-----BEGIN CERTIFICATE-----\n${E(this.exportAsBase64())}\n-----END CERTIFICATE-----`}async getThumbprint(t="SHA-1"){try{const s=await b(t,this.raw);s&&(this.thumbprints[t]=C.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("CN"===s.shortName||"E"===s.shortName||"O"===s.shortName)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("CN"===s.shortName)return s.value;if("E"===s.shortName)return s.value}return""}get isRoot(){return JSON.stringify(this.issuer)===JSON.stringify(this.subject)}subjectToString(){return this.subject?this.subject.map((t=>`${t.shortName}=${t.value}`)).join(", "):""}issuerToString(){return this.issuer?this.issuer.map((t=>`${t.shortName}=${t.value}`)).join(", "):""}downloadAsPEM(t){A.cert.asPEM(this.exportAsPemFormatted(),t||this.commonName)}downloadAsDER(t){A.cert.asDER(this.exportAsHexFormatted(),t||this.commonName)}}export{N as X}
|