@peculiar/certificates-viewer 3.1.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/cjs/{certification_request-878e786a.js → certification_request-cde57123.js} +137 -266
  2. package/dist/cjs/csr-78378ed0.js +150 -0
  3. package/dist/cjs/download-6724f3a7.js +79 -0
  4. package/dist/cjs/{download-5e7d5455.js → index-ff818d4d.js} +0 -72
  5. package/dist/cjs/index.cjs.js +2 -1
  6. package/dist/cjs/l10n-a048a686.js +145 -0
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/peculiar-attribute-certificate-viewer_2.cjs.entry.js +479 -0
  9. package/dist/cjs/peculiar-button_5.cjs.entry.js +148 -0
  10. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +173 -0
  11. package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +1 -1
  12. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +124 -0
  13. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +6 -4
  14. package/dist/cjs/peculiar.cjs.js +1 -1
  15. package/dist/cjs/public_key-2f5bd471.js +1104 -0
  16. package/dist/cjs/x509_attribute_certificate-cc325b70.js +87 -0
  17. package/dist/cjs/x509_certificate-51a97033.js +139 -0
  18. package/dist/collection/components/certificate-decoder/certificate-decoder.js +54 -23
  19. package/dist/collection/components/certificate-viewer/attributes/type_relationship_attribute.js +1 -1
  20. package/dist/collection/components/certificate-viewer/extensions/basic_constraints_extension.js +1 -1
  21. package/dist/collection/components/certificate-viewer/extensions/basic_extension.js +1 -1
  22. package/dist/collection/components/certificate-viewer/extensions/timestamp_extension.js +1 -1
  23. package/dist/collection/utils/index.js +0 -1
  24. package/dist/collection/www-copy/index.js +80 -0
  25. package/dist/esm/{certification_request-3402a181.js → certification_request-c0674647.js} +76 -205
  26. package/dist/esm/csr-c1b6a176.js +147 -0
  27. package/dist/esm/download-735fb2eb.js +76 -0
  28. package/dist/esm/{download-cf68ac2c.js → index-0ba131b0.js} +1 -71
  29. package/dist/esm/index.js +2 -1
  30. package/dist/esm/l10n-ac28fa92.js +141 -0
  31. package/dist/esm/loader.js +1 -1
  32. package/dist/esm/peculiar-attribute-certificate-viewer_2.entry.js +474 -0
  33. package/dist/esm/peculiar-button_5.entry.js +140 -0
  34. package/dist/esm/peculiar-certificate-decoder.entry.js +169 -0
  35. package/dist/esm/peculiar-certificate-summary_3.entry.js +1 -1
  36. package/dist/esm/peculiar-certificate-viewer.entry.js +120 -0
  37. package/dist/esm/peculiar-certificates-viewer.entry.js +5 -3
  38. package/dist/esm/peculiar.js +1 -1
  39. package/dist/esm/public_key-38c9ddc8.js +1089 -0
  40. package/dist/esm/x509_attribute_certificate-a6d4aa15.js +85 -0
  41. package/dist/esm/x509_certificate-12f6d344.js +137 -0
  42. package/dist/peculiar/index.esm.js +1 -1
  43. package/dist/peculiar/p-006865d7.js +4 -0
  44. package/dist/peculiar/p-17c4da7b.js +11 -0
  45. package/dist/peculiar/{p-b09a1f0b.entry.js → p-38635919.entry.js} +1 -1
  46. package/dist/peculiar/p-3f8d1008.entry.js +4 -0
  47. package/dist/peculiar/p-42da7f97.js +11 -0
  48. package/dist/peculiar/p-464e0943.js +87 -0
  49. package/dist/peculiar/p-4f4c1d30.js +12 -0
  50. package/dist/peculiar/p-6011646e.entry.js +11 -0
  51. package/dist/peculiar/p-6bfd077c.entry.js +18 -0
  52. package/dist/peculiar/p-6c510523.js +18 -0
  53. package/dist/peculiar/p-986cc770.entry.js +11 -0
  54. package/dist/peculiar/p-b765873e.js +78 -0
  55. package/dist/peculiar/p-d7a13cb4.js +18 -0
  56. package/dist/peculiar/p-dafae164.entry.js +4 -0
  57. package/dist/peculiar/peculiar.esm.js +1 -1
  58. package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +13 -1
  59. package/dist/types/components.d.ts +20 -0
  60. package/dist/types/utils/index.d.ts +0 -1
  61. package/package.json +2 -3
  62. package/dist/cjs/l10n-d4a77087.js +0 -767
  63. package/dist/cjs/peculiar-attribute-certificate-viewer_9.cjs.entry.js +0 -2187
  64. package/dist/collection/utils/history.js +0 -19
  65. package/dist/collection/utils/parse_hash.js +0 -28
  66. package/dist/collection/utils/query_stringify.js +0 -21
  67. package/dist/esm/l10n-9ac63748.js +0 -762
  68. package/dist/esm/peculiar-attribute-certificate-viewer_9.entry.js +0 -2175
  69. package/dist/peculiar/p-08538084.entry.js +0 -113
  70. package/dist/peculiar/p-3fc37750.entry.js +0 -4
  71. package/dist/peculiar/p-8ad24aa3.js +0 -87
  72. package/dist/peculiar/p-99797a49.js +0 -34
  73. package/dist/peculiar/p-c774ec0b.js +0 -18
  74. package/dist/types/utils/history.d.ts +0 -9
  75. package/dist/types/utils/parse_hash.d.ts +0 -9
  76. package/dist/types/utils/query_stringify.d.ts +0 -8
