@peculiar/certificates-viewer 3.0.4 → 3.2.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-43396146.js → certification_request-cde57123.js} +138 -266
- package/dist/cjs/csr-78378ed0.js +150 -0
- package/dist/cjs/download-6724f3a7.js +79 -0
- package/dist/cjs/{download-5e7d5455.js → index-ff818d4d.js} +0 -72
- package/dist/cjs/index.cjs.js +2 -1
- package/dist/cjs/l10n-a048a686.js +145 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer_2.cjs.entry.js +479 -0
- package/dist/cjs/peculiar-button_5.cjs.entry.js +148 -0
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +173 -0
- package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +1 -1
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +124 -0
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +6 -4
- package/dist/cjs/peculiar.cjs.js +1 -1
- package/dist/cjs/public_key-e56dbe52.js +1104 -0
- package/dist/cjs/x509_attribute_certificate-cc325b70.js +87 -0
- package/dist/cjs/x509_certificate-51a97033.js +139 -0
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +54 -11
- package/dist/collection/constants/oids.js +1 -0
- package/dist/collection/utils/index.js +0 -1
- package/dist/collection/www-copy/index.js +80 -0
- package/dist/esm/{certification_request-16ea346c.js → certification_request-c0674647.js} +77 -205
- package/dist/esm/csr-c1b6a176.js +147 -0
- package/dist/esm/download-735fb2eb.js +76 -0
- package/dist/esm/{download-cf68ac2c.js → index-0ba131b0.js} +1 -71
- package/dist/esm/index.js +2 -1
- package/dist/esm/l10n-ac28fa92.js +141 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/peculiar-attribute-certificate-viewer_2.entry.js +474 -0
- package/dist/esm/peculiar-button_5.entry.js +140 -0
- package/dist/esm/peculiar-certificate-decoder.entry.js +169 -0
- package/dist/esm/peculiar-certificate-summary_3.entry.js +1 -1
- package/dist/esm/peculiar-certificate-viewer.entry.js +120 -0
- package/dist/esm/peculiar-certificates-viewer.entry.js +5 -3
- package/dist/esm/peculiar.js +1 -1
- package/dist/esm/public_key-43b2cbf0.js +1089 -0
- package/dist/esm/x509_attribute_certificate-a6d4aa15.js +85 -0
- package/dist/esm/x509_certificate-12f6d344.js +137 -0
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/p-006865d7.js +4 -0
- package/dist/peculiar/p-17c4da7b.js +11 -0
- package/dist/peculiar/p-1ebab45c.js +78 -0
- package/dist/peculiar/{p-b09a1f0b.entry.js → p-38635919.entry.js} +1 -1
- package/dist/peculiar/p-3f8d1008.entry.js +4 -0
- package/dist/peculiar/p-42da7f97.js +11 -0
- package/dist/peculiar/p-464e0943.js +87 -0
- package/dist/peculiar/p-4f4c1d30.js +12 -0
- package/dist/peculiar/p-530afe84.entry.js +11 -0
- package/dist/peculiar/p-6011646e.entry.js +11 -0
- package/dist/peculiar/p-6c510523.js +18 -0
- package/dist/peculiar/p-d7a13cb4.js +18 -0
- package/dist/peculiar/p-dafae164.entry.js +4 -0
- package/dist/peculiar/p-e77d0ccc.entry.js +18 -0
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +13 -0
- package/dist/types/components.d.ts +20 -0
- package/dist/types/constants/oids.d.ts +1 -0
- package/dist/types/utils/index.d.ts +0 -1
- package/package.json +2 -3
- package/dist/cjs/l10n-d4a77087.js +0 -767
- package/dist/cjs/peculiar-attribute-certificate-viewer_9.cjs.entry.js +0 -2175
- package/dist/collection/utils/history.js +0 -19
- package/dist/collection/utils/parse_hash.js +0 -28
- package/dist/collection/utils/query_stringify.js +0 -21
- package/dist/esm/l10n-9ac63748.js +0 -762
- package/dist/esm/peculiar-attribute-certificate-viewer_9.entry.js +0 -2163
- package/dist/peculiar/p-7452b86e.entry.js +0 -4
- package/dist/peculiar/p-99797a49.js +0 -34
- package/dist/peculiar/p-c774ec0b.js +0 -18
- package/dist/peculiar/p-d0db9e70.entry.js +0 -113
- package/dist/peculiar/p-d7ed39f0.js +0 -87
- package/dist/types/utils/history.d.ts +0 -9
- package/dist/types/utils/parse_hash.d.ts +0 -9
- 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-
|
|
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}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import{h as e}from"./p-f7683ba5.js";import{b as a}from"./p-006865d7.js";import{l as n,a as c}from"./p-4f4c1d30.js";import{O as t,P as o,Q as f,p as s,S as i,X as d,Y as b,Z as r,_ as l,$ as u,a0 as m,a1 as v,a2 as g,a3 as p,a4 as x,a5 as C,a6 as h,a7 as y,a8 as N,a9 as S,aa as D,ab as A,ac as I,ad as G,ae as j,af as T,ag as O,ah as $,ai as k,aj as P,ak as V,al as L,am as E,an as R,ao as K,ap as Y,aq as H,ar as X,as as M}from"./p-464e0943.js";import{C as U}from"./p-6c510523.js";import{D as _}from"./p-d7a13cb4.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
|
+
*/function q(e){const a=t[e];return a?`${a} (${e})`:e}
|
|
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
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/
|
|
26
|
+
const B=a=>{const{value:n}=a;return n?e("tr",{class:"title"},e("td",{colSpan:2},e("peculiar-typography",{type:"h6"},n))):null},w=a=>{const{name:n,value:c,monospace:t,collapse:o,href:f,extraValue:s}=a;if(!n)return null;if(null==c)return null;let i;i=o?e("peculiar-text-hider",null,c):c;const d=!!c.toString();return e("tr",null,e("td",{colSpan:d?1:2},e("peculiar-typography",{color:"grey_5"},n,d?":":"")),d&&e("td",{class:{monospace:t}},function(e){return 0===e.indexOf("http")}(c.toString())||f?e("peculiar-link",{href:f||c.toString()},c):e("peculiar-typography",{monospace:t},i,s)))},W=c=>{const{signature:t}=c;return t?[e(B,{value:n.getString("signature")}),e(w,{name:n.getString("algorithm"),value:q(t.algorithm)}),e(w,{name:n.getString("value"),value:a.Convert.ToHex(t.value),monospace:!0,collapse:!0})]:null},z={otherName:"Other Name",rfc822Name:"RFC 822 Name",dNSName:"DNS Name",x400Address:"X400 Address",directoryName:"Directory Name",ediPartyName:"Edi Party Name ",uniformResourceIdentifier:"URI",iPAddress:"IP Address",registeredID:"Registered ID"},F=n=>{const{generalName:c,getDNSNameLink:r,getIPAddressLink:l}=n;return c?Object.keys(c).map((n=>{const u=c[n];if(u instanceof o)return[e(w,{name:z[n]||n,value:""}),u.map((a=>a.map((a=>e(w,{name:t[a.type]||a.type,value:a.value.toString()})))))];if(u instanceof f){try{const a=s.parse(u.value,i);return e(w,{name:t[u.typeId]||u.typeId,value:a.toString()})}catch(e){}try{const a=s.parse(u.value,d);if(a.explicitText)return e(w,{name:t[u.typeId]||u.typeId,value:a.explicitText.toString()})}catch(e){}return e(w,{name:t[u.typeId]||u.typeId,value:a.Convert.ToHex(u.value),monospace:!0})}return a.BufferSourceConverter.isBufferSource(u)?e(w,{name:z[n]||n,value:a.Convert.ToString(u)}):e(w,u instanceof b?{name:z[n]||n,value:a.Convert.ToString(u.partyName)}:"dNSName"===n?{name:z[n]||n,value:u,href:r(u)}:"iPAddress"===n?{name:z[n]||n,value:u,href:l(u)}:{name:z[n]||n,value:u})})):null},Q=a=>{const{thumbprints:c}=a;if(!c)return null;const t=Object.keys(c);return t.length?[e(B,{value:n.getString("fingerprints")}),t.map((a=>e(w,{name:a,value:c[a],monospace:!0})))]:null},Z=(a,n)=>{const{extension:c}=a;return[e(w,{name:"Name",value:q(c.asn.extnID)}),e(w,{name:"Critical",value:c.asn.critical?"YES":"NO"}),n,e("tr",null,e("td",{colSpan:2,class:"divider"},e("span",{class:"bg_fill"})))]},J=a=>{const{extension:n}=a;return e(Z,{extension:n},e(w,{name:"Usage",value:n.value.toJSON().join(", ")}))},ee=a=>{const{extension:n}=a;return e(Z,{extension:n},e(w,{name:"Certificate Authority",value:n.value.cA?"YES":"NO"}),e(w,{name:"Path Length Constraint",value:n.value.pathLenConstraint}))},ae=a=>{const{extension:n}=a;return e(Z,{extension:n},n.value.map(((a,n)=>e(w,{name:`Purpose #${n+1}`,value:q(a)}))))},ne=n=>{const{extension:c,getSubjectKeyIdChildrenLink:t,getSubjectKeyIdSiblingsLink:o}=n,f=a.Convert.ToHex(c.value.buffer),s=t(f),i=o(f);return e(Z,{extension:c},e(w,{name:"Key ID",value:f,monospace:!0,extraValue:[s&&e("span",null," [",e("peculiar-link",{href:s},"children"),"]"),i&&e("span",null," [",e("peculiar-link",{href:i},"siblings"),"]")]}))},ce=n=>{const{extension:c,getAuthKeyIdParentLink:t,getAuthKeyIdSiblingsLink:o}=n,f=a.Convert.ToHex(c.value.keyIdentifier.buffer),s=t(f),i=o(f);return e(Z,{extension:c},e(w,{name:"Key ID",value:f,monospace:!0,extraValue:[s&&e("span",null," [",e("peculiar-link",{href:s},"parents"),"]"),i&&e("span",null," [",e("peculiar-link",{href:i},"siblings"),"]")]}))},te=a=>{const{extension:n}=a;return e(Z,{extension:n},n.value.map((n=>{var c,t;return[null===(c=n.distributionPoint)||void 0===c?void 0:c.fullName.map((n=>e(F,Object.assign({generalName:n},a)))),null===(t=n.cRLIssuer)||void 0===t?void 0:t.map((n=>e(F,Object.assign({generalName:n},a))))]})))},oe=a=>{const{extension:n}=a;return e(Z,{extension:n},n.value.map(((n,c)=>[e(w,{name:`Description #${c+1}`,value:""}),e(w,{name:"Method",value:q(n.accessMethod)}),e(F,Object.assign({generalName:n.accessLocation},a))])))},fe=a=>{const{extension:n}=a;return e(Z,{extension:n},n.value.map((n=>e(F,Object.assign({generalName:n},a)))))},se=a=>{const{extension:n}=a;return e(Z,{extension:n},n.value.map(((a,n)=>{var c;return[e(w,{name:`Policy #${n+1}`,value:""}),e(w,{name:"ID",value:q(a.policyIdentifier)}),null===(c=a.policyQualifiers)||void 0===c?void 0:c.map(((a,c)=>{const t=[e(w,{name:`Qualifier #${n+1}.${c+1}`,value:""}),e(w,{name:"ID",value:q(a.policyQualifierId)})];if("1.3.6.1.5.5.7.2.1"===a.policyQualifierId){const n=s.parse(a.qualifier,i);t.push(e(w,{name:"Value",value:n.toString()}))}if("1.3.6.1.5.5.7.2.2"===a.policyQualifierId){const n=s.parse(a.qualifier,d);n.explicitText&&t.push(e(w,{name:"Value",value:n.explicitText.toString()}))}return t}))]})))},ie={"9606c02c690033aa1d145f59c6e2648d0549f0df96aab8db915a70d8ecf390a5":"Akamai CT","39376f545f7b4607f59742d768cd5d2437bf3473b6534a4834bcf72e681c83c9":"Alpha CT",a577ac9ced7548dd8f025b67a241089df86e0f476ec203c2ecbedb185f282638:"CNNIC CT",cdb5179b7fc1c046feea31136a3f8f002e6182faf8896fecc8b2f5b5ab604900:"Certly.IO","1fbc36e002ede97f40199e86b3573b8a4217d80187746ad0da03a06054d20df4":"Cloudflare “Nimbus2017”",db74afeecb29ecb1feca3e716d2ce5b9aabb36f7847183c75d9d4f37b61fbf64:"Cloudflare “Nimbus2018”","747eda8331ad331091219cce254f4270c2bffd5e422008c6373579e6107bcc56":"Cloudflare “Nimbus2019”","5ea773f9df56c0e7b536487dd049e0327a919a0c84a112128418759681714558":"Cloudflare “Nimbus2020”","4494652eb0eeceafc44007d8a8fe28c0dae682bed8cb31b53fd33396b5b681a8":"Cloudflare “Nimbus2021”","41c8cab1df22464a10c6a13a0942875e4e318b1b03ebeb4bc768f090629606f6":"Cloudflare “Nimbus2022”","7a328c54d8b72db620ea38e0521ee98416703213854d3bd22bc13a57a352eb52":"Cloudflare “Nimbus2023”","6ff141b5647e4222f7ef052cefae7c21fd608e27d2af5a6e9f4b8a37d6633ee5":"DigiCert Nessie2018",fe446108b1d01ab78a62ccfeab6ab2b2babff3abdad80a4d8b30df2d0008830c:"DigiCert Nessie2019",c652a0ec48ceb3fcab170992c43a87413309e80065a26252401ba3362a17c565:"DigiCert Nessie2020",eec095ee8d72640f92e3c3b91bc712a3696a097b4b6a1a1438e647b2cbedc5f9:"DigiCert Nessie2021","51a3b0f5fd01799c566db837788f0ca47acc1b27cbf79e88429a0dfed48b05e5":"DigiCert Nessie2022",b3737707e18450f86386d605a9dc11094a792db1670c0b87dcf0030e7936a59a:"DigiCert Nessie2023","5614069a2fd7c2ecd3f5e1bd44b23ec74676b9bc99115cc0ef949855d689d0dd":"DigiCert Server","8775bfe7597cf88c43995fbdf36eff568d475636ff4ab560c1b4eaff5ea0830f":"DigiCert Server 2",c1164ae0a772d2d4392dc80ac10770d4f0c49bde991a4840c1fa075164f63360:"DigiCert Yeti2018",e2694bae26e8e94009e8861bb63b83d43ee7fe7488fba48f2893019dddf1dbfe:"DigiCert Yeti2019",f095a459f200d18240102d2f93888ead4bfe1d47e399e1d034a6b0a8aa8eb273:"DigiCert Yeti2020","5cdc4392fee6ab4544b15e9ad456e61037fbd5fa47dca17394b25ee6f6c70eca":"DigiCert Yeti2021","2245450759552456963fa12ff1f76d86e0232663adc04b7f5dc6835c6ee20f02":"DigiCert Yeti2022","35cf191bbfb16c57bf0fad4c6d42cbbbb627202651ea3fe12aefa803c33bd64c":"DigiCert Yeti2023","717ea7420975be84a2723553f1777c26dd51af4e102144094d9019b462fb6668":"GDCA 1","14308d90ccd030135005c01ca526d81e84e87624e39b6248e08f724aea3bb42a":"GDCA 2",c9cf890a21109c666cc17a3ed065c930d0e0135a9feba85af14210b8072421aa:"GDCA CT #1","924a30f909336ff435d6993a10ac75a2c641728e7fc2d659ae6188ffad40ce01":"GDCA CT #2",fad4c97cc49ee2f8ac85c5ea5cea09d0220dbbf4e49c6b50662ff868f86b8c28:"Google “Argon2017”",a4501269055a15545e6211ab37bc103f62ae5576a45e4b1714453e1b22106a25:"Google “Argon2018”","63f2dbcde83bcc2ccf0b728427576b33a48d61778fbd75a638b1c768544bd88d":"Google “Argon2019”",b21e05cc8ba2cd8a204e8766f92bb98a2520676bdafa70e7b249532def8b905e:"Google “Argon2020”",f65c942fd1773022145418083094568ee34d131933bfdf0c2f200bcc4ef164e3:"Google “Argon2021”","2979bef09e393921f056739f63a577e5be577d9c600af8f94d5d265c255dc784":"Google “Argon2022”","68f698f81f6482be3a8ceeb9281d4cfc71515d6793d444d10a67acbb4f4ffbc4":"Google “Aviator”",c3bf03a7e1ca8841c607bae3ff4270fca5ec45b186ebbe4e2cf3fc778630f5f6:"Google “Crucible”","1d024b8eb1498b344dfd87ea3efc0996f7506f235d1d497061a4773c439c25fb":"Google “Daedalus”","293c519654c83965baaa50fc5807d4b76fbf587a2972dca4c30cf4e54547f478":"Google “Icarus”",a4b90990b418581487bb13a2cc67700a3c359804f91bdfb8e377cd0ec80ddc10:"Google “Pilot”",ee4bbdb775ce60bae142691fabe19e66a30f7e5fb072d88300c47b897aa8fdcb:"Google “Rocketeer”",bbd9dfbc1f8a71b593942397aa927b473857950aab52e81a909664368e1ed185:"Google “Skydiver”","52eb4b225ec896974850675f23e43bc1d021e3214ce52ecd5fa87c203cdfca03":"Google “Solera2018”","0b760e9a8b9a682f88985b15e947501a56446bba8830785c3842994386450c00":"Google “Solera2019”","1fc72ce5a1b799f400c359bff96ca3913548e8644220610952e9ba1774f7bac7":"Google “Solera2020”",a3c99845e80ab7ce00157b3742df0207dd272b2b602ecf98ee2c12db9c5ae7e7:"Google “Solera2021”","697aafca1a6b536fae21205046debad7e0eaea13d2432e6e9d8fb379f2b9aaf3":"Google “Solera2022”",a899d8780c9290aaf462f31880ccfbd52451e970d0fbf591ef75b0d99b645681:"Google “Submariner”",b0cc83e5a5f97d6baf7c09cc284904872ac7e88b132c6350b7c6fd26e16c6c77:"Google “Testtube”",b10cd559a6d67846811f7df9a51532739ac48d703bea0323da5d38755bc0ad4e:"Google “Xenon2018”","084114980071532c16190460bcfc47fdc2653afa292c72b37ff863ae29ccc9f0":"Google “Xenon2019”","07b75c1be57d68fff1b0c61d2315c7bae6577c5794b76aeebc613a1a69d3a21c":"Google “Xenon2020”","7d3ef2f88fff88556824c2c0ca9e5289792bc50e78097f2e6a9768997e22f0d7":"Google “Xenon2021”","46a555eb75fa912030b5a28969f4f37d112c4174befd49b885abf2fc70fe6d47":"Google “Xenon2022”","7461b4a09cfb3d41d75159575b2e7649a445a8d27709b0cc564a6482b7eb41a3":"Izenpe","8941449c70742e06b9fc9ce7b116ba0024aa36d59af44f0204404f00f7ea8566":"Izenpe “Argi”","296afa2d568bca0d2ea844956ae9721fc35fa355ecda99693aafd458a71aefdd":"Let“s Encrypt ”Clicky”","537b69a3564335a9c04904e39593b2c298eb8d7a6e83023635c627248cd6b440":"Nordu “flimsy”",aae70b7f3cb8d566c86c2f16979c9f445f69ab0eb4535589b2f77a030104f3cd:"Nordu “plausible”",e0127629e90496564e3d0147984498aa48f8adb16600eb7902a1ef9909906273:"PuChuangSiDa CT",cf55e28923497c340d5206d05353aeb25834b52f1f8dc9526809f212efdd7ca6:"SHECA CT 1","32dc59c2d4c41968d56e14bc61ac8f0e45db39faf3c155aa4252f5001fa0c623":"SHECA CT 2",db76fdadac65e7d09508886e2159bd8b90352f5fead3e3dc5e22eb350acc7b98:"Sectigo (Comodo) “Dodo” CT","6f5376ac31f03119d89900a45115ff77151c11d902c10029068db2089a37d913":"Sectigo (Comodo) “Mammoth” CT","5581d4c2169036014aea0b9b573c53f0c0e43878702508172fa3aa1d0713d30c":"Sectigo (Comodo) “Sabre” CT","34bb6ad6c3df9c03eea8a499ff7891486c9d5e5cac92d01f7bfd1bce19db48ef":"StartCom",ddeb1d2b7a0d4fa6208b81ad8168707e2e8e9d01d55c888d3d11c4cdb6ecbecc:"Symantec",a7ce4a4e6207e0addee5fdaa4b1f86768767b5d002a55d47310e7e670a95eab2:"Symantec Deneb","15970488d7b997a05beb52512adee8d2e8b4a3165264121a9fabfbd5f85ad93f":"Symantec “Sirius”",bc78e1dfc5f63c684649334da10fa15f0979692009c081b4f3f6917f3ed9b8a5:"Symantec “Vega”",b0b784bc81c0ddc47544e883f05985bb9077d134d8ab88b2b2e533980b8e508b:"Up In The Air “Behind the Sofa”",ac3b9aed7fa9674757159e6d7d575672f9d98100941e9bdeffeca1313b75782d:"Venafi","03019df3fd85a69a8ebd1facc6da9ba73e469774fe77f579fc5a08b8328c1d6b":"Venafi Gen2 CT","41b2dc2e89e63ce4af1ba7bb29bf68c6dee6f9f1cc047e30dffae3b3ba259263":"WoSign","63d0006026dde10bb0601f452446965ee2b6ea2cd4fbc95ac866a550af9075b7":"WoSign 2","9e4ff73dc3ce220b69217c899e468076abf8d78636d5ccfc85a31a75628ba88b":"WoSign CT #1"},de=a=>{const{extension:n}=a;return e(Z,{extension:n},n.value.toJSON().map(((a,n)=>[e(w,{name:`SCT #${n+1}`,value:""}),e(w,{name:"Version",value:a.version+1}),e(w,{name:"Log Operator",value:ie[a.logId]||a.logId}),e(w,{name:"Log Key ID",value:a.logId,monospace:!0}),e(w,{name:"Timestamp",value:c(a.timestamp)}),e(w,{name:"Signature Algorithm",value:`${a.hashAlgorithm} ${a.signatureAlgorithm}`.toUpperCase()}),e(w,{name:"Signature",value:a.signature,monospace:!0})])))},be=a=>{var n,c;const{extension:t}=a;return e(Z,{extension:t},null===(n=t.value.excludedSubtrees)||void 0===n?void 0:n.map((n=>e(F,Object.assign({generalName:n.base},a)))),null===(c=t.value.permittedSubtrees)||void 0===c?void 0:c.map((n=>e(F,Object.assign({generalName:n.base},a)))))},re=a=>{const{extension:n}=a;return e(Z,{extension:n},e(w,{name:"Template ID",value:n.value.templateID}),e(w,{name:"Template Major Version",value:n.value.templateMajorVersion}),e(w,{name:"Template Minor Version",value:n.value.templateMinorVersion}))},le=a=>{const{extension:n}=a;return e(Z,{extension:n},e(w,{name:"Name",value:n.value.toString()}))},ue=a=>{const{extension:n}=a,c=n.value.getVersion();return e(Z,{extension:n},e(w,{name:"Certificate Index",value:c.certificateIndex}),e(w,{name:"Key Index",value:c.keyIndex}))},me=n=>{const{extension:c}=n;return e(Z,{extension:c},c.value.map(((n,c)=>[e(w,{name:`Statement #${c+1}`,value:""}),e(w,{name:"ID",value:q(n.statementId)}),e(w,{name:"Info",value:n.statementInfo.byteLength?a.Convert.ToHex(n.statementInfo):null,monospace:!0})])))},ve=a=>{const{extension:n}=a;return e(Z,{extension:n},e(w,{name:"Comment",value:n.value.value}))},ge=a=>{const{extension:n}=a;return e(Z,{extension:n},e(w,{name:"Type",value:n.value.toJSON().join(", ")}))},pe=a=>{const{extension:n}=a;return e(Z,{extension:n},e(w,{name:"Role",value:n.value.text}))},xe=a=>{const{extension:n,getLEILink:c}=a;return e(Z,{extension:n},e(w,{name:"Identifier",value:n.value.text,href:c(n.value.text)}))},Ce=a=>{const{extension:n}=a;return e(Z,{extension:n},e(w,{name:"Version",value:n.value.version}),e(F,Object.assign({generalName:n.value.location},a)),e(w,{name:"Requires Auth",value:n.value.requiresAuth?"YES":"NO"}))},he=a=>{const{extension:n}=a;return e(Z,{extension:n},e(w,{name:"Version",value:n.value.version}))},ye=a=>{const{extension:n}=a;return e(Z,{extension:n},e(w,{name:"Reason",value:n.value.toJSON()}))};
|
|
27
|
+
/**
|
|
28
|
+
* @license
|
|
29
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/
|
|
34
|
+
function Ne(e){return a.Convert.ToString(e.values[0])}
|
|
35
|
+
/**
|
|
36
|
+
* @license
|
|
37
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const Se=a=>{const{extension:n}=a;return e(Z,{extension:n},n.value.map(((a,n)=>[e(w,{name:`Attribute #${n+1}`,value:""}),e(w,{name:"Type",value:q(a.type)}),e(w,{name:"Value",value:Ne(a)})])))},De=a=>{const{extension:n}=a;return e(Z,{extension:n},e(w,{name:"Value",value:n.value,monospace:!0}))},Ae=a=>{const{extension:n}=a;return e(Z,{extension:n},e(w,{name:"Not Before",value:c(n.value.notBefore)}),e(w,{name:"Not After",value:c(n.value.notAfter)}))},Ie=a=>{const{extension:n}=a;return e(Z,{extension:n},e(w,{name:"Version",value:n.value.entrustVers}),e(w,{name:"Info Flags",value:n.value.entrustInfoFlags.toJSON().join(", ")}))},Ge=n=>{const{extension:c}=n;return e(Z,{extension:c},c.value.map(((n,c)=>[e(w,{name:`Biometric #${c+1}`,value:""}),e(w,{name:"OID",value:q(n.typeOfBiometricData.biometricDataOid)}),e(w,{name:"Type",value:n.typeOfBiometricData.predefinedBiometricType}),e(w,{name:"Algorithm",value:q(n.hashAlgorithm.algorithm)}),e(w,{name:"Hash",value:a.Convert.ToHex(n.biometricDataHash.buffer),monospace:!0}),e(w,{name:"Source Uri",value:n.sourceDataUri})])))},je=n=>{const{extension:c}=n,t=n=>n?n.map((n=>{const{imageDetails:c}=n;return[e(w,{name:"Image Type",value:c.mediaType}),e(w,{name:"Image Hash",value:a.Convert.ToHex(c.logotypeHash[0].hashValue),monospace:!0}),e(w,{name:"Image URL",value:c.logotypeURI[0],monospace:!0,collapse:!0}),e(w,{name:"Image Hash Algorithm",value:q(c.logotypeHash[0].hashAlg.algorithm)})]})):null,o=n=>n?n.map((n=>{const{audioDetails:c}=n;return[e(w,{name:"Audio Type",value:c.mediaType}),e(w,{name:"Audio Hash",value:a.Convert.ToHex(c.logotypeHash[0].hashValue),monospace:!0}),e(w,{name:"Audio URL",value:c.logotypeURI[0],monospace:!0,collapse:!0}),e(w,{name:"Audio Hash Algorithm",value:q(c.logotypeHash[0].hashAlg.algorithm)})]})):null,f=(a,n)=>{if(!n||!n.direct)return null;const{image:c,audio:f}=n.direct;return[e(w,{name:"Type",value:a}),t(c),o(f),e("tr",null,e("td",null),e("td",null))]};return e(Z,{extension:c},f("Subject",c.value.subjectLogo),f("Issuer",c.value.issuerLogo))},Te=a=>{const{extension:n}=a;return e(Z,{extension:n},n.value.map(((a,n)=>[e(w,{name:`Entry #${n+1}`,value:""}),e(w,{name:"SPC",value:a.spc}),e(w,{name:"Range",value:a.range?`start=${a.range.start} count==${a.range.count}`:null}),e(w,{name:"One",value:a.one})])))},Oe=a=>{const{extension:n}=a;return e(Z,{extension:n},n.value.requireExplicitPolicy&&e(w,{name:"Require Explicit Policy",value:r.toASN(n.value.requireExplicitPolicy).valueBlock.toString()}),n.value.inhibitPolicyMapping&&e(w,{name:"Inhibit Policy Mapping",value:r.toASN(n.value.inhibitPolicyMapping).valueBlock.toString()}))},$e=a=>{const{extension:n}=a;return e(Z,{extension:n},n.value.map(((a,n)=>[e(w,{name:`Policy #${n+1}`,value:""}),e(w,{name:"Issuer Domain",value:q(a.issuerDomainPolicy)}),e(w,{name:"Subject Domain",value:q(a.subjectDomainPolicy)})])))},ke=a=>{const{extensions:n,title:c}=a;return n&&n.length?[e(B,{value:c||"Extensions"}),n.map((n=>{try{return n.value instanceof l?e(J,{extension:n}):n.value instanceof u?e(ee,{extension:n}):n.value instanceof m?e(ae,{extension:n}):n.value instanceof v?e(ne,Object.assign({extension:n},a)):n.value instanceof g?e(ce,Object.assign({extension:n},a)):n.value instanceof p?e(te,Object.assign({extension:n},a)):n.value instanceof x||n.value instanceof C?e(oe,Object.assign({extension:n},a)):n.value instanceof h?e(fe,Object.assign({extension:n},a)):n.value instanceof y?e(se,{extension:n}):n.value instanceof N?e(de,{extension:n}):n.value instanceof S?e(be,Object.assign({extension:n},a)):n.value instanceof D?e(re,{extension:n}):n.value instanceof A?e(le,{extension:n}):n.value instanceof I?e(ue,{extension:n}):n.value instanceof G?e(me,{extension:n}):n.value instanceof j?e(ve,{extension:n}):n.value instanceof T?e(ge,{extension:n}):n.value instanceof O?e(pe,{extension:n}):n.value instanceof $?e(xe,Object.assign({extension:n},a)):n.value instanceof k?e(Ce,Object.assign({extension:n},a)):e(n.value instanceof P?he:n.value instanceof V?ye:n.value instanceof L?Se:n.value instanceof E?Ae:n.value instanceof R?Ie:n.value instanceof K?Ge:n.value instanceof Y?je:n.value instanceof H?Te:n.value instanceof X?Oe:n.value instanceof M?$e:"string"==typeof n.value?De:Z,{extension:n})}catch(e){return console.error("Error render extension:",n.asn.extnID),null}}))]:null},Pe=a=>{const{serialNumber:t,version:o,validity:f,notBefore:s,notAfter:i,type:d}=a;return[e(B,{value:n.getString("basicInformation")}),e(w,{name:n.getString("type"),value:d}),e(w,{name:n.getString("serialNumber"),value:t,monospace:!0}),e(w,{name:n.getString("version"),value:o}),e(w,{name:n.getString("validity"),value:f}),e(w,{name:n.getString("issued"),value:s?c(s):void 0}),e(w,{name:n.getString("expired"),value:i?c(i):void 0})]};
|
|
42
|
+
/**
|
|
43
|
+
* @license
|
|
44
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* @license
|
|
51
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the MIT license found in the
|
|
54
|
+
* LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/
|
|
56
|
+
function Ve(e){e instanceof U?_.pkcs10.asPEM(e.exportAsPemFormatted(),e.commonName):_.x509.asPEM(e.exportAsPemFormatted(),e.commonName)}function Le(e){e instanceof U?_.pkcs10.asDER(e.exportAsHexFormatted(),e.commonName):_.x509.asDER(e.exportAsHexFormatted(),e.commonName)}const Ee=a=>{const{certificate:c}=a;return[e(B,{value:n.getString("miscellaneous")}),e("tr",null,e("td",{class:"vertical_align_middle"},e("peculiar-typography",{color:"grey_5"},n.getString("download"),":")),e("td",null,e("peculiar-button-split",{onClick:Ve.bind(void 0,c),actions:[{text:n.getString("download.der"),onClick:Le.bind(void 0,c)}]},n.getString("download.pem"))))]},Re=e=>`https://search.gleif.org/#/record/${e}`,Ke=e=>`https://search.censys.io/search?resource=hosts&q=dns.names%3A${e}`,Ye=e=>`https://search.censys.io/search?resource=hosts&q=ip%3A${e}`
|
|
57
|
+
/**
|
|
58
|
+
* @license
|
|
59
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the MIT license found in the
|
|
62
|
+
* LICENSE file in the root directory of this source tree.
|
|
63
|
+
*/,He=a=>{const{name:c}=a;return[e(B,{value:n.getString("subjectName")}),c.map((a=>e(w,{name:a.name||a.type,value:a.value})))]};
|
|
64
|
+
/**
|
|
65
|
+
* @license
|
|
66
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the MIT license found in the
|
|
69
|
+
* LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/
|
|
71
|
+
/**
|
|
72
|
+
* @license
|
|
73
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the MIT license found in the
|
|
76
|
+
* LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/
|
|
78
|
+
function Xe(e){var a;if(null===(a=e.params)||void 0===a?void 0:a.modulus){let a=e.params.modulus.byteLength;return a%2&&(a-=1),8*a}return null}function Me(e){var a;return(null===(a=e.params)||void 0===a?void 0:a.publicExponent)?3===e.params.publicExponent.byteLength?65537:3:null}const Ue=c=>{var t;const{publicKey:o}=c;return o?[e(B,{value:n.getString("publicKeyInfo")}),e(w,{name:n.getString("algorithm"),value:q(o.algorithm)}),e(w,{name:n.getString("namedCurve"),value:q(null===(t=o.params)||void 0===t?void 0:t.namedCurve)}),e(w,{name:n.getString("exponent"),value:Me(o)}),e(w,{name:n.getString("modulus"),value:Xe(o)}),e(w,{name:n.getString("value"),value:a.Convert.ToHex(o.value),monospace:!0,collapse:!0})]:null};export{Pe as B,ke as E,F as G,Ee as M,Ue as P,w as R,W as S,Q as T,B as a,Re as b,Ke as c,Ye as d,He as e,q as g}
|
|
@@ -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-
|
|
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}
|