@@ -0,0 +1,85 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
+ */
4
+ import { A as AsnData, d as certificateRawToBuffer, m as AttributeCertificate, E as Extension, e as AsnConvert, l as getCertificateThumbprint, j as hexFormat, k as base64Format } from './certification_request-c0674647.js';
5
+ import { b as build } from './index-0ba131b0.js';
6
+ import { d as dateDiff } from './l10n-ac28fa92.js';
7
+ import { A as Attribute } from './csr-c1b6a176.js';
8
+
9
+ /**
10
+ * @license
11
+ * Copyright (c) Peculiar Ventures, LLC.
12
+ *
13
+ * This source code is licensed under the MIT license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */
16
+ class X509AttributeCertificate extends AsnData {
17
+ constructor(raw) {
18
+ var _a;
19
+ super(certificateRawToBuffer(raw), AttributeCertificate);
20
+ this.thumbprints = {};
21
+ this.type = 'X.509 Attribute Certificate';
22
+ const { acinfo } = this.asn;
23
+ this.serialNumber = build.Convert.ToHex(acinfo.serialNumber);
24
+ this.version = acinfo.version;
25
+ const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;
26
+ if (!notBefore) {
27
+ throw new Error("Cannot get 'notBefore' value");
28
+ }
29
+ this.notBefore = notBefore;
30
+ const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;
31
+ if (!notAfter) {
32
+ throw new Error("Cannot get 'notAfter' value");
33
+ }
34
+ this.notAfter = notAfter;
35
+ this.validity = dateDiff(this.notBefore, this.notAfter);
36
+ this.issuer = acinfo.issuer.v1Form || ((_a = acinfo.issuer.v2Form) === null || _a === void 0 ? void 0 : _a.issuerName);
37
+ this.holder = acinfo.holder;
38
+ }
39
+ get signature() {
40
+ const { signatureValue, signatureAlgorithm } = this.asn;
41
+ return {
42
+ value: signatureValue,
43
+ algorithm: signatureAlgorithm.algorithm,
44
+ };
45
+ }
46
+ parseExtensions() {
47
+ const { acinfo } = this.asn;
48
+ if (acinfo.extensions) {
49
+ this.extensions = acinfo.extensions
50
+ .map((e) => new Extension(AsnConvert.serialize(e)));
51
+ }
52
+ }
53
+ parseAttributes() {
54
+ const { acinfo } = this.asn;
55
+ if (acinfo.attributes) {
56
+ this.attributes = acinfo.attributes
57
+ .map((e) => new Attribute(AsnConvert.serialize(e)));
58
+ }
59
+ }
60
+ async getThumbprint(algorithm = 'SHA-1') {
61
+ try {
62
+ const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
63
+ if (thumbprint) {
64
+ this.thumbprints[algorithm['name'] || algorithm] = build.Convert.ToHex(thumbprint);
65
+ }
66
+ }
67
+ catch (error) {
68
+ console.error('Error thumbprint get:', error);
69
+ }
70
+ }
71
+ exportAsBase64() {
72
+ return build.Convert.ToBase64(this.raw);
73
+ }
74
+ exportAsHexFormatted() {
75
+ return hexFormat(build.Convert.ToHex(this.raw));
76
+ }
77
+ exportAsPemFormatted() {
78
+ return `-----BEGIN ATTRIBUTE CERTIFICATE-----\n${base64Format(this.exportAsBase64())}\n-----END ATTRIBUTE CERTIFICATE-----`;
79
+ }
80
+ get commonName() {
81
+ return `attribute-certificate-${this.thumbprints['SHA-1']}`;
82
+ }
83
+ }
84
+
85
+ export { X509AttributeCertificate as X };
@@ -0,0 +1,137 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
+ */
4
+ import { A as AsnData, d as certificateRawToBuffer, C as Certificate, N as Name, E as Extension, e as AsnConvert, f as id_ecPublicKey, g as ECParameters, h as id_rsaEncryption, R as RSAPublicKey, j as hexFormat, k as base64Format, l as getCertificateThumbprint } from './certification_request-c0674647.js';
5
+ import { b as build } from './index-0ba131b0.js';
6
+ import { d as dateDiff } from './l10n-ac28fa92.js';
7
+
8
+ /**
9
+ * @license
10
+ * Copyright (c) Peculiar Ventures, LLC.
11
+ *
12
+ * This source code is licensed under the MIT license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */
15
+ class X509Certificate extends AsnData {
16
+ constructor(raw) {
17
+ super(certificateRawToBuffer(raw), Certificate);
18
+ this.thumbprints = {};
19
+ this.type = 'X.509 Certificate';
20
+ const { tbsCertificate } = this.asn;
21
+ this.serialNumber = build.Convert.ToHex(tbsCertificate.serialNumber);
22
+ this.subject = new Name(tbsCertificate.subject).toJSON();
23
+ this.issuer = new Name(tbsCertificate.issuer).toJSON();
24
+ this.version = tbsCertificate.version + 1;
25
+ const notBefore = tbsCertificate.validity.notBefore.utcTime
26
+ || tbsCertificate.validity.notBefore.generalTime;
27
+ if (!notBefore) {
28
+ throw new Error("Cannot get 'notBefore' value");
29
+ }
30
+ this.notBefore = notBefore;
31
+ const notAfter = tbsCertificate.validity.notAfter.utcTime
32
+ || tbsCertificate.validity.notAfter.generalTime;
33
+ if (!notAfter) {
34
+ throw new Error("Cannot get 'notAfter' value");
35
+ }
36
+ this.notAfter = notAfter;
37
+ this.validity = dateDiff(this.notBefore, this.notAfter);
38
+ }
39
+ parseExtensions() {
40
+ const { tbsCertificate } = this.asn;
41
+ if (tbsCertificate.extensions) {
42
+ this.extensions = tbsCertificate.extensions
43
+ .map((e) => new Extension(AsnConvert.serialize(e)));
44
+ }
45
+ }
46
+ get publicKey() {
47
+ const { subjectPublicKey, algorithm } = this.asn.tbsCertificate.subjectPublicKeyInfo;
48
+ let params;
49
+ if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {
50
+ params = AsnConvert.parse(algorithm.parameters, ECParameters);
51
+ }
52
+ if (algorithm.algorithm === id_rsaEncryption) {
53
+ params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);
54
+ }
55
+ const spki = AsnConvert.serialize(this.asn.tbsCertificate.subjectPublicKeyInfo);
56
+ return {
57
+ params,
58
+ value: spki,
59
+ algorithm: algorithm.algorithm,
60
+ };
61
+ }
62
+ get signature() {
63
+ const { signatureValue, signatureAlgorithm } = this.asn;
64
+ return {
65
+ value: signatureValue,
66
+ algorithm: signatureAlgorithm.algorithm,
67
+ };
68
+ }
69
+ exportAsBase64() {
70
+ return build.Convert.ToBase64(this.raw);
71
+ }
72
+ exportAsHexFormatted() {
73
+ return hexFormat(build.Convert.ToHex(this.raw));
74
+ }
75
+ exportAsPemFormatted() {
76
+ return `-----BEGIN CERTIFICATE-----\n${base64Format(this.exportAsBase64())}\n-----END CERTIFICATE-----`;
77
+ }
78
+ async getThumbprint(algorithm = 'SHA-1') {
79
+ try {
80
+ const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
81
+ if (thumbprint) {
82
+ this.thumbprints[algorithm['name'] || algorithm] = build.Convert.ToHex(thumbprint);
83
+ }
84
+ }
85
+ catch (error) {
86
+ console.error('Error thumbprint get:', error);
87
+ }
88
+ }
89
+ get commonName() {
90
+ if (!this.subject) {
91
+ return '';
92
+ }
93
+ for (let i = 0; i < this.subject.length; i += 1) {
94
+ const name = this.subject[i];
95
+ if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {
96
+ return name.value;
97
+ }
98
+ }
99
+ return '';
100
+ }
101
+ get issuerCommonName() {
102
+ if (!this.issuer) {
103
+ return '';
104
+ }
105
+ for (let i = 0; i < this.issuer.length; i += 1) {
106
+ const name = this.issuer[i];
107
+ if (name.shortName === 'CN') {
108
+ return name.value;
109
+ }
110
+ if (name.shortName === 'E') {
111
+ return name.value;
112
+ }
113
+ }
114
+ return '';
115
+ }
116
+ get isRoot() {
117
+ return JSON.stringify(this.issuer) === JSON.stringify(this.subject);
118
+ }
119
+ subjectToString() {
120
+ if (!this.subject) {
121
+ return '';
122
+ }
123
+ return this.subject
124
+ .map((name) => (`${name.shortName}=${name.value}`))
125
+ .join(', ');
126
+ }
127
+ issuerToString() {
128
+ if (!this.issuer) {
129
+ return '';
130
+ }
131
+ return this.issuer
132
+ .map((name) => (`${name.shortName}=${name.value}`))
133
+ .join(', ');
134
+ }
135
+ }
136
+
137
+ export { X509Certificate as X };
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
3
  */
4
- export{D as Download,d as downloadFromBuffer}from"./p-c774ec0b.js";import"./p-d0b55fbb.js";
4
+ export{D as Download,d as downloadFromBuffer}from"./p-d7a13cb4.js";import"./p-006865d7.js";import"./p-d0b55fbb.js";
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
+ */
4
+ import{c as t}from"./p-d0b55fbb.js";var r=t((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}}));export{r as b}
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
+ */
4
+ import{A as t,d as s,C as r,N as e,E as i,e as n,f as o,g as a,h,R as u,j as c,k as m,l as f}from"./p-464e0943.js";import{b as g}from"./p-006865d7.js";import{d as l}from"./p-4f4c1d30.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 p extends t{constructor(t){super(s(t),r),this.thumbprints={},this.type="X.509 Certificate";const{tbsCertificate:i}=this.asn;this.serialNumber=g.Convert.ToHex(i.serialNumber),this.subject=new e(i.subject).toJSON(),this.issuer=new e(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=l(this.notBefore,this.notAfter)}parseExtensions(){const{tbsCertificate:t}=this.asn;t.extensions&&(this.extensions=t.extensions.map((t=>new i(n.serialize(t)))))}get publicKey(){const{subjectPublicKey:t,algorithm:s}=this.asn.tbsCertificate.subjectPublicKeyInfo;let r;return s.algorithm===o&&s.parameters&&(r=n.parse(s.parameters,a)),s.algorithm===h&&(r=n.parse(t,u)),{params:r,value:n.serialize(this.asn.tbsCertificate.subjectPublicKeyInfo),algorithm:s.algorithm}}get signature(){const{signatureValue:t,signatureAlgorithm:s}=this.asn;return{value:t,algorithm:s.algorithm}}exportAsBase64(){return g.Convert.ToBase64(this.raw)}exportAsHexFormatted(){return c(g.Convert.ToHex(this.raw))}exportAsPemFormatted(){return`-----BEGIN CERTIFICATE-----\n${m(this.exportAsBase64())}\n-----END CERTIFICATE-----`}async getThumbprint(t="SHA-1"){try{const s=await f(t,this.raw);s&&(this.thumbprints[t.name||t]=g.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(", "):""}}export{p as X}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
3
  */
4
- import{r as t,h as r,H as s,g as i}from"./p-f7683ba5.js";import{l as e,a as o}from"./p-99797a49.js";import"./p-d0b55fbb.js";const a=class{constructor(r){t(this,r),this.showIssuer=!0}renderRow(t,s,i){return r("tr",null,r("td",null,r("peculiar-typography",{color:"grey_5"},t,":")),r("td",null,r("peculiar-typography",{class:"meta_value",monospace:i},s)))}render(){return r(s,null,r("table",null,r("tbody",null,this.renderRow(e.getString("subjectName"),this.certificate.subjectToString()),this.showIssuer&&this.renderRow(e.getString("issuerName"),this.certificate.issuerToString()),this.renderRow(e.getString("serialNumber"),this.certificate.serialNumber,!0),this.renderRow(e.getString("version"),this.certificate.version),this.renderRow(e.getString("validity"),this.certificate.validity),this.renderRow(e.getString("issued"),o(this.certificate.notBefore)),this.renderRow(e.getString("expired"),o(this.certificate.notAfter)))))}};a.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%}td{border:none;padding:0}table{width:100%;border-spacing:0;border-collapse:collapse}td{vertical-align:top;padding-top:5px;padding-bottom:5px}table td:first-child{width:130px;padding-right:10px}table td:last-child{width:calc(100% - 130px)}@media (max-width: 900px){table,tr,td{display:block}table td:last-child,table td:first-child{width:100%}}";const h=class{constructor(r){t(this,r),this.size=24,this.width=4,this.box=50}render(){return r(s,null,r("div",{class:"circle_progress",style:{width:`${this.size}px`,height:`${this.size}px`}},r("svg",{class:"circle_progress_svg",viewBox:`0 0 ${this.box} ${this.box}`},r("circle",{class:"circle_progress_backdrop",cx:this.box/2,cy:this.box/2,r:this.box/2-5,fill:"none",style:{strokeWidth:`${this.width}px`}}),r("circle",{class:"circle_progress_circle",cx:this.box/2,cy:this.box/2,r:this.box/2-5,fill:"none",style:{strokeWidth:`${this.width}px`}}))))}};h.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%}@-webkit-keyframes circular-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes circular-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes circular-dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:100, 200;stroke-dashoffset:-15}to{stroke-dasharray:100, 200;stroke-dashoffset:-120}}@keyframes circular-dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:100, 200;stroke-dashoffset:-15}to{stroke-dasharray:100, 200;stroke-dashoffset:-120}}.circle_progress{margin:0 auto}.circle_progress_svg{-webkit-animation:circular-rotate 1.4s linear infinite;animation:circular-rotate 1.4s linear infinite}.circle_progress_circle{stroke-linecap:round;-webkit-animation:circular-dash 1.4s ease-in-out infinite;animation:circular-dash 1.4s ease-in-out infinite;stroke-dasharray:80, 200;stroke-dashoffset:0;stroke:#3584f7;stroke:rgba(var(--pv-color-primary-rgb), 1)}.circle_progress_backdrop{stroke:#d1d5d9;stroke:rgba(var(--pv-color-grey_3-rgb), 1)}";const l=class{constructor(r){t(this,r),this.tag="mark"}componentDidLoad(){this.handleHighlightSearch()}componentDidUpdate(){this.handleHighlightSearch()}handleHighlightSearch(){const t=this.resetHighlightSearch(this.host.innerHTML);let r=t;if(this.search){const s=new RegExp(`(${this.search})`,"gi");r=t.replace(s,`<${this.tag}>$1</${this.tag}>`)}this.host.innerHTML=r}resetHighlightSearch(t){const r=new RegExp(`</?${this.tag}>`,"g");return t.replace(r,"")}render(){return r(s,null,r("slot",null))}get host(){return i(this)}};l.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:inline}::slotted(mark){background-color:rgba(247, 168, 49, 0.4);background-color:rgba(var(--pv-color-attention-rgb), 0.4)}";export{a as peculiar_certificate_summary,h as peculiar_circular_progress,l as peculiar_highlight_words}
4
+ import{r as t,h as r,H as s,g as i}from"./p-f7683ba5.js";import{l as e,a as o}from"./p-4f4c1d30.js";import"./p-d0b55fbb.js";const a=class{constructor(r){t(this,r),this.showIssuer=!0}renderRow(t,s,i){return r("tr",null,r("td",null,r("peculiar-typography",{color:"grey_5"},t,":")),r("td",null,r("peculiar-typography",{class:"meta_value",monospace:i},s)))}render(){return r(s,null,r("table",null,r("tbody",null,this.renderRow(e.getString("subjectName"),this.certificate.subjectToString()),this.showIssuer&&this.renderRow(e.getString("issuerName"),this.certificate.issuerToString()),this.renderRow(e.getString("serialNumber"),this.certificate.serialNumber,!0),this.renderRow(e.getString("version"),this.certificate.version),this.renderRow(e.getString("validity"),this.certificate.validity),this.renderRow(e.getString("issued"),o(this.certificate.notBefore)),this.renderRow(e.getString("expired"),o(this.certificate.notAfter)))))}};a.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%}td{border:none;padding:0}table{width:100%;border-spacing:0;border-collapse:collapse}td{vertical-align:top;padding-top:5px;padding-bottom:5px}table td:first-child{width:130px;padding-right:10px}table td:last-child{width:calc(100% - 130px)}@media (max-width: 900px){table,tr,td{display:block}table td:last-child,table td:first-child{width:100%}}";const h=class{constructor(r){t(this,r),this.size=24,this.width=4,this.box=50}render(){return r(s,null,r("div",{class:"circle_progress",style:{width:`${this.size}px`,height:`${this.size}px`}},r("svg",{class:"circle_progress_svg",viewBox:`0 0 ${this.box} ${this.box}`},r("circle",{class:"circle_progress_backdrop",cx:this.box/2,cy:this.box/2,r:this.box/2-5,fill:"none",style:{strokeWidth:`${this.width}px`}}),r("circle",{class:"circle_progress_circle",cx:this.box/2,cy:this.box/2,r:this.box/2-5,fill:"none",style:{strokeWidth:`${this.width}px`}}))))}};h.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%}@-webkit-keyframes circular-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes circular-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes circular-dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:100, 200;stroke-dashoffset:-15}to{stroke-dasharray:100, 200;stroke-dashoffset:-120}}@keyframes circular-dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:100, 200;stroke-dashoffset:-15}to{stroke-dasharray:100, 200;stroke-dashoffset:-120}}.circle_progress{margin:0 auto}.circle_progress_svg{-webkit-animation:circular-rotate 1.4s linear infinite;animation:circular-rotate 1.4s linear infinite}.circle_progress_circle{stroke-linecap:round;-webkit-animation:circular-dash 1.4s ease-in-out infinite;animation:circular-dash 1.4s ease-in-out infinite;stroke-dasharray:80, 200;stroke-dashoffset:0;stroke:#3584f7;stroke:rgba(var(--pv-color-primary-rgb), 1)}.circle_progress_backdrop{stroke:#d1d5d9;stroke:rgba(var(--pv-color-grey_3-rgb), 1)}";const l=class{constructor(r){t(this,r),this.tag="mark"}componentDidLoad(){this.handleHighlightSearch()}componentDidUpdate(){this.handleHighlightSearch()}handleHighlightSearch(){const t=this.resetHighlightSearch(this.host.innerHTML);let r=t;if(this.search){const s=new RegExp(`(${this.search})`,"gi");r=t.replace(s,`<${this.tag}>$1</${this.tag}>`)}this.host.innerHTML=r}resetHighlightSearch(t){const r=new RegExp(`</?${this.tag}>`,"g");return t.replace(r,"")}render(){return r(s,null,r("slot",null))}get host(){return i(this)}};l.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:inline}::slotted(mark){background-color:rgba(247, 168, 49, 0.4);background-color:rgba(var(--pv-color-attention-rgb), 0.4)}";export{a as peculiar_certificate_summary,h as peculiar_circular_progress,l as peculiar_highlight_words}
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
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-17c4da7b.js";import{O as i}from"./p-464e0943.js";import"./p-006865d7.js";import{l}from"./p-4f4c1d30.js";import{D as s}from"./p-d7a13cb4.js";import"./p-d0b55fbb.js";const c=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(),s.x509.asPEM(t.body.exportAsPemFormatted(),t.name||t.body.commonName)}handleClickDownloadAsDer(t,r){r.stopPropagation(),s.x509.asPEM(t.body.exportAsHexFormatted(),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"]}}};c.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{c as peculiar_certificates_viewer}
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
+ */
4
+ import{A as t,d as s,m as r,E as e,e as i,l as o,j as a,k as n}from"./p-464e0943.js";import{b as h}from"./p-006865d7.js";import{d as c}from"./p-4f4c1d30.js";import{A as u}from"./p-6c510523.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 m extends t{constructor(t){var e;super(s(t),r),this.thumbprints={},this.type="X.509 Attribute Certificate";const{acinfo:i}=this.asn;this.serialNumber=h.Convert.ToHex(i.serialNumber),this.version=i.version;const o=i.attrCertValidityPeriod.notBeforeTime;if(!o)throw new Error("Cannot get 'notBefore' value");this.notBefore=o;const a=i.attrCertValidityPeriod.notAfterTime;if(!a)throw new Error("Cannot get 'notAfter' value");this.notAfter=a,this.validity=c(this.notBefore,this.notAfter),this.issuer=i.issuer.v1Form||(null===(e=i.issuer.v2Form)||void 0===e?void 0:e.issuerName),this.holder=i.holder}get signature(){const{signatureValue:t,signatureAlgorithm:s}=this.asn;return{value:t,algorithm:s.algorithm}}parseExtensions(){const{acinfo:t}=this.asn;t.extensions&&(this.extensions=t.extensions.map((t=>new e(i.serialize(t)))))}parseAttributes(){const{acinfo:t}=this.asn;t.attributes&&(this.attributes=t.attributes.map((t=>new u(i.serialize(t)))))}async getThumbprint(t="SHA-1"){try{const s=await o(t,this.raw);s&&(this.thumbprints[t.name||t]=h.Convert.ToHex(s))}catch(t){console.error("Error thumbprint get:",t)}}exportAsBase64(){return h.Convert.ToBase64(this.raw)}exportAsHexFormatted(){return a(h.Convert.ToHex(this.raw))}exportAsPemFormatted(){return`-----BEGIN ATTRIBUTE CERTIFICATE-----\n${n(this.exportAsBase64())}\n-----END ATTRIBUTE CERTIFICATE-----`}get commonName(){return`attribute-certificate-${this.thumbprints["SHA-1"]}`}}export{m as X